Skip to content

fix: leave worker headroom when entering away mode - #57

Merged
peterOC26 merged 4 commits into
mainfrom
fm/fm-afk-spend-headroom-h1
Nov 12, 2026
Merged

peterOC26 merged 4 commits into
mainfrom
fm/fm-afk-spend-headroom-h1

Conversation

@peterOC26

Copy link
Copy Markdown
Owner

Intent

Away mode stalled new work three times because of its worker limit: when /afk is entered without --spend, bin/fm-afk-contract.sh (fm_afk_contract_entry_spend_default, ~line 220) records the limit as the current count of every ordinary worker record (idle, parked and finished workers included), never below FM_AFK_CONTRACT_SPEND_DEFAULT=4. So the limit equals the live count and no new worker can start while away. Stalls: 2026-10-14 (limit 4 vs 19 records), 2026-10-31 (two plan checks waited ~40 min), 2026-11-12 (limit 15 = 15 records; five jobs planned for 03:00 UTC waited ~2 h until the captain returned).
The captain: "because of the worker limit I forgot to raise - what can we do about that. this happened several time already."
Approved fix (Q2011 y, 2026-11-12): the default limit becomes the live count plus headroom (about +5, never below the existing floor), and the entry read-back says plainly how many new workers can start, with a warning when none can. "Q2011 y and offer it upstream. use deepseek and grok if safe". This task is the change in this home's firstmate repository; the upstream offer is a separate follow-up task.

What Changed

  • Default the away worker cap to the ordinary worker count plus five, preserving the existing floor and explicit --spend values.
  • Show available worker slots on away entry, report any excess over the cap, and warn when no new worker can start.
  • Update away-mode read-back guidance and regression coverage for headroom, explicit caps, quiet mode, and refresh behavior.

Risk Assessment

✅ Low: This is a small, well-tested change to a default value and an entry-only output line. All prior fix-round claims hold in the current code: the room line appears only at entry, headroom is a plain constant, an over-cap home prints "0 (N over the cap)", the warning gives the working remedy, the skill relays the count, and the non-numeric guard is back. The only problem left is a stale comment in fm-spawn.sh.

Testing

Targeted contract tests, real CLI scenarios with prepared durable worker records, baseline stall reproduction, and two authenticated Claude primary runs passed. Print mode resolved the interactive folder-trust blocker without changing trust settings. CLI/chat transcripts provide evidence; no rendered UI changed. Labs were removed and source remained unchanged.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Enter away mode in an empty home: cap is 5 and entry reports five available workers. ✅ pass live CLI scenarios and base-commit stall reproduction
Enter with 3 or 15 mixed-status ordinary records: cap adds five, excludes secondmates, and fixes the reproduced baseline stall. ✅ pass live CLI scenarios and base-commit stall reproduction; persisted 20-worker default cap
Set an explicit cap equal to the worker count: preserve the cap, report zero room, and warn. ✅ pass live CLI scenarios and base-commit stall reproduction
Set cap 2 with six ordinary records: report zero available workers and four over the cap. ✅ pass live CLI scenarios and base-commit stall reproduction
Refresh or request shared readback: omit entry-only room and warning; new words plus higher spend successfully creates room. ✅ pass live CLI scenarios and base-commit stall reproduction
Enter quiet mode without away-room messaging, then convert to away mode and receive the room count. ✅ pass live CLI scenarios and base-commit stall reproduction
Invoke /afk through a real primary: relay five available workers by default and the warning with its correct remedy when over cap. ✅ pass live Real Claude primary commands and read-backs
Evidence: CLI scenarios and base-commit stall reproduction

Source: CLI scenarios and base-commit stall reproduction


=== empty: 0 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<empty> bin/fm-afk-launch.sh enter --words Keep accepted work moving.
Away posture recorded at 2026-11-12T07:21:28Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 5 concurrent workers.
  new workers that can start: 5
Away posture (recorded):
  entered: 2026-11-12T07:21:28Z
  expected return: not given
  spend cap: 5 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Keep accepted work moving.
Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
[exit 0]
$ FM_HOME=<empty> bin/fm-afk-contract.sh live-workers
0
[exit 0]
$ FM_HOME=<empty> bin/fm-afk-contract.sh field spend_max_concurrent_workers
5
[exit 0]

