Detect stalled doorbells with herdr's own signal; require briefs to state how to falsify themselves #7

Merged
forgejo-admin merged 2 commits from fix-mail-nudge-and-brief-rules into main 2026-07-31 22:31:42 +00:00

Two fixes that came out of asking eleven working agents what was actually costing
them time.

1. Stalled doorbells were skipped for exactly the agents that stalled

Delivery hand-rolled its stall check: prompt, sleep 2, then nudge unless the
recipient's status was working or done.

done is a resting state — it is where an agent sits after finishing a turn,
which is precisely the state a pane is in when a doorbell lands in its input line
unsubmitted. So the recovery was skipped for the only agents that needed it.
Observed at 5 of 11 sends in one session; every stalled pane read done, and
all five had to be flushed by hand.

herdr already detects this properly — from a non-working state, --wait requires
an observed state change and exits non-zero with agent_prompt_stalled when none
comes. Using that instead of guessing from a status poll also drops the fixed 2s
delay from the happy path.

mail selftest pins the contract the fix rests on: an unsubmitted prompt must
exit non-zero. If that ever changes, every stalled doorbell would read as
delivered and the nudge would silently stop firing again — the same failure, back
without a symptom.

Verified end to end against a live done agent: doorbell submitted with no
manual intervention.

2. Briefs must say how to falsify their own premises

The skill's rule 3 ("dump the diagnosis you already did") is right, and is also
what makes a brief dangerous: a confidently stated diagnosis is the part a fresh
agent will not re-check.

Seen here. An agent was spawned with an otherwise textbook brief whose central
claim was "the exact code, which I have confirmed is still present on
origin/main."
The author had grepped their own working tree, sitting on a stale
branch, inside a command that also ran git fetch origin — so it read as a
remote check without being one. The fix had already merged. That agent verified
before typing and stopped; trusting the brief would likely have produced a
second implementation of an existing fix.

Adds rule 5 and a Check this first: line to the skeleton, placed ahead of
"where to start" so a spawned agent's first action is an attempt to prove the
brief wrong.

Testing

  • mail selftest — passes; asserts the CLI contract the nudge depends on.
  • Live delivery to a done agent — auto-submitted.
  • python3 -m py_compile herdr-mail/bin/mail — clean.

Note (added after merge): the ※ recap: caveat documented in this PR was
overstated — see the correction and the agent-labelling work in the follow-up PR.

🤖 Generated with Claude Code

Two fixes that came out of asking eleven working agents what was actually costing them time. ## 1. Stalled doorbells were skipped for exactly the agents that stalled Delivery hand-rolled its stall check: prompt, `sleep 2`, then nudge unless the recipient's status was `working` **or `done`**. `done` is a *resting* state — it is where an agent sits after finishing a turn, which is precisely the state a pane is in when a doorbell lands in its input line unsubmitted. So the recovery was skipped for the only agents that needed it. Observed at **5 of 11 sends** in one session; every stalled pane read `done`, and all five had to be flushed by hand. herdr already detects this properly — from a non-working state, `--wait` requires an observed state change and exits non-zero with `agent_prompt_stalled` when none comes. Using that instead of guessing from a status poll also drops the fixed 2s delay from the happy path. `mail selftest` pins the contract the fix rests on: an unsubmitted prompt must exit non-zero. If that ever changes, every stalled doorbell would read as delivered and the nudge would silently stop firing again — the same failure, back without a symptom. **Verified end to end** against a live `done` agent: doorbell submitted with no manual intervention. ## 2. Briefs must say how to falsify their own premises The skill's rule 3 ("dump the diagnosis you already did") is right, and is also what makes a brief dangerous: a confidently stated diagnosis is the part a fresh agent will *not* re-check. Seen here. An agent was spawned with an otherwise textbook brief whose central claim was *"the exact code, which I have confirmed is still present on origin/main."* The author had grepped their own working tree, sitting on a stale branch, inside a command that also ran `git fetch origin` — so it read as a remote check without being one. The fix had already merged. That agent verified before typing and stopped; trusting the brief would likely have produced a *second* implementation of an existing fix. Adds rule 5 and a `Check this first:` line to the skeleton, placed ahead of "where to start" so a spawned agent's first action is an attempt to prove the brief wrong. ## Testing - `mail selftest` — passes; asserts the CLI contract the nudge depends on. - Live delivery to a `done` agent — auto-submitted. - `python3 -m py_compile herdr-mail/bin/mail` — clean. --- **Note (added after merge):** the `※ recap:` caveat documented in this PR was overstated — see the correction and the agent-labelling work in the follow-up PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Delivery hand-rolled its stall check: prompt, sleep 2s, then nudge unless
the recipient's status was `working` or `done`. But `done` is a resting
state — it is where an agent sits after finishing a turn, which is exactly
the state a pane is in when a doorbell lands in its input line unsubmitted.
So the nudge was skipped for precisely the agents that needed it. Observed
at 5 of 11 sends in one session, every stalled pane reading `done`.

herdr already detects this properly: from a non-working state `--wait`
requires an observed state change and exits non-zero with
`agent_prompt_stalled` when none comes. Use that instead of guessing from
a status poll, which also drops the fixed 2s delay from the happy path.

`mail selftest` pins the contract the fix rests on — an unsubmitted prompt
must exit non-zero. If that ever changes, every stalled doorbell would read
as delivered and the nudge would silently stop firing again.

Verified end to end against a live `done` agent: doorbell submitted with no
manual intervention.

Also documents a second, unfixed stall: a pane showing a `※ recap:` block
swallows Enter entirely, so neither the automatic nudge nor a hand-sent
`send-keys enter` reaches it. That one needs a fix in herdr.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rule 3 tells you to dump the diagnosis you already did, which is right and
is also what makes a brief dangerous: a confidently stated diagnosis is the
part a fresh agent will not re-check.

Seen here. An agent was spawned with an otherwise textbook brief whose
central claim was "the exact code, which I have confirmed is still present
on origin/main". The author had grepped their own working tree, sitting on
a stale branch, inside a command that also ran `git fetch origin` — so it
read as a remote check without being one. The fix had already merged. The
agent verified before typing and stopped; trusting the brief would likely
have produced a second implementation of an existing fix.

Adds rule 5 and a "Check this first" line to the skeleton, placed ahead of
"where to start" so a resurrected agent's first action is an attempt to
prove the brief wrong.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
forgejo-admin changed title from Detect stalled doorbells with herdr's own signal; require briefs to state how to falsify themselves to Make agent-to-agent mail legible: real sender names, reliable doorbells, briefs that can be checked 2026-08-01 00:21:44 +00:00
forgejo-admin changed title from Make agent-to-agent mail legible: real sender names, reliable doorbells, briefs that can be checked to Detect stalled doorbells with herdr's own signal; require briefs to state how to falsify themselves 2026-08-01 00:22:24 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo-admin/herdrmastr!7
No description provided.