Skip to content
This repository was archived by the owner on Oct 24, 2026. It is now read-only.

feat(brief): add shared no-mistakes daemon safety rule to briefs - #10

Merged
mielyemitchell merged 2 commits into
mainfrom
fm/brief-daemonrule
Jul 7, 2026
Merged

mielyemitchell merged 2 commits into
mainfrom
fm/brief-daemonrule

Conversation

@mielyemitchell

@mielyemitchell mielyemitchell commented Jul 7, 2026 •

Copy link
Copy Markdown
Owner

Intent

Add a shared-daemon safety rule to both ship and scout briefs: workers report daemon errors and escalate them to the supervisor instead of stopping, restarting or updating the shared service. Verify that both brief types render the rule correctly and that the focused tests pass.

What Changed

  • Added a new numbered rule to both the ship-task and scout-task # Rules sections in bin/fm-brief.sh's scaffold: crewmates must never stop, restart, or update the shared no-mistakes daemon, and must instead append a blocked status and escalate daemon errors to firstmate.
  • Extended tests/fm-brief.test.sh with new assertions verifying the daemon rule renders correctly, with proper numbering, in both generated ship and scout briefs.
  • Updated CONTRIBUTING.md's test-file table entry for tests/fm-brief.test.sh to mention the new daemon-rule coverage.

Risk Assessment

✅ Low: Small, additive doc/text change to a shell heredoc scaffold (a new numbered rule appended verbatim to both ship and scout blocks) plus two matching new tests; verified bash -n still parses and the rule numbering/quoting matches existing conventions.

Testing

Ran the targeted test file tests/fm-brief.test.sh directly (all 5 checks pass, including the two new tests asserting the daemon rule appears in generated ship and scout briefs), then manually regenerated both brief types in a scratch temp home and visually confirmed rule 7's exact wording, numbering continuity, and quoting style match the surrounding rules in both scaffolds; the configured full baseline suite had already passed per the task setup, and a full re-run timed out only due to unrelated long-running e2e/backend tests in this large repo, not this change.

Evidence: Generated ship brief with new daemon rule
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 demo-project, 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 task worktree you were launched in, such as a treehouse pool path or an Orca-managed worktree, 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/brief-verify-ship1`
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/l1/t2yfcls14bs7vfn5yjyc66wr0000gn/T/tmp.dpQ0l6hTqa/state/brief-verify-ship1.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.
7. Never stop, restart, or update the shared `no-mistakes` daemon - it is one instance serving
   every lane/home, so restarting it kills other lanes' in-flight pipeline runs. On ANY no-mistakes
   daemon error, append `blocked: {the daemon error}` and stop; only firstmate manages the daemon.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `~/.no-mistakes/worktrees/f84ca48a38b7/01KWYQX68C5E2Y5V2HX87KXPPY/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 the guidance no-mistakes itself provides 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 (the CI-ready return point - do not wait for it to keep monitoring in the background until merge), append `done: PR {url} checks green` and stop. You are finished.
Evidence: Generated scout brief with new daemon rule
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 demo-project, at a detached HEAD on a clean default branch.
This is a SCOUT task: the deliverable is a written report, not a PR.
The worktree is your laboratory - install, run, edit, and make scratch commits freely; all of it is discarded at teardown.
The report is the only thing that survives, so anything worth keeping must be in it.

# Rules
1. Never push to any remote and never open a PR.
2. Stay inside this worktree; the only files you may write outside it are the report and the status file below.
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/l1/t2yfcls14bs7vfn5yjyc66wr0000gn/T/tmp.dpQ0l6hTqa/state/brief-verify-scout1.status'`
   States: working, needs-decision, blocked, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on 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),
   append `needs-decision: {summary of options}` and stop. Firstmate will reply with the decision.
7. Never stop, restart, or update the shared `no-mistakes` daemon - it is one instance serving
   every lane/home, so restarting it kills other lanes' in-flight pipeline runs. On ANY no-mistakes
   daemon error, append `blocked: {the daemon error}` and stop; only firstmate manages the daemon.

# Definition of done
Write your findings to `/var/folders/l1/t2yfcls14bs7vfn5yjyc66wr0000gn/T/tmp.dpQ0l6hTqa/data/brief-verify-scout1/report.md`.
The report must stand alone: what you did, what you found, the evidence (commands run, output, file:line references), and what you recommend.
When the report is complete, append `done: {one-line conclusion}` to the status file and stop.
If your findings reveal work that should ship (e.g. you reproduced a bug and the fix is clear), say so in the report; firstmate may promote this task in place, and you would then receive mode-specific ship instructions as a follow-up message.

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.

  • command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"
  • bash tests/fm-brief.test.sh (all 5 assertions pass, including the two new daemon-rule checks for ship and scout briefs)
  • Manually generated a ship brief (./bin/fm-brief.sh brief-verify-ship1 demo-project) and a scout brief (./bin/fm-brief.sh brief-verify-scout1 demo-project --scout) in a scratch FM_HOME, then inspected the rendered # Rules sections to confirm rule 7 appears verbatim with correct numbering in both
  • git diff --stat against base commit to confirm only bin/fm-brief.sh and tests/fm-brief.test.sh changed
  • git status --porcelain to confirm no leftover artifacts in the worktree after cleanup
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Reuses the equivalent-content fix from held upstream PR kunchenguid#267
(fork-local only; upstream contribution stays a separate deliberate act).

Extends tests/fm-brief.test.sh with coverage that both scaffolds emit the rule.
…y for tests/fm-brief.test.sh to mention the new daemon-rule coverage; no other docs referenced the brief's rule content.
@mielyemitchell
mielyemitchell merged commit 1933d34 into main Jul 7, 2026
4 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant