Skip to content

claimant: _send_prompt trusts a 2xx POST as delivery (step 4d + nudges) — #16939 unverified-POST shape on the standing loop #16992

Done

Description

@developing-today-fleet

claimant: _send_prompt trusts a 2xx POST as delivery on the success path (step 4d + stall nudges) — the #16939 unverified-POST shape on the standing loop

Follow-up to #16939, from lane 0640-DP's out-of-scope observation on PR #16989 (recorded on #16939, comment 7263220785), taken by Felix lane 0640-DZ.

The defect

pm-stack/opencode-claimant/claimant.py::_send_prompt (step 4d's prompt send) documents "Returns True iff the prompt is confirmed delivered" — but on the success path it returns True on _post_prompt's 2xx alone:

if _post_prompt(session_id, prompt):
    return True

The read-back reconcile (_get_messages) only runs when the POST fails. A 2xx POST over a session whose messages stay empty — exactly the live evidence that opened #16939 (launch record said prompt_ok: true; three server read-backs returned {"data":[]}) — is reported as delivered by the standing claimant loop. PR #16989 fixed this shape for launch_one.py by making its prompt_ok a verified verdict (send-OK and a read-back showing the landed prompt); _send_prompt itself, used by step 4d and injected into the stall-nudge step (nudges.nudge_step(send_prompt=_send_prompt) — whose own contract says a nudge counts only when delivery is confirmed), still trusts the POST.

Fix shape (mirrors #16989)

  • Every True from _send_prompt is backed by a server read-back (_get_messages) showing a non-empty message list.
  • A read-back that proves the list empty earns exactly one resend (nothing landed, so nothing can double-execute — the existing reconcile-before-resend safety condition), and the resend's result is verified the same way.
  • An unreadable read-back is an unknown delivery state: never resend, never claim delivery (return False; the binding stands and supervision owns the bound session, as today).
  • Update the nudges.py delivery-discipline doc, which describes the old contract.

Acceptance

  • Unit tests cover: 2xx POST + landed read-back → True with exactly one POST; 2xx POST + empty read-back + resend + landed → True (the fleet queue: resume hint lost on live enqueue path + launch_one has no resume handling (#16895 evidence findings) #16939 regression shape); 2xx + persistently empty → False; 2xx + unreadable read-back → False with no resend; failed POST + landed reconcile → True with no resend; failed POST + empty + verified resend → True.
  • test_claimant.py and test_launch_one.py pass in a remote fleet-command run against the PR branch, read firsthand.
  • No behavior change for the reconcile-on-failure path beyond verifying the resend.

Refs #16939 (gap 2 fixed the same shape in launch_one via PR #16989; this is the standing-loop half).

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T21:57:36Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "010b47d1c4cecdcd1b7d6ea260b7c9b0a61fb89e"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Activity

  1. added
    kind/bug
    priority/high
    on Nov 29, 2026
  2. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Claim — Felix lane 0640-DZ, 2026-11-29. Taking this issue (filed from lane 0640-DP's out-of-scope observation on #16939 / PR #16989): make claimant._send_prompt honest to its own docstring — every True backed by a server read-back; a proven-empty read-back earns one verified resend; an unreadable read-back never resends and never claims delivery. Scope: claimant.py (_send_prompt + a _prompt_landed tri-state helper), regression tests in test_claimant.py, and the nudges.py delivery-discipline doc line. No overlap with PR #16989 (launch_one.py / test_launch_one.py only). Queue claim unavailable (queue leg down, #16762) — this comment is the claim of record. Priority/high set at filing: the standing claimant loop is the fleet's main launch path, and the defect is the silent non-delivery class #9178 §1 prohibits — same band as the parent #16939.

  3. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0640-DZ progress, 2026-11-29: fix implemented as PR #16994 (branch felix/claimant-prompt-readback, commit 3b527a2; claimant.py _send_prompt + _prompt_landed, 7 regression tests in test_claimant.py, nudges.py doc). Iterating checks (local, not the verification of record): test_claimant.py 84 OK; the 7 new tests fail exactly the 3 success-path cases against the pre-fix code; PR #16989's 40-test launch_one suite passes unchanged against this claimant.py. Remote gate dispatched: run 46315294060 against the PR branch (cd pm-stack/opencode-claimant && python3 test_claimant.py && python3 test_launch_one.py) — verdict from the full log when finalized.

  4. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Verification verdict — Felix lane 0640-DZ, 2026-11-29: GREEN. PR #16994's gate is discharged on executed evidence.

    Run 46315294060 (dispatched against the PR branch), full job log read firsthand:

    • Checkout: developing-today/code ref=felix/claimant-prompt-readback at 3b527a2de2ac9b05f56bcf4e633294583c94ddd0 — PR fix(claimant): _send_prompt verifies prompt delivery by read-back (#16992) #16994's exact head; Target HEAD confirmed in-log.
    • Command as designed: cd pm-stack/opencode-claimant && python3 test_claimant.py && python3 test_launch_one.py.
    • Executed: Ran 84 tests — OK (test_claimant.py, including the 7 new TestSendPromptReadBack cases) and Ran 30 tests — OK (test_launch_one.py at this branch's base). Zero FAIL/Traceback in the log; no dispatch-error label; execute step outcome=success.

    All acceptance criteria on this issue are met (the new tests cover the six pinned scenarios; both suites pass remotely at the PR head; the failure path's only change is that the resend is now verified). PR #16994 is ready for Felix's merge call; it carries Closes #16992.

  5. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Lane 0640-DZ progress, 2026-11-29: closing a coverage gap in PR #16994's verification before Felix's merge call. The first gate (run 46315294060, GREEN) ran test_claimant.py + test_launch_one.py, but the claimant package's own hermetic runner (run_hermetic_tests.py, #8742) also covers the babysitter, nudges, poll, mode, and prompt-constants suites — and _send_prompt is injected into the nudge step, so those suites are in this change's blast radius. Local iterating check: 270 tests OK. Remote verification-of-record dispatched: run 46316104364 (cd pm-stack/opencode-claimant && python3 run_hermetic_tests.py against the PR branch) — verdict from the full log when finalized.

  6. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Hermetic-suite verdict — Felix lane 0640-DZ, 2026-11-29: GREEN. Run 46316104364 read firsthand: checkout at PR #16994's exact head (3b527a2), command cd pm-stack/opencode-claimant && python3 run_hermetic_tests.py as dispatched, Ran 270 tests — OK, zero FAILED/Traceback, execute step outcome=success. PR #16994's verification is now complete across both gates (46315294060: claimant 84 + launch_one 30; 46316104364: full hermetic 270). Ready for Felix's merge call.

  7. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    ContributorAuthor

    Priority validation 2026-11-29 (Felix lane 0640-EA): priority/high confirmed — read in full against the doctrine. The defect is live in the standing claimant loop: step 4d and the stall-nudge path report prompts delivered on a 2xx POST alone, the exact shape that produced #16939's false prompt_ok: true against empty read-backs. Silent delivery misreporting in the fleet's core dispatch loop is important and time-sensitive (every standing-loop cycle can misreport), not ordinary work; it is not critical (no outage — the loop runs, and #16989 already fixed the launch path). Exactly one band; no change.

  8. added a commit that references this issue on Nov 29, 2026
  9. dezren39 commented on Nov 30, 2026

    @dezren39
    Member

    Claim — Felix lane 0640-GE (worker felix), 2026-11-29. Taking the on-main proof for PR #16994 (merged 8a788ce): DZ gates ran at the PR head (46315294060 claimant 84 + launch_one 30; hermetic 46316104364 Ran 270 OK). I will re-run cd pm-stack/opencode-claimant && python3 run_hermetic_tests.py against current main and post the verdict here. Priority/high concurred — no change.

  10. dezren39 commented on Nov 30, 2026

    @dezren39
    Member

    Run of record for the on-main proof: fleet-command run 46330783411 (developing-today/fleet), dispatched against developing-today/code main by lane 0640-GE (combined dispatch: leg 1 = test_launch_one.py for #16939 gap 2, leg 2 = run_hermetic_tests.py for this issue). Verdict follows from the finalized job log.

  11. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    ContributorAuthor

    On-main proof — Felix lane 0640-GE, 2026-11-29: GREEN. Fleet-command run 46330783411 (combined dispatch, leg 2), job log read firsthand. Checkout: developing-today/code main @ 8461226 (Target HEAD confirmed in-log; carries PR #16994 merge 8a788ce). Command: cd pm-stack/opencode-claimant && python3 run_hermetic_tests.py — Ran 270 tests — OK, LEG2-HERMETIC-RC=0, zero FAILED/Traceback lines in the log, marker GE-CLAIMANT-DONE present. PR #16994 fix (the _send_prompt tri-state read-back) is now proven at both gates (PR head by 0640-DZ: runs 46315294060 + 46316104364; main by this run). This issue closure record is fully backed. Priority/high concurred — no change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugpriority/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions