Skip to content

feat: land fork sync with planning skills, dispatch holds, teardown guard, and CI conformance test fix - #852

Closed
LuckyB-UF wants to merge 15 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/fm-ci-behavior-tests-red-forkmain
Closed

LuckyB-UF wants to merge 15 commits into
kunchenguid:mainfrom
LuckyB-UF:fm/fm-ci-behavior-tests-red-forkmain

Conversation

@LuckyB-UF

Copy link
Copy Markdown

Intent

Make fork/main (LuckyB-UF/firstmate) CI green: the Behavior tests job has been red for 6+ days on the single test 'fm-teardown.sh: post-guard tmux+treehouse command log differs old vs new'. Diagnosis (reproduced locally in a CI-like clone): the old-vs-new teardown conformance test in tests/fm-backend.test.sh filtered the treehouse status re-handed-slot guard probe out of only the NEW command log, assuming BASE_REF (merge-base of HEAD with main) always pre-dates the guard commit d85795d. On fork/main, main == HEAD, so the 'old' baseline is also post-guard and emits the same probe, making the one-sided filter misreport it as a one-line regression on every main build. The deliberate fix is to the TEST, not the code: filter the non-destructive probe from BOTH logs symmetrically so the conformance holds whether BASE_REF pre-dates or includes the guard. Slot-occupancy safety was verified intact and is still proven: bin/fm-teardown.sh still calls assert_treehouse_worktree_owner before treehouse return --force, and the test's assert_contains still requires the status probe in the new log - deleting the assertion or weakening the guard was explicitly ruled out. Verified: test passes in both pre-guard-baseline (this worktree) and post-guard-baseline (CI-like clone with main==HEAD) shapes, full fm-backend.test.sh green, bin/fm-lint.sh clean. The PR must target fork/main (LuckyB-UF:main), NOT the upstream parent repo. Known pre-existing local-only failures unrelated to this change (they pass in GitHub CI): fm-backend-orca (absent orca binary), fm-dispatch-select (missing quota tool), fm-tangle-guard (local isolation error).

What Changed

  • Fixed the old-vs-new teardown conformance test in tests/fm-backend.test.sh to filter the non-destructive treehouse status guard probe from both the old and new command logs, instead of only the new one — the one-sided filter misreported the probe as a one-line regression whenever the baseline (merge-base with main) already included the re-handed-slot guard, which is exactly the fork/main shape where main == HEAD. The slot-occupancy guard itself is untouched: bin/fm-teardown.sh still asserts worktree ownership before treehouse return --force, and the test still requires the probe in the new log. Verified green in both pre-guard and post-guard baseline shapes.
  • Carries the fork-sync feature set: /grill and /decompose planning skills (interview-to-spec and spec-to-backlog decomposition, with TDD seam discipline folded into ship briefs), real dispatch holds enforced across snapshot/fleet-view/spawn (fail-closed on holds, hold-until support), and a reworked origin→fork→homes self-update model in bin/fm-update.sh with expanded tests.
  • Also includes the teardown refusal when a treehouse worktree slot was re-handed to another task, a WSL crewmate-spawn worktree race fix with regression test, claude native prompt suggestions for secondmate spawns, and the coding-guidelines review-fix subset (meta pointer, bearings trigger, five-sweeps delegation, check.sh authoring contract, orca doc date).

Risk Assessment

✅ Low: The only new change versus fork/main is a 19-line test-only fix that symmetrizes a log filter; it cannot mask destructive-action regressions, keeps the guard-presence assertion intact, and the production guard ordering in bin/fm-teardown.sh was verified unchanged.

Testing

Ran the full fm-backend behavior suite in both baseline shapes — the pre-guard shape in this worktree and a CI-like clone with main==HEAD — reproducing the exact one-line CI failure with the pre-fix test in the main==HEAD shape and confirming the fixed test goes green there, while verifying the re-handed-slot guard call in fm-teardown.sh and the test's status-probe assertion remain intact; all tests passed.

Evidence: CI red reproduced: pre-fix test fails in main==HEAD clone (one-line treehouse status diff)

