Skip to content

feat(bin): require a Done when line in every brief and file follow-ups before cleanup - #62

Merged
TastyTom13 merged 6 commits into
mainfrom
fm/fm-ledger-c4-done-when-followups
Oct 15, 2026
Merged

TastyTom13 merged 6 commits into
mainfrom
fm/fm-ledger-c4-done-when-followups

Conversation

@TastyTom13

@TastyTom13 TastyTom13 commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

Intent

Go on revised ledger. The captain approved the revised, engine-first plan for the live project ledger (the mission control / cockpit / second brain) and wants it to actually track tasks and know the goal each piece of work serves. This task is one step of that plan, step C4, and must not build the other steps (C1 event log, C2 charters, C3 renderer are out of scope). Substance of the plan for C4: in the plan's finish loop, every brief carries one runnable 'Done when' line (BMAD step 1: one check a non-builder can run - a command, a scenario, or a screen walk - proving the work is finished; a scout gets it phrased as the question its report must answer), and follow-ups become backlog items before cleanup (the design's S8 first half: 'split, never shrink' - a worker's 'wired later' is filed as its own item instead of shrinking the task; cleanup refuses until each follow-up is filed, with a --none escape). The plan's C4 row reads: 'Done when line in every brief; follow-ups filed before cleanup, with a --none escape', in the firstmate repo. The reason, from the plan: today almost no backlog items carry a finish line, work keeps stopping at 'landed', and the proof of finished must come before any view. Later decision from firstmate: this PR is delivered through the no-mistakes pipeline on the existing branch, keeping the existing commits.

What Changed

  • bin/fm-brief.sh now requires --done-when "<check>" on ship and scout briefs and refuses a secondmate charter that passes it. A missing, blank, or multi-line value stops the scaffold before anything is written. The line renders as a ## Done when subsection under # Task. A scout's line reads "the report answers ". bin/fm-dod-lib.sh repeats it in the Definition of done as the acceptance check to run and cite. bin/fm-spawn.sh's forge-mismatch re-scaffold hint now includes --done-when.
  • Ship and scout briefs gain a "Follow-ups" section. The worker lists each follow-up as one line in data/<task-id>/follow-ups.md, or runs the new bin/fm-followups.sh <task-id> --none, which appends followups=none to the task's meta under its lock. bin/fm-teardown.sh files each recorded line as a queued kind=follow-up backlog item through bin/fm-tasks-axi.sh add, with an "Origin: " body. It tracks progress in the meta so a retried teardown does not file a title twice. Teardown refuses when there is neither a non-empty record nor the --none escape, and --force skips the check. Where no automatic backlog transition applies, it prints the titles instead of refusing.
  • Tests, tests/lib.sh, docs/scripts.md, and the operational-home-layout skill follow the new --done-when flag and follow-ups step. Existing fm-brief.sh call sites in bin/fm-live-lab.sh and bin/fm-test-run.sh are updated. The suite gains cases for the Done when line and the follow-up filing, refusal, and --none paths.

Risk Assessment

✅ Low: The round-1 fix is minimal and correct: recorded titles now win over followups=none, and followups=filed is the only early return, since fm_meta_get is last-wins.

Testing

I ran the three test files this PR touches, as the operator asked, and not the full suite. All three exited 0 with no failures, including the teardown cases for follow-ups: refuse until filed, file all before cleanup, no double filing after a partial failure, the --none escape, and filing a follow-up recorded after --none. I did not run a live Herdr or tmux lab, because these tests already drive the real scripts end to end. There is no UI, so there are no screenshots.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Every brief scaffold carries a runnable Done when line (scouts get it as a question) ✅ pass live fm-brief.log (tests/fm-brief.test.sh, exit 0)
Teardown refuses until follow-ups are recorded or declared none ✅ pass live fm-teardown.log: 'teardown refuses until follow-ups are recorded or declared none'
Teardown files every recorded follow-up as a backlog item before cleanup, and never twice after a partial failure ✅ pass live fm-teardown.log: 'files every recorded follow-up as a backlog item' and 'retried after a partial filing failure never files a follow-up twice'
The --none escape lets teardown proceed, but a follow-up recorded after --none is still filed (review fix) ✅ pass live fm-teardown.log: 'the --none escape is recorded in the task's meta' and 'a follow-up recorded after --none is still filed'
Done-when gate helpers (fm-dod-lib) still behave ✅ pass live fm-dod-lib.log (tests/fm-dod-lib.test.sh, exit 0)
Evidence: fm-brief test log