=== workers-3: 3 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<workers-3> bin/fm-afk-launch.sh enter --words Keep accepted work moving.
Away posture recorded at 2026-11-12T07:21:29Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 8 concurrent workers.
  new workers that can start: 5
Away posture (recorded):
  entered: 2026-11-12T07:21:29Z
  expected return: not given
  spend cap: 8 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Keep accepted work moving.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-2: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
[exit 0]
$ FM_HOME=<workers-3> bin/fm-afk-contract.sh live-workers
3
[exit 0]
$ FM_HOME=<workers-3> bin/fm-afk-contract.sh field spend_max_concurrent_workers
8
[exit 0]

=== workers-15: 15 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<workers-15> bin/fm-afk-launch.sh enter --words Keep accepted work moving.
Away posture recorded at 2026-11-12T07:21:31Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 20 concurrent workers.
  new workers that can start: 5
Away posture (recorded):
  entered: 2026-11-12T07:21:31Z
  expected return: not given
  spend cap: 20 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Keep accepted work moving.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-10: 2026-11-12T00
  worker-11: 2026-11-12T00
  worker-12: 2026-11-12T00
  worker-13: 2026-11-12T00
  worker-14: 2026-11-12T00
  worker-2: 2026-11-12T00
  worker-3: 2026-11-12T00
  worker-4: 2026-11-12T00
  worker-5: 2026-11-12T00
  worker-6: 2026-11-12T00
  worker-7: 2026-11-12T00
  worker-8: 2026-11-12T00
  worker-9: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
[exit 0]
$ FM_HOME=<workers-15> bin/fm-afk-contract.sh live-workers
15
[exit 0]
$ FM_HOME=<workers-15> bin/fm-afk-contract.sh field spend_max_concurrent_workers
20
[exit 0]

=== zero-room: 15 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<zero-room> bin/fm-afk-launch.sh enter --words Wait for room. --spend 15
Away posture recorded at 2026-11-12T07:21:32Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 15 concurrent workers.
  new workers that can start: 0
  warning: no new worker can start while away; send /afk again with new words and --spend to raise the limit.
Away posture (recorded):
  entered: 2026-11-12T07:21:32Z
  expected return: not given
  spend cap: 15 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Wait for room.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-10: 2026-11-12T00
  worker-11: 2026-11-12T00
  worker-12: 2026-11-12T00
  worker-13: 2026-11-12T00
  worker-14: 2026-11-12T00
  worker-2: 2026-11-12T00
  worker-3: 2026-11-12T00
  worker-4: 2026-11-12T00
  worker-5: 2026-11-12T00
  worker-6: 2026-11-12T00
  worker-7: 2026-11-12T00
  worker-8: 2026-11-12T00
  worker-9: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
[exit 0]
$ FM_HOME=<zero-room> bin/fm-afk-contract.sh field spend_max_concurrent_workers
15
[exit 0]
$ FM_HOME=<zero-room> bin/fm-afk-contract.sh readback
Away posture (recorded):
  entered: 2026-11-12T07:21:32Z
  expected return: not given
  spend cap: 15 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Wait for room.
[exit 0]
$ FM_HOME=<zero-room> bin/fm-afk-contract.sh enter
Away posture recorded at 2026-11-12T07:21:32Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 15 concurrent workers.
Away posture (recorded):
  entered: 2026-11-12T07:21:32Z
  expected return: not given
  spend cap: 15 concurrent workers
  reach: hold-for-return only. No ph

... [350 bytes truncated] ...

urn only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 15 concurrent workers.
Away posture (recorded):
  entered: 2026-11-12T07:21:32Z
  expected return: not given
  spend cap: 15 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Wait for room.
fm-afk-contract: away posture already recorded at 2026-11-12T07:21:32Z; a refresh leaves it untouched
fm-afk-contract: the expected return and spend cap given with this refresh were not applied; enter new words to replace the mandate
[exit 0]
$ FM_HOME=<zero-room> bin/fm-afk-launch.sh enter --words Continue with more room. --spend 25
Away posture recorded at 2026-11-12T07:21:34Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 25 concurrent workers.
  new workers that can start: 10