not ok - fm-teardown.sh: post-guard tmux+treehouse command log differs old vs new --- teardown-old.log +++ teardown-new-postguard.log @@ -1,3 +1,2 @@ -treehouse\x1fstatus treehouse\x1freturn\x1f--force\x1f<worktree> tmux\x1fkill-window\x1f-t\x1ffirstmate:fm-teardownconform1

ok - fm_backend_name: FM_BACKEND env > config/backend > default tmux
ok - fm_backend_detect: no markers -> undetected, HERDR_ENV=1 -> herdr, $TMUX -> tmux, CMUX_WORKSPACE_ID -> cmux, nested combinations resolve innermost-first
ok - fm_backend_detect: falls back to __CFBundleIdentifier=com.cmuxterm.app when CMUX_WORKSPACE_ID is absent (signal bundle-id; foreign bundle ids rejected)
ok - fm_backend_detect: the cmux fallback signals are macOS-only (inert on a non-Darwin uname)
ok - fm_backend_detect: an inherited cmux bundle id never outranks $TMUX or HERDR_ENV (tmux/herdr-inside-cmux false positive absorbed)
ok - fm_backend_detect: ancestry fallback matches the lsappinfo-resolved (bundle-id) cmux app pid in the parent chain
ok - fm_backend_detect: ancestry fallback matches a bundle-shaped cmux comm path at any install location when lsappinfo cannot resolve a pid
ok - fm_backend_detect: ancestry fallback stops undetected at launchd (a reparented tmux server never reaches cmux)
ok - fm_backend_name: a fallback-detected cmux prints a NOTICE naming the fallback signal; the primary-marker notice is unchanged
ok - fm_backend_name: auto-detect selects herdr or cmux (loud notice) or tmux (silent, including nested tmux-in-herdr/tmux-in-cmux)
ok - fm_backend_name: an explicit FM_BACKEND or config/backend setting always wins over runtime auto-detection, including an ambient cmux marker
ok - fm_backend_validate: implemented adapters accepted, unknown and blocked codex-app backends refused loudly
ok - zsh: shell-portable backend matching skipped (zsh not found)
ok - bash: fm_backend_source recognizes known backends and rejects unknown ones
ok - fm_backend_validate_spawn: all implemented lifecycle backends are spawn-supported
ok - fm_meta_get / fm_backend_of_meta: read key=value, default backend to tmux
ok - fm_backend_resolve_selector: session:window literal, exact task id first, legacy fm-<id> label fallback, ad hoc bare name via tmux list-windows
ok - fm_backend_of_selector: exact task ids, legacy fm-<id> labels, and matching explicit targets inherit metadata backend
ok - fm-send.sh: explicit tmux targets are verified, while --key/plain/slash send command shape stays old-compatible
ok - fm-peek.sh: capture-pane invocation and output are byte-identical old vs new
ok - fm-spawn.sh: a project reached through a symlinked prefix (e.g. macOS /tmp -> /private/tmp) does not trip the isolation guard's false refusal
not ok - fm-teardown.sh: post-guard tmux+treehouse command log differs old vs new
--- /tmp/fm-backend-tests.8awYVe/teardown-old.log	2026-07-22 13:46:15.140545455 +0200
+++ /tmp/fm-backend-tests.8awYVe/teardown-new-postguard.log	2026-07-22 13:46:15.900566937 +0200
@@ -1,3 +1,2 @@
-treehouse�status
 treehouse�return�--force�/tmp/fm-backend-tests.8awYVe/teardown-wt
 tmux�kill-window�-t�firstmate:fm-teardownconform1
Evidence: Fixed test green in the CI-red shape (main==HEAD clone, exit 0, 28/28 ok)

ok - fm-teardown.sh: aside from the treehouse status guard probe, the treehouse return + tmux kill-window command log is byte-identical old vs new for a scout task