Source: fm-brief test log

ok - fm-brief: scaffolds leave the worker role scope to the launch boundary and keep the secondmate contract
ok - fm-brief.sh: bash -n succeeds
/private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/heredoc-in-substitution.sh:2
ok - fm-brief.sh: no heredoc is nested inside a command substitution (Bash 3.2 parse-safe)
ok - fm-brief.sh: --help renders the complete header
ok - fm-brief.sh: no-mistakes/direct-PR/local-only briefs generate cleanly
ok - fm-brief.sh: ship --mode is required and closed-set validated
ok - fm-brief.sh: the explicit ship mode wins over the registered posture
ok - fm-brief.sh: ship and scout briefs require one non-empty --done-when line
ok - fm-brief.sh: the Done when line renders in the Task section and the Definition of done
ok - fm-brief.sh: ship and scout briefs name the follow-ups record and its --none escape
ok - fm-brief.sh: --yolo and scout/secondmate --mode are refused, never silently dropped
ok - fm-brief.sh: the base branch line renders only for an explicit base
ok - fm-brief.sh: faster paths use configured authority without stacked review
ok - fm-brief.sh: no-mistakes DOD keeps its apostrophe prose and bans --yes outright
ok - fm-brief.sh: no-mistakes DOD detects a green PR from the drive call, not a status poll
ok - fm-brief.sh: PR-based done requires a non-draft PR; a deliberate draft declares a wait
ok - fm-brief.sh: no-mistakes ask-user findings use one event plus a verbatim snapshot
ok - fm-brief.sh: ship project-memory wording bounds edits to corrections of wrong information
ok - fm-brief.sh: --herdr-lab emits the complete hard safety contract
ok - fm-brief.sh: --herdr-lab uses its quoted Firstmate-owned helper path
ok - fm-brief.sh: ship and scout scaffolds make omitted Herdr intent fail-visible
ok - fm-brief.sh: the documented {TASK} and {FIRSTMATE_SPEC} fills cannot corrupt the Herdr safety gate
ok - fm-brief.sh: Herdr lab contract covers scouts and rejects secondmate misuse
ok - fm-brief.sh: --no-projects scaffolds a project-less charter and guards misuse
ok - fm-brief.sh: marked requests avoid generic acknowledgements and preserve material reporting
ok - fm-brief.sh: relative directory inputs ignore CDPATH, render stable absolute charter paths, or fail loudly
ok - fm-brief.sh: custom pause verb renders in every scaffold
ok - fm-brief.sh: ship and scout scaffolds declare a validation-round pause once, then hold it
ok - fm-brief.sh: investigation and visual-review completions load the shared decision policy
ok - fm-brief: scout and secondmate code paths still scaffold well-formed briefs
ok - fm-brief.sh: scout Lavish hosting follows the bootstrap lavish-axi floor and names a durable board path
ok - fm-brief.sh: ship and scout carry the CONTEXT pointer, Toolkit, and Reporting rules
ok - fm-brief.sh: --env-file is opt-in, absolute, self-explaining, and refused on charters
ok - fm-brief.sh: the merge wait is declared exactly where a PR is raised
ok - fm-brief.sh: the Built-by PR-body line reads this task's own recorded harness/model/effort
ok - fm-brief.sh: fable-prompting Task subsections, charter Intent slot, Working discipline lines, cd caution, and ship verification step render for every scaffold
ok - fm-brief.sh: acceptance-numbering and red-then-green rules render only for PR-raising ship briefs
ok - fm-brief.sh: PR-raising ship briefs classify a failing check once and never rerun a known failure
ok - fm-brief.sh: the screenshot pre-flight renders only for --ui tasks
ok - fm-brief.sh: --help documents the --ui screenshot pre-flight
ok - fm-brief.sh: ship and scout briefs name the unwanted and wanted turn ends plus the time sentence
ok - fm-brief.sh: --pasted-file marks the captain's paste under Captain's intent and is otherwise byte-identical
ok - fm-brief.sh: --design adds only the front-end design block
warning: the decks point-of-view document does not exist yet (checked /private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/visual-kind-scout/projects/some-proj/docs/design/point-of-view.md); the brief tells the worker to create it from the ratified point-of-view report before designing
warning: the decks point-of-view document does not exist yet (checked /private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/visual-kind-direct-PR/projects/some-proj/docs/design/point-of-view.md); the brief tells the worker to create it from the ratified point-of-view report before designing
warning: the decks point-of-view document does not exist yet (checked /private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/visual-kind-local-only/projects/some-proj/docs/design/point-of-view.md); the brief tells the worker to create it from the ratified point-of-view report before designing
warning: the decks point-of-view document does not exist yet (checked /private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/visual-flagged/projects/some-proj/docs/design/point-of-view.md); the brief tells the worker to create it from the ratified point-of-view report before designing
ok - fm-brief.sh: --visual is surface-bound, shared by ship/scout, and byte-neutral when absent
ok - fm-brief.sh: --help documents the visual-work flag and surface selector
ok - fm-brief.sh: --help documents --pasted-file and --design
ok - fm-brief: workers end the turn on a decision, wait in one bounded shell command, and never poll
ok - fm-brief: without config/wait-no-turns the brief and drive text stay as they were
ok - fm-brief.sh: the home brief include lands last on ship and scout, verbatim, and fails closed
ok - fm-brief.sh: --branch-prefix omitted defaults every ship mode to fm/<task-id>
ok - fm-brief.sh: a --branch-prefix override renders identically across every generated section
ok - fm-brief.sh: an empty --branch-prefix override resolves to a bare <task-id> branch
ok - fm-brief.sh: --branch-prefix is refused on scout and secondmate scaffolds
ok - fm-brief.sh: --branch-prefix value is validated against embedded spaces and a leading dash
Switched to a new branch '$(touch${IFS}/private/var/folders/08/gk0k1cz96snd794rnghc_98r0000gn/T/fm-brief.GBq8QO/branch-prefix-shell-safe-marker)brief-branch-safe-g3'
ok - fm-brief.sh: ref-format-valid shell metacharacters stay literal in generated branch commands
ok - fm-brief.sh: every crewmate scaffold forbids administering the shared worktree pool
Evidence: fm-dod-lib test log

