Repository navigation
Description
Found while verifying #459's acceptance criteria against the deployed code, not from a live incident.
The claim
#459 AC4 — "the honesty rule covers asserted failures, not only asserted successes" — is delivered
in the prompt and pinned by nothing. 8f5afaa added the sentences; no test reads them, so a
later prompt edit removes the guard silently.
Verified
workers/api/src/agent-think.ts:707-711, the text as it stands today:
The same rule covers FAILURE: never assert a run is stalled, blocked, stuck or dead unless a tool
result says so. The run report states that verdict explicitly — quote it. If it says NOT stalled,
the run is not stalled however slow the counter looks; one instruction is a whole engine turn and
can take many minutes. Calling running work stuck is as wrong as calling failed work done.
The rationale sits at :702-706. And:
$ grep -rn "covers FAILURE\|stalled, blocked, stuck" workers/api/src --include="*.test.ts"
(no matches)
So the block can be reworded or deleted and every gate stays green.
Why this one is worth pinning rather than trusting
The neighbouring facts it depends on are pinned, which is what makes the asymmetry visible:
RUN_HEALTH_LEGENDis asserted atworkers/api/src/lib/work-report.test.ts:256.- The report's own wording is asserted at
work-report.test.ts:82-83, including
expect(s).not.toMatch(/step \d+\/\d+/)— written specifically so the counter [bug] Agent reports a healthy run as "stalled" — step N/M reads as progress, liveness is only ever stated negatively, and the honesty rule covers false success but not false failure #459 complained
about cannot come back by the obvious wrong fix. work-report.ts:324-326deliberately keeps the word "engine" out ofNOT_STALLEDso that the
"never says engine" guards are not silently disarmed.
The prompt sentence is the one link in that chain with no assertion behind it, and it is the link
that does the work: the platform computes NOT stalled correctly and it is the prompt that tells
the model to quote it rather than form its own view. #459's incident was not a wrong verdict — the
verdict was right and describeLoopRun did not say the run was stalled. The model filled a silence.
What to do
A source-level guard over agent-think.ts asserting the failure-honesty block is present, in the
shape this repo already uses for prompt prose (prompt-claims.test.ts reads agent-think.ts for
exactly this kind of claim). It should assert the load-bearing clauses rather than the whole
paragraph, so a rewording that keeps the meaning does not fail:
- that it forbids asserting stalled/blocked/stuck/dead without a tool result,
- that it tells the model to QUOTE the report's verdict,
- that it says one instruction can be a whole engine turn.
Per ADR 0002 G1, it must also assert it read a plausible prompt — a guard that greps a file it
failed to parse reports a clean tree.
Why this is filed rather than fixed
agent-think.ts was checked out by another lane during the #459 verification, and a guard over a
file someone else is actively rewording would be written against text about to change. It is a test
file addition only — no production change — so it is cheap whenever that file is free.
Acceptance criteria
- A test fails when the failure-honesty clauses are removed from
agent-think.ts. - It survives a reasonable rewording that preserves the meaning.
- It asserts the size of what it read (G1), so a moved prompt block fails as "stopped measuring"
rather than passing.
Not claimed
That the model obeys it. #459's AC2 ("an agent asked about a run under STALLED_AFTER_MS does not
describe it as stalled") is a claim about a live turn and is not verifiable from code or tests — it
needs a machine running pags up with a real running coding run to ask about. That is #459's
remaining open item, and this ticket does not close it.
Activity
serge-ivo commentedon Aug 18, 2026
Audit — still LIVE. Citation exact, and the gap is unchanged.
workers/api/src/agent-think.ts:707-711still carries the block verbatim:And it is still the only place that string exists:
One file, zero test files. The link in the not-stalled chain with nothing asserting it is still unasserted.
Leaving open, labels unchanged.
serge-ivo commentedon Aug 29, 2026
Fixed in afeffcf. Section 7 added to
workers/api/src/lib/prompt-claims.test.ts— four tests readagent-think.tsviapromptTextOfand assert:stalled.*blocked.*stuck+tool resultpresent in string literalsquote itorstates that verdict explicitlyone instruction is a whole\s+engine turn(\s+ handles the promptTextOf boundary space between concatenated literals)All 10,144 unit tests pass; only the pre-existing pdf-lib tests fail. Every other gate (biome, typecheck, scripts/check-*, docs:drift, openapi-coverage) is green.