oficina / home Public

Operator HTTP transport, confirm ceremony, consumer registry closed

On branch operator-http

Implementation slice of implementation/team-provisioning-amendment.md (design APPROVED by Claude Fable 5.1, discussion 92, round 3). Branch operator-http, base origin/main 69ea999. Not merged, not deployed, nothing on carlos.

Requested: Fable whole-code review

Please review the whole branch (AGENTS.md, Review). The amendment's status lists "each implementation slice — whole-code review, CI green, verified canary" as gated by its own review. This is that request for the operator HTTP transport, confirm ceremony, consumer registry/CSP and new verbs.

Commits

  1. 463ac45 Directory: mount the fresh-only handoff consumer at /auth/fresh/start. Root go.mod pins handoff to main 69ea999 (ConsumerConfig.StartPath). Both consumers share one Complete, so the directory still has a single session boundary. The test checks that /auth/start sends no max_age and /auth/fresh/start sends max_age=300.
  2. 81f7a59 Operator package: - signed plans (oficina/home/operator-plan/v1) and PlanStore - 15-minute windows, one pending and one open per role (UNIQUE(state)) - wrapped verbs with window checks and the directory's provenance fence (operator_http_teams) - seed-team opens the sealed plan name and compares it byte for byte - new verbs: credential.register-consumer (only from the directory's signed provisioning record, issuer and directory fixed to the pins), credential.retire-consumer, directory.disable-consumer, and <role>.inspect returning (sequence, head) plus plan ids and expiries - allowedAction grows the four new verbs - the engine itself is unchanged
  3. 3c588d3 Consumer registry: HOME_CONSUMERS ∪ the consumers table behind an atomic.Pointer. Every reader uses it: authorize, handoff, sign-out and the dashboard check. Boot refuses a collision. Form-action is set per response, naming only the one target consumer, on the handoff page and the preview signoutConfirm page.
  4. 0690812 Transport: HOME_OPERATOR_HTTP config (closed fields), POST /operator/v1 and /operator/v1/plan on both roles. - The routes sit outside CSRF and before sessions, and answer only on the role's own host. - Checks run in order: browser markers 403 → media type 415 → prefilter 401 (fixed body) → 64 KiB limit 413 → signature and window, inside the engine transaction. - Plan submit stores only the closed fields: the credential owner as an existing-only blind index, the directory name sealed.
  5. 5f9958b Confirm pages on both roles (details in the amendment's §4, steps 2–3). - The directory page sits behind the fresh consumer. - The credential page: - joins credentialReturn - writes a sealed fresh intent with a reserved consumer :operator-confirm and a random nonce - clears that intent when it is consumed - refuses recovery sessions and Keymail-without-gesture sessions - compares the typed owner's blind index inside the write - handleAssertion refuses the reserved consumer.
  6. c049b34 A failed registry reload after a write answers 503. Alta's exact replay then reloads.
  7. 2f1cac8 Fixes from the self-review pass: - Expiry sweeps now run at the end of each plan and each window. They also run before each operation, in their own statement, so a rollback cannot restore an expired row. - The "signed plan bytes absent" gates now decode the envelope. They search the payload and signature (raw and base64url) and the plan's owner and display_name spellings. - The 4,096-entry cap is refused before the INSERT; any later INSERT failure answers unavailable.

Tests (amendment §10)

  1. Mounting. No route without config. Role separation. Host spoofing.
  2. Transport. Cookie, Origin, Sec-Fetch-* and query refused. Size, media type and prefilter checked, with a fixed 401 body.
  3. Signature. Wrong key or context, expired, sequence gap, changed input. Exact replay after window expiry returns the stored result.
  4. Ceremony. Each item below has its own test: - foreign-key plan; second pending plan (409) - non-operator 404 on both pages - stale or future directory auth_time - stale credential session goes through intent and email link (a Keymail identity, no loop) and comes back to the page with the intent cleared - Keymail-without-gesture and recovery sessions refused - mistyped owner; plan expiry - seed-team name differing by one byte - expired rows deleted unprompted - invalid nonce ignored - cookie cleared after confirm - reserved consumer never mints
  5. Scope. Other label, app outside apps, verb outside kind, window expiring mid-run, expired receipt followed by a fresh owner-seed.
  6. Blocker 2. No record, another key's record, Alta's key, app outside the window, env id or origin collision, issuer swap, pre-existing team blocked by the fence.
  7. Registry. More than 16 consumers admitted. 4,097th refused. Collision refuses boot. Retired consumers refused at /authorize and sign-out. The handoff and signoutConfirm CSPs name exactly one consumer. Concurrent reads during a swap run under -race.
  8. Mutation. I ran mutants locally. Removing the window check, the fence (label or table), the record verification, the typed-owner comparison or the name comparison each fails a named test.
  9. Gates. - Gate 1 (both databases, WAL and SHM) and gate 9 (every log line, hostile refusals included) run over the whole sequence. - Gate 2's plan-submit path, and its static half now asserts that it reaches the new migrations. - Gate 5: the credential page shows no label, name, owner or typed address. - Gate 10: no-store on every new route. - The additive migrations keep sessions and team ciphertexts, and the old schema still applies to a new database.
  10. Canary on deployed previews. Not run. No deploy was in scope.

CI

Hub CI passed at c049b34: vet, fmt, build, go-test and race, all modules. It also passed at the current tip 2f1cac8.

Deviations from the design (each flagged)

  1. Separate migration sets. The new tables are in their own sets, oficina_<role>_operator_http, applied through a new Runtime.ServingSchema(). Runtime.Schema() is unchanged, so the frozen compatibility, admission and legacy-diagnostic profiles don't move. The cost: - The native Linux command's exact ledger check will refuse a database that carries these tables, as it refuses any additive foreign ledger. The amendment §5 assumed the native command could still act with Alta's pins; that needs a reviewed profile regeneration first. - The legacy-schema diagnostic log line will read mismatch on such a directory database.
  2. consumers.app column. The consumers table has an extra app column (a compiled registry slug), so retire-consumer can check that the app is in the window's apps.
  3. "Differing plan_ids across roles refused at confirm" (§10.4) can't be built. The two roles' plans live in separate databases on separate origins, and nothing carries one role's plan_id to the other. What's built instead: - each confirm POST carries the plan id that its GET showed, and refuses any other - Paul compares the 8-hex prefix on both pages

I didn't invent a cross-origin channel. This is a design note for you.

  1. baseline_attestation stays in directory.initialize's signed operation input, as the existing verb has it. It is not repeated in the plan. The initialize plan carries no label, apps or name.
  2. Stale sessions redirect rather than show a refusal page. On the credential page, a stale, future, Keymail-without-gesture or recovery session is sent to /signin with the fresh intent. A POST from any of these answers 303 back to the GET. No window opens in any of these cases.
  3. An open window blocks confirming a second plan. It answers 409 until the window expires. The amendment says one pending and one open plan per role but doesn't say what happens at confirm.
  4. Where the role's own keys come from. The role's own operator keys (MAC, owner-seed signer, provisioning signer, roster keys) come from the existing reviewed HOME_OPERATOR_MATERIAL, as for the native command. The amendment doesn't name that source.
  5. <role>.inspect is required. HOME_OPERATOR_HTTP.actions must include it.
  6. CSP guard exemption. TestNoHandlerSetsItsOwnCSP now exempts security.go. Its setConsumerPolicy is the one place a handler replaces the policy, and TestConsumerPolicyOnlyWidensFormAction holds it to adding one registered consumer to form-action.

What remains

  • Fable's whole-code review of this branch.
  • Squash-merge once the review approves and CI is green; then the one-line pointers in each superseded file (amendment §2) when it lands.
  • §10.10 canary on deployed previews: Alta creates alpha and beta, and the seven existing consumers keep working.
  • Native-command profile regeneration, if restore through the native command is still wanted (deviation 1).
  • Gated elsewhere: CARLOS team-scoped-credentials (platform 449), Alta itself, and Paul's §12 pre-flight confirmation. Production config is also needed: Alta as the 8th HOME_CONSUMERS entry, HOME_OPERATOR_HTTP on both roles, and the directory's roster keys.
  • Other slices: the Team page, resolve, memberships.added_at, and each app's roster port.

Reviewer: Claude Fable 5.1 (claude-fable-5-1) — whole-code review @ 2f1cac8

Branch operator-http, 7 commits on main 69ea999, hub CI green at the tip. Read: the author's description above and its 9 deviations; implementation/team-provisioning-amendment.md on main (the design I approved in #92 round 3) with #92's round-2 blockers and round-3 notes; team-provisioning-app.md §6–§7 (Alta's calls); team-members.md §2; AGENTS.md in full. Reviewed the whole diff (38 files) against the design and the existing code: internal/operator/{plan,http_verbs,credential,directory,protocol,engine,inspect,verification}.go, both http_migrations, internal/home/{operator_http,operator_confirm,operator_material,consumer_registry,security,exchange,signout,dashboard_config,runtime,directory,app,signin_return,schema_inventory}.go, both templates, every new test, and the handoff pin (69ea999 records its own review in #93, so the round-3 gate 1 is met). make test run locally: green, except the -race step's Linux-only internal/provisioner setup failure, which CI covers. Fifteen mutations run by hand (list at the end).

Verdict: CHANGES REQUIRED (narrow)

The shape is the approved design, built faithfully: plans are verified and only closed fields reach disk (owner blind-indexed, name sealed, no plan bytes — gate 2 now decodes the envelope and scans payload, signature, raw and base64url, file + WAL + SHM); one pending and one open per role is UNIQUE(state) plus the store's checks; expiry sweeps run before each operation in their own statement, at the end of each plan and window, and at boot; the kind→verb table is windowAdmits; every directory mutation but initialize goes through fence on the window's label and operator_http_teams; register-consumer is driven only by the directory's signed record with issuer and directory fixed to the pins, the union collision check and the 4,096 cap before the INSERT; the registry is one immutable map behind an atomic.Pointer, swapped after each committed write, and every reader uses it (/authorize, handleAssertion, sign-out, dashboard_config); form-action is per response on the two pages whose form leaves the origin; a collision refuses boot; the transport sits outside CSRF and before sessions on both routers and refuses cookies, Origin, Sec-Fetch-*, query, wrong media, bad prefilter (fixed 401 body) and size, in that order; both confirm pages do what §4 steps 2–3 say, including the random-nonce fresh intent cleared on use, the reserved consumer refused in handleAssertion, recovery and Keymail-without-gesture refused, the owner retyped and compared as a blind index inside the write, and a credential page that renders only compiled names, prefixes and fixed text (gate 5 test with label, name, address, typed address and a consumer hostname as canaries). Logs are a fixed vocabulary with an 8-character operation prefix (gate 9 test over the whole sequence, hostile refusals included). Gate 1 runs over both databases. Gate 10 covers every new route.

Three things stop a merge. Two are small code-plus-test changes; one is the design document catching up with what was built.

BLOCKERS

1. A directory-signed record can commit a consumer row the registry reload refuses — and the next boot refuses with it, permanently. internal/operator/http_verbs.go:306-313 admits any b.Audience that passes operator.Origin and collides with nothing. consumerRegistry.load (internal/home/consumer_registry.go:76) then runs assertion.NewVerifier(credential, origin, keys), which refuses issuer == audience. I confirmed it with a throwaway test on this branch: a record signed by the directory's provisioning key with Audience = https://id.oficina.works is registered (err=nil, one row); a credential role booted with such a row fails NewRuntime with invalid assertion configuration (runtime.go:225). After the write, every exact replay answers 503 (operator_http.go:403-405), and consumers_no_delete makes the row unremovable without hand surgery on the live database. Only the directory's provisioning key can produce the record, so this is a directory compromise or a directory bug — but §8 concedes a directory compromise "could sign provisioning records", not a standing refusal to boot the credential origin, which AGENTS.md calls a suite-wide outage. Fix: make the verb's admission the reload's admission, so no row can be committed that load would refuse. NewCredentialHTTP takes an admit func(id, origin string) bool; newOperatorEndpoint (operator_http.go:256) wires it to consumerName(id) && assertion.NewVerifier(cfg.origins.Credential, origin, cfg.keys) == nil; register calls it before the collision checks and the INSERT. (At minimum refuse b.Audience == h.c.engine.verifier.pins.Origin || b.Audience == h.c.directory in the verb, but the shared predicate is what keeps the two from drifting again.) Tests: in http_verbs_test.go, a record with audience = the credential origin is ErrRefused and the table stays empty; in internal/home, an invariant test that registers through the HTTP fixture and then calls registry.load on a fresh registry — it must succeed for every row the verb admitted.

2. credential.retire-consumer's app scope has no test. internal/operator/http_verbs.go:350 checks !contains(w.Apps, app); dropping it leaves make test green (mutant survived). §10.5 names "app outside apps" and §10.8 says removing the window check fails a named test; this verb is the one place that is not true. Fix: in TestOperatorHTTPRegisterConsumerOnlyFromTheDirectoryRecord (or a new test), open a retire-apps window for sheets, assert retiring alpha-docs is ErrRefused with the row still active, then the docs window retires it as today.

3. The amendment now says things the branch does not do, and nothing on the branch records the difference. implementation/team-provisioning-amendment.md §5 "the native Linux command can act only with Alta's pins and key" is false after deviation 1 (the command refuses such a database outright); §3 lists credential.inspect as one of the actions, not as required (deviation 8); §7 "New tables" omits consumers.app (deviation 2); §10.4 "differing plan_ids across roles refused at confirm" is unbuildable (deviation 3); §5 puts baseline_attestation "signed in the plan" (deviation 4, it is in the operation input); §4 says nothing about confirm during an open window (deviation 6) or where the role's own keys come from (deviation 7). AGENTS.md's rule for binding documents is that they are fixed in the same commit as the code that falsifies them. Fix: a "Round 4 (implementation, discussion 94)" entry in §13 — or a short §14 — recording each deviation and this review's ruling on it, plus the §5 sentence rewritten to "restore through the native command needs a reviewed profile regeneration first; until then it refuses a database that has served over HTTP". One commit on this branch so the squash carries it. No re-review of the prose needed.

Deviations — rulings

  1. Separate migration sets, ServingSchema vs Schema. Accepted, with blocker 3 recording it. The frozen compatibility, admission and legacy-diagnostic profiles are reviewed artefacts and the new assertion in operator_schema_linux_test.go keeps the HTTP tables out of them; restore stays gated (§2 item 7) and platform 117 does not exist, so the native command is not a live path any serving database needs today. The legacy diagnostic reading mismatch on every directory boot is a standing false alarm — see the non-blocking note; it is not a reason to move the tables into the frozen set.
  2. consumers.app. Accepted: a compiled slug under a CHECK, needed for the retire scope. Add it to §7.
  3. Cross-role plan_id check at confirm. Accepted. The §10.4 item over-specified what round 2 asked for ("same plan_id on both roles, shown on both pages so Paul can see he is confirming one plan twice"); each POST carrying the id its GET showed, refusing any other, is the buildable half, and it is tested.
  4. baseline_attestation in initialize's input. Accepted: it is still under Alta's signature, verified by the same key, inside the same window, and initialize keeps its four-empty-tables precondition. Fix the §5 wording.
  5. Stale sessions redirect rather than render a refusal. Accepted: a redirect that forces a real gesture is a refusal that recovers, no window opens on any of the four cases, and TestOperatorCredentialConfirmRefusesKeymailWithoutGestureAndRecovery covers both the GET and the POST.
  6. An open window blocks a second confirm with 409. Accepted; one open per role is UNIQUE(state), and 409 until the window expires is the right answer — the design's silence was an omission.
  7. Keys from HOME_OPERATOR_MATERIAL. Accepted: the same reviewed material the native command reads, with distinctOperatorKeys extended to Alta's key and the directory's pins.
  8. <role>.inspect required. Accepted; Alta resynchronises from it, and refusing a configuration without it is correct.
  9. CSP guard exemption for security.go. Accepted: one file, and TestConsumerPolicyOnlyWidensFormAction holds setConsumerPolicy to adding exactly one registered origin to form-action and nothing to an unregistered one.

Non-blocking

  • Inside-the-write re-checks are dead by construction. operator_confirm.go:116-119 and :231-241 re-check subject and freshness inside the Open admit closure, but the closure captures the same s the outer *OperatorSession check already passed in the same request, so both mutants dropping them survive. Not a hole: plan expiry is genuinely re-read inside the transaction (scanPlan, plan.go:374). Either say so in the comment or make the closure the POST's only check so the mutation is killed.
  • exchange.go:81: the explicit intent.Consumer == operatorConfirmConsumer refusal is belt-and-braces (the union lookup already refuses it); that mutant survives, which is fine.
  • operator_http.go:403: the post-commit reload runs on r.Context(); a client disconnect after the commit leaves the union stale until Alta replays. Use context.Background() — load already bounds itself to 5 s.
  • operator_http.go:267: boot sweeps but schedules no sweepAt for rows that survive a restart, so a pending plan submitted just before a deploy lingers until the next access. After the boot Sweep, schedule for any remaining pending/open row.
  • Design note for a later amendment, not a deviation: credential.retire-consumer is app-scoped, not team-scoped (the credential role sees no labels), so a confirmed retire-apps window admits retiring any table consumer of those apps for any team, and the credential page cannot show Paul which. The mirror of register's record-derivation would be a directory disable receipt. The approved design has this shape; recording it here so it is weighed before a second team exists.
  • noscript_test.go's sweep walks a fixture without HOME_OPERATOR_HTTP, so the two confirm pages are outside the scriptless sweep. Both templates carry no script, but the gate does not look. Add a pass over the operator fixture.
  • Legacy diagnostic: legacy-directory-v1.json is an exact object set, so every directory boot will now log mismatch. Either extend the profile under its own review or have the diagnostic ignore the oficina_directory_operator_http set; until then a true mismatch hides behind a false one.
  • handleOperator: a body that fails Verify is routed to inspect and logged as <role>.inspect refused; closed vocabulary, fine, but the log cannot tell a bad operation from a bad inspect. Optional: log verb - on that path.
  • credentialOperatorSession's stale-GET intent overwrites any in-flight handoff intent cookie; harmless (that handoff fails closed and restarts), noting it only.

Tests, as checked

§10: 1 mounting (TestOperatorEndpointIsOffWithoutConfiguration; host-spoof and other-role in TestOperatorTransportRefusesBrowsersAndChecksPrefilterFirst); 2 transport (same test, 13 cases plus the 64 KiB body); 3 signature (TestOperatorPlanVerifyRefusesWrongKeyContextPinsAndClock, engine tests, TestOperatorHTTPReplayAfterWindowExpiryReturnsStoredResult); 4 ceremony (the seven ceremony tests, every listed item present); 5 scope (TestOperatorHTTPProvenanceFenceAndScope, …DisableConsumerUnderRetireApps, …OwnerSeedIsExistingOnlyAndTheTypedOwner); 6 blocker 2 (TestOperatorHTTPRegisterConsumerOnlyFromTheDirectoryRecord, eight refusals, plus the pre-existing-team fence in the end-to-end test); 7 registry (TestConsumerRegistryUnionPastSixteen, …CollisionRefusesBoot, …ConsumerTableCap, the two CSP tests, the race loop); 9 gates (whole-sequence gate 1 + 9, gate 2 static reach + plan-submit path, gate 5, gate 10, additive migrations with the old schema re-applied); 10 canary not run, correctly, since no deploy was in scope.

Mutations I ran (each restored; working tree clean): owner-seed typed-owner compare, fence in provision, issuer pin in register, env-origin collision, directory windowAdmits, credential windowAdmits, seed-team name byte compare, recovery refusal, typed-owner compare always true, query refusal, intent not cleared on confirm, reload after write dropped — all killed by a named test. Survived: retire app scope (blocker 2); inside-the-write session re-checks on both pages; the belt-and-braces reserved-consumer check (acceptable).

What this approves, once the blockers land

The operator HTTP transport, the confirm ceremony on both roles, the consumer registry with per-response form-action, and the four new verbs, as code — subject to CI green on the fixed tip and the §10.10 canary on deployed previews before anything is promoted. Reply here with the fixing commit; I expect to approve on the diff without another whole-code pass. Still gated elsewhere, unchanged: CARLOS team-scoped-credentials (platform 449) before Alta reaches production, Alta itself, the Team page, and Paul's §12 pre-flight confirmation before the first production initialize.

Round-4 fixes are pushed. The tip is c880a02 (6d8eee2 is code, c880a02 is the amendment), and hub CI passed at c880a02. Nothing is merged or deployed.

Blockers

  1. Registration admission now equals reload admission (6d8eee2). - NewCredentialHTTP takes admit(id, origin). newOperatorEndpoint wires it to registryAdmits, which is the same predicate consumerRegistry.load now uses: consumerName(id) && assertion.NewVerifier(credential, origin, keys) == nil. - register calls it before the collision checks and the INSERT. - Tests: - TestOperatorHTTPRegisterConsumerOnlyFromTheDirectoryRecord gains a case where the record's audience is the credential origin. It is ErrRefused and the table stays empty. - TestOperatorRegisteredRowsAlwaysReload (internal/home) registers through the HTTP fixture and refuses the credential origin and a port variant. A fresh registry.load and a fresh NewRuntime both succeed. - The mutant that drops admit fails both tests.
  2. retire-consumer's app scope is tested (6d8eee2). A retire-apps window for sheets refuses retiring alpha-docs, and the row stays active; the docs window then retires it. The mutant that drops !contains(w.Apps, app) is now killed.
  3. The amendment records round 4 (c880a02). - §13 has a "Round 4 (implementation, discussion 94)" entry with the nine deviations and your ruling on each. - The §5 restore sentence is rewritten as you gave it. - §3: <role>.inspect is required, and the role's own keys come from HOME_OPERATOR_MATERIAL. - §4: a second confirm answers 409 while a window is open. - §5: baseline_attestation is in the initialize input. - §7: the tables are in their own migration sets, and consumers.app is added. - §10.4: the cross-role plan_id item now explains why it can't be built and what was built instead. - The retire-consumer team-scope design note is recorded for a later amendment.

Non-blocking

  • Post-commit reload now runs on context.Background().
  • Boot schedules sweepAt for every plan row that survives the boot sweep (new PlanStore.Ends).
  • Confirm-page re-checks. - On both POSTs, the freshness and method check is now made only inside the Open admit closure, and a stale session gets the 303 from there. - The subject 404 stays outside the closure. - Both "drop the in-write freshness check" mutants now fail: TestOperatorDirectoryConfirmCeremony and TestOperatorCredentialConfirmRefusesKeymailWithoutGestureAndRecovery.
  • Scriptless sweep. TestOperatorPagesUnderTheScriptlessSweep serves both confirm pages (success and refusal paths) and both transport routes, on both origins, through rastrillo.Handler with the served policy. It asserts no inline or eval'd script and no script beyond busy.js.
  • Legacy diagnostic. - It now skips exactly the directory's additive set, computed as ServingSchema less Schema: those ledger rows by checksum, those objects by exact type, name, table and SQL. It doesn't import internal/operator, so TestLegacyDiagnosticCannotExpandAcceptedProfiles still holds. - TestLegacyDiagnosticSkipsOnlyTheExactOperatorHTTPSet checks that the serving schema reads match. A changed operator_plans reads mismatch, and so does a wrong checksum on that set.
  • Logging. A body that is neither a verified operation nor a verified inspect now logs route operation, verb -.
  • Reserved-consumer check and intent overwrite: both left as they are, as you noted.

Checks run:

  • make test on the Mac: green, except the race step's known setup failure on the Linux-only internal/provisioner.
  • -race on internal/home and internal/operator: green.
  • Linux-only tests in Docker: green, except the credits check, which fails there because the container has a newer Go toolchain than the pinned one; it fails the same way on main in that container.
  • Hub CI at c880a02: green.

Reviewer: Claude Fable 5.1 (claude-fable-5-1) — fix review @ c880a02

Scope as promised in the whole-code review: the diff 2f1cac8..c880a02 (6d8eee2 code, c880a02 amendment), 11 files; the fix mapping above; make test on a scratch worktree at c880a02 (green except the -race step's Linux-only internal/provisioner setup, which CI covers; hub CI green at c880a02); and ten mutations against the new guards.

Verdict: APPROVED

Blocker 1 — registration admits only what the reload admits: resolved. registryAdmits(credential, keys) (consumer_registry.go:99) is now the one predicate: load applies it to every active row, and newOperatorEndpoint hands it to NewCredentialHTTP, whose register calls it before the collision checks and the INSERT (http_verbs.go:309). TestOperatorHTTPRegisterConsumerOnlyFromTheDirectoryRecord gains the credential-origin audience; TestOperatorRegisteredRowsAlwaysReload registers through the real wiring, refuses the credential origin and a port variant, then proves a fresh load and a fresh NewRuntime both succeed with the committed row. Mutations: dropping h.admit fails the operator test; dropping it fails the home test; making registryAdmits return true fails the home test. (Dropping only the consumerName half survives — atom in the verb and the table's CHECK enforce the same grammar, so that is redundancy, not a gap.)

Blocker 2 — retire-consumer app scope: resolved. A retire-apps window for sheets refuses retiring alpha-docs and the row stays active, then the docs window retires it. Dropping !contains(w.Apps, app) now fails the named test.

Blocker 3 — the amendment records round 4: resolved, and faithfully. §13's "Round 4 (implementation, discussion 94)" lists the nine deviations with the rulings as I gave them; §5's restore sentence is the wording I asked for; §3 now requires <role>.inspect and names HOME_OPERATOR_MATERIAL; §4 records the 409; §5 puts baseline_attestation in the initialize input; §7 records the separate migration sets and consumers.app; §10.4 says why the cross-role plan_id item is unbuildable and what stands in for it; the retire-consumer team-scope note is recorded for a later amendment. Nothing is overstated.

Non-blocking notes, applied. Post-commit reload on context.Background(); boot schedules sweepAt for every surviving row (PlanStore.Ends); the POSTs' freshness and method check now lives only in the Open admit closure, and both "drop the in-write check" mutants are killed (TestOperatorDirectoryConfirmCeremony, TestOperatorCredentialConfirmRefusesKeymailWithoutGestureAndRecovery); TestOperatorPagesUnderTheScriptlessSweep serves both confirm pages on both outcomes and both transport routes under the served policy; the legacy diagnostic skips exactly the additive set by checksum and exact object, and TestLegacyDiagnosticSkipsOnlyTheExactOperatorHTTPSet holds a changed table and a wrong checksum to mismatch — that test is //go:build linux, so my mutant against the checksum skip was inconclusive here, but I confirmed the test is not vacuous (its UPDATE … LIKE 'oficina_directory_operator_http/%' matches exactly the one ledger row, oficina_directory_operator_http/0001_operator_http) and CI runs it; the unverified-body log line now says verb -.

Non-blocking (apply before the squash; no re-review)

  1. A stale POST with a non-pending plan id now renders instead of redirecting. operator_confirm.go:120-131 and :246-262: stale is set only when the admit closure runs, and Open runs it only for the pending, unexpired plan id. A stale operator session posting any other id (or a malformed form, :113/:239) therefore reaches renderOperatorRefusal, which draws the pending plan — on the directory, its label and display name — to a session the GET would have sent through the fresh exchange. The window cannot open and nothing account-authored reaches the credential origin (gate 5 holds), so this is consistency, not a boundary; but at 2f1cac8 every stale POST was a 303, and the design says GET and POST both require freshness. Fix: compute fresh := credentialFresh(s, time.Now()) (resp. directoryFresh) once before Open, keep the closure as the check that counts, and after Open redirect whenever !fresh || stale before any render. The mutation that drops the closure's check is still killed, because the window opens before the redirect and the tests count open rows.
  2. Boot Ends sweeps have no test: for _, end := range ends[:0] survives. Add a case to TestOperatorExpirySweepsRunUnprompted that writes a pending row, builds the endpoint with a captured after, and asserts one wait is scheduled at the row's end.
  3. The credential closure's subject half (s.Subject != a.op.subject) survives mutation because the outer 404 runs first; that is the design (404 outside, freshness inside), fine as is.
  4. The amendment's status line still reads "APPROVED (design) … round 3". When this lands, add one line: implementation slice 1 (operator HTTP transport, confirm ceremony, consumer registry, new verbs) reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-28, discussion 94, APPROVED at c880a02.

What is approved

Branch operator-http at c880a02, as code: the operator HTTP transport (POST /operator/v1, /operator/v1/plan on both roles), the confirm ceremony on both roles behind the directory's fresh consumer, the consumer registry (HOME_CONSUMERS ∪ table behind the atomic pointer, per-response form-action, boot refusal on collision), the four new verbs (credential.register-consumer, credential.retire-consumer, directory.disable-consumer, <role>.inspect), the separate oficina_<role>_operator_http migration sets through ServingSchema, the legacy-diagnostic skip, and the amendment's round-4 text. Squash-merge per AGENTS.md: CI green on the merge tip, checked.

Still gated, unchanged

  • §10.10 canary on deployed previews (Alta creates alpha and beta; the seven existing consumers keep working) before anything is promoted — and production config first: Alta as the 8th HOME_CONSUMERS entry, HOME_OPERATOR_HTTP on both roles, the directory's roster keys.
  • CARLOS team-scoped-credentials (platform 449) and its floor release before Alta reaches production (Paul's condition on ruling 8); Alta itself; the Team page, resolve, memberships.added_at and each app's roster port — each its own slice and review.
  • Paul's §12 pre-flight confirmation before the first production initialize.
  • Native-command profile regeneration, under its own review, if restore through the native command is ever wanted (round-4 deviation 1).
  • The one-line pointers in each superseded file (amendment §2) when this lands.

Landed on main as squash commit 82d9388 (82d938882ed314174cf769cdca0d702054b14ca0), from branch tip b4fc99d. CI passed on the branch tip and on main at 82d9388.

Before the squash I applied Fable's approval notes, items 1, 2 and 4:

  1. Stale confirm POSTs. Both confirm POSTs now compute freshness before Open. Afterwards they redirect whenever the session isn't fresh, or the in-write check found it stale, before anything is rendered. That includes a malformed form. The check inside the write is still the one that counts. - Tests: a stale POST with another plan id gets a 303 on both pages, and the directory page never shows the plan name. - If the up-front check is dropped, TestOperatorDirectoryConfirmCeremony fails.
  2. Boot sweep scheduling. TestOperatorBootSchedulesSweepsForSurvivingRows checks that a plan row that survives a restart gets one boot-scheduled sweep at its end, and that the sweep deletes it. If the Ends loop is dropped, the test fails.
  3. Amendment status and pointers. The status line records slice 1 as reviewed by Claude Fable 5.1 (claude-fable-5-1), 2026-10-28, discussion 94, APPROVED at c880a02. Every file that §2 supersedes now carries a one-line pointer: home-provisioner.md, home-operator-seed.md, roster-contract.md, team-entry.md, directory-runtime.md, and the spec's §10 drain paragraph.

Item 3 needed no change.

Nothing is deployed. These remain gated:

  • the §10.10 canary on deployed previews, and the production config before it
  • CARLOS team-scoped credentials (platform 449)
  • Alta
  • Paul's §12 pre-flight confirmation

Closing.