Source: fm-dod-lib test log

ok - scout done: is not gated
ok - fm_dod_block repeats the Done when line as acceptance, and is unchanged without one
ok - unpushed ship done: is refused
ok - no-mistakes done: without a PR URL is refused
ok - a no-mistakes ship done: without a PR URL is classified not done
ok - named head on a remote-tracking ref is accepted
ok - a moved remote branch that lacks the named head is refused
ok - a 40-hex token in the note is not the named head
ok - a recorded merged PR satisfies the gate after prune
ok - the merged-PR short-circuit applies only to the recorded PR the done line names
ok - a forge-recorded head for the named PR is accepted without a local object
ok - a direct-PR recorded head does not cover a later unpushed commit
ok - no-mistakes CI-ready done: with extra text is gated
ok - keyed and spaced ship done: lines are gated
ok - local-only linked named branch is reachable from the project clone
ok - local-only detached HEAD only in the disposable copy is refused
ok - standalone local-only done: requires the named head in the project clone
ok - non-done lines are not gated
ok - fenced and indented Captain lines are not authorized intent
ok - PR-based DoD draft check uses gh-axi
all fm-dod-lib tests passed
Evidence: fm-teardown test log

Source: fm-teardown test log

ok - a missing teardown startup source refuses before cleanup
ok - an unreadable teardown startup source refuses before cleanup
ok - a missing adapter sibling refuses before cleanup
ok - a forced descendant with a missing adapter sibling refuses before cleanup
ok - a forced secondmate with a missing own adapter sibling refuses before child cleanup
ok - present required sources still reach the ordinary teardown refusal
ok - local-only worktree with HEAD on a fork remote is torn down and the home summary is refreshed
ok - teardown retires only its browser bridge, MCP, and Chrome family
ok - teardown retires its browser bridge after zellij confirms the endpoint is gone
ok - teardown rejects malformed zellij shutdown inventory
ok - teardown retires its browser bridge after cmux confirms the endpoint is gone
ok - teardown rejects malformed cmux shutdown inventory
ok - teardown retires its browser bridge after orca confirms the endpoint is gone
ok - teardown closes its own backlog item before reporting success
ok - teardown honors config/backlog-backend=manual and still finishes cleanly
ok - teardown refuses until follow-ups are recorded or declared none
ok - teardown files every recorded follow-up as a backlog item before cleanup
ok - a teardown retried after a partial filing failure never files a follow-up twice
ok - the --none escape is recorded in the task's meta and lets teardown proceed
ok - a follow-up recorded after --none is still filed
ok - local-only worktree with truly unpushed work is refused (safety preserved)
ok - local-only worktree with work merged into local main is torn down (no regression)
ok - no-mistakes worktree with HEAD on origin is torn down (no regression)
ok - no-mistakes worktree with genuinely unlanded work is refused (safety preserved)
ok - local-only worktree with unpushed work is torn down under --force (escape hatch)
ok - fm-pr-check publishes the PR-ready line on a secondmate's parent channel once
ok - a secondmate home's teardown delivers the child's final line or refuses until it can
ok - teardown completes when an exact busy-state sidecar is already absent
ok - herdr teardown removes pane-owned escalation dedupe state
ok - herdr flat teardown refuses before returning the isolated copy under lock contention and the retry completes cleanly
ok - herdr flat teardown never erases records when pane presence is unparseable
ok - herdr flat teardown preflight refuses before every destructive change
ok - forced secondmate teardown preflights every Herdr child before cleanup mutation
ok - forced secondmate teardown holds every descendant lifecycle and metadata lock
ok - forced secondmate teardown retains Herdr child identity until exact pane disappearance
ok - forced teardown retains a nested secondmate home and its grandchild's Herdr identity when the grandchild close is unconfirmed
ok - herdr projection teardown retires its journal only after confirming the exact recorded pane is gone
ok - herdr projection teardown retains every record when post-close presence is unknown
ok - herdr projection teardown surfaces failed focus restoration without turning confirmed cleanup into a hard failure
ok - teardown retires the task's own watcher markers and orphaned presentation journal, leaving other tasks' markers alone
ok - teardown retains a presentation journal bound to a pane other than the closed endpoint
ok - teardown retires a v1 presentation journal once its token workspace is confirmed gone
ok - teardown retains a v1 presentation journal while its token workspace is still present
ok - teardown retains a v1 presentation journal when the workspace query is ambiguous
ok - squash-merged + deleted-branch worktree (PR merged) is torn down (the fix)
ok - squash-merged PR accepts a local HEAD that is an ancestor of the final PR head
ok - teardown discovers a merged PR by branch name and tears down when no pr= was ever recorded
ok - squash-merged PR accepts replayed unpushed local patches contained in the PR head
ok - merged PR does not allow teardown after a later local commit
ok - squash-merged task whose local branch followed the pipeline rebase is torn down
ok - squash-merged same-path different content still refuses
ok - squash-merged rebased local still refuses a genuinely unlanded follow-up commit
ok - squash-merged stale local still refuses when the forge is unreachable
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
ok - fm-pr-check does not refresh PR head after HEAD moves
fm-contributions: data directory unavailable
contributions: observation not armed; coverage is unconfirmed
ok - fm-pr-check records the remote PR head when the local worktree lags
ok - worktree whose content already landed in the default branch is torn down (content fallback)
ok - content fallback refreshes origin default before comparing trees
ok - dirty worktree is refused even when its committed work has landed (dirty always wins)
ok - gh lookup error with content not in default refuses (fail-safe)
ok - a record predating spawn_gen refuses teardown until --legacy-record is passed
warning: tmux endpoint shutdown confirmation is unsupported or unconfirmed; skipping browser bridge sweep for task-x1
ok - a windowless leftover with no spawn_gen and no worktree tears down without --legacy-record
warning: tmux endpoint shutdown confirmation is unsupported or unconfirmed; skipping browser bridge sweep for task-x1
ok - a windowless leftover with no spawn_gen also tears down when --legacy-record is passed
ok - a windowless leftover still refuses while its worktree holds unlanded work
ok - a windowless record with a spawn_gen, a non-tmux backend or endpoint identity, no backlog validation, or ambiguous, foreign, or malformed identity still refuses
warning: tmux endpoint shutdown confirmation is unsupported or unconfirmed; skipping browser bridge sweep for task-x1
ok - a windowless leftover retries its retained legacy stamp without --legacy-record
ok - a landed legacy record with a dead endpoint tears down and logs its accepted incarnation
ok - --legacy-record never relaxes the unlanded-work refusal
ok - an endpoint that cannot be confidently read as dead refuses --legacy-record teardown
ok - --legacy-record teardown rolls its stamp back when the close marker write fails
ok - a legacy stamp a failed rollback left behind still faces the endpoint gate
ok - a corrupt spawn_gen is never accepted as a legacy record
ok - provably-stale worktree index.lock (old, no live holder) is cleared and teardown succeeds
ok - live-held worktree index.lock is never removed and teardown refuses
ok - lsof errors leave worktree index.lock in place and refuse teardown
ok - stale lock cleanup rechecks and refuses dirty worktree before return
ok - normal repo index.lock is resolved from the worktree and cleared when stale
ok - index-lock mtime fault injection is PATH-based; skipped on Darwin where stat is /usr/bin/stat
ok - transient index.lock cleared after first failed return is retried successfully without force-remove
ok - persistent index.lock exhausts retries and refuses without force-removing the lock
ok - empty retry wait overrides use the default without aborting teardown
ok - fractional legacy retry wait remains supported without arithmetic
ok - a task's own parked no-mistakes run is aborted, not orphaned, before the worker is removed
ok - a run that lands on passed-with-override after abort is still recognized as terminal
ok - a run that lands on passed-with-skips after abort is still recognized as terminal
ok - a parked run the pipeline advanced past the task copy is still concluded from the runs ledger, not orphaned
ok - a ledger row for a different head never authorizes a parked-run abort
ok - a malformed ledger row never authorizes a parked-run abort
ok - an impossible ledger date never authorizes a parked-run abort
ok - a terminal status with a stale gate never reaches ledger cleanup
ok - an advanced head present locally aborts through the strict rule alone - the ledger fallback stays dormant
ok - an unresolvable active row with no same-branch anchor is never concluded (conservative refusal)
ok - an ancestor-only anchor never binds an advanced parked run to this task
ok - a terminal unfetched-head row is stale history and never concludes a run
ok - a terminal newest row anchored at this worktree's head never authorizes an abort
ok - a resolvable diverged newer same-branch row makes every older row stale history; no run is concluded
ok - consecutive unresolvable rows are ambiguous and never conclude a run
ok - a ledger-proven continuation is still left alone while the run is autonomously active
ok - teardown refuses before reap or removal when a task-owned run remains parked
ok - a different run cannot confirm the targeted abort
ok - empty post-abort status is not accepted as confirmation
ok - the CLI's exact run-not-found signal confirms completion
ok - a parked run on another branch is never aborted by this task's teardown (ownership is precise)
ok - a task-owned autonomous running step is left alone rather than aborted
ok - a leaked descendant process rooted under the task's worktree is reaped by teardown, not left surviving
ok - a leaked descendant process rooted under the task's per-task tasktmp is reaped by teardown too
ok - missing lsof falls back to reaping the tmux pane process group
ok - an erroring lsof scan refuses teardown and preserves the task
ok - a reused pid with a different start time is never force-killed
ok - an exec change preserves birth identity and the process is reaped
ok - a process spawned during grace is reaped on a later pass
ok - persistent leaked processes refuse teardown after bounded retries
ok - a process exiting during identity lookup does not block teardown
ok - the run abort and the leaked-process reap both complete before the destructive worktree return
ok - teardown refuses a worktree another task record still names, and changes nothing
ok - --force authorizes discarding this task's work, never another task's shared worktree
ok - --release-shared-record retires only the stale record and leaves the shared worktree intact
ok - --release-shared-record refuses outside the shared-worktree case it exists for
- Outcome: 🔧 1 issue found → no changes applied ✅ across 2 runs (41m59s)

