Skip to content

fix(bin): enforce ship brief decision and pipeline contracts - #2

Merged
V4f1k merged 4 commits into
mainfrom
fm/brief-autorstvi-rozhodnuti
Aug 15, 2026
Merged

fix(bin): enforce ship brief decision and pipeline contracts#2
V4f1k merged 4 commits into
mainfrom
fm/brief-autorstvi-rozhodnuti

Conversation

@V4f1k

@V4f1k V4f1k commented Aug 15, 2026

Copy link
Copy Markdown
Owner

Intent

Fix four demonstrated gaps in the ordinary ship brief generated by bin/fm-brief.sh, with regression tests through the script executable interface. Decision provenance: a worker must describe a decision as coming from firstmate unless firstmate explicitly says the captain made it; standing yolo authority must never be rewritten as a direct captain decision. Nonterminal statuses: the generated contract must cover every nonterminal line, explicitly including resolved:, require the same turn to continue, and after responding to a no-mistakes gate the worker must wait for the next pipeline return rather than ending its turn. Completion boundary: in no-mistakes mode an implementation commit is a working: milestone, never done:; done: is reserved for the existing PR-with-green-checks terminal condition. Distinguishable evidence: when a task requires evidence from multiple execution paths, copied or byte-identical artifacts are insufficient; each artifact must visibly prove which path produced it. Inspect existing brief tests and history before choosing wording. Extend the smallest existing tests through fm-brief.sh output and behavior; tests must not assert implementation-source bytes. Review the complete branch diff after all lint and test fixes. Preserve commits c37dead and 2bea96a exactly. Run fresh no-mistakes validation and delivery on this clean head, push fm/brief-autorstvi-rozhodnuti, open a PR against fork main, drive every synchronous return through checks-passed or passed, never merge, and report the full PR URL. Do not add Herdr lifecycle commands.

What Changed

  • Preserve firstmate decision provenance and require path-distinguishable evidence in generated ship briefs.
  • Treat all nonterminal statuses as same-turn continuation points and drive no-mistakes responses through their returned gate or outcome.
  • Reserve done: for PRs with green checks, using working: for committed implementation milestones, with executable-interface regression coverage.

Risk Assessment

✅ Low: The change is narrowly scoped to the generated ordinary ship brief, satisfies the source-verifiable intent across all delivery modes, and tests the emitted brief through the script executable interface without introducing material risk.

Testing

Reviewed the scoped diff and history, ran the focused executable-interface brief tests, and manually generated and inspected the actual worker-facing no-mistakes brief; all required provenance, nonterminal continuation, pipeline-return, completion-boundary, and distinguishable-evidence contracts rendered correctly. No screenshot was produced because the end-user surface is generated Markdown, preserved directly as the evidence artifact.

Evidence: Generated no-mistakes ordinary ship brief

Source: Generated no-mistakes ordinary ship brief

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 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 wait in the same turn for firstmate's help.

1. First action: create your branch: `git checkout -b fm/evidence-ordinary-ship`
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}" >> '/tmp/no-mistakes-evidence/01M02CGGBW5PA3M17WVCYGCKX0/home/state/evidence-ordinary-ship.status'`
   States: working, needs-decision, blocked, paused, resolved, 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/resolved/done/failed states. No step-by-step FYI progress lines;
   firstmate reads your pane for that.
   Every status line except `done:` and `failed:` is nonterminal, including `working:`,
   `needs-decision:`, `blocked:`, `paused:`, and `resolved:`; after any such line,
   continue the same turn's work or enter its prescribed wait, and never end the task merely
   because that status line was written.
   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 wait in the same turn for firstmate's help.
6. If a decision belongs above the implementation worker (product choices, destructive actions, ask-user findings),
   append `needs-decision: {summary of options}` and wait in the same turn. Firstmate will apply the configured authority and reply with the decision.
   A decision or blocker you opened stays open until a `resolved` line carrying its exact key lands; a later `done:` or `working:` line never closes it, even when the answer is what started that work.
   Firstmate's reply normally writes that closing line at answer time; when a blocker or wait clears WITHOUT a firstmate reply, append `resolved: {how it cleared}` yourself (same `[key=<slug>]` if you opened it with one) as you resume.
   Describe each decision as coming from firstmate unless firstmate explicitly says the captain made it; standing yolo authority is firstmate's authority and must never be rewritten as a direct captain 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 wait in the same turn for firstmate; only firstmate manages the daemon.
8. When the task requires evidence from multiple execution paths, generate each artifact through
   its own path and make the producing path visible in the artifact; copied or byte-identical
   artifacts are not sufficient evidence.

# Project memory
If `AGENTS.md` or `CLAUDE.md` already exists, or if this task produced durable project-intrinsic knowledge, run `/home/firstmate/.no-mistakes/worktrees/5cb9d2c83bde/01M02CGGBW5PA3M17WVCYGCKX0/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 `/home/firstmate/.no-mistakes/worktrees/5cb9d2c83bde/01M02CGGBW5PA3M17WVCYGCKX0/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
Delivery contract: mode=no-mistakes
The implementation milestone is complete only when committed on your branch; report it with
`working: {summary}`, never `done:`, and continue in the same turn into the no-mistakes pipeline.
Immediately invoke /no-mistakes to validate and ship a PR; do not wait for another instruction.

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.
When starting no-mistakes, make `--intent` preserve all relevant content from this brief's `# Task` section plus every later accepted Firstmate requirement, clarification, constraint, exclusion, and supersession, carrying only each requirement's current accepted form; retain direct requirements instead of substituting a diff summary, and exclude generic operational, status, delivery, and other scaffold boilerplate unless it is task-specific.
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 never yours to answer: escalate to firstmate (rule 6), then enter the same-turn wait for its decision.
  Firstmate applies the authority contract in its `AGENTS.md` and obtains any required captain decision.
  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.
  Wait in the same turn for `no-mistakes axi respond` itself to return, then immediately process its returned gate or outcome and continue driving the pipeline; do not end the turn or wait again for another return.
- Avoid `--yes`: it would silently bypass firstmate's authority check and any required captain escalation.

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.

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.

  • Inspected git diff 2d475fa3ffe21726dc2f6e3b004e381c17b0033d..HEAD -- bin/fm-brief.sh tests/fm-brief.test.sh and recent branch history.
  • Ran tests/fm-brief.test.sh.
  • Generated an ordinary ship brief through FM_HOME=&lt;evidence-home&gt; bin/fm-brief.sh evidence-ordinary-ship demo-project --mode no-mistakes.
  • Inspected the generated public brief contract with rg -n -C 3 &#34;Definition of done|Delivery contract|implementation milestone|States:|Every status|Describe each decision|multiple execution paths|no-mistakes axi respond|After /no-mistakes reports&#34; &lt;generated-brief&gt;.
  • Ran git status --short after testing to confirm no worktree artifacts remained.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@V4f1k
V4f1k merged commit f14b36a into main Aug 15, 2026
13 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