Skip to content

docs(proposals): fiber/asset authoring ergonomics + F7 auth-gap test#192

Open
ottobot-ai wants to merge 1 commit into
mainfrom
feat/fiber-ergonomics-proposals
Open

docs(proposals): fiber/asset authoring ergonomics + F7 auth-gap test#192
ottobot-ai wants to merge 1 commit into
mainfrom
feat/fiber-ergonomics-proposals

Conversation

@ottobot-ai

Copy link
Copy Markdown
Collaborator

A proposal program to fix the authoring friction discovered building the riverdale-economy e2e (6 fibers, 2 versioned packages, real asset custody — all hand-written JSON-Logic). Docs only, plus one regression test. No chain behavior changed.

docs/proposals/fiber-ergonomics/

  • README — findings catalog (F1–F10) → severity → proposal; a risk-ascending roadmap (P0 docs → P1 validator → P2 SDK templates → P3 genesis std-lib → P4 model changes) with the guardrails (signed canonical frozen — rule docs: Comprehensive documentation overhaul #1; lineage combine-only — rule Refactor: Extract shared test utilities and migrate example tests #3; additive-first).
  • 00 — SDK std-lib + templates (the SDK-repo handoff doc): typed builders that emit canonical defs/policies/effects + a genesis-loaded std-lib, so apps stop hand-rolling. Reframed after research: the SDK already ships defineFiberApp/effect/guard builders — so it's extend + adopt, not build-from-zero.
  • 01 — Authoring safety: an offline definition validator (var-path resolution, reserved-_-key validation, reachability, conformance) + state-shape defaults. The static conformance check strong-typing-and-conformance.md §3 specified but was never built.
  • 02 — Asset-effect ergonomics: canonicalize the _transferAsset recipient (bare string → also accept the AssetHolder object), illuminate the fiber/wallet custody boundary (without removing R1). Found a third holder encoding (holderJlv).
  • 03 — Cross-fiber & authorization: the auth matrix, the trigger-vs-read dependency asymmetry, and the F7 gap below.

⚠️ Key finding (F7) — a likely transition-authorization gap, settled by test

The owner gate diverges by code path:

  • Validator.validateSignedUpdate(non-owner transition)Invalid (gate enforced here)
  • Combiner.insert(same transition)applied (no owner check; the guard is the only gate)

The live ML0 path follows the combiner, and the riverdale e2e (distinct keys: alice creates, bob transitions) saw bob's transition apply — so in production, primary transitions are effectively guard-only-gated; the validator's owner gate isn't reached/enforced before combine.

  • Confirmed by the new TransitionOwnerGateDivergenceSuite (passes: validator rejects bob, combiner applies bob) — runs in the Unit Tests lane.
  • The pre-existing MultiPartyTransitionSigningSuite already encodes both halves and is self-contradictory ("a counterparty can sign" via the combiner vs "an unauthorized third party cannot" via the validator).
  • F8 (spawned-child owners) is a second witness of the same gap.

Proposed fix: enforce signer-auth in the combiner (graceful CombineRejected, rule #3-safe), then layer an opt-in transitionPolicy dial there. The breaking-change default-choice (today's live behavior is guard-only; tightening to owners-or-participants would break the multi-party "counterparty can sign" design) is left as the lead open question for maintainers.

This finding is the product of the parallel/adversarial review — a single pass would have published it wrong either way (my "not gated" vs the first draft's "gated"). The test-confirmed truth is the gate exists but isn't enforced where it counts.

🤖 Generated with Claude Code

Improvement program from the friction discovered authoring the
riverdale-economy e2e (6 fibers, 2 versioned packages, real asset custody,
all hand-written JSON-Logic). docs/proposals/fiber-ergonomics/:

- README.md — findings catalog (F1-F10), proposal index, and a risk-ascending
  safe-improvement roadmap (P0 docs → P1 validator → P2 SDK templates →
  P3 genesis std-lib → P4 targeted model changes) with the signed-canonical
  (rule #1) + combine-only-lineage (rule #3) + additive-first guardrails.
- 00-sdk-stdlib-and-templates.md — the SDK-repo HANDOFF: typed builders that
  emit canonical defs/policies/effects + a genesis-loaded std-lib so apps stop
  hand-rolling. (Reframed: the SDK already ships defineFiberApp/effect/guard
  builders — extend + adopt, not build-from-zero.)
- 01-authoring-safety.md — offline definition validator (var-path resolution,
  reserved-_-key validation, reachability, conformance) + state-shape defaults.
- 02-asset-effect-ergonomics.md — canonicalize the _transferAsset recipient,
  illuminate the fiber/wallet custody boundary (without removing R1).
- 03-cross-fiber-and-authorization.md — the auth matrix, the trigger-vs-read
  dependency asymmetry, and the F7 enforcement gap (below).

KEY FINDING (F7) — a likely transition-authorization gap, settled by test:
the owner gate DIVERGES by code path. Validator.validateSignedUpdate REJECTS a
non-owner transition, but Combiner.insert APPLIES it (no owner check; guard is
the only gate). The live ML0 path follows the combiner, so in production
transitions are effectively guard-only-gated. Confirmed by the new
TransitionOwnerGateDivergenceSuite (passes); the pre-existing
MultiPartyTransitionSigningSuite already encodes both halves and is
self-contradictory. Proposed fix: enforce signer-auth in the COMBINER (graceful
CombineRejected, rule #3-safe), then layer an opt-in transitionPolicy dial —
with the breaking-change default-choice left as the lead open question.

Docs only (+ one regression test). No chain behavior changed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5TUSJPD8FCtJagf7siXgt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant