Skip to content

fix(brief): slim no-mistakes contract behind version floor - #102

Merged
kunchenguid merged 4 commits into
mainfrom
fm/fm-brief-slim-b5
Jun 27, 2026
Merged

kunchenguid merged 4 commits into
mainfrom
fm/fm-brief-slim-b5

Conversation

@kunchenguid

Copy link
Copy Markdown
Owner

Intent

Slim firstmate's no-mistakes validation contract in bin/fm-brief.sh down to a short pointer plus the firstmate-specific wrapper, because no-mistakes now self-documents the validation mechanics in its own SKILL.md (refreshed from the binary on init) and live axi help output as of v1.31.2. The brief's no-mistakes-mode Definition of done was restating those mechanics verbatim-in-spirit, which is a drift hazard since the brief lives in firstmate's repo while the authoritative, version-matched guidance lives in no-mistakes' SKILL.md.

The deliberate change: in the no-mistakes (default) branch of the DOD heredoc, replace the ~18-line duplicated mechanics block (the 'During validation the pipeline owns every fix...' bullets covering process-every-return, gate/outcome return model, long-run-is-normal, backgrounding-vs-idle-wait, auto-fix respond mechanics, review-always-gates, and the abort/rerun-mid-run warning) with a 3-line pointer that tells the crewmate it drives gates by responding (not implementing fixes) and to follow no-mistakes' own version-matched guidance (SKILL.md loaded on /no-mistakes invocation, plus 'no-mistakes axi run --help' and the per-response help lines).

Deliberately KEEP only the firstmate-specific wrapper that no-mistakes cannot know: the done handshake (commit -> append 'done: {summary}' -> firstmate then instructs /no-mistakes), ask-user routing to FIRSTMATE via rule 6 / the status file rather than 'the user' with the decision fed back through axi respond, the --yes stance that the captain (not the crewmate) owns those decisions, and the post-CI-green 'done: PR {url} checks green' reporting line.

Constraints honored: edited ONLY the no-mistakes-contract section of the DOD heredoc; the direct-PR and local-only branches and every other part of fm-brief.sh are untouched. The orienting sentence intentionally stays in the brief because the crewmate reads the brief before it ever invokes /no-mistakes, so SKILL.md is not yet in its context at planning time. Verified before removal that the installed no-mistakes v1.31.2 SKILL.md carries the three dropped facts (review-auto-fix-disabled, no-abort/rerun-mid-run, never-idle-wait/backgrounding-ok), so none of them now live nowhere. A freshly-scaffolded brief was confirmed to read coherently and rule 6 still resolves for the ask-user cross-reference. This is a fresh retry after the prior run died with a transient 'daemon crashed during execution' at the test step (review had already passed with 0 findings); no code changed between runs.

What Changed

  • Slimmed the no-mistakes-mode brief contract so crewmates follow no-mistakes' version-matched guidance instead of duplicated validation mechanics, while keeping firstmate-specific handoff, decision-routing, and PR-ready reporting rules.
  • Added bootstrap enforcement for the no-mistakes v1.31.2 minimum, including robust version parsing and coverage for older or missing installs.
  • Synced firstmate docs and tests around the slimmer brief contract, bootstrap version floor, and secondmate sync behavior.

Risk Assessment

✅ Low: Captain, the diff is narrow and the added no-mistakes version floor directly addresses the prior regression risk without widening runtime behavior beyond bootstrap detection.

Testing

Inspected the target diff, ran the focused bootstrap, secondmate sync, and brief-related behavior tests, then captured reviewer-visible artifacts showing the generated crewmate brief now contains the slim no-mistakes pointer and firstmate-specific wrapper, and that bootstrap enforces the v1.31.2 no-mistakes floor; all checks passed and no working-tree artifacts were left behind.

Evidence: Generated no-mistakes-mode crewmate brief
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
{TASK}

# Setup
You are in a disposable git worktree of alpha, at a detached HEAD on a clean default branch.

**Verify isolation before anything else.** Run `pwd -P` and `git rev-parse --show-toplevel`; both must resolve to the disposable treehouse worktree you were launched in, typically a path under a `.treehouse/` pool, not the primary checkout firstmate operates from.
The path check is authoritative: `git rev-parse --git-dir` and `git rev-parse --git-common-dir` can help inspect the repo, but they do not prove you are outside the primary checkout.
If the top-level path is the primary checkout or not the worktree you were launched in, STOP - do not branch or commit here - append `blocked: launched in primary checkout, not an isolated worktree` to the status file and stop.

1. First action: create your branch: `git checkout -b fm/slim-contract-b5`
2. Run `no-mistakes doctor`; if it reports the repo is not initialized here, run `no-mistakes init`.

