Skip to content

feat(brief): embed commit-style contract in ship briefs - #10

Merged
7hoenix merged 2 commits into
mainfrom
fm/tighten-commit-style-7k
Jul 24, 2026
Merged

7hoenix merged 2 commits into
mainfrom
fm/tighten-commit-style-7k

Conversation

@7hoenix

@7hoenix 7hoenix commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Intent

Tighten the commit-message style firstmate crewmates produce: commits should be SHORT, with the lengthy detail living in the PR description instead. The captain found crewmate-generated commits 'a bit intense and not useful' and wants the model to be his own concise commit style (short conventional-commit subject, minimal or no body), while PR descriptions stay lengthy and written for teammates.

Approach and deliberate decisions:

  • Encoded a commit-style contract in bin/fm-brief.sh's shared ship-brief heredoc so it rides ALL three ship modes (no-mistakes, direct-PR, local-only) but NOT scout briefs (scouts produce a report, no commits). The scaffold is the single owner of the brief contract.
  • The contract: short imperative conventional-commit subject (<=72 char budget, ticket ref exempt), at most a few plain body lines of what/why (no body fine for small changes), and explicitly keep process narration / validation transcripts / risk-assessment essays / agent bookkeeping OUT of commits - that goes in the PR description. Included 2 before/after examples modeled on the captain's real commits so workers calibrate instantly.
  • One-owner rule: full contract lives in fm-brief.sh; added a one-line cross-reference in the firstmate-coding-guidelines skill (and its frontmatter description) for firstmate-repo commits, rather than duplicating the contract.
  • HONEST SCOPE BOUNDARY, documented deliberately in the scaffold header comment and stated plainly in the brief rather than overstated: this contract governs only the commits the crewmate authors. I verified against the koodos repos (insights-app, shelf) that GitHub's squash-merge default is configured to 'PR title and description', so the landed default-branch commit body is a verbatim copy of the (deliberately lengthy) PR body, NOT the crewmate's branch commits. So short branch commits improve the PR Commits tab, review readability, and non-squash/rebase/local-only landings, and the PR title becomes the squash subject - but making the landed squash BODY short on those repos is a repo-settings change (squash default -> 'PR title only'), outside the scaffold's reach. The contract also does not reach the no-mistakes pipeline's own no-mistakes(...) gate-fix commits or the PR body it generates. This is intentional and called out honestly, not a gap.
  • Extended tests/fm-brief.test.sh with a test asserting the contract renders in all three ship modes and is absent from scout briefs.

Note: bin/fm-lint.sh could not run locally because ShellCheck 0.11.0 is not installed on this host; the change added only heredoc/comment text (no new shell logic), and the pipeline runs the pinned linter.

What Changed

  • Added a "Commit style" section to the shared ship-brief heredoc in bin/fm-brief.sh, so all three ship modes (no-mistakes, direct-PR, local-only) instruct crewmates to write short imperative conventional-commit subjects with minimal or no body and keep lengthy detail in the PR description; scout briefs, which produce reports rather than commits, omit it.
  • Cross-referenced bin/fm-brief.sh as the single owner of the contract from the firstmate-coding-guidelines skill (body and frontmatter) and noted the contract in AGENTS.md, rather than duplicating it.
  • Extended tests/fm-brief.test.sh with a case asserting the contract renders in all three ship modes and is absent from scout briefs.

Risk Assessment

✅ Low: Pure documentation/heredoc-text change with a correctly-scoped regression test; no shell logic, control flow, or behavior is altered, and the new heredoc text is properly escaped and correctly excluded from scout briefs.

Testing

Baseline e2e suite already passed; I additionally ran the targeted tests/fm-brief.test.sh (all green) and produced the real end-user artifact by generating actual briefs across every delivery mode. The rendered no-mistakes ship brief carries the complete commit-style contract (short subject budget, ticket-ref exemption, no-body-for-small-changes guidance, the "keep process narration out, put it in the PR" routing, calibrated before/after subject and body examples, and the honest pipeline-scope boundary), the contract also renders in direct-PR and local-only briefs, and it is correctly absent from scout briefs. Rendered-Markdown evidence files are saved in the evidence directory. This is a text/contract change to generated brief output with no runtime UI surface, so the Markdown brief itself is the reviewer-visible artifact.

Evidence: Rendered no-mistakes ship brief (shows full Commit style section)
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
{TASK}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text that replaces `{TASK}` later.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of insights-app, 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/ship-nm-x1`
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/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T/tmp.RmPmGqmd9w/fm-home/state/ship-nm-x1.status'`
   States: working, needs-decision, blocked, paused, 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/paused/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
   Use `paused: {why}` - distinct from `blocked:` - ONLY when you are deliberately idling on a
   known external wait you expect to clear on its own (an upstream release, a rate-limit reset,
   a scheduled window): firstmate then leaves your idle pane alone and rechecks it on a long
   cadence instead of treating it as a possible wedge. Use `blocked:` when you are stuck and need help.
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.
   When firstmate replies or a blocker clears and you resume, append `resolved: {how it was decided or unblocked}` (add the same `[key=<slug>]` if you opened it with one) so the decision or blocker is durably closed and does not keep resurfacing.
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.

# Commit style
Keep commit messages SHORT. The lengthy story belongs in the PR description, never in the commit.
- Subject: one imperative line in conventional-commit shape (`fix(api): ...`, `feat: ...`, `chore(db): ...`), aim for <=72 chars (a leading `KOO-####` ticket ref does not count against that budget), no trailing period.
- Body: at most a few plain lines stating WHAT changed and the essential WHY. A small, self-evident change often needs no body at all.
- Keep OUT of every commit: process narration ("after three attempts"), validation or test/CI transcripts, risk-assessment essays, and agent bookkeeping. That is `git log` noise; put it in the PR description instead, which stays written for teammates.
Calibrate against these before/after pairs:
- Subject. BAD: `fix: after a failed rebase, finally hide gated apps via a host filter per the brief` GOOD: `fix(api): hide platform-gated micro-apps from Android directory`
- Body. BAD: a multi-paragraph `## Intent / ## What I built / ## Testing` essay narrating the whole session. GOOD, two plain lines: `Android users could launch platform-gated micro-apps and hit broken runs.` then `Add a host-based directory filter that hides gated apps from Android; iOS/web unaffected.`
This contract governs the commits YOU author. It does not reach commits or PR text the no-mistakes pipeline generates itself (its own `no-mistakes(...)` gate-fix commits and the PR description it writes); those are outside your control.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `/Users/jholzmann/.no-mistakes/worktrees/47329d59bc68/01KY86YB2PKVFTVB0JYGFWVWQF/bin/fm-ensure-agents-md.sh .` in the worktree.
Record only project knowledge useful to almost every future session.
For anything the codebase already shows, prefer a pointer to the authoritative file, command, or doc over copying the detail.
If you touch a project `AGENTS.md` that lacks `## Maintaining this file`, add that short self-governance section from `/Users/jholzmann/.no-mistakes/worktrees/47329d59bc68/01KY86YB2PKVFTVB0JYGFWVWQF/bin/fm-ensure-agents-md.sh` in the same pass.
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.

Right before you invoke /no-mistakes, run `/Users/jholzmann/.no-mistakes/worktrees/47329d59bc68/01KY86YB2PKVFTVB0JYGFWVWQF/bin/fm-nm-clone-config.sh .` once.
It hardens the no-mistakes internal clone against unattended commit-signing and credential hangs; it is idempotent and a silent no-op when unneeded, so a second run is harmless.

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: Rendered scout brief (Commit style section correctly absent)
You are a crewmate: an autonomous worker agent managed by firstmate. Work on your own; do not wait for a human.

# Task
{TASK}

# Herdr lifecycle declaration - NOT ENABLED
**HARD SAFETY GATE:** this scaffold cannot inspect the task text that replaces `{TASK}` later.
If the task will start, stop, delete, restart, profile, or otherwise drive Herdr lifecycle behavior, stop and regenerate the brief with `--herdr-lab` before dispatch.
Do not add Herdr lifecycle commands to this unguarded brief by hand.

# Setup
You are in a disposable git worktree of insights-app, 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/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T/tmp.RmPmGqmd9w/fm-home/state/scout-x4.status'`
   States: working, needs-decision, blocked, paused, done, failed.
   Each append wakes firstmate, so report sparingly: only phase changes a supervisor
   would act on and the needs-decision/blocked/paused/done/failed states. No step-by-step
   FYI progress lines; firstmate reads your pane for that.
   Use `paused: {why}` - distinct from `blocked:` - ONLY when you are deliberately idling on a
   known external wait you expect to clear on its own (an upstream release, a rate-limit reset):
   firstmate then leaves your idle pane alone and rechecks it on a long cadence instead of
   treating it as a possible wedge. Use `blocked:` when you are stuck and need help.
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.
   When firstmate replies or a blocker clears and you resume, append `resolved: {how it was decided or unblocked}` (add the same `[key=<slug>]` if you opened it with one) so the decision or blocker is durably closed and does not keep resurfacing.
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/2_/dz7_pwrs2_s0nx0y3lq0rznc0000gn/T/tmp.RmPmGqmd9w/fm-home/data/scout-x4/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.
Evidence: Per-mode presence check
ship-nm-x1 (no-mistakes) -> Commit style: PRESENT
ship-dp-x2 (direct-PR) -> Commit style: PRESENT
ship-lo-x3 (local-only) -> Commit style: PRESENT
scout-x4 (scout) -> Commit style: absent

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 — full suite passes, including new test_commit_style_contract_on_ship_not_scout
  • Rendered real briefs via FM_HOME=... bin/fm-brief.sh &lt;id&gt; &lt;proj&gt; for no-mistakes/direct-PR/local-only projects and --scout, then grepped ^# Commit style: PRESENT in all 3 ship modes, absent in scout
  • Captured the full rendered # Commit style section a crewmate would read from a no-mistakes ship brief
  • Confirmed the firstmate-coding-guidelines SKILL.md cross-reference points to fm-brief.sh as the one owner of the contract
✅ **Document** - passed

✅ No issues found.

⚠️ **Lint** - 1 warning
  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; shellcheck passes clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; shellcheck 0.11.0 passes clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)

🔧 Fix: no lint issues; ShellCheck 0.11.0 passes clean
1 warning still open:

  • ⚠️ linter found issues (exit code 127)
✅ **Push** - passed

✅ No issues found.

7hoenix added 2 commits July 23, 2026 15:22
Ship briefs now instruct short imperative-subject commits with a few
plain body lines; the long story goes in the PR description. Documents
the honest boundary: it governs crewmate commits, not the no-mistakes
pipeline's own commits or the squash body GitHub copies from the PR.
@7hoenix
7hoenix merged commit c839f2c into main Jul 24, 2026
4 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