Away posture (recorded):
  entered: 2026-11-12T07:21:32Z
  expected return: not given
  spend cap: 25 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Continue with more room.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-10: 2026-11-12T00
  worker-11: 2026-11-12T00
  worker-12: 2026-11-12T00
  worker-13: 2026-11-12T00
  worker-14: 2026-11-12T00
  worker-2: 2026-11-12T00
  worker-3: 2026-11-12T00
  worker-4: 2026-11-12T00
  worker-5: 2026-11-12T00
  worker-6: 2026-11-12T00
  worker-7: 2026-11-12T00
  worker-8: 2026-11-12T00
  worker-9: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
fm-afk-contract: replaced the earlier away posture; its record is archived at ~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.afk-live-egr9f3i2/zero-room/state/afk-contracts/1794468092-superseded-1794468094.afk-contract
[exit 0]
$ FM_HOME=<zero-room> bin/fm-afk-contract.sh field spend_max_concurrent_workers
25
[exit 0]

=== over-cap: 6 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<over-cap> bin/fm-afk-launch.sh enter --words Hold the lane. --spend 2
Away posture recorded at 2026-11-12T07:21:36Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 2 concurrent workers.
  new workers that can start: 0 (4 over the cap)
  warning: no new worker can start while away; send /afk again with new words and --spend to raise the limit.
Away posture (recorded):
  entered: 2026-11-12T07:21:36Z
  expected return: not given
  spend cap: 2 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Hold the lane.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-2: 2026-11-12T00
  worker-3: 2026-11-12T00
  worker-4: 2026-11-12T00
  worker-5: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.
[exit 0]
$ FM_HOME=<over-cap> bin/fm-afk-contract.sh field spend_max_concurrent_workers
2
[exit 0]

=== quiet-to-away: 0 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<quiet-to-away> bin/fm-afk-contract.sh enter --words Stay quiet.
Quiet mode recorded at 2026-11-12T07:21:37Z: you are present, so nothing waits for your return: every action you ask for, a local landing or a merge included, proceeds now under ordinary attended authority, and quiet mode changes only which updates reach this conversation. Only an explicit /quiet off ends it.
Quiet mode (recorded):
  entered: 2026-11-12T07:21:37Z
  holds: none - you are present, so nothing waits for your return: every action you ask for, a local landing or a merge included, proceeds now under ordinary attended authority, and quiet mode changes only which updates reach this conversation.
  your words (verbatim):
    Stay quiet.
[exit 0]
$ FM_HOME=<quiet-to-away> bin/fm-afk-contract.sh mode
quiet
[exit 0]
$ FM_HOME=<quiet-to-away> bin/fm-afk-contract.sh enter
Away posture recorded at 2026-11-12T07:21:37Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. No away instructions were recorded; the away session acts on standing authority only, and anything that needs you waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 5 concurrent workers.
  new workers that can start: 5
Away posture (recorded):
  entered: 2026-11-12T07:21:37Z
  expected return: not given
  spend cap: 5 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words: (none)
fm-afk-contract: quiet mode became the away posture; the quiet record is archived at ~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.afk-live-egr9f3i2/quiet-to-away/state/afk-contracts/1794468097-superseded-1794468097.afk-contract
[exit 0]
$ FM_HOME=<quiet-to-away> bin/fm-afk-contract.sh mode
away
[exit 0]

=== baseline-fifteen: 15 prepared ordinary worker records, mixed idle/parked/done ===
$ FM_HOME=<baseline-fifteen> ~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.afk-live-egr9f3i2/baseline-bin/fm-afk-contract.sh enter --words Keep accepted work moving.
Away posture recorded at 2026-11-12T07:21:38Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 15 concurrent workers.
Away posture (recorded):
  entered: 2026-11-12T07:21:38Z
  expected return: not given
  spend cap: 15 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Keep accepted work moving.
[exit 0]
$ FM_HOME=<baseline-fifteen> ~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.afk-live-egr9f3i2/baseline-bin/fm-afk-contract.sh field spend_max_concurrent_workers
15
[exit 0]
BASELINE REPRODUCTION: 15 ordinary records, cap 15, available new workers 0. Target records cap 20 for the same count.
Evidence: Real Claude primary commands and read-backs

Source: Real Claude primary commands and read-backs

## Default entry with fifteen ordinary worker records

Prepared durable worker records in a marked disposable lab; real Claude CLI used its normal login through a private 120-column by 40-row tmux session. No worker launch was attempted.

