GeezerVison is showing github.com — Act only on a verified read — one seam contract for the opencode-claimant · Issue #7770 · developing-today/code
Act only on a verified read — one seam contract for the opencode-claimant #7770Closed 9 / 99 of 9 issues completedClosed 9 / 99 of 9 issues completed Description
🤖 Agent note · design-architect pass 74 — design filed this pass
Design doc: files/designs/code-claimant-seam-contract.md in the keep-the-four-repos-healthy goal workspace. Audit at origin/main b64288a567fa1710abea0866dd3e43cd7f7fab61.
Summary
Design #4912 stated the opencode-claimant's contract with the OpenCode server for its Slice-1 surfaces (poll.py + prompt.md). The claimant has since grown a second implementation (claimant.py) and works through three seams whose contract was never stated — the queue it reads, the server transport it shells out through, and its own actuation and fire log. Eight filings are one defect: the claimant acts on reads it never verified, in shapes the writers never produced, and records measurements it never took.
- Queue seam:
repo-queue list emits a human table while the claimant parses JSON, so discovery is blind (opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325, opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375); and the checkpoint verb writes the yield at progress.last_checkpoint.stage while is_candidate() reads progress.stage — ~60–78 real yields invisible per fire in one direction, and a stale top-level handed_off offering a task whose lane is mid-work in the other (opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706, the double-execution shape opencode-claimant: launch only into recorded handoffs (#3026) #4490 hardened against).
- Server seam: every
claimant.py server call is an unauthenticated curl -s whose exit code is treated as success (opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367); the zero-message gate guarding design: judge a session by its own record — the opencode-claimant's session contract (per-id reads, verified create, every bound state dispositioned) #4912's recovery calls a plural /messages path the v2 server 404s with an empty body, and stdout or "[]" reads that as zero messages — every stuck-bound row passes the gate that protects live sessions from deletion, and only the queue read failing first (opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325) prevents the chained DELETE + binding clear today (opencode-claimant(claimant.py): zero-message gate calls /api/session/<id>/messages — a 404 empty body reads as "zero messages" (fail-open before DELETE + binding clear) #7760).
- Actuation seam:
launch_step binds a session and never sends the prompt (opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356), ignores its mode argument so a shadow fire creates and binds (opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate #7366), and gate-exit fires log a hardcoded cap_room: 0 although cap_step() never ran (opencode-claimant(claimant.py): gate-exit logs a hardcoded cap_room 0 — idle fires read as cap-saturated #7732).
This design originates on the trigger recorded at passes 71–73 (a further claimant interface filing): three landed in one window (#7706, #7732, #7760). #4916 (parked) scopes only poll.py/prompt.md server calls plus a limit=500 question — none of the eight legs is in its scope.
The contract
The claimant acts only on a verified read. A read is verified when it arrived through the seam's one transport, in the shape the writer actually produces, with its status checked. Anything else is UNKNOWN — and unknown never authorizes a side effect (launch, delete, unbind) and is never recorded as a measurement.
Decisions recorded (the architect's pins)
- Queue channel: the claimant reads queue state through ONE channel — the repo-queue CLI's JSON output (the CLI grows a stable JSON mode; the human table stays for humans). Direct broker HTTP from the claimant loses: queue selection, auth and de-chunking are the CLI's contract, and the filed traps (repo-queue(client): a list response over 32 KiB comes back chunked — the client does not de-chunk, parses Null, and silently prints "(no tasks)" for a 178-row queue #7355, repo-queue:
claim (and list/health) silently default to the shadow queue — the trap enqueue was hardened against #7358) live there. A failed/non-JSON read is discovery-UNKNOWN, not zero candidates.
- Yield field: opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706's option A — the yield of record is
progress.last_checkpoint.stage; progress.stage stays accepted for older rows, and a row whose live progress.stage names a later non-yield work stage is rejected (stale direction). Option B (checkpoint also stamps the top-level field) loses: it changes the queue contract for every consumer and needs a ~500-row backfill to fix a one-reader defect.
- Server transport: one authenticated helper for every server call; success = HTTP 2xx AND the body parses into the expected envelope (
{"data": [...]} for message reads, singular /message path as a constant). A subprocess exit code is never a verdict — reads or DELETE. Zero messages is a 200 with an empty data list; gone is a 404 from the per-id GET through the same helper; empty body / non-2xx / wrong shape is UNKNOWN. This states at the transport what prompt.md step 1a already rules, completing design: judge a session by its own record — the opencode-claimant's session contract (per-id reads, verified create, every bound state dispositioned) #4912's recovery rule.
- Actuation: a launch is create → prompt → bind (a failed prompt send leaves no binding); mode is checked at the actuation helper, not per call site (shadow = no create/bind/prompt/delete); the fire log records only measured values (
cap_room is cap_step()'s value or null; candidates_seen distinguishes unknown from empty).
Phases (sub-issues of this issue)
- Phase 1 — opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325 + opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375 + opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706 (ADOPTED): queue seam — CLI JSON channel + yield from
last_checkpoint.stage with the stale-direction rejection.
- Phase 2 — opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367 + opencode-claimant(claimant.py): zero-message gate calls /api/session/<id>/messages — a 404 empty body reads as "zero messages" (fail-open before DELETE + binding clear) #7760 (ADOPTED, independent): server seam — one authenticated transport, status + shape verdicts, unknown-never-zero/gone, test stub corrected to the writer's shapes.
- Phase 3 — opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356 + opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate #7366 + opencode-claimant(claimant.py): gate-exit logs a hardcoded cap_room 0 — idle fires read as cap-saturated #7732 (ADOPTED, independent): actuation seam — create → prompt → bind, mode gate at the helper, measured-only fire log. Coordination: its create/delete calls use Phase 2's transport helper when it exists; if Phase 3 lands first it introduces the helper for its own calls rather than a private curl shape.
- Phase 4 — NEW (closing audit, filed with this design): seam + stub-shape inventory over
poll.py, claimant.py, and prompt.md's queue reads; README contract statement; required dispositions — (a) repo-queue verb trio repo-queue: list and health reject --worker, which the opencode-claimant packet mandates on every verb #7349/repo-queue(client): a list response over 32 KiB comes back chunked — the client does not de-chunk, parses Null, and silently prints "(no tasks)" for a 178-row queue #7355/repo-queue: claim (and list/health) silently default to the shadow queue — the trap enqueue was hardened against #7358 dependency per verb, (b) fleet(queue): claim verb cannot target a specific task — monitor Duty 1B PR binding has no claim path for a queued task #7735 claim targeting (queue-side, not a phase), (c) the Phase 4 (audit) of #4912 — closing server-call inventory + contract statement for the opencode-claimant #4916 boundary (its inventory owns poll.py/prompt.md OpenCode calls; this one owns claimant.py + both queue seams), (d) opencode-claimant: handed-off tasks are never launched — executed_lane/session_id stay null across repeated claim→handed_off→park cycles #6533 discovery tracker closure/re-scope on Phase 1 evidence.
Open questions (recorded in the design doc, not phased)
Deprecating progress.stage as a yield source entirely (queue-side, long-term form of #7706's B); generating prompt.md's prose steps from claimant.py's constants (the drift class behind the wrong path); a queue-health read as the discovery-unknown signal.
For triage: do NOT re-file or split the phases — they are the sub-issues of this issue, with the decisions recorded here and in the design doc.
Acceptance criteria
- The seam contract (design doc linked in the body) states one rule for all three seams — queue reads, server transport, actuation/fire log: the claimant acts only on a verified read, in the shape the writer actually produces, and logs only measurements it actually took.
- Each of the eight linked filings (opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325, opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375, opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706, opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367, opencode-claimant(claimant.py): zero-message gate calls /api/session/<id>/messages — a 404 empty body reads as "zero messages" (fail-open before DELETE + binding clear) #7760 and siblings) maps to a named contract clause, so a reader can trace filing → clause → implementation.
- Implementation follow-on issues exist and are linked for every clause that is not already fixed, per the native-relations rule (a design with no implementation link is not finished work).
- A claimant fire after the contract lands shows no action taken on an unverified, mis-shaped, or unmeasured read in any of the three seams.
Sub-issuesCollapse Sub-issuesSub-issues9 of 99 of 9 Issues completedLoading 9 sub-issues Activitydeveloping-today commented on Nov 8, 2026 dezren39 commented on Nov 10, 2026
🤖 Agent note · parked — conflicting work in the primary clone
- Agent: repo queue worker, lane code-v (repo-worker-code), task 14536
- Verified fresh (2026-11-10T13:59Z): issue Act only on a verified read — one seam contract for the opencode-claimant #7770 OPEN, no hard-stop labels, no status/needs-triage.
- Conflict: the laptop primary clone (branch queue/13790-5954-deploy-smoke-fixture, a different task) carries uncommitted modifications to exactly this issue's surface — pm-stack/opencode-claimant/claimant.py, poll.py, prompt.md, test_claimant.py, test_poll.py, plus untracked IMPLEMENTATION_STATUS.md. That work is owned by whoever holds the primary; building a competing worktree/PR would collide.
- Action: parked task 14536 for 30 minutes naming the conflict. Resume when the primary's claimant changes land (or are cleared) — then implement Act only on a verified read — one seam contract for the opencode-claimant #7770 in a dedicated worktree.
dezren39 commented on Nov 10, 2026 agent-note:v1 — Phase 2 landed (lane code-l, task 14536)
PR #8174 merged (merge commit 86b896f): every OpenCode server call in pm-stack/opencode-claimant/claimant.py now goes through one authenticated verified-read transport (_server_request); verdicts come from HTTP status + body shape, never curl's exit code. Session GET is ok/gone(404)/unknown — a 401 leaves the task bound; the recovery DELETE counts only on a verified 2xx; a create 401 now names the transport failure instead of session_wrong_location.
#7770 stays open for Phase 4 (#7772, closing seam inventory + contract statement), which is tracked as its own sub-issue. dezren39 commented on Nov 11, 2026 🤖 Agent note · Phase 4 closing audit landed (issue #7772, task 14782, PR #8367)
- Agent: repo-worker-code, lane code-y
Per phase:
- Phase 1 (queue seam — opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325, opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375, opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706): landed and dispositioned. Rows read via the broker's rich
/list; yield from progress.last_checkpoint.stage (option A). Divergence from Decision 1's letter, recorded for this design thread: the pin named the repo-queue CLI's JSON output as the one channel; the implementation landed the broker rich read (commit eb1f9987eb) and the CLI still has no JSON list mode (verified live 2026-11-11). The intent (machine shape, fail-closed) is met. Amend the pin or re-pin here — the audit does not silently rewrite the decision.
- Phase 2 (server seam — opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367, opencode-claimant(claimant.py): zero-message gate calls /api/session/<id>/messages — a 404 empty body reads as "zero messages" (fail-open before DELETE + binding clear) #7760): landed and dispositioned. One authenticated transport (
_server_request), status+shape verdicts, gone = per-id 404, zero = 2xx with empty data from singular /message.
- Phase 3 (actuation seam — opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356, opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate #7366, opencode-claimant(claimant.py): gate-exit logs a hardcoded cap_room 0 — idle fires read as cap-saturated #7732): landed and dispositioned, with two fire-log measurement defects found and fixed in PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367 (cap-unknown logged the
-1 sentinel; gate discovery failure logged as a verified empty queue — both now null, tests pinned). The landed launch order (create → verify → bind → verified prompt) supersedes the design text's create → prompt → bind; the reason is recorded in the README contract statement.
- Phase 4 (this audit): seam inventory + stub-shape audit + contract statement are in
pm-stack/opencode-claimant/README.md beside Phase 4 (audit) of #4912 — closing server-call inventory + contract statement for the opencode-claimant #4916's session contract (PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367). One stub mirrored the reader's assumption (test/test_claimant.py, 2 failing tests) — fixed. Dispositions: (a) verb trio repo-queue: list and health reject --worker, which the opencode-claimant packet mandates on every verb #7349/repo-queue(client): a list response over 32 KiB comes back chunked — the client does not de-chunk, parses Null, and silently prints "(no tasks)" for a 178-row queue #7355/repo-queue: claim (and list/health) silently default to the shadow queue — the trap enqueue was hardened against #7358 independent of the landed channel, per verb; (b) fleet(queue): claim verb cannot target a specific task — monitor Duty 1B PR binding has no claim path for a queued task #7735 not a phase, claimant has no use for by-id claim; (c) Phase 4 (audit) of #4912 — closing server-call inventory + contract statement for the opencode-claimant #4916 boundary resolved by cross-reference (it landed first); (d) opencode-claimant: handed-off tasks are never launched — executed_lane/session_id stay null across repeated claim→handed_off→park cycles #6533 re-scoped to live-fire verification with the Phase 1 evidence chain recorded on it; (e) prompt.md generation — YES, filed as opencode-claimant: prompt.md constants drift from claimant.py — generate them or pin them by a sync check (#7772 disposition e) #8366 (prompt.md's stale CLI-path constants were repaired in the same PR). Residuals on poll.py's per-queue unknown marker are owned by opencode-claimant: fire log cannot distinguish a failed queue read from an empty queue, or say why a bind failed #8042.
Open question from the design, untouched: progress.stage deprecation and a claimant-side queue-health read remain recorded-not-phased, as the design left them.
dezren39 commented on Nov 17, 2026 🤖 Agent note · done — contract landed in all four phases; closing
- Agent: queue worker (repo-worker-code), lane any-g
- Session / ID: task 18535
- Found via: queue claim
- Task: Fresh revalidation of issue Act only on a verified read — one seam contract for the opencode-claimant #7770 (verified-read seam contract for the opencode-claimant). Verdict: ALREADY DONE — the design's four phases all landed and were dispositioned, and the closing audit is merged. Closing as completed, with the one recorded divergence and the owned residuals stated plainly below so nothing is buried by the close.
- Evidence (fresh, 2026-11-17):
- Phase 1 (queue seam — opencode-claimant(poll): repo-queue list emits a table, not JSON — every queue read fails and candidate discovery is blind fleet-wide #7325/opencode-claimant: repo-queue list emits a table, claimant poll/claimant parse JSON — candidate discovery silently no-ops #7375/opencode-claimant(poll): candidate filter reads progress.stage, but the checkpoint verb writes progress.last_checkpoint.stage — ~60 recorded yields invisible per fire, stale stages offered unsafely #7706): landed; rows read via the broker's rich /list, yield read from progress.last_checkpoint.stage.
- Phase 2 (server seam — opencode-claimant(claimant.py): every OpenCode server call is unauthenticated — session create always 401s, and the delete gate trusts curl's exit status #7367/opencode-claimant(claimant.py): zero-message gate calls /api/session/<id>/messages — a 404 empty body reads as "zero messages" (fail-open before DELETE + binding clear) #7760): landed; one authenticated transport with status+shape verdicts.
- Phase 3 (actuation seam — opencode-claimant(claimant.py): launch_step binds a session and never sends the prompt — every live launch creates a zero-message bound session #7356/opencode-claimant(claimant.py): launch_step ignores its mode argument — a shadow fire creates and binds a session if discovery ever returns a candidate #7366/opencode-claimant(claimant.py): gate-exit logs a hardcoded cap_room 0 — idle fires read as cap-saturated #7732): landed; two further fire-log measurement defects found and fixed in PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367.
- Phase 4 (closing audit, issue Closing seam inventory + stub-shape audit + contract statement (Phase 4 of the claimant seam-contract design #7770) #7772): CLOSED; PR claimant: #7770 Phase 4 closing audit — seam contract, fire-log unknowns, stub-shape fix (#7772) #8367 MERGED 2026-11-11T00:29:02Z — seam inventory, stub-shape audit, and the contract statement in
pm-stack/opencode-claimant/README.md. Audit task 14782 recorded state=done.
- Recorded divergence (carried, not hidden): Decision 1's pin named the repo-queue CLI's JSON output as the one channel; the implementation landed the broker rich read instead and the CLI still has no JSON list mode (verified live 2026-11-11 by the audit). The intent (machine shape, fail-closed) is met; the operative contract statement is the README's. If Drew wants the pin formally amended in the design doc (
files/designs/code-claimant-seam-contract.md in the goal workspace), that is a one-line edit on request — it is documentation hygiene, not undone contract work.
- Residuals, all owned elsewhere: poll.py unknown-marker residuals → opencode-claimant: fire log cannot distinguish a failed queue read from an empty queue, or say why a bind failed #8042 (OPEN); live-fire verification → opencode-claimant: handed-off tasks are never launched — executed_lane/session_id stay null across repeated claim→handed_off→park cycles #6533 (re-scoped); prompt.md generation → opencode-claimant: prompt.md constants drift from claimant.py — generate them or pin them by a sync check (#7772 disposition e) #8366 (filed). The design's two recorded-not-phased questions (progress.stage deprecation; claimant-side queue-health read) were left unphased by the design itself.
- Queue scan: no live task for Act only on a verified read — one seam contract for the opencode-claimant #7770 besides this triage.
dezren39 commented on Nov 17, 2026
Agent note — task 20030 already_done (lane any-n)
- State: already_done — issue Act only on a verified read — one seam contract for the opencode-claimant #7770 is CLOSED (status:done). Triage of record task 18535 (lane any-g, 2026-11-17, comment 6937232205) verified all four phases of the verified-read seam contract landed and dispositioned, with the closing audit merged, and closed the issue as completed.
- Revalidated fresh this claim: issue state CLOSED; no work remains for this follow-on.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|