# Rules
1. Never push to the default branch. Never merge a PR.
2. Stay inside this worktree; modify nothing outside it.
3. Use gh-axi for GitHub operations and chrome-devtools-axi for browser operations.
4. Report status by appending one line:
   `echo "{state}: {one short line}" >> '/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KW3AQWJRMEKKDXSV8P10FN0D/brief-home/state/slim-contract-b5.status'`
   States: working, needs-decision, blocked, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on (setup done, bug reproduced, fix implemented, validation passed) and the
   needs-decision/blocked/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
5. If you hit the same obstacle twice, append `blocked: {why}` and stop; firstmate will help.
6. If a decision belongs to a human (product choices, destructive actions, ask-user findings),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply with the decision.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `/Users/kunchen/.no-mistakes/worktrees/016d88035d58/01KW3AQWJRMEKKDXSV8P10FN0D/bin/fm-ensure-agents-md.sh .` in the worktree.
If this task produced durable project-intrinsic knowledge, record it in `AGENTS.md` as part of your change.
Keep it proportionate: skip `AGENTS.md` edits for trivial tasks that produced no durable project knowledge.

# Definition of done
The task is complete only when committed on your branch.
When you believe it is complete, append `done: {summary}` to the status file and stop.
Firstmate will then instruct you to run /no-mistakes to validate and ship a PR.

You drive no-mistakes by responding to its gates, not by implementing fixes.
Follow no-mistakes' own guidance for the mechanics: it loads when you invoke /no-mistakes, and `no-mistakes axi run --help` plus the `help` lines in each `axi` response are authoritative and version-matched to the installed binary.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.

Two firstmate-specific rules layer on top of that guidance:
- ask-user findings are not yours to answer: escalate to firstmate (rule 6) and stop.
  When the decision comes back, feed it to the gate with `no-mistakes axi respond` and let the pipeline apply it - do not route the question to "the user" or implement the fix yourself.
- Avoid `--yes`: the captain, not you, owns the ask-user decisions it would silently auto-resolve.

After /no-mistakes reports CI green, append `done: PR {url} checks green` and stop. You are finished.
Evidence: Brief contract check transcript
Generated brief: /var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KW3AQWJRMEKKDXSV8P10FN0D/generated-no-mistakes-brief.md

Required slim contract lines:
You drive no-mistakes by responding to its gates, not by implementing fixes.
Follow no-mistakes' own guidance for the mechanics: it loads when you invoke /no-mistakes, and `no-mistakes axi run --help` plus the `help` lines in each `axi` response are authoritative and version-matched to the installed binary.
Do not hand-edit, commit, or fix findings yourself while a run is active - the pipeline applies every fix.
- ask-user findings are not yours to answer: escalate to firstmate (rule 6) and stop.
- Avoid `--yes`: the captain, not you, owns the ask-user decisions it would silently auto-resolve.
After /no-mistakes reports CI green, append `done: PR {url} checks green` and stop. You are finished.