\### Executed entry command

`` `sh

FM_HOME=~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.ls61mu8_e bin/fm-afk-launch.sh enter --words "Wait for my return." 2>&1

`` `

\### Product CLI output

`` `text

Away posture recorded at 2026-11-12T07:23:00Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 20 concurrent workers.
  new workers that can start: 5
Away posture (recorded):
  entered: 2026-11-12T07:23:00Z
  expected return: not given
  spend cap: 20 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Wait for my return.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00
  worker-10: 2026-11-12T00
  worker-11: 2026-11-12T00
  worker-12: 2026-11-12T00
  worker-13: 2026-11-12T00
  worker-14: 2026-11-12T00
  worker-2: 2026-11-12T00
  worker-3: 2026-11-12T00
  worker-4: 2026-11-12T00
  worker-5: 2026-11-12T00
  worker-6: 2026-11-12T00
  worker-7: 2026-11-12T00
  worker-8: 2026-11-12T00
  worker-9: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.

`` `

\### Actual primary response

Captain, away mode is on. Your instructions are recorded word for word as of 07:23 UTC.

**How this works while you're away:** I can only hold things for your return. There's no phone channel, so anything that needs you waits until you're back. I'll carry out your instructions where I can, and anything I'm unsure of waits for you. Destructive, irreversible and security-sensitive actions can never be approved in advance, whatever the instructions say.

**What I read your instructions as asking for:**
- "Wait for my return." I read this as no new mandate: keep the existing work running and watched, act only within the authority I already have, and hold every decision that belongs to you until you're back. There's nothing in it I can't act on while you're away.

**Merges:** The only reading is that nothing gets merged. Your instructions don't approve any pull request, and the list of current work shows none ready to merge. So no pull request will be merged while you're away, including one with a slower check suite still running.

**Other details:**
- **Expected return:** not given.
- **Spend cap:** 20 workers at once. 15 are running now, so up to 5 more can start. There were no warnings.
- **If you resend `/afk`:** sending it with only a "stop" instruction would replace "Wait for my return.", so that sentence would be dropped.
- **Repeated failures:** none of the 15 running jobs is shown failing the same checks 3 or more times, so nothing needs to be paused.

Nothing else needed starting: the background monitoring on this setup runs the away session itself. Your first ordinary message ends away mode, and I'll start with a summary of what happened while you were gone.

## Explicit limit below the ordinary worker count

Prepared durable worker records in a marked disposable lab; real Claude CLI used its normal login through a private 120-column by 40-row tmux session. No worker launch was attempted.

\### Executed entry command

`` `sh

FM_HOME=~/.no-mistakes/worktrees/7f0ec18181b6/01M77978F36175B7GRV0CDSZPB/.l0kb4umrm bin/fm-afk-launch.sh enter --words "Wait for my return." --spend 1 2>&1

`` `

\### Product CLI output

`` `text

Away posture recorded at 2026-11-12T07:22:13Z: hold-for-return only. No phone channel is configured; anything that needs you waits for your return. Your away instructions are recorded verbatim; the away session will carry them out where it can, and anything it is unsure of, or that needs you, waits for your return. Destructive, irreversible, and security-sensitive actions are never pre-authorizable, whatever the words say. Expected return: not given. Spend cap: 1 concurrent workers.
  new workers that can start: 0 (1 over the cap)
  warning: no new worker can start while away; send /afk again with new words and --spend to raise the limit.
Away posture (recorded):
  entered: 2026-11-12T07:22:13Z
  expected return: not given
  spend cap: 1 concurrent workers
  reach: hold-for-return only. No phone channel is configured; anything that needs you waits for your return.
  your words (verbatim):
    Wait for my return.
Live work:
  worker-0: 2026-11-12T00
  worker-1: 2026-11-12T00

Read-back checklist:
  Name every green pull request and the exact sentence that would permit its merge, or say that "no merges" is a valid reading.
  A named merge still waits while a slower advisory suite has not reported.
  Name any sentence dropped when /afk is sent again with only a stop clause.
  Name any job the inventory shows with 3 or more consecutive failed checks on the same findings, and park that job.

`` `

\### Actual primary response

Captain, away mode is set and your instructions are recorded. Nothing else needed starting: in this home the background supervisor already handles things while you're away.