Acceptance criteria

  1. Every ship brief carries one Done when line, filled at scaffold time through a required flag, and the scaffold refuses when it is missing or empty like --mode.
    Proof: test_done_when_is_required_on_ship_and_scout (missing on ship and scout, --done-when= empty, whitespace-only, multi-line, and secondmate misuse all refuse and write nothing) and test_done_when_renders_in_task_and_definition_of_done (all three ship modes).
  2. Scout briefs get the same line phrased as the question the report must answer.
    Proof: the scout half of test_done_when_renders_in_task_and_definition_of_done.
  3. The worker's definition of done repeats that line as acceptance.
    Proof: test_dod_block_repeats_done_when_line (no-mistakes, direct-PR, local-only, and both Gerrit modes; unchanged without the argument) and the Definition of done assertions in criterion 1's render test.
  4. Teardown refuses a ship or scout task until its follow-ups are filed or an explicit --none escape is recorded in meta.
    Proof: test_teardown_refuses_until_follow_ups_are_recorded (no record refuses, an empty record refuses, task record, backlog row, and worktree are all kept).
  5. Teardown reads data/<task>/follow-ups.md, one item per line, files each through bin/fm-tasks-axi.sh add as kind follow-up with repo and origin task, then proceeds.
    Proof: test_teardown_files_follow_ups_before_cleanup (three items, bullets stripped, blank line skipped, each (repo: project) (kind: follow-up) with Origin: task-x1, task then closed), test_teardown_retry_never_files_a_follow_up_twice, and the review fix's test_teardown_files_follow_ups_recorded_after_none (a record written after --none is still filed).
  6. The --none escape is recorded in the task's meta and lets teardown proceed.
    Proof: test_teardown_none_escape_recorded_in_meta.
  7. Tests use the repo's existing bash test style; run output is below.

