Plan 3 claims: rulings and follow-ups after merge open
On branch agent-start-demo-3
Rulings the build controller made (merged as e12fe9a1). Each line gives the decision, the reason, and what it costs if wrong.
- Ruling R1: Task 2 wires handleDemoClaimSelect (and verify's one-membership path) to chooseDemoClaimAccount/reserveDemoClaim, editing democlaimauth.go — the select handler must exist and the plan's T1 says it delegates to T2 — cost if wrong: none, file ownership only.
- Ruling R2: Task 2 checks placement/plan only; the capability gate (worker claim capability, seed floor demo-claim-seed-v1, edge moved/gate capability) is enforced in Task 5's advance before the freeze dispatch, with a seam (func field) Task 2 leaves for it — capabilities do not exist until T3/T4/T6 — cost if wrong: a reserve that later refuses before freeze, which the plan already handles as safe refusal.
- Ruling R3: Task 3 defines the box<->console claim wire contract in internal/democlaim (paths /api/box/demo-claims/{id}/pickup|snapshot|ack, request/response structs, headers) and the agent client, tested against an httptest fake console; Task 5 implements the console handlers and coordinator against that contract — keeps the plan's file split — cost if wrong: contract mismatch found in T5 review, small rework.
- Ruling R4: Task 5 writes a durable moved-notice SQL row (demo id, host, target host, original expiry) inside the commit transaction and enqueues a "publish moved" outbox step calling (*Server).publishDemoMoved, which T5 stubs as a no-op; Task 6 replaces the stub and adds notice-capacity reservation to T5's pre-commit check — keeps T5 testable alone — cost if wrong: T6 edits T5's commit path, review covers it.
- Ruling R5: endpoints from T1-T7 ship in the same merge as T8's CARLOSDEMOCLAIM gate; T1-T7 register routes but each handler must refuse when a s.demoClaimEnabled() check fails, defaulting false until T8 wires the config — no window where claims are live without the switch — cost if wrong: a dead code path until T8.
- Ruling R6: no implementer touches dev or any real box. Plan steps that run witnesses on dev (T3 Step 4 cgroup witness, T8 Step 3 real-box exercise, TestDemoClaimDevAcceptance live run) are recorded as outstanding evidence and run by the controller after merge under the brief's Dev activation section; implementers write those tests gated by an env var and skip without it — Codex brief forbids boxes — cost if wrong: root-level defects surface only at dev witness, after merge, while switch is off on flagship.
- Ruling R7: T8 Step 4 full local gate is replaced by targeted local tests plus amadan CI as the full gate (brief §5, memory local-tests-ci-full); census-propose still runs locally; landing (T8 Step 5) is the controller's — cost if wrong: CI catches what local skip misses.
- Ruling R8: implementers put every new human-facing claim string in one file per binary (internal/console/democlaimcopy.go; moved page strings in internal/democlaim/moved_copy.go) as named constants tagged with the plan's copy IDs, draft wording, no em dashes; the Luna copy pass before Task 8 rewrites those constants verbatim — copy reviewed once, applied verbatim per brief — cost if wrong: a few strings outside the files get missed; the whole-branch review checks.
- Ruling R9: one census overlay (NAME=agent-start-demo-3), produced after Task 6 and rerun at Task 8 with the same NAME; Opus reviews every unit/envelope once on the final overlay; per-task reviews flag new root reads as findings — AGENTS.md allows rerunning propose with the same NAME — cost if wrong: census findings arrive late, inside the whole-branch round budget.
- Ruling R10: split Task 3 remainder into 3b (report items 1-3 + agent side of 6: claimDemo executor, pickup, Record.DemoClaim hold + restore/ordinary-writer protection, reversible serving cancel, abort) and 3c (items 4-5: SnapshotDemo, root /demo-snapshot, RunSnapshotWorker, __demo-snapshot dispatch, unit, builder-slot serialization, restart cleanup) with item 7 tests split by owner; one Opus review covers 8b202f29..end of 3c — one task, one review surface, Codex ran out of room — cost if wrong: a larger review package; structural issues found later.
- Ruling R11: accepted reap reading the snapshot root's entries before readiness checks its mode/ownership (root-created StateDirectory; cleanup confined by os.Root; ValidJobID gate) — cost if wrong: a stray non-job entry in that root-only dir keeps builds poisoned until an operator removes it.
- Ruling R5a (clarifies R5): the switch gates only NEW proof/selection/reservation (agent + browser start/verify/select and freeze dispatch for not-yet-frozen ops). Status, box pickup/snapshot/ack for existing ops, abort, committed recovery, retirement and moved notices run regardless — plan Task 8 Interfaces says switching off leaves these operational; R5 as worded made a held source stay frozen until expiry — cost if wrong: none beyond the fix.
- Ruling R12: accept Luna's table; Luna's flags need no new strings (no fact conflicts; CLAIM-BUSY/RETIRED covered by demoClaimWorking/demoClaimAborted; the CLAIM-OPERATOR rows come with Task 8's README and stay operator docs) — cost if wrong: a few refusals less informative than ideal; Paul sees the collected strings on the branch.
- Ruling R13: the Task 7 intent-cookie P2 is fixed as the first commit of the Task 8 run (exempt intent from the reserved-cookie refusal; test demo A then demo B), checked by the controller from the diff — one-line gate change with a named test; saves a run — cost if wrong: caught in the whole-branch review.
- Ruling R14: request-cost is a repeat fault family (T5 P2-3, T6 P2-2, branch P2-2). Per AGENTS rule 2 option 3 (state the invariant, enforce it in one place, guard test) rather than a third example fix: every ReconcileDemoClaims retry that made no progress goes through one backoff function (2 s doubling to 5 min cap, reset on progress or external signal), and a table-driven guard test walks every phase/sub-state asserting unchanged ticks after the first cause no additional store requests beyond the backoff schedule. Not escalated to Paul: the rule's own remedy, Paul said "keep going until it's done" (17:45Z #527); noted on the branch — cost if wrong: Paul prefers to be asked; no behaviour risk.
- Ruling R15: demo-claim-seed-v1 is advertised only when the box has CARLOSDEMOCLAIM=1 (dormant boxes publish as main) — keeps the dormant-is-main invariant; the dev witness therefore needs CARLOSDEMOCLAIM=1 on the dev destination/ingress boxes too — cost if wrong: activation needs a box env change (host.env restart, ~11 s per box) that rides the next roll.
- Ruling R16: revert the host claimRecord change to the unjudged GetRecord and permit it in unjudgedReadPermitted with a reason (agent-side equality checks against Ed25519-signed work that already binds account/app/host/lifetime/generation; acts only on this box's own held route), and drop the WithLifetimes wiring on the demo worker ctx — a judged read through a door that cannot see slot keys would fail the freeze on real demo boxes, found only at the dev witness — cost if wrong: a stale-lifetime record could be read, but the signed-work equality check refuses any mismatch.
Follow-ups (P3s and deferred minors; none blocks, per the whole-branch triage)
- Task 1: minor (deferred) P3-1: sendChallengeAsync now logs only error type (%T) for all sign-in/step-up mail failures; redact code/link instead
- Task 1: minor (deferred) P3-5: proveDemoClaim UPDATE uses time.Now() instead of now (:279)
- Task 1: minor (deferred) P3-6: otherDemo/otherFlow tests hit a held challenge, not a sent rival
- Task 2: minor (deferred) P3-4: withAutoAppSQL guard precedes outerInsideView check (claimsqlauto.go:15)
- Task 2: minor (deferred) P3-6: TestDemoClaimTargetIsolation loop checks labels not doors (doors covered by apiAccountApp witness)
- Task 2: minor (deferred) P3-7: bucket reads under source demo app lock during name search
- Task 3: minor (deferred) P3-a: export holds adopt flock up to ~2.5 min; freeze/close budgets can expire waiting
- Task 3: minor (deferred) P3-b: p.cleanup uses own Background timeout, recovery can exceed ensureReady's bound (~20 s)
- Task 4: minor (carried to T8) P3: signed seeds floor publication must be {min:2} at activation (rootseedsfloor_publication.go:19); floor door now always republishes min 2 (runbook note)
- Task 4: minor (deferred) P3-2 no golden bytes test for SeedColumn/SeedSource without ClaimID; P3-4 committed claim records keep shape limits; P3-5 census false positives (RunState.Open, SQL Exec)
- Task 5: minor (deferred) beginDemoClaimAbort overwrites stored reason with expired (diagnostics only)
- Task 6: minor (deferred) P3-4 registry fingerprint hashes whole snapshot each pass
- Task 6: minor (deferred, for final review) P3: skipped row after operator domain change publishes non-monotonic snapshot (refuse Put when non-monotonic vs old, or keep published rows); P3: local SQLite busy in box moved pass consumes generation (same family as R1 P2-2); P3: duplicate hosts/size overflow fail whole SignMoved (guarded at reservation)
- Final fix wave scoped re-review: READY (all 3 addressed). Follow-ups: P3-A backoff cap uses end-of-pass time so a pass straddling a deadline aborts up to one backoff late (safe; source frozen longer); P3-B busy claim lock makes ObserveDemoJobs return, skipping later scopes until next timer.
- Merge integration check: READY. P3 follow-up: site Origin allowlist matches /api/demo/claims/ prefix not exact set (democlaimauth.go:30-31). TestDemoAPIAliasBoundary/local_transports skipped in sandbox; CI covers.
- Site Origin allowlist matches the /api/demo/claims/ prefix rather than the exact set (democlaimauth.go:30-31).
- R13 intent exemption is path-based (democlaimpage.go:175).
- Dead democlaim.ExportSQLite; ensureSystemUnits does not list carlos-demo-snapshot@.service.
- Outstanding evidence (R6): real-box witnesses gated by CARLOSDEMOCLAIMDEVWITNESS=1 (cgroup stop proof, snapshot unit limits and isolation, systemd property readback) run at the dev witness.