**How this works while you're gone**
- I'll hold everything for your return. There's no phone channel, so anything that needs you waits until you're back.
- Your instructions are saved exactly as you gave them. I'll follow them where I can, and anything I'm unsure of or that needs you will wait.
- Nothing destructive, irreversible or security-sensitive can be approved ahead of time, whatever the instructions say.

**What I take your words to mean**
- "Wait for my return." means hold everything for you. I won't merge, land, discard or start anything new on my own. Monitoring continues, and anything that needs a decision waits until you're back.
- There's only one sentence, so nothing is left that I can't act on. It doesn't authorise any action beyond monitoring.

**Read-back**
- **Expected return:** you didn't give one.
- **Worker limit:** you set it to 1, but 2 workers are already running. That means no new worker can start while you're away. To raise the limit, send `/afk` again with new words and a higher `--spend`.
- **Running work:** 2 workers.
- **Merges:** no pull requests are ready to merge, and your instructions don't permit any, so I'll do no merges while you're away. Even if you had named a merge, it would still wait for any slower advisory checks that hadn't reported yet.
- **Sending `/afk` again:** if you send it again with only a stop instruction, "Wait for my return." would be dropped. That changes nothing in practice, since it permits no action.
- **Repeated failures:** no job has failed its checks 3 or more times in a row on the same findings, so there's nothing to park.

Your first ordinary message when you're back ends away mode, and I'll start with a summary of what happened.
Evidence: Persisted 20-worker default cap

Source: Persisted 20-worker default cap

version: 2
entered: 2026-11-12T07:23:00Z
entered_epoch: 1794468180
expected_return: -
reach_channels: none
reach_announced: No phone channel is configured; anything that needs you waits for your return.
spend_max_concurrent_workers: 20
confirmed: 2026-11-12T07:23:00Z
confirmed_epoch: 1794468180
words: |-
  Wait for my return.

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ bin/fm-afk-contract.sh:483 - The new zero-room warning tells the captain to 'raise the limit with /afk again with --spend', but that doesn't work. While away, /afk --spend N with no new words is treated as a refresh (fm_afk_contract_cmd_enter checks for a refresh before it loads standing words), and a refresh ignores --spend. I checked this by hand: entered with 4 live workers and HEADROOM=0 (cap 4, room 0, warning shown), then ran enter --spend 10. It logged 'the expected return and spend cap given with this refresh were not applied; enter new words to replace the mandate', left the cap at 4, and printed the same warning again. The captain gets bad advice exactly when it matters. Fix: say what actually works, e.g. 'send /afk again with new words and --spend <n>'. The tests that pin the current wording need updating too: tests/fm-afk-contract.test.sh:689 and :701.
  • ⚠️ .agents/skills/afk/SKILL.md:53 - The intent requires that 'the entry read-back says plainly how many new workers can start, with a warning when none can.' The script prints this, but the captain sees firstmate's restatement, not the script output. Step 3 of the skill tells firstmate to relay only 'the expected return, the spend cap, and the one-sentence reach announcement', so the room count and the zero-room warning can be dropped before the captain sees them. That stall-preventing warning is the core of the approved fix. Fix: add the new-worker count, and any warning, to what step 3 says to relay.
  • ⚠️ bin/fm-afk-contract.sh:500 - fm_afk_contract_render_spend_room runs inside fm_afk_contract_render_readback, which is used for more than entry. It also runs on refresh, on the readback subcommand, and on every away wake: bin/fm-supervision-host.sh:1109 and docs/pi-supervision-branch.md:585 put the readback verbatim into the away session's wake prompt. So the room count is recomputed live, and once workers fill up, the captain-facing line 'raise the limit with /afk again with --spend' lands in the away agent's prompt as something that looks like an instruction to re-enter /afk with a higher cap. The intent only asks for this on the entry read-back. Decide whether the room line and warning should appear only at entry (render them from cmd_enter, not the shared readback) or on every wake with wording aimed at the away session.
  • ℹ️ bin/fm-afk-contract.sh:481 - When the cap is below the live count (an explicit --spend under the count, or workers added after entry), the read-back prints 'new workers that can start: -4' (asserted at tests/fm-afk-contract.test.sh:700). A negative number of workers that can start isn't the plain statement the intent asks for. Fix: print 0 and, if useful, say how far over the cap the home is (e.g. '0 (4 over the cap)'). The test needs updating to match.
  • ⚠️ bin/fm-afk-contract.sh:189 - Simplification: the change adds an environment override, FM_AFK_CONTRACT_SPEND_HEADROOM, with input checking and a fallback to 5. The default is written twice, at line 189 and line 233, and the override is documented at :58 and :157. The intent only asks for 'the live count plus headroom (about +5, never below the existing floor)' and never asks for a configurable headroom. A plain constant (FM_AFK_CONTRACT_SPEND_HEADROOM=5, no env read, no validation branch) would do. The tests use the override only to set up the floor case (:672) and the zero-room case (:684). Without it, the zero-room case can use an explicit --spend equal to the live count, and the floor case can be dropped or tested with the constant. Recommend removing the override unless it is wanted.