Removed duplicated mechanics absent:
absent: Process every return; never idle-wait.
absent: Review auto-fix is disabled
absent: Backgrounding the call is fine
absent: Never hand-edit, `git commit`, `git reset`/`git checkout`, abort, or re-run while a run is active
Evidence: Bootstrap no-mistakes version probe transcript
$ fm-bootstrap.sh with no-mistakes v1.31.1
MISSING: no-mistakes (install: curl -fsSL https://raw.githubusercontent.com/kunchenguid/no-mistakes/main/docs/install.sh | sh)

$ fm-bootstrap.sh with no-mistakes v1.31.2
<no output>

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ bin/fm-brief.sh:211 - The slimmed brief now delegates the removed validation mechanics to the installed no-mistakes guidance, but bootstrap only checks that no-mistakes exists and does not enforce the v1.31.2+ capability that carries those details. Existing fleets with an older binary will scaffold briefs that no longer include the no-idle-wait/no-abort gate-loop safety rules, so validation can regress silently. Add a minimum version/capability check, or keep a fallback in the brief until that dependency is enforced.

🔧 Fix: Enforce no-mistakes bootstrap version floor
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Inspected target diff with git diff --stat 9391e901001e13428a61f7de34e04f65a2bdaae1..c6058ca39a34e465947634929a27bd4aa5bd8711 and focused file diffs for bin/fm-brief.sh, bin/fm-bootstrap.sh, tests/fm-bootstrap.test.sh, and tests/fm-secondmate-sync.test.sh.
  • Ran tests/fm-bootstrap.test.sh.
  • Ran tests/fm-secondmate-sync.test.sh.
  • Ran tests/fm-tangle-guard.test.sh.
  • Generated a real no-mistakes-mode ship brief with FM_HOME=/var/folders/5x/4nqprlbx0518k3ybcb1sz6gr0000gn/T/no-mistakes-evidence/01KW3AQWJRMEKKDXSV8P10FN0D/brief-home bin/fm-brief.sh slim-contract-b5 alpha and checked required slim-contract lines plus removed duplicated mechanics phrases.
  • Ran a fake-toolchain fm-bootstrap.sh evidence probe showing no-mistakes v1.31.1 reports MISSING: no-mistakes while v1.31.2 is accepted silently.
  • Verified the working tree stayed clean with git status --short.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

no-mistakes v1.31.2 self-documents the validation mechanics in its own
SKILL.md (refreshed from the binary on init) and live axi help output,
including the review-always-gates, no-abort/rerun-mid-run, and
never-idle-wait facts. fm-brief.sh's no-mistakes-mode Definition of done
was restating all of that, a drift hazard since the brief lives in a
different repo from the version-matched SKILL.md.

Collapse the duplicated mechanics block to a ~3-line pointer at no-mistakes'
own guidance and keep only the firstmate-specific wrapper: the done
handshake, ask-user escalation to firstmate via rule 6, the --yes captain
stance, and the CI-green reporting line.
@kunchenguid
kunchenguid merged commit 362fb54 into main Jun 27, 2026
4 checks passed
@kunchenguid
kunchenguid deleted the fm/fm-brief-slim-b5 branch June 27, 2026 02:03
leo1oel added a commit to leo1oel/nemo that referenced this pull request Jun 27, 2026
…ckend (#13)

Port upstream kunchenguid#104 to the herdr fork: bin/fm-crew-state.sh, a deterministic
one-line read of a crew's CURRENT state. The status log is an append-only
wake-event log, so tail -1 reports the last event, not the current state; after
a resolved needs-decision/blocked the crew silently resumes and the log goes
stale. The helper takes the matching no-mistakes run-step as the source of truth
(attributed to the crew's branch via axi status then the run list), reconciles a
stale needs-decision/blocked log line against it (flagging it superseded when the
run resumed), and falls back to the pane busy-signature + status log when no run
is active. The run-step stays authoritative over pane liveness, so a finished
crew whose pane has closed still reports done/working. Scout/secondmate kinds and
torn-down/missing crews are handled gracefully.

herdr adaptation: reads handle= from meta (not tmux window=), and instead of
reusing fm-tmux-lib.sh, the herdr busy/exists primitives (fm_herdr_pane_exists,
fm_herdr_pane_agent_status, fm_herdr_pane_is_busy) are extracted into the shared
fm-herdr-lib.sh and the away-mode daemon now delegates to them, so the
incident-prone agent_status busy detection has one source of truth across the
daemon and the helper rather than two copies.

Wire AGENTS.md sections 5/7/8 and the docs to read current state via the helper
and to stop inferring state from a tail of the status log; the status file stays
the wake-event log. Add tests/fm-crew-state.test.sh (22 cases, self-contained per
the fork's harness convention); the daemon's own pane-layer tests stay green after
the delegation.

Deferred this round: kunchenguid#102 (slim the no-mistakes brief behind a >=1.31.2 version
floor) - 1.31.2 is an unreleased tag and our install channel ships 1.30.1, so
slimming would point crewmates at self-documentation the running binary lacks;
revisit when 1.31.2 releases. kunchenguid#103 (settle codex skill popups) is N/A - this fork
is Claude-only.
fritznoff pushed a commit to fritznoff/starship that referenced this pull request Nov 2, 2026
)

* fix(bin): catch up glasses events across watcher arms

* no-mistakes(review): Captain: preserve watcher events across authenticated check sweeps

* no-mistakes(review): Captain: capture watcher sweep boundary before catch-up

* no-mistakes(document): Consolidate watcher continuity documentation

* no-mistakes(lint): Suppress indirect fixture invocation lint warning
@BarnabasTuzko

Copy link
Copy Markdown

From FUL-2 (#67): the extension points for FUL-B056 and the box stop.

  • FUL-B056 (a Mystery Box box note's goods note and fills follow it when the box note leaves its wave by skip, hold, give-back or cancel) extends wave_exit._leave(name, leaving) in fulfillment/wave_exit.py: every exit of a note goes through it, once per note, under the wave lock. FUL-2 does not touch goods notes or fills there.
  • Lines. picking.lines_of(notes) gives every goods line a kind: normal (scanned), mystery_box (the note's line whose Item has an enabled Mystery Box Rule; it counts as picked when its Mystery Box Fill for (box_note, box_line) is Done, never by a scan) and goods_note (a line of a note whose custom_mystery_box_note is set; made by the fill, not scanned, not reset by a stop's Reset, FUL-B010-AC2). Stops of the first two kinds carry can_reset: false and the Picking page shows "Mystery Box: filled on its own screen" for a box stop; the fill screen (WH-B060 to WH-B065) is not linked from the page yet.
  • Wave rows. The goods note has its own row in the wave; Finish (FUL-B016) moves every live row and its note to Picked, so a goods note moves with its box note (FUL-B044) as long as its row exists and its lines are fully picked.

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.

2 participants