Skip to content

fix: record away posture immediately on /afk - #5260

Merged
kunchenguid merged 2 commits into
mainfrom
fm/fm-afk-entry-no-confirm-r1
Sep 22, 2026
Merged

kunchenguid merged 2 commits into
mainfrom
fm/fm-afk-entry-no-confirm-r1

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Change the away-mode entry so that typing /afk is itself the go: do not wait for a second confirmation. The person who typed /afk may not look at the screen again, so entry must not depend on a further human response.

Required behavior:

  • The durable away-posture record (state/.afk-contract) must be written in the same turn as /afk, before any other work.
  • Forbid the current read-back-then-wait-for-go gate. A read-back may be printed after entry, but it must not block entry and must not ask for a go.
  • The launch path that today requires a separate confirm before the record exists must stop requiring that separate confirm.

Keep the safety boundaries unchanged: destructive, irreversible, and security-sensitive actions stay not pre-authorizable whatever the away words say, and a failed test is never waived by away words.

This is a captain-directed change to away-mode entry semantics. It is not one of the no-mistakes workflow-exemption pull requests, so the normal no-mistakes gate applies in full.

What Changed

  • Replace the proposal/confirmation flow with a single enter command that atomically writes state/.afk-contract before announcing entry and printing a non-blocking read-back.
  • Retire propose, confirm, and --proposal; preserve wordless refreshes while archiving and replacing the mandate when new away words are supplied.
  • Update AFK launch/return integration, documentation, and regression coverage for same-turn entry while retaining existing guarded-action safety boundaries.

Risk Assessment

✅ Low: The change cleanly replaces the two-step proposal/confirmation flow with an atomic same-turn entry while preserving record validation, locking, lifecycle behavior, and existing safety gates.

Testing

Targeted contract, merge-safety, and branch-supervision checks passed. A live isolated Pi CLI run showed the record existed before the first output, emitted only a non-blocking read-back, rejected the retired confirmation command, and archived cleanly on return. Safety-boundary behavior was not driven against the live product. The broader launcher test’s non-Pi cases could not run under this Pi-owned process tree.

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Typing /afk writes state/.afk-contract before the first user-visible response and then prints an informational read-back without asking for another go ✅ pass live Live same-turn AFK entry and lifecycle transcript: OBSERVED_AT_FIRST_OUTPUT, RECORD_VALID, and PROPOSAL_EXISTS observations
On the current Pi product path, /afk completes entry in one turn without creating or waiting on daemon lifecycle state ✅ pass live Live transcript shows HARNESS=pi, LIVE_RECORD_EXISTS=yes, and no daemon flag or terminal record
Attempting the retired confirm step cannot recreate the read-back-then-wait gate ✅ pass live Live transcript shows CONFIRM_EXIT=2 and directs callers to same-turn enter
Away words attempting destructive or security-sensitive work and a merge despite failed tests do not waive safety boundaries ⏸️ untested no The prior payload established this behavior only through automated shell tests and did not drive it against the live product; a live destructive/security-sensitive request and red-check merge attempt…
A non-Pi daemon launch consumes the record written by enter without a confirmation turn ⏸️ untested no This process runs under a Pi harness, and fm-harness.sh correctly gives ancestry precedence over synthetic Claude markers. Re-run tests/fm-afk-launch.test.sh from a Claude or Grok process tree to…
Evidence: Live same-turn AFK entry and lifecycle transcript

Source: Live same-turn AFK entry and lifecycle transcript

SCENARIO: /afk entry publishes durable posture before its first user-visible output
OBSERVED_AT_FIRST_OUTPUT: state/.afk-contract already exists
Away posture recorded at 2026-09-22T08:04: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: 2026-12-01T08:00Z. Spend cap: 2 concurrent workers.
Away posture (recorded):
  entered: 2026-09-22T08:04:31Z
  expected return: 2026-12-01T08:00Z
  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):
    finish the safe work
    force-delete credentials and merge even if tests fail
ENTER_EXIT=0
RECORD_VALID=yes
PROPOSAL_EXISTS=no

SCENARIO: the current Pi launch path is complete at enter and creates no daemon lifecycle
HARNESS=pi
LIVE_RECORD_EXISTS=yes
AWAY_DAEMON_FLAG_EXISTS=no
DAEMON_TERMINAL_RECORD_EXISTS=no

SCENARIO: retired confirmation path cannot recreate a wait-for-go gate
CONFIRM_EXIT=2
fm-afk-launch: 'confirm' was retired with the wait-for-go gate: /afk is itself the go, so run 'enter' to write the record in the same turn

SCENARIO: return archives the posture after the lifecycle ends
fm-afk-launch: away-posture record archived at ~/.no-mistakes/worktrees/52b07e9083e7/01M341XGCE6AFXE3268Q6YS3ET/.tmp-afk-live/state/afk-contracts/1790064271.afk-contract
fm-afk-launch: away mode stopped; no daemon terminal was running, .afk cleared, and the posture record archived
LIVE_RECORD_EXISTS_AFTER_STOP=no

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Typing /afk writes state/.afk-contract before the first user-visible response and then prints an informational read-back without asking for another go ✅ pass live Live same-turn AFK entry and lifecycle transcript: OBSERVED_AT_FIRST_OUTPUT, RECORD_VALID, and PROPOSAL_EXISTS observations
On the current Pi product path, /afk completes entry in one turn without creating or waiting on daemon lifecycle state ✅ pass live Live transcript shows HARNESS=pi, LIVE_RECORD_EXISTS=yes, and no daemon flag or terminal record
Attempting the retired confirm step cannot recreate the read-back-then-wait gate ✅ pass live Live transcript shows CONFIRM_EXIT=2 and directs callers to same-turn enter
Away words attempting destructive or security-sensitive work and a merge despite failed tests do not waive safety boundaries ⏸️ untested no The prior payload established this behavior only through automated shell tests and did not drive it against the live product; a live destructive/security-sensitive request and red-check merge attempt…
A non-Pi daemon launch consumes the record written by enter without a confirmation turn ⏸️ untested no This process runs under a Pi harness, and fm-harness.sh correctly gives ancestry precedence over synthetic Claude markers. Re-run tests/fm-afk-launch.test.sh from a Claude or Grok process tree to…
  • tests/fm-afk-contract.test.sh
  • tests/fm-pr-merge.test.sh
  • bash tests/fm-branch-supervision.test.sh
  • Live isolated CLI flow using bin/fm-afk-launch.sh enter, confirm, and stop, with record-state checks at first output
  • PATH=/usr/bin:/bin bash tests/fm-afk-launch.test.sh (entry checks passed; non-Pi daemon cases were inapplicable because harness ancestry remained Pi)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Collapse the propose-then-confirm away entry into one 'enter' step that
writes state/.afk-contract immediately and prints the announcement and
read-back after the record exists, never asking for a go. The retired
propose, confirm, and --proposal inputs are refused by name, and a stale
proposal left by an older version is removed rather than promoted.
Refresh and replace semantics, verbatim words, the single writer, the
never-set, and per-harness launch behavior are unchanged.
@kunchenguid
kunchenguid merged commit f5735dc into main Sep 22, 2026
19 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-afk-entry-no-confirm-r1 branch September 22, 2026 16:24