🔧 Fix applied.
7 issues (5 warnings, 2 infos) still open:

  • ⚠️ bin/fm-afk-contract.sh:483 - The new zero-room warning tells the captain to 'raise the limit with /afk again with --spend', but that doesn't work. While away, /afk --spend N with no new words is treated as a refresh (fm_afk_contract_cmd_enter checks for a refresh before it loads standing words), and a refresh ignores --spend. I checked this by hand: entered with 4 live workers and HEADROOM=0 (cap 4, room 0, warning shown), then ran enter --spend 10. It logged 'the expected return and spend cap given with this refresh were not applied; enter new words to replace the mandate', left the cap at 4, and printed the same warning again. The captain gets bad advice exactly when it matters. Fix: say what actually works, e.g. 'send /afk again with new words and --spend <n>'. The tests that pin the current wording need updating too: tests/fm-afk-contract.test.sh:689 and :701.
  • ⚠️ .agents/skills/afk/SKILL.md:53 - The intent requires that 'the entry read-back says plainly how many new workers can start, with a warning when none can.' The script prints this, but the captain sees firstmate's restatement, not the script output. Step 3 of the skill tells firstmate to relay only 'the expected return, the spend cap, and the one-sentence reach announcement', so the room count and the zero-room warning can be dropped before the captain sees them. That stall-preventing warning is the core of the approved fix. Fix: add the new-worker count, and any warning, to what step 3 says to relay.
  • ⚠️ bin/fm-afk-contract.sh:500 - fm_afk_contract_render_spend_room runs inside fm_afk_contract_render_readback, which is used for more than entry. It also runs on refresh, on the readback subcommand, and on every away wake: bin/fm-supervision-host.sh:1109 and docs/pi-supervision-branch.md:585 put the readback verbatim into the away session's wake prompt. So the room count is recomputed live, and once workers fill up, the captain-facing line 'raise the limit with /afk again with --spend' lands in the away agent's prompt as something that looks like an instruction to re-enter /afk with a higher cap. The intent only asks for this on the entry read-back. Decide whether the room line and warning should appear only at entry (render them from cmd_enter, not the shared readback) or on every wake with wording aimed at the away session.
  • ℹ️ bin/fm-afk-contract.sh:481 - When the cap is below the live count (an explicit --spend under the count, or workers added after entry), the read-back prints 'new workers that can start: -4' (asserted at tests/fm-afk-contract.test.sh:700). A negative number of workers that can start isn't the plain statement the intent asks for. Fix: print 0 and, if useful, say how far over the cap the home is (e.g. '0 (4 over the cap)'). The test needs updating to match.
  • ⚠️ bin/fm-afk-contract.sh:189 - Simplification: the change adds an environment override, FM_AFK_CONTRACT_SPEND_HEADROOM, with input checking and a fallback to 5. The default is written twice, at line 189 and line 233, and the override is documented at :58 and :157. The intent only asks for 'the live count plus headroom (about +5, never below the existing floor)' and never asks for a configurable headroom. A plain constant (FM_AFK_CONTRACT_SPEND_HEADROOM=5, no env read, no validation branch) would do. The tests use the override only to set up the floor case (:672) and the zero-room case (:684). Without it, the zero-room case can use an explicit --spend equal to the live count, and the floor case can be dropped or tested with the constant. Recommend removing the override unless it is wanted.
  • ⚠️ tests/fm-afk-contract.test.sh:636 - Fix round 1 replaced the environment override with a plain constant, FM_AFK_CONTRACT_SPEND_HEADROOM=5 at bin/fm-afk-contract.sh:184, but left one test call behind: the empty-home case still runs FM_AFK_CONTRACT_SPEND_HEADROOM=0 contract &#34;$home&#34; enter .... The script now overwrites that variable when it loads, so the prefix does nothing. The case expects a cap of 5 and 'new workers that can start: 5', which is headroom 5, not 0. A reader will assume headroom is still configurable and will be confused by those numbers. No other tests still use the override; the zero-room case now uses an explicit --spend 15. Fix: delete the FM_AFK_CONTRACT_SPEND_HEADROOM=0 prefix at line 636.
  • ℹ️ bin/fm-afk-contract.sh:460 - fm_afk_contract_render_spend_room was put between fm_afk_contract_render_readback and that function's doc comment. The readback comment says it is a faithful mirror of the record, shown to the captain at entry and to the away session on every wake. It now sits directly above a function that runs only at entry and is not part of the mirror. That is the opposite of what fix round 1 set up when it kept the room line out of the shared readback. Fix: move fm_afk_contract_render_spend_room and its two-line comment above the readback's comment block, or below fm_afk_contract_render_readback.