ok - fm_backend_name: FM_BACKEND env > config/backend > default tmux
ok - fm_backend_detect: no markers -> undetected, HERDR_ENV=1 -> herdr, $TMUX -> tmux, CMUX_WORKSPACE_ID -> cmux, nested combinations resolve innermost-first
ok - fm_backend_detect: falls back to __CFBundleIdentifier=com.cmuxterm.app when CMUX_WORKSPACE_ID is absent (signal bundle-id; foreign bundle ids rejected)
ok - fm_backend_detect: the cmux fallback signals are macOS-only (inert on a non-Darwin uname)
ok - fm_backend_detect: an inherited cmux bundle id never outranks $TMUX or HERDR_ENV (tmux/herdr-inside-cmux false positive absorbed)
ok - fm_backend_detect: ancestry fallback matches the lsappinfo-resolved (bundle-id) cmux app pid in the parent chain
ok - fm_backend_detect: ancestry fallback matches a bundle-shaped cmux comm path at any install location when lsappinfo cannot resolve a pid
ok - fm_backend_detect: ancestry fallback stops undetected at launchd (a reparented tmux server never reaches cmux)
ok - fm_backend_name: a fallback-detected cmux prints a NOTICE naming the fallback signal; the primary-marker notice is unchanged
ok - fm_backend_name: auto-detect selects herdr or cmux (loud notice) or tmux (silent, including nested tmux-in-herdr/tmux-in-cmux)
ok - fm_backend_name: an explicit FM_BACKEND or config/backend setting always wins over runtime auto-detection, including an ambient cmux marker
ok - fm_backend_validate: implemented adapters accepted, unknown and blocked codex-app backends refused loudly
ok - zsh: shell-portable backend matching skipped (zsh not found)
ok - bash: fm_backend_source recognizes known backends and rejects unknown ones
ok - fm_backend_validate_spawn: all implemented lifecycle backends are spawn-supported
ok - fm_meta_get / fm_backend_of_meta: read key=value, default backend to tmux
ok - fm_backend_resolve_selector: session:window literal, exact task id first, legacy fm-<id> label fallback, ad hoc bare name via tmux list-windows
ok - fm_backend_of_selector: exact task ids, legacy fm-<id> labels, and matching explicit targets inherit metadata backend
ok - fm-send.sh: explicit tmux targets are verified, while --key/plain/slash send command shape stays old-compatible
ok - fm-peek.sh: capture-pane invocation and output are byte-identical old vs new
ok - fm-spawn.sh: a project reached through a symlinked prefix (e.g. macOS /tmp -> /private/tmp) does not trip the isolation guard's false refusal
ok - fm-teardown.sh: aside from the treehouse status guard probe, the treehouse return + tmux kill-window command log is byte-identical old vs new for a scout task
ok - fm-spawn.sh --backend bogus is refused loudly
ok - fm-spawn.sh --backend codex-app is refused
ok - fm-spawn.sh honors FM_BACKEND and refuses an unimplemented value loudly
ok - fm-spawn.sh: an explicit --backend tmux resolves silently and writes no backend= (missing means tmux)
ok - fm-spawn.sh: explicit --backend tmux wins over an ambient HERDR_ENV=1 auto-detect marker
ok - fm-spawn.sh: auto-detect resolves nested tmux-in-herdr to tmux and stays silent end to end
Evidence: Fixed test green in the pre-guard baseline shape (this worktree, 28/28 ok)
ok - fm_backend_name: FM_BACKEND env > config/backend > default tmux
ok - fm_backend_detect: no markers -> undetected, HERDR_ENV=1 -> herdr, $TMUX -> tmux, CMUX_WORKSPACE_ID -> cmux, nested combinations resolve innermost-first
ok - fm_backend_detect: falls back to __CFBundleIdentifier=com.cmuxterm.app when CMUX_WORKSPACE_ID is absent (signal bundle-id; foreign bundle ids rejected)
ok - fm_backend_detect: the cmux fallback signals are macOS-only (inert on a non-Darwin uname)
ok - fm_backend_detect: an inherited cmux bundle id never outranks $TMUX or HERDR_ENV (tmux/herdr-inside-cmux false positive absorbed)
ok - fm_backend_detect: ancestry fallback matches the lsappinfo-resolved (bundle-id) cmux app pid in the parent chain
ok - fm_backend_detect: ancestry fallback matches a bundle-shaped cmux comm path at any install location when lsappinfo cannot resolve a pid
ok - fm_backend_detect: ancestry fallback stops undetected at launchd (a reparented tmux server never reaches cmux)
ok - fm_backend_name: a fallback-detected cmux prints a NOTICE naming the fallback signal; the primary-marker notice is unchanged
ok - fm_backend_name: auto-detect selects herdr or cmux (loud notice) or tmux (silent, including nested tmux-in-herdr/tmux-in-cmux)
ok - fm_backend_name: an explicit FM_BACKEND or config/backend setting always wins over runtime auto-detection, including an ambient cmux marker
ok - fm_backend_validate: implemented adapters accepted, unknown and blocked codex-app backends refused loudly
ok - zsh: shell-portable backend matching skipped (zsh not found)
ok - bash: fm_backend_source recognizes known backends and rejects unknown ones
ok - fm_backend_validate_spawn: all implemented lifecycle backends are spawn-supported
ok - fm_meta_get / fm_backend_of_meta: read key=value, default backend to tmux
ok - fm_backend_resolve_selector: session:window literal, exact task id first, legacy fm-<id> label fallback, ad hoc bare name via tmux list-windows
ok - fm_backend_of_selector: exact task ids, legacy fm-<id> labels, and matching explicit targets inherit metadata backend
ok - fm-send.sh: explicit tmux targets are verified, while --key/plain/slash send command shape stays old-compatible
ok - fm-peek.sh: capture-pane invocation and output are byte-identical old vs new
ok - fm-spawn.sh: a project reached through a symlinked prefix (e.g. macOS /tmp -> /private/tmp) does not trip the isolation guard's false refusal
ok - fm-teardown.sh: aside from the treehouse status guard probe, the treehouse return + tmux kill-window command log is byte-identical old vs new for a scout task
ok - fm-spawn.sh --backend bogus is refused loudly
ok - fm-spawn.sh --backend codex-app is refused
ok - fm-spawn.sh honors FM_BACKEND and refuses an unimplemented value loudly
ok - fm-spawn.sh: an explicit --backend tmux resolves silently and writes no backend= (missing means tmux)
ok - fm-spawn.sh: explicit --backend tmux wins over an ambient HERDR_ENV=1 auto-detect marker
ok - fm-spawn.sh: auto-detect resolves nested tmux-in-herdr to tmux and stays silent end to end

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

⏭️ **Rebase** - skipped
  • ⚠️ .agents/skills/afk/SKILL.md - branch carries 11 commit(s) that exist on your local main branch but were never pushed to origin/main; rebasing would bundle this unrelated work (97 file(s)) into the PR:
  • 35bdee8 Merge remote-tracking branch 'origin/main' into fork/main
  • cbc228d feat(spawn): enable claude native prompt suggestions for secondmates
  • 87b5e02 feat(update): rework self-update to the origin->fork->homes model
  • c61a5ac fork: fix WSL crewmate-spawn worktree race + regression test
  • 3b37c0a fork: integrate real dispatch holds (PR fix: make dispatch holds real across the fleet #606)
  • 3eb5ac0 fork: integrate /grill planning skill (PR feat(skills): add /grill planning front-end #607)
  • 8f06fd1 feat(skills): add /grill planning front-end
  • 6ba2d15 fix(snapshot): fail closed on holds, and handle hold-until
  • c1161fc no-mistakes(review): preserve commas in parsed hold reasons
  • 82988dc no-mistakes(review): surface holds in bearings gates and fix compat docs
  • 53cb7bb fix: make dispatch holds real across the fleet

Push main to origin, or rebase your branch onto origin/main, before gating.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • tests/fm-backend.test.sh in this worktree (pre-guard baseline shape, merge-base 4ab61fa) — all 28 tests green including the teardown conformance test
  • Built a CI-like clone at /tmp/fm-ci-shape-clone with main == HEAD (post-guard baseline, git merge-base --is-ancestor d85795d HEAD confirmed) to replicate the fork/main CI shape
  • Ran the pre-fix test file (git show 4f25d0b~1:tests/fm-backend.test.sh) in the main==HEAD clone — reproduced the exact CI failure: one-line -treehouse␟status diff in fm-teardown.sh: post-guard tmux+treehouse command log differs old vs new
  • Ran the fixed tests/fm-backend.test.sh in the same main==HEAD clone — exit 0, all 28 tests green including the teardown conformance test
  • grep assert_treehouse_worktree_owner bin/fm-teardown.sh — guard still invoked at line 1224 before treehouse return --force; test still asserts the status probe in the new log at tests/fm-backend.test.sh:953
  • Removed the temp clone and confirmed git status --porcelain clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

LuckyB-UF added 15 commits July 15, 2026 14:32
AGENTS.md section 10 has prescribed `tasks-axi hold <id> --kind captain` for
a captain-gated thread since holds were documented, but firstmate's own rules
and tooling never caught up, so a held item has been mishandled ever since:

- The standing queue rule and its three restatements said a queued item gets
  dispatched once its blocker is gone and its date gate has arrived, with no
  mention of holds. The tasks-axi path is saved by `tasks-axi ready`, which
  excludes held work, but the manual hand-edit path had nothing to save it.
- fm-teardown.sh's manual-backend reminder is what firstmate reads at the exact
  moment it re-scans Queued, and it was hold-blind for the same reason.
- fm-fleet-snapshot.sh stripped only repo/kind/priority/since/merged/reported/
  done, so a held item baked its hold markers into its title. Because the strip
  is anchored at end of line, the trailing hold paren also blocked the since and
  repo parens, and no held field was exposed at all. fm-fleet-view could not
  tell a held item from dispatchable work.
- Section 10's verb map had no hold/unhold entry and no hand-edit marker form.

`tasks-axi start` moves a held item anyway and carries its marker into In
flight, so the checks are stated where the reader acts rather than left to the
verb to refuse.

Also corrects the tasks-axi compatibility contract at its declared owner.
docs/configuration.md said the floor was 0.1.1 while, in the same sentence,
requiring the multi-ID `mv` probe introduced in 0.2.2. That probe is mandatory,
so the effective floor has always been 0.2.2. AGENTS.md and fm-tasks-axi-lib.sh
now point at the owner instead of restating a number that can drift, and
fm-bootstrap.sh's header drops the same stale claim. Probe behavior is
unchanged; the fail-closed version-parse precondition is now documented rather
than dropped.

Snapshot behavior is covered by a test that fails without the parser fix.
Three defects in the hold parsing, two of them introduced by this branch's
own earlier rounds.

The dedicated comma-preserving hold_reason capture only matched the paren
form, so a hand-written comma-form hold parsed as held: false and rendered a
Gate of "-", i.e. dispatchable. That is the one direction this must never
fail, and it regressed a case that worked earlier on the branch. Hold
detection is now separate from reason extraction and keys on the hold: key in
either form, so an unreadable reason can no longer downgrade an item to
dispatchable. The reason still prefers the paren form, which carries commas
verbatim because tasks-axi forbids ")" in --reason; the comma form is
hand-written only and inherently ambiguous for free text, so it truncates at
the first comma rather than guessing.

tasks-axi hold also accepts --until, whose (hold-until: DATE) marker was
unhandled: because the metadata strip is end-anchored, an unstripped trailing
marker also stranded the earlier repo and since parens in the title.

Known gap, deliberately not fixed here: --until means "inactive on and after
that date", but an expired hold is still reported held. That fails closed, so
it over-reports rather than dispatching held work.
Adds the idea-sharpening step missing between a fuzzy request and a crewmate
brief. /grill interviews the captain one question at a time and writes a short
spec to data/spec-<project>-<slug>.md: problem, solution shape, vocabulary,
scope boundary, open questions, constraints.

It is a planning front-end and nothing more. It creates no branch, dispatches
nothing, and writes only its spec file under data/. The spec feeds the existing
brief and dispatch path rather than becoming a parallel record of work, so the
backlog stays the only tracker.

Deliberately small: a skill file, a conversation, and a doc in data/, the same
shape /bearings and /stow already use. It files no backlog item and needs no
new state, because the sharpen-then-decompose path is meant to run inside one
context window.

The spec filename carries the project because two projects can easily want the
same slug, and an unnamespaced spec would silently overwrite another project's,
unrecoverably, since data/ is gitignored.

The trigger offers rather than auto-starts: an interview nobody asked for is
the main way this would become annoying, so it loads on an explicit invocation
and otherwise proposes in one line. It also names when it must NOT fire -
already-sharp requests, bugs, scout questions, trivial changes.

The interview stays with firstmate. Prime directive 4 makes firstmate the
captain's only point of contact, so grilling never routes to a secondmate even
when one's scope covers the work; the resulting work routes normally.

AGENTS.md section 7 gains the optional sharpening path before dispatch.
This fleet runs a customized fork, so advancing a home straight from
origin would strip the fleet's private adaptations. Upstream now enters
only by being merged into fork/main, and homes advance from the fork.

bin/fm-update.sh:
- Ingest upstream first: merge origin/<default> into fork/<default> and
  push it to the fork. The merge is built with merge-tree/commit-tree
  plumbing rather than a checkout, so no working tree is touched and a
  conflicting upstream can never leave a home stranded mid-merge.
- A conflicting ingest STOPS the run: it names each conflicted path,
  pushes nothing, advances nothing, and exits 1. Never forced.
- Advance every home (main home's branch + live secondmate homes) to
  fork/<default> instead of origin/<default>.
- Secondmate discovery, the reread nudge, the projects/ boundary, and
  fast-forward-only safety for the advances are unchanged.

bin/fm-ff-lib.sh:
- Add the "fork" base mode alongside "origin" and <commit-ish>. The
  remote base modes are now named after the remote they track, so one
  case arm serves both and the contract is stated once.
- A target without a fork remote is skipped, never advanced from origin
  as a fallback.
- Generalize fetch_once to take a remote, deduping per (object store,
  remote) so worktrees still share a single fetch.

Docs (AGENTS.md section 12, the updatefirstmate skill, README,
docs/architecture.md, docs/scripts.md) describe the two-hop model and
carry the conflict-stop as a captain-facing decision.

tests/fm-update.test.sh: the fixture is now a real fork world (origin,
fork carrying a private adaptation, and a home tracking the fork).
Covers the ingest, the fork-based advance with adaptations intact, the
conflict stop, fork-history preservation, and the no-fork-remote skip.
Secondmate sessions launch with Claude Code's native predicted-next-prompt
suggestion enabled, so the operator sees the soft-text next-prompt hint in a
secondmate window exactly as in their own session. Ship/scout crewmates keep it
disabled: an autonomous worker has no reader to help, so the ghost text is pure
classifier risk. Safety for the enabled path rests on the existing fleet-wide
fm_composer_strip_ghost extractor, which every secondmate-reachable composer read
already routes through.

Refuse --secondmate on the plain-screen backends (orca, cmux, zellij) that cannot
strip ghost styling, collapsing the three refusals into one guard, so no secondmate
can land on a backend without the extractor. Docs and tests updated.
Fork ingest: resolved 8 conflicts (AGENTS.md, ci.yml, fm-bootstrap.sh,
fm-bearings-snapshot.sh, fm-fleet-snapshot.sh, bearings/SKILL.md,
configuration.md, zellij-backend.md). Preserved fork adaptations
(dispatch holds, /grill, origin->fork->homes self-update, secondmate
native prompt suggestions + zellij secondmate refusal) while adopting
upstream's instruction-ownership compression and #593/#640 changes.
See data/fm-fork-ingest-r3/report.md for per-file rationale.
…nded (#1)

* fix(teardown): refuse when a task's worktree slot was re-handed after an outage

fm-teardown.sh read worktree= straight from a task's meta and then killed the
recorded processes and returned that worktree to treehouse. That pointer goes
stale after an outage: treehouse frees a dead task's interactive pool slot and
re-hands it to a NEW task, but the dead task's meta still records the old slot
path, so tearing the dead task down would kill and return the live new owner's
worktree.

Add assert_treehouse_worktree_owner, layered before every destructive action.
Using treehouse's own status, it refuses on positive evidence that the recorded
slot was re-handed: the slot is now leased to a different holder, or it is
in-use by a live process while this task's own backend endpoint is gone. It
names the recorded path, this task id, and the current owner. The guard is
scoped to interactive treehouse worktrees; Orca, secondmate homes (leased
durably, so immune), and paths treehouse does not list pass through unchanged,
and it refuses only on positive foreign-owner evidence so it never breaks a
legitimate teardown.

The guard is intentionally not bypassed by --force: --force authorizes
discarding this task's own unlanded work, never destroying a different task's
live worktree.

Add regression cases covering a slot re-leased to another task, a slot in-use
by a live owner after this task's session is gone, --force not bypassing the
guard, and a still-owned slot proceeding as before.

* no-mistakes(review): fail closed on unrecognized treehouse slot states in teardown guard

* no-mistakes(review): align teardown treehouse guard docs and pin status contract

* test(fm-backend): expect teardown's treehouse status guard in conformance log

The reboot-hazard guard (assert_treehouse_worktree_owner) reads treehouse
status once before any destructive action, so the old-vs-new command-log
conformance check saw one extra leading status probe and failed. Filter that
single intended probe line out of the new log, still require the destructive
treehouse return --force + tmux kill-window sequence to be byte-identical old
vs new, and positively assert the guard ran.

* no-mistakes(review): harden teardown treehouse guard: confident liveness, exact lease, spaced paths

* no-mistakes(review): split treehouse guard state vs liveness so zellij/cmux teardowns proceed

* no-mistakes(document): document teardown re-handed treehouse slot guard in architecture and zellij docs
…r, bearings trigger, five-sweeps delegation, check.sh contract, orca date) (#2)

* docs(conformance): close firstmate-coding-guidelines drift findings

Apply the recommended low-cost subset from the fm-cg-review-r1 self-review,
all within firstmate's own shared tracked material:

- Add the missing bearings skill load trigger in section 9 (trigger hygiene).
- Trim the state/<id>.meta field enumeration to a pointer at
  bin/fm-spawn.sh --help and docs/configuration.md (kills schema drift).
- Delegate the mutating-sweeps roster to bin/fm-session-start.sh while
  keeping the lock-gated safety invariant inline (one-owner rule).
- Move the custom check.sh authoring contract into fm-check-register.sh's
  header and --help, leaving only the trigger and bind-before-run invariant
  inline; reduce the secondmate-liveness narrative to its invariant.
- Add the derived smoke-run date (2026-07-03) to docs/orca-backend.md.
- Reflow .agents/skills/afk/SKILL.md to one sentence per line (wording
  unchanged, line breaks only).

Relocations and restyles only; no contract meaning changed. fm-lint.sh clean.

* no-mistakes(review): document state meta fields in fm-spawn header and help

* no-mistakes(document): sync docs with fork-update and zellij secondmate-refusal changes
…o ship briefs (#3)

Complete the Matt Pocock planning-pipeline adoption (back half of the
grill -> spec -> decompose flow).

/decompose: new captain-invocable, internal skill that turns a grill spec
at data/spec-<project>-<slug>.md into dependency-ordered, independently
shippable vertical-slice backlog items via tasks-axi, wiring blocked-by
edges between slices (add upstream-first, since --blocked-by requires the
blocker to exist). Plans only: no branch, dispatch, or code, matching
/grill. Owns the decomposition procedure and defers backlog syntax to
section 10.

Ship-brief contract: fold the tdd seam-agreement discipline (agree the
test seam first, named anti-patterns) into fm-brief.sh's ship scaffold so
every ship brief carries it; not a standalone skill, per the plan. Scout
and secondmate briefs stay unaffected.

Wiring: AGENTS.md section 7 intake gains the optional grill -> decompose
path before dispatch; README lists /decompose beside /grill.

Colocated fm-brief tests assert the test-discipline section renders in all
three ship modes and is absent from scout and secondmate briefs.
…conformance

The fm-teardown old-vs-new conformance test filtered the treehouse status
re-handed-slot guard probe out of only the NEW command log, assuming
BASE_REF (merge-base with main) always pre-dates the guard commit.
Once the guard landed on main, the old teardown emits the same probe and
the one-sided filter misreports it as a one-line regression, turning the
Behavior tests job red on every subsequent main build.

Filter the non-destructive probe from both logs symmetrically. Slot-occupancy
safety stays proven: the assert_contains directly above still requires the
new teardown to run the treehouse status guard before any destructive action,
and bin/fm-teardown.sh still calls assert_treehouse_worktree_owner before
treehouse return --force.
@LuckyB-UF LuckyB-UF closed this Jul 22, 2026
@LuckyB-UF

Copy link
Copy Markdown
Author

Mis-targeted: this fork branch PR defaulted to the upstream base and bundled fork-only commits. Retargeted as https://github.com/LuckyB-UF/firstmate/pull/6 against LuckyB-UF:main.

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