Test runs

Red, before the implementation (new tests only):

not ok - ship without --done-when: expected a non-zero exit
not ok - no-mistakes: Task section has no Done when subsection (missing: '## Done when')
not ok - ship: brief has no Follow-ups section
not ok - no-mistakes/none: DoD does not repeat the Done when line (missing: 'Done when: open /settings and the saved name shows after a reload')
not ok - teardown succeeded with no follow-ups record and no --none: ...
not ok - teardown filed 0 follow-up items, expected 3: # Backlog
not ok - fm-followups.sh --none failed: ... bin/fm-followups.sh: No such file or directory

The retry test was added after the implementation; disabling its skip check turns it red (not ok - a retried teardown filed the first follow-up again).

Green, after:

ok - fm-brief.sh: ship and scout briefs require one non-empty --done-when line
ok - fm-brief.sh: the Done when line renders in the Task section and the Definition of done
ok - fm-brief.sh: ship and scout briefs name the follow-ups record and its --none escape
ok - fm_dod_block repeats the Done when line as acceptance, and is unchanged without one
ok - teardown refuses until follow-ups are recorded or declared none
ok - teardown files every recorded follow-up as a backlog item before cleanup
ok - a teardown retried after a partial filing failure never files a follow-up twice
ok - the --none escape is recorded in the task's meta and lets teardown proceed
tests/fm-brief.test.sh exit=0 ok=56 not_ok=0
tests/fm-dod-lib.test.sh exit=0 ok=20 not_ok=0
tests/fm-teardown.test.sh exit=0 ok=116 not_ok=0   (117 with the review fix's case, per the pipeline Testing section)

Other suites that scaffold briefs or run teardown, run locally, all exit 0 with no not ok: fm-ask-user-authority, fm-tangle-guard, fm-fleet-ledger, fm-secondmate-safety, fm-subagent-pretool-check, fm-task-delivery, fm-control-relaunch, fm-arm-pretool-check, fm-afk-return, fm-backlog-handoff, fm-backlog-atomicity, fm-backend-orca, fm-backend-zellij, fm-branch-supervision, fm-busy-state, fm-captain-hold-lifecycle, fm-gotmp, fm-model-scorecard, fm-pr-merge, fm-public-followup, fm-pr-check-security, fm-remote-secondmate-parent-binding, fm-spawn-pool-base-freshen, fm-teardown-endpoint-safety, fm-backend, fm-grok-harness, fm-kimi-harness, fm-muse-harness, fm-backend-autodetect-smoke, fm-secondmate-lifecycle-e2e, fm-live-lab, fm-spawn-dispatch-profile.
bin/fm-lint.sh and bin/fm-doc-audience-check.sh pass.

GitHub CI on the final head 36f18f2: all 19 checks pass, including Behavior portable serial 9 and PR must be raised via no-mistakes after firstmate re-ran those two jobs.

Not caused by this branch, measured locally:

  • tests/fm-remote-secondmate-lifecycle-e2e.test.sh exits 1 after 22 passing cases with error: remote code root did not complete a safe origin update; the same run on origin/main (e4fe17a) fails the same way.
  • tests/fm-gate-refuse.test.sh stops at not ok - tmux is required for the lab socket behavioral test because tmux is not installed on this machine.

Follow-ups

  • F1: bin/fm-promote.sh takes no --done-when, so a promoted scout's ship contract carries no runnable Done when line; its Task section still holds the scout's question. The promotion parity tests now ignore only that line.
  • F2: Tasks dispatched before this lands never saw the Follow-ups section, so their teardown refuses until firstmate writes their record or runs bin/fm-followups.sh <id> --none.

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-teardown.sh:1766 - The followups=none escape beats any recorded titles. teardown_file_follow_ups returns 0 as soon as the meta says none, before it reads data/<id>/follow-ups.md. Example: a worker runs fm-followups.sh &lt;id&gt; --none, later finds a gap and writes it to follow-ups.md. Teardown then files nothing and says nothing, so the follow-up is lost. That is the 'wired later' drop this change is meant to stop. A smaller fix: when state is none and the record has titles, either file them or refuse with a clear message.

🔧 Fix applied.
✅ Re-checked - no issues remain.

🔧 **Test** - 1 issue found → no changes applied ✅
  • ⚠️ The Test agent did not finish within its invocation budget. Reported: agent run tests timed out after 30m0s: agent last produced output 1s ago (73 observed); agent reported: claude parse events: context deadline exceeded. This is a budget or provider-slowness cut, not a code failure. Re-running the same request costs another full budget, so no further attempt is made automatically. If this repository's targeted tests or evidence gathering routinely approach the default 30m0s, raise test_agent_timeout in global config. Respond with fix to spend another budget: a repair turn runs only for selected findings other than this budget cut, then validation re-runs. Or abort and retry after raising the budget.

🔧 No changes applied.
✅ Re-checked - no issues remain.

  • Live validation: ✅ go - 5 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Every brief scaffold carries a runnable Done when line (scouts get it as a question) ✅ pass live fm-brief.log (tests/fm-brief.test.sh, exit 0)
Teardown refuses until follow-ups are recorded or declared none ✅ pass live fm-teardown.log: 'teardown refuses until follow-ups are recorded or declared none'
Teardown files every recorded follow-up as a backlog item before cleanup, and never twice after a partial failure ✅ pass live fm-teardown.log: 'files every recorded follow-up as a backlog item' and 'retried after a partial filing failure never files a follow-up twice'
The --none escape lets teardown proceed, but a follow-up recorded after --none is still filed (review fix) ✅ pass live fm-teardown.log: 'the --none escape is recorded in the task's meta' and 'a follow-up recorded after --none is still filed'
Done-when gate helpers (fm-dod-lib) still behave ✅ pass live fm-dod-lib.log (tests/fm-dod-lib.test.sh, exit 0)
  • bash tests/fm-brief.test.sh (exit 0, 56 ok, 0 not ok)
  • bash tests/fm-dod-lib.test.sh (exit 0, 20 ok)
  • bash tests/fm-teardown.test.sh (exit 0, 117 ok, 0 not ok)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Built by: claude/opus at high

…s before cleanup

fm-brief.sh now requires --done-when on ship and scout briefs and renders it
in the Task section; fm-dod-lib.sh repeats it as the acceptance check. Workers
record follow-ups in data/<id>/follow-ups.md or declare none with the new
fm-followups.sh, and fm-teardown.sh files each one as a backlog item before
cleanup or refuses.
@TastyTom13
TastyTom13 merged commit a7455e7 into main Oct 15, 2026
38 of 40 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