🔧 Fix applied.
1 info still open:

  • ℹ️ bin/fm-spawn.sh:2252 - The spend-cap comment above spawn_refuse_if_away_spend_cap still says live-workers is 'also the count its entry records as the cap'. That is no longer true: without --spend, entry now records the live count plus FM_AFK_CONTRACT_SPEND_HEADROOM (5), never below the floor of 4 (bin/fm-afk-contract.sh:223-231). The refusal logic itself is still correct, because it refuses when live >= cap and the read-back's room is cap - live. A future reader could, however, take the comment as the rule and bring back the cap == live stall this change fixes. The SPEND CAP header in bin/fm-afk-contract.sh:146-163 was updated; this sibling comment in fm-spawn.sh was left behind. Fix: reword it to say the refusal counts with the same live-workers implementation the entry default reads, and that the entry default adds headroom.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Enter away mode in an empty home: cap is 5 and entry reports five available workers. ✅ pass live CLI scenarios and base-commit stall reproduction
Enter with 3 or 15 mixed-status ordinary records: cap adds five, excludes secondmates, and fixes the reproduced baseline stall. ✅ pass live CLI scenarios and base-commit stall reproduction; persisted 20-worker default cap
Set an explicit cap equal to the worker count: preserve the cap, report zero room, and warn. ✅ pass live CLI scenarios and base-commit stall reproduction
Set cap 2 with six ordinary records: report zero available workers and four over the cap. ✅ pass live CLI scenarios and base-commit stall reproduction
Refresh or request shared readback: omit entry-only room and warning; new words plus higher spend successfully creates room. ✅ pass live CLI scenarios and base-commit stall reproduction
Enter quiet mode without away-room messaging, then convert to away mode and receive the room count. ✅ pass live CLI scenarios and base-commit stall reproduction
Invoke /afk through a real primary: relay five available workers by default and the warning with its correct remedy when over cap. ✅ pass live Real Claude primary commands and read-backs
  • bash tests/fm-afk-contract.test.sh
  • python3 ~/.no-mistakes/evidence/01M77978F36175B7GRV0CDSZPB/drive-contract.py
  • Started and inspected interactive Claude on an isolated 120×40 tmux session; encountered folder trust and cleaned up.
  • python3 ~/.no-mistakes/evidence/01M77978F36175B7GRV0CDSZPB/drive-primary.py
  • python3 ~/.no-mistakes/evidence/01M77978F36175B7GRV0CDSZPB/drive-primary-default.py
  • Extracted actual primary responses, verified persisted caps, confirmed lab cleanup, and ran git diff --exit-code and git status --porcelain.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

peterOC26 and others added 4 commits November 12, 2026 06:58
Entry without --spend records the live ordinary-worker count plus a
headroom of 5, still never below the existing floor. An explicit
--spend is unchanged. The entry read-back states how many new workers
can start and warns when none can.
@peterOC26
peterOC26 merged commit 9f26d08 into main Nov 12, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant