Skip to content

feat(bin): merge upstream Firstmate main 3d14792a into house - #96

Merged
jazz127 merged 19 commits into
housefrom
fm/firstmate-house-upstream-merge-r6
Sep 28, 2026
Merged

jazz127 merged 19 commits into
housefrom
fm/firstmate-house-upstream-merge-r6

Conversation

@jazz127

@jazz127 jazz127 commented Sep 28, 2026 •

Copy link
Copy Markdown
Owner

Intent

ok, lots of updates to firstmate upstream, youre going to have to check it out and see what we do in terms of clean/unclean merges

Context for reading that ask. Upstream Firstmate main (kunchenguid/firstmate) is at 3d14792, 15 commits past the fork's house (jazz127/firstmate, at 7725545 after PR 91). A trial merge (git merge-tree of upstream/main into origin/house, 2026-09-28) conflicts in 18 files. The conflicts cluster around these upstream PRs: kunchenguid#5808 "silence routine no-change supervision outcomes" (the branch outcome/report/prompt scripts, the Pi branch extension, and the supervision docs, overlapping house's own routine-outcome and bookkeeping silence features); kunchenguid#5889 "reduce remote worker and polling helper process churn" (herdr backend, branch outcome, contributions, overlapping house's remote-worker identity features); kunchenguid#5900 "prevent contribution poll starvation on slow GitHub reads" (contributions and timeout-lib tests, overlapping house's automated-reviewer intake); kunchenguid#5877 "chain repository hooks under git -c overrides" and kunchenguid#5859 "config/keep-ai-trailers opt-out" (AI trailer stripping); kunchenguid#5884 "grant Claude workers access to Firstmate task channels" (spawn); kunchenguid#5876 Herdr composer full-viewport reads; kunchenguid#5879 second-mate signal wake routing; plus docs/configuration.md touched by most of them. The other upstream commits (kunchenguid#5903 guard framework, kunchenguid#5744, kunchenguid#5882, kunchenguid#4819, kunchenguid#5886, kunchenguid#5917, kunchenguid#5928) appear to merge cleanly.
Standing guidance on tests for these merges: "i think we need to start not caring about the tests as much before the merge completes and just let a test suit run agter and follow up or somethjng. its way tok long for the whole suite"
As before, say in the PR body, for each house feature touched by a conflict, whether the upstream change now covers it (with evidence), or that it does not.

What Changed

House features touched by conflicts, and whether upstream now covers them

House feature Conflict Upstream covers it? Resolution
Bookkeeping-only silence (fork PR 1) branch outcome/report/prompt, Pi extension, supervision docs and tests Partly. kunchenguid#5808 now allows silent on any task's routine outcome (the old fleet-only restriction is gone in bin/fm-branch-outcome.sh and .pi/extensions/fm-branch-supervision.ts) and keeps silent rows out of captain-return relays (bin/fm-branch-report.sh, bin/fm-supervision-host.sh, bin/fm-afk-return.sh). Its eligibility is only "worker still busy, nothing new, no action taken", and upstream's test requires a silent task outcome to update the status-coverage index. Upstream kunchenguid#5808 adopted fully, so one silence rule applies everywhere. Dropped house behavior: (a) a silent outcome no longer stays out of the task's status-coverage index; (b) the house bookkeeping-silent cases are removed: the echo of a pause or status record the branch just wrote or steered, a scheduled recheck of an already-registered pause, and a re-confirmation of a declared pause or open captain hold. Keeping (b) together with upstream's index write would let a silent recheck mark a lost captain-facing status as handled.
Routine-outcome silence (fork PR 4) same files No. Upstream still renders every non-silent routine note (display: !row.silent). House kept: every routine note is delivered hidden (display: false), the historical-message renderer still hides old routine notes, and the prompt and docs say routine outcomes are hidden regardless of silent. Upstream's sentence "stays rendered" becomes "is never silent", and the prompt assertion in tests/fm-branch-supervision.test.sh follows.
Report wake row and receipt lock (fork PR 41 features) bin/fm-branch-report.sh, docs/supervision-host.md, tests/fm-supervision-host.test.sh No. House kept (--row, receipt lock held across check/append/write). Upstream's silent early exit now runs after the lock is released. Upstream's host test stub and its silent-after-return test now report once per wake row, and the large-turn fixture numbers its bulk rows after the real reports.
Second-mate restart reads Pi's empty composer (fork PR 46) bin/backends/herdr.sh composer state and content No. kunchenguid#5876 changes the capture to the full visible viewport but carries no Pi capability flags. Upstream's viewport capture taken, with the house Pi compact/prompt capability lines added to it.
Upstream prior-art push guard (fork PR 44) bin/fm-spawn.sh, bin/fm-git-strip-ai-trailers.sh and its test No. kunchenguid#5877 and kunchenguid#5859 change the hook chaining and add the config/keep-ai-trailers opt-out, but have no push guard. Both kept: the installer still accepts the guard, and spawn installs it for shipping tasks whenever stripping is enabled. Gap: a home that sets config/keep-ai-trailers installs no pane hooks at all (upstream kunchenguid#5859), so its shipping workers also skip the prior-art push guard. This home does not set the flag.
Codex seats bound to dock-local credential homes (fork PR 43) bin/fm-spawn.sh launch prefix No. Seat block kept after upstream's conditional hooks export.
Automated reviewer intake (fork PR 2) bin/fm-contributions.sh, tests/fm-contributions.test.sh No. kunchenguid#5900 adds the budget cap under the watcher check timeout. Both kept.
Closed-row ownership for landed contributions (fork PR 39) tests/fm-contributions.test.sh runner list No. Test kept in the merged list.
Bash 3.2 timed-executor fix (fork PR 65) tests/fm-timeout-lib.test.sh No. Upstream bin/fm-timeout-lib.sh still reads $BASHPID directly. House test kept beside upstream's two new tests.
Remote worker files (fork PR 34 line) tests/fm-extension-binding.test.sh remote file list No. Both lists merged (fm-path-lib.sh from upstream, fm-task-inbox-lib.sh and fm-backend.sh from house).

Other house behavior checked beside the conflicts:

Known follow-ups

  • Silent routine outcomes now follow upstream fix: silence routine no-change supervision outcomes kunchenguid/firstmate#5808 only: they count toward the task's status-coverage index, and the house bookkeeping-silent cases (pause echo, registered-pause recheck, hold re-confirmation) are dropped. Those outcomes are still hidden from captain chat as routine notes; they are just no longer marked silent.
  • A home that sets config/keep-ai-trailers installs no pane hooks, so its shipping workers skip the prior-art push guard (upstream does not cover this house feature). Second mates inherit the flag, so theirs do too. Accepted for now because this home does not set the flag; docs/configuration.md "Commit attribution" now says so. Keeping the guard would need a guard-only hook install mode, which is new behavior.
  • tests/fm-contributions.test.sh failed on plain house 79ef0f4 as well (house's published-file check against the test's fake GitHub, which had no pull-request files route); not a merge regression. The pipeline's test step added that route to the fixture, so the file now passes on this branch.
  • The pipeline's test step changed bin/fm-composer-lib.sh ghost-text stripping (see What Changed); upstream fix(bin): capture the full viewport for Herdr composer reads so a slash-command popup cannot hide the composer kunchenguid/firstmate#5876's /exit-behind-popup case failed on this Claude Code/Herdr version pair on upstream main alone too. Worth reviewing as a behavior change beyond the merge itself.

Risk Assessment

⚠️ Medium: the conflict resolutions keep both sides except where recorded above. The two silence findings were resolved by adopting upstream kunchenguid#5808's single silence rule, and the keep-ai-trailers push-guard gap is documented and accepted as a follow-up.

Testing

In round 2 the live Herdr check failed at the /exit-behind-popup step, on this merge and on pure upstream alike. I re-drove it with the real Claude CLI in a disposable fm-lab Herdr session. All three steps passed: a landed idle steer reads empty, a payload carrying the U+2063 away-supervisor mark is submitted, and a typed /exit behind the command popup is recognised as typed text, submitted, and Claude exits. The composer-lib test file also passes, including the new case built from the live capture and the existing cases for grok's placeholder and muse's prompt glyph. Those are unit tests only; live grok and muse panes were not launched, so that scenario is marked untested. I did not re-drive the other round-2 scenarios (silent outcomes, AI-trailer hook chaining, contributions, lab-home tmux) this round, because this round's only change is to the composer ghost-text stripper. Their round-2 evidence files are still in the evidence directory. There is no rendered UI change here, so the CLI test transcripts are the evidence.

  • Live validation: ✅ go - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Herdr composer read: a typed /exit behind Claude's slash-command popup is proven, submitted, and Claude exits (kunchenguid#5876) ✅ pass live herdr-submit-confirm-live-e2e-round3.log (third ok line)
Herdr composer read: a landed idle steer to real Claude reads empty and the reply renders ✅ pass live herdr-submit-confirm-live-e2e-round3.log (first ok line)
Herdr submit: a payload carrying the U+2063 away-supervisor mark is submitted even though the mark is missing when the composer is read back ✅ pass live herdr-submit-confirm-live-e2e-round3.log (second ok line)
Guard against over-correcting: muted dark placeholder text (grok) is still stripped as ghost text, and muse's ⟩ glyph still reads as an empty composer ⏸️ untested no The earlier payload did not show a live result for this scenario. It was only checked by unit tests (composer-lib-round3.log) against byte captures from earlier live panes. Live grok and muse panes we…
Evidence: Live Herdr submit-confirm e2e (round 3, passing)

Source: Live Herdr submit-confirm e2e (round 3, passing)

ok - live Herdr submit confirm: Claude Code (2.1.283 (Claude Code)) on herdr 0.9.1 reports empty and renders the requested reply in isolated session fm-lab-herdr-submit-con-61540-23068 ok - ... submits a U+2063 away-supervisor payload whose read-back drops the mark ok - ... proves and submits a typed /exit behind its command popup

ok - live Herdr submit confirm: Claude Code (2.1.283 (Claude Code)) on herdr 0.9.1 reports empty and renders the requested reply in isolated session fm-lab-herdr-submit-con-61540-23068
ok - live Herdr submit confirm: Claude Code (2.1.283 (Claude Code)) on herdr 0.9.1 submits a U+2063 away-supervisor payload whose read-back drops the mark
ok - live Herdr submit confirm: Claude Code (2.1.283 (Claude Code)) on herdr 0.9.1 proves and submits a typed /exit behind its command popup
Evidence: Composer lib targeted tests (round 3)

Source: Composer lib targeted tests (round 3)

ok - fm_composer_classify_content: a bare shell prompt glyph (>/$/%/#) reads unknown, never empty
ok - fm_composer_classify_content: stripped unbordered content is unknown except verified agent glyphs
ok - fm_composer_classify_content: a bare shell prompt carrying a command is not empty
ok - fm_composer_classify_content: a bare prompt glyph inside a bordered composer box reads empty (claude's own idle composer)
ok - fm_composer_classify_content: agent prompt glyphs (❯ claude, › codex, ⟩ muse) read empty bordered or bare
ok - fm_composer_classify_content: an empty composer reads empty
ok - fm_composer_classify_content: idle matching is limited to proven placeholder positions
ok - fm_composer_classify_content: idle matching preserves the caller's case mode
ok - fm_composer_classify_content: real unsubmitted text reads pending (including a popup argument-hint fill)
ok - matrix: claude's ❯+NBSP row reads empty on every profile in both locales (#1988)
ok - matrix: claude's arrow statusline is footer furniture, not a composer holding text
ok - fm_composer_classify_screen: footer demotion needs a contiguous, glyph-proven pair
ok - fm_composer_classify_screen: the footer zone holds for boxes, not only separator pairs
ok - fm_composer_classify_screen: the footer zone only ever refuses, never allows
ok - matrix: codex's dim hint is empty when styling proves it, unknown (never pending) when it cannot
ok - matrix: muse's ⟩ reads empty everywhere and survives losing the styled-glyph signal
ok - fm_composer_strip_ghost: saturated dark truecolor is typed input, muted dark truecolor stays ghost
ok - matrix: cursor's reverse-video placeholder remnant reads empty; real typed text stays pending
ok - matrix: herdr half-block rules bound a bare composer's wrap region
ok - matrix: omp's status row bounds the bare composer's wrap region
ok - matrix: codex 0.154's starfield rows are furniture; typed, mixed, and unanchored rows keep their verdicts
ok - matrix: pi's separated composer needs identity + structure; the blank row alone never proves it
ok - matrix: a dollar-first pi status footer reads empty; dead shells still refuse
ok - matrix: pi's cost-first footer is furniture only as a complete tuple in its footer position under an idle pi
ok - strict posture: a zero-height separator pair is never positive container proof
ok - matrix: pi's compact layout is opt-in per call, needs its cursor cell and idle identity, and extracts in any order
ok - matrix: pi's own first-row prompt glyph is the empty composer; only the pair is input
ok - matrix: only pi's '>' is first-row furniture; $, %, and # stay typed input
ok - matrix: pi extraction and classification agree on the pair in any call order
ok - matrix: pi's first-row '>' is furniture only when this call opts in
ok - matrix: opencode's left-bar composer reads empty everywhere and scans the full active run
ok - matrix: grok's real oversized titled bottom is empty while typed and unproved panes stay safe
ok - matrix: kimi's bordered shell-glyph box reads empty through the shared owner (spawn's fourth copy retired)
ok - matrix: the real claude-in-zellij --ansi dump reads empty in both locales
ok - strict posture: blank and unidentified rows are unknown, never injectable empty
ok - fm_composer_classify_screen: the bare composer's wrap region stays identified; structure breaks it
ok - fm_composer_classify_screen: a row-leading agent glyph reanchors the live composer
ok - fm_composer_classify_screen: a lower dead shell invalidates only cursorless stale composers
ok - fm_composer_classify_screen: cursorless bare wrap regions participate in verdicts
ok - fm_composer_classify_screen: cursorless containers reject only contiguous unclaimed activity
ok - fm_composer_classify_screen: the bottom-most candidate wins; stale banners cannot
ok - fm_composer_classify_screen: incomplete lower structure invalidates stale boxes
ok - fm_composer_classify_screen: titled bottoms retain full box geometry
ok - fm_composer_classify_screen: a proven box tolerates a bottom-border cursor
ok - fm_composer_extract_selected_content: scopes user content and excludes furniture
ok - fm_composer_queued_enter_verdict: pending + busy returns empty (queued Enter)
ok - fm_composer_queued_enter_verdict: pending + idle/unknown stays pending
ok - fm_composer_queued_enter_verdict: only proven pending is converted
- Outcome: 🔧 1 issue found → auto-fixed (2) ✅ across 3 runs (46m34s)

Worker-side checks

Before the pipeline ran, the worker ran synthetic/offline local test runs of the covering test files on the pre-fix merge commit 68266ba and compared failures against git archive exports of origin/house and upstream main; results are in the evidence artifact below. The full suite was not run, per the standing guidance.

evidence-artifact: /tmp/fm-firstmate-house-upstream-merge-r6/tests/evidence-summary.txt
evidence-command: bash tests/.test.sh for each listed test, on the merge commit and on git archive exports of origin/house and upstream/main
evidence-captured: 2026-09-27T23:30:38Z

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ bin/fm-spawn.sh:4901 - The merge nests house's upstream prior-art push guard inside upstream feat(bin): add config/keep-ai-trailers opt-out to keep AI co-author trailers kunchenguid/firstmate#5859's if [ "$KEEP_AI_TRAILERS" = 0 ] block. The guard's only install path is the strip-hook install ... <guard> pre-push wrapper, and the pane's core.hooksPath export at bin/fm-spawn.sh:5280 is gated the same way. So on a home with config/keep-ai-trailers, a ship task in a non-local-only mode gets no fm-upstream-push-guard.sh, and a push to a non-origin GitHub repo skips the prior-art receipt check (bin/fm-upstream-push-guard.sh). The updated comment at bin/fm-spawn.sh:4898 records this, but docs/configuration.md:1034 describes the flag as affecting only attribution and trailers. The inherited-config rule (bin/fm-config-inherit-lib.sh:82) carries the flag into secondmate homes, so their ship tasks lose the guard too. The fix needs a guard-only hook install mode (new behaviour), not only a correction, so a human needs to decide whether the guard should stay on when trailers are kept. For the PR body's per-feature accounting: upstream does not cover this house feature.
  • ⚠️ bin/fm-branch-outcome.sh:487 - The resolution drops house's rule that a silent outcome never updates the task's status-coverage index. The append at bin/fm-branch-outcome.sh:487 now writes the index for silent rows, and the rebuild at :278 no longer filters .silent != true. The house test that checked this (test_silent_bookkeeping_outcomes_stay_out_of_replay_and_coverage) was cut down, and upstream's opposite assertion now applies (tests/fm-branch-supervision.test.sh:158). Upstream fix: silence routine no-change supervision outcomes kunchenguid/firstmate#5808 only allows silent for a still-busy, no-change worker. House's merged prompt also allows it for pause echoes, rechecks of a registered pause, and re-confirmations of an open captain hold (bin/fm-branch-prompt.sh:98-101). Concrete sequence: task-p is on a captain hold; the worker writes a new captain-facing status (for example blocked: needs credential) whose wake is lost; the branch then handles a scheduled pause recheck and reports --silent true. The append records the current status endpoint, so fm-wake-drain.sh:365-367 treats the unseen blocked status as covered and the lost-wake backstop never re-delivers it. This is exactly the hazard house's removed comment guarded against. The merge commit calls this an adopted upstream requirement, so a human needs to confirm it. Options: keep upstream's index semantics and narrow house's bookkeeping-silent eligibility, or keep upstream's index write only for no-change silent rows. For the PR body: upstream does not cover this house invariant; it reverses it.
  • ⚠️ bin/fm-branch-prompt.sh:81 - The merged branch prompt now gives contradictory silence rules. Upstream's line 81 says to set silent true for a task-level routine outcome 'only when it says the worker is still busy, nothing new has happened since the last outcome, and no action was taken'. House's 'Silent outcomes' section (lines 96-103) tells the branch to set silent for 'the echo of a pause or status record you yourself just wrote', which is an action on a task that is not 'still busy'. Step 4 (line 54) joins the two with 'or', and the same union appears in docs/supervision-protocols/pi.md:25, .pi/extensions/fm-branch-supervision.ts:1182 and docs/configuration.md:218. This generated prompt is what the model follows, so pause echoes will be reported inconsistently: sometimes silent, sometimes not. Which case you pick also decides whether the coverage-index hazard above is reachable. The author needs to decide which rule wins and reword line 81, or the Silent outcomes section, to match.

🔧 Fix applied.
1 warning still open:

  • ⚠️ bin/fm-spawn.sh:4901 - The merge nests house's upstream prior-art push guard inside upstream feat(bin): add config/keep-ai-trailers opt-out to keep AI co-author trailers kunchenguid/firstmate#5859's if [ "$KEEP_AI_TRAILERS" = 0 ] block. The guard's only install path is the strip-hook install ... <guard> pre-push wrapper, and the pane's core.hooksPath export at bin/fm-spawn.sh:5280 is gated the same way. So on a home with config/keep-ai-trailers, a ship task in a non-local-only mode gets no fm-upstream-push-guard.sh, and a push to a non-origin GitHub repo skips the prior-art receipt check (bin/fm-upstream-push-guard.sh). The updated comment at bin/fm-spawn.sh:4898 records this, but docs/configuration.md:1034 describes the flag as affecting only attribution and trailers. The inherited-config rule (bin/fm-config-inherit-lib.sh:82) carries the flag into secondmate homes, so their ship tasks lose the guard too. The fix needs a guard-only hook install mode (new behaviour), not only a correction, so a human needs to decide whether the guard should stay on when trailers are kept. For the PR body's per-feature accounting: upstream does not cover this house feature.
🔧 **Test** - 1 issue found → auto-fixed (2) ✅
  • ⚠️ tests/fm-contributions.test.sh:137 - tests/fm-contributions.test.sh failed 14 cases ('could not register the owned delivery'). It fails the same 14 on base house 79ef0f4, so this merge did not cause it. The test's fake gh had no route for pulls/N/files, which house's published-scratch guard (fm_pr_refuse_published_scratch in bin/fm-pr-lib.sh) calls during fm-pr-check registration. I added a pulls/*/files?* route that returns no files, and the whole file now passes.
  • Round 1 result (superseded by round 3 below; synthetic runs of our own scripts except where noted): go.
Scenario Result Live Evidence
Branch prompt generator emits a single upstream kunchenguid#5808 silence rule (still busy, nothing new, no action) with no house bookkeeping-silent cases ✅ pass synthetic branch-prompt.txt: no 'Silent outcomes' section, no 'bookkeeping'; step 4 says only 'routine no-change outcome'
Recording a silent routine outcome for a live task writes the status-coverage index (upstream semantics), and a silent captain outcome is refused ✅ pass synthetic branch-outcome-silent.log: .task-p.branch-outcome-index written; captain+silent refused with 'error: silent outcomes must have the routine verdict' rc=2
Committing inside a fleet pane strips AI co-author trailers, keeps human trailers, and still runs the project's own commit-msg hook, including under git -c core.hooksPath (kunchenguid#5877) ✅ pass synthetic strip-hooks-chain.log: Claude/Cursor trailers removed, Alice trailer kept, 'PROJECT commit-msg hook ran' on both commit paths
Pre-push through pane hooks runs the prior-art guard and then the project pre-push; a guard refusal blocks the push ✅ pass synthetic strip-hooks-chain.log: guard pass leads to the project pre-push running and rc=0; guard refusal gives 'guard: refused' and rc=1
With config/keep-ai-trailers, spawn omits Claude attribution-off settings and pane hooks, and secondmate homes inherit the flag ⏸️ untested no The prior run did not establish a live result: a real worker spawn needs a live harness launch in a lab fleet, which was not driven. Only tests/fm-spawn-dispatch-profile.test.sh ran, and it uses a stu…
Lab home creates a short private tmux socket dir under a deep TMPDIR and teardown removes it (kunchenguid#5886) ✅ pass synthetic lab-home-tmux.log: /tmp/fml.* (15 chars), mode drwx------, session started, dir removed on teardown
Contribution polling, Herdr backend, remote-job, timeout-lib and Pi branch extension behaviour after conflict resolution (kunchenguid#5900, kunchenguid#5889, kunchenguid#5876, kunchenguid#5808) ⏸️ untested no The prior run did not establish a live result: this was covered only by script-level tests with a stubbed forge and Herdr (targeted-tests.log, contributions-after-fix.log), not a live Herdr lab sessio…
  • bin/fm-branch-prompt.sh in a throwaway FM_HOME: checked that the emitted prompt has no 'Silent outcomes' section and no bookkeeping silence cases
  • bin/fm-branch-outcome.sh append in a throwaway FM_HOME: a silent routine row writes the status-coverage index, --verdict captain --silent true is refused with rc=2, and unread output checked
  • bin/fm-git-strip-ai-trailers.sh install <hooks> <repo> <guard> in a throwaway repo with .husky hooks: commits made through the pane GIT_CONFIG env and through git -c core.hooksPath; pushes made with the guard passing and with it refusing
  • bin/fm-lab-home.sh create/tmux-dir/teardown with a tmux server started on the lab socket and then killed
  • bin/fm-test-run.sh tests/fm-branch-supervision.test.sh tests/fm-pi-branch-extension.test.sh tests/fm-git-strip-ai-trailers.test.sh tests/fm-contributions.test.sh tests/fm-timeout-lib.test.sh tests/fm-backend-herdr.test.sh tests/fm-spawn-dispatch-profile.test.sh tests/fm-remote-job.test.sh
  • bash tests/fm-contributions.test.sh on a git-archive copy of base 79ef0f4e, which fails the same 14 cases, so the failure predates this merge
  • bash tests/fm-contributions.test.sh after adding the fixture's pulls/*/files route: rc=0

🔧 Fix applied.
2 issues (1 error, 1 warning) still open:

Scenario Result Live Evidence
A worker commit through the pane hooks drops AI co-author trailers, keeps human ones, and still runs the repo's own pre-commit hook, under both the pane GIT_CONFIG override and git -c core.hooksPath (… ✅ pass synthetic trailer-strip-hook-chain.txt: Claude and Cursor trailers stripped, Jane Human kept, REPO-PRE-COMMIT-RAN on both commit paths
A push under git -c core.hooksPath runs the prior-art guard and then the repo's pre-push; when the guard refuses, the push is blocked ✅ pass synthetic trailer-strip-hook-chain.txt: GUARD-RAN then REPO-PRE-PUSH-RAN, push-exit=0; with GUARD_EXIT=1, refused-push-exit=1
The emitted branch prompt has one upstream silence rule (still busy, nothing new, no action), with no house bookkeeping-silent cases, and routine outcomes stay hidden from captain chat ✅ pass synthetic branch-prompt-emitted.txt (byte-identical across runs; bookkeeping phrases absent; line 31 hides routine outcomes regardless of silent)
A silent routine outcome is stored and updates the task's status-coverage index (upstream semantics), and a silent outcome with verdict captain is refused ✅ pass synthetic branch-outcome-silent-index.txt: index written at statusEndpoint 16 after the silent row; the captain+silent append exits 2 with 'silent outcomes must have the routine verdict'
Claude spawns grant the task-channel dirs via --add-dir; keep-ai-trailers omits attribution settings and pane hooks and is inherited by secondmates ⏸️ untested no The prior payload did not establish a live result. This was only checked by running the real fm-spawn.sh against fixture tmux/Claude launchers (tests/fm-spawn-dispatch-profile, tests/fm-secondmate-har…
Contribution polling survives slow GitHub reads and house reviewer intake still registers (kunchenguid#5900 + house) ⏸️ untested no The prior payload did not establish a live result. This was only checked with the test's fake gh (tests/fm-contributions passed). Driving it live needs real GitHub PR API responses, which would mean m…
Herdr composer read: a typed /exit behind Claude's slash-command popup is proven and submitted (kunchenguid#5876) ❌ fail live herdr-submit-confirm-live-e2e.log: first two checks ok, '/exit ... judged unsent and cleared instead of submitted'; the upstream-3d14792a baseline log shows the same failure
Herdr backend, watch arm, remote-job and timeout-lib behaviour after the process-churn merge (kunchenguid#5889, kunchenguid#5917) ⏸️ untested no The prior payload did not establish a live result. This was only checked by script-level tests with fixture backends (fm-backend-herdr, fm-watch-arm, fm-remote-job and fm-timeout-lib all passed). No l…
  • Trailer strip and hook chaining live in a throwaway git repo: bin/fm-git-strip-ai-trailers.sh install <hooks> <repo> <guard> g1, then commits and pushes through both the pane-style GIT_CONFIG_* override and git -c core.hooksPath= (#5877)
  • Branch prompt: ran bin/fm-branch-prompt.sh twice, confirmed identical output, and checked the emitted prompt text for the silence rule
  • Outcome store in a lab home made by bin/fm-lab-home.sh create: bin/fm-branch-outcome.sh append --silent true (routine), append with verdict captain plus silent (should be refused), a visible routine append after a new status line, then unread and present
  • FM_HERDR_SUBMIT_CONFIRM_LIVE=1 bash tests/fm-herdr-submit-confirm-live-e2e.test.sh: real Claude Code 2.1.283 on herdr 0.9.1 in an fm-lab-* session run through bin/fm-herdr-lab.sh, on the merge result and again on a git archive 3d14792a upstream tree
  • Targeted test files: bash tests/fm-branch-supervision.test.sh, tests/fm-pi-branch-extension.test.sh, tests/fm-contributions.test.sh, tests/fm-git-strip-ai-trailers.test.sh, tests/fm-spawn-dispatch-profile.test.sh, tests/fm-devin-harness.test.sh, tests/fm-backend-herdr.test.sh, tests/fm-timeout-lib.test.sh, tests/fm-watch-arm.test.sh, tests/fm-remote-job.test.sh, tests/fm-secondmate-harness.test.sh

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

  • Live validation: ✅ go - 3 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Herdr composer read: a typed /exit behind Claude's slash-command popup is proven, submitted, and Claude exits (kunchenguid#5876) ✅ pass live herdr-submit-confirm-live-e2e-round3.log (third ok line)
Herdr composer read: a landed idle steer to real Claude reads empty and the reply renders ✅ pass live herdr-submit-confirm-live-e2e-round3.log (first ok line)
Herdr submit: a payload carrying the U+2063 away-supervisor mark is submitted even though the mark is missing when the composer is read back ✅ pass live herdr-submit-confirm-live-e2e-round3.log (second ok line)
Guard against over-correcting: muted dark placeholder text (grok) is still stripped as ghost text, and muse's ⟩ glyph still reads as an empty composer ⏸️ untested no The earlier payload did not show a live result for this scenario. It was only checked by unit tests (composer-lib-round3.log) against byte captures from earlier live panes. Live grok and muse panes we…
  • env -u NO_MISTAKES_GATE FM_HERDR_SUBMIT_CONFIRM_LIVE=1 bash tests/fm-herdr-submit-confirm-live-e2e.test.sh (real Claude Code 2.1.283 in an isolated fm-lab-* Herdr 0.9.1 session through bin/fm-herdr-lab.sh; the test tore the lab down itself)
  • bash tests/fm-composer-lib.test.sh (48 ok, including the new test_claude_saturated_slash_command_is_typed_content and the existing grok/muse ghost-strip matrix cases)
  • Checked that no fm-herdr-submit-confirm-live temp directories were left behind and the worktree is clean
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 19 commits September 27, 2026 01:56
…guid#5879)

* fix: route second-mate signal wakes by their new status span

A second mate's status log is a shared channel carrying many independently
keyed decisions, so judging its signal rows by every decision still open in
the whole log pinned each routine update to main behind any unrelated
parked hold. scopeForUnreadWake (the one owner for Pi and the attended
supervision host) now judges a second-mate signal row by the lines presented
since the last drain, bounded by the existing status-presentation cursor:
a decision, blocked, resolution, or captain-held line, or a line declaring
the key of a still-open decision, keeps the whole row on main, and any
cursor problem falls back to the whole log. Keys are read only at the
status parser's declared positions, with readable time stamps stripped as
bin/fm-classify-lib.sh does. Single-task crewmate and stale routing are
unchanged, and stale and signal rows for one mate keep independent verdicts.

The supervision branch now treats a second mate's done and merged lines as
relayed child outcomes, and fm-teardown refuses the branch actor second-mate
retirement through the existing role-partition helper in both postures.

* no-mistakes(review): Route second-mate resolutions to main only when closing open decision

* no-mistakes(review): Guard bare-verb fold lines and fold resolution spans incrementally

* no-mistakes(document): Clarify second-mate wake routing and retirement documentation

* no-mistakes(ci): The CI failure was a timing-sensitive watcher teardown test, not the PR’s signal-scope code. Extended the bounded wait for both state-directory and home removal. The watcher suite passes locally, and git diff --check is clean
…extension (kunchenguid#5882)

register-extension took the extension lifecycle lock and then the source
lock, while reconcile republishing an unhandled extension result holds the
source lock and reaches the lifecycle lock through the extension host's
process-event path. Both waits are unbounded and both owners stay alive, so
the two could wait on each other forever and freeze the home's monitoring
cycle.

register-extension now takes the source lock first, matching every other
path that holds both. The lifecycle lock still spans binding resolution
through registration publication, so binding retirement stays serialized.

A new lifecycle-order section in the extension-binding suite, run in the
default aggregate, holds a re-registration inside binding resolution while
reconcile republishes that source's unhandled result and requires both to
finish within a bound.

Fixes kunchenguid#5866
* fix(bin): run the repository's own hooks when git -c carries the per-task hooksPath

The per-task hooks wrappers cleared only the GIT_CONFIG_COUNT override before
looking up the repository's own hooks directory. When core.hooksPath reached git
through git -c (GIT_CONFIG_PARAMETERS), directly or inherited by a child
process, the lookup found the wrapper directory again and exited 0, so the
repository's real hook - such as a pre-push publish guard - never ran and the
push succeeded.

The lookup now ignores GIT_CONFIG_PARAMETERS too, so only the repository's
config files decide its hooks directory, and a failed lookup exits nonzero
instead of skipping the hook. AI-trailer stripping is unchanged.

Fixes kunchenguid#5871

* no-mistakes(document): Document git hook chaining and lookup failure behavior
…unchenguid#5744)

* feat(bin): add an optional never-send list to typed dispatch resolution

* Added config/dispatch-never-send, an optional local list of literal
  values and re: regular expressions checked against every string of
  the resolver request before it is sent to typesafe.ai
* A match, an unreadable list, or an empty or invalid pattern now stops
  the request and falls back to the off path, so firstmate dispatches
  through its existing intake; the one stderr diagnostic names at most
  the list line number and never the value
* No list, or a list with no match, leaves resolution unchanged

* no-mistakes(review): Match never-send literals across whitespace, drop regex mode

* no-mistakes(review): Inherit the never-send list into secondmate homes

* no-mistakes(ci): ci-2 (Lint 2), caused by this PR and now fixed. The rule that broke: the test script must not share shell variables with a library it sources. The new secondmate-inheritance test in tests/fm-dispatch-resolve.test.sh sourced bin/fm-config-inherit-lib.sh inside a `( ... )` subshell. That lib assigns `out`, so ShellCheck flagged every later `$out` in the test with SC2031. The subshell was the only place this PR sources that lib. The fix runs the propagation in a child shell instead (`bash -c '. "$1" && propagate_inheritable_config "$2" "$3"' _ lib from to`), so the test shell never sources the lib. `bin/fm-lint.sh tests/fm-dispatch-resolve.test.sh` now exits 0, and `bash tests/fm-dispatch-resolve.test.sh` passes. That includes the check that an inherited list is enforced in a secondmate home. ci-1 (Behavior portable serial 8), not caused by this PR, so no code change for it. The only failing test is tests/fm-remote-secondmate-relaunch.test.sh, which fails with "not ok - could not arm the PR poll fixture for the relaunch-ordering test". This PR doesn't touch that test or the code it runs. I reproduced the same failure locally on the base commit ea7c7f7. Main's own CI run on ea7c7f7 (run 36212602588) fails only this job, with the same message. The recent main runs before it also concluded failure
…hrashing guard (kunchenguid#5903)

* feat(jev): add the guard framework and the memory RSS/swap thrashing guard

A Jev guard is a bounded read-only host diagnostic that turns one class of
resource pressure into a machine-readable audit record and a one-line verdict.
This lands the framework contract (docs/jev-guards.md) with one representative
family (Pattern 46, memory RSS and swap thrashing) as the pilot: thin bash
wrapper, stdlib-only python engine, and a behavioral test through the CLI.

* no-mistakes(review): fix jev mem guard fail-open unknown and contract

* no-mistakes(review): fix mem guard rss pairing, memfree, tests, docs

* no-mistakes(review): fix inverted UNKNOWN branch in fail-forcing test

* no-mistakes(review): register docs/jev-guards.md in audience inventory

* no-mistakes(review): simplify wrapper, drop dead top_n, single-source thresholds

* no-mistakes(review): assert exact exit code in fail-forcing test leg

* no-mistakes(review): tolerate any stdout encoding in text output

* no-mistakes(document): Fix guard contract dash style and output wording
…enguid#5900)

* fix(bin): stop slow GitHub reads from starving and waking the contributions poll

The poll's fixed budget cut the tail URL's reads short, and any read killed at the bound was recorded as a forge failure, so routine GitHub slowness produced an observation-unavailable wake. A configured FM_CONTRIBUTIONS_BUDGET now rides the generated check shim and is cut down to the watcher's per-check bound with a margin, a read killed at the bound or the deadline is budget refusal that leaves records untouched, and the poll moves to the next URL that still has a full observation reserve instead of ending.

* fix(bin): report the bound when a signal death leaks through fm_run_timed

fm_run_external_timeout trusted the wrapper's recorded status over the runner's own bound verdict, so a read killed by the bound's TERM could surface as 143 and callers such as the contributions poll classified a budget-bound read as a forge failure. When the runner reports the bound, a signal-death status is the bound's own TERM racing the wrapper's bookkeeping and is reported as 124; a natural exit still passes through. The replace-shell probe also moves to the repo's portable BASHPID fallback so the suite runs on the macOS system bash.

* no-mistakes(review): Rotate contribution polling and verify generated budget behavior

* no-mistakes(review): Stabilize contribution rotation across successful observation refreshes

* no-mistakes(review): Exclude settled contributions from live observation rotation

* no-mistakes(document): Document contribution poll rotation and observation reserves

* no-mistakes(ci): Captain, fixed timeout handling with a one-line change preserving natural exit 137. Full session-start and contributions suites, targeted regressions, and lint passed. The timeout suite still fails on the known Bash 3.2 BASHPID issue, left unchanged as instructed. Logs retained in .no-mistakes/ci-evidence/. Remote CI was not rerun

* no-mistakes(ci): Fixed the fixture’s lock-acquisition race with a one-line bounded wait. Forced contention reproduced the CI error before the fix and passed afterward; the ordinary held-lock case, lint, syntax, and diff checks passed. Local Bash 3.2 failures remain: “cleanup lock bound 08 gave up before the marker lock freed” (also reproduced without the fix) and “TERM did not stop a watcher blocked inside a poll”. Remote CI was not rerun
…railers (kunchenguid#5859)

* feat: add keep AI trailers setting

* no-mistakes(document): Drop duplicate keep-ai-trailers line, update Cursor attribution note

* no-mistakes(document): Honor keep-ai-trailers for Devin worker attribution

* no-mistakes(document): Qualify Devin attribution note with keep-ai-trailers flag

* no-mistakes(review): Inherit keep-ai-trailers into secondmate homes
…sh-command popup cannot hide the composer (kunchenguid#5876)

* Fix Herdr composer reads blinded by the slash-command popup

Capture the full visible viewport for every Herdr composer state and content read instead of a bounded tail.
Claude Code renders its slash-command popup between the composer and the pane bottom, which pushes the composer outside a tail window.
The pre-Enter payload proof then read an empty composer, judged a typed command unsent, and cleared it without pressing Enter.
The proof-lines value now bounds only the clear cost, not the capture size.
Growing the window adds rows above the composer only, so bottom-most shape selection and prior verdicts are unchanged.
The suffix refusal is kept, and the shared inbox pending-line read stays a bounded tail.
Portable regressions cover the popup-below-composer layout, and the live submit-confirmation guard gains a third exit scenario.
The runtime-backends verification record documents the Herdr 0.9.0 and Claude Code 2.1.283 run.

Closes kunchenguid#5533

* no-mistakes(document): Clarify composer capture bound ownership

* no-mistakes(review): Drop unrequired bracketed-paste Enter fallback from live guard

* no-mistakes(review): Latch trust prompt, check idle composer arm first
…configurable bound (kunchenguid#5917)

Each per-task endpoint read in the session-start fleet digest runs in its own crash-isolated child under the existing timeout helper with a configurable FM_SESSION_START_ENDPOINT_TIMEOUT bound (default 10s).

A hung or killed read becomes that task's endpoint error while the digest continues, and the wrapper banners any abnormal child exit naming its status.
…nchenguid#5886)

* Keep lab tmux sockets on short private paths

* no-mistakes(review): Fix Linux stat checks and fail-closed lab tmux teardown

* no-mistakes(document): Update lab helper documentation for isolated tmux sockets
* Allow silent task-level no-change outcomes

* no-mistakes(review): Exclude silent outcomes from captain-return handoffs

* fix: look up supervision receipts by exact sequence

* no-mistakes(review): Suppress silent notes in away-return brief

* no-mistakes(review): Clarify visible notes; remove unused mode

* no-mistakes(review): Clarify silent outcomes and avoid false drain promises

* no-mistakes(document): Clarify silent supervision outcome documentation
…chenguid#5928)

* feat: make /quiet a statement where the attended supervision host runs

On a home that opted into the supervision host, quiet mode is what the
attended host already does, so /quiet now enters nothing there instead of
launching the quiet daemon and writing a record that would park a present
captain's main.

- bin/fm-afk-launch.sh quiet-check says quiet mode needs nothing where the
  attended host runs, or that the session is paused while its
  broken-session latch holds; a quiet enter refuses there before writing
  anything.
- Where the home opted in but the attended host lacks a part (engine,
  tools, verified mirror writer, identifiable main session, valid mirror),
  quiet-check names it and quiet mode falls back to the daemon.
- Under a live away record on that home, quiet-check and a quiet enter
  refuse and name the record, so the return runs first, whatever
  state/.afk says.
- A quiet enter records mode: quiet in the posture record, so start and
  start-native launch the quiet daemon without FM_AFK_MODE, and the away
  refusal wording fires only for away.
- bin/fm-host-mirror.sh check validates the dialog mirror read-only and
  exits 1 on a missing, unreadable, or invalid mirror.
- The quiet and afk skills and the supervision-host docs describe the new
  behavior; homes without the opt-in and Pi homes keep the daemon path.

* no-mistakes(review): Archive the quiet record when a quiet daemon start fails

* no-mistakes(document): Clarify quiet-mode documentation and remove stale duplicates
…uid#5884)

* fix(bin): grant Claude workers their task-channel dirs via --add-dir

Since Claude Code 2.1.257, a file-tool read (Read/Glob/Grep, and an
Edit's mandatory prior read) of a path outside the working directories
parks --permission-mode auto panes on a one-time interactive question,
and a "Block" answer lands permissions.blockReadsOutsideWorkingDirectories
in user settings, refusing the same reads even under bypass. Firstmate
launches Claude with no --add-dir, so a secondmate's parent-home steering
inbox and a ship or scout worker's launch record, steering inbox, brief
dir, and code-root .agents/skills were all outside: workers wedged on
the question the first time they read a steer.

Every Claude launch, spawn and relaunch, in both permission modes, now
grants exactly the task's channel directories: state/<id>.inbox for a
secondmate (in the parent home), or state/operational-inbox,
state/<id>.inbox, data/<id>, and the code root's .agents/skills for a
ship or scout. Paths resolve to real paths and lazily created channel
dirs are made before launch so the grant never names a not-yet-existing
directory; the whole state/ is deliberately never granted.

The grant keeps the bypass-mode launch argv changed on purpose: it also
protects bypass workers against a machine-recorded Block answer.

* no-mistakes(document): Consolidate Claude launch guidance in configuration reference

* no-mistakes(document): Clarify Claude permission documentation reference
…nguid#4819)

* fix(supervision): prevent idle recovery loops without stranding wakes

* no-mistakes(review): Remove unused wake-append rollback helper
…id#5889)

* fix(bin): stop the remote-job worker busy-polling an idle queue

The serving loop slept 50ms between passes and re-ran state preparation
(chmod on every queue directory), the heartbeat publish, and the stale sweep
on every pass. It now blocks on a worker.wake FIFO that staging,
cancellation, and lane exit nudge, keeps a short fast-poll window after
activity, refreshes the heartbeat at most once a second, and runs the sweep
(which re-applies the queue directories' 0700 modes) at startup and then on
a bounded interval. Lane-owned records are no longer re-read every pass.

Measured with a fork/execve-interposing counter on a --serve worker in a
disposable HOME and queue, bash 3.2, 20-second windows (the counter slows
the old loop to about 5 passes a second, so real-host rates were higher):
  idle worker             146 forks/s, 61 execs/s -> 4.8 forks/s, 3.1 execs/s
  one running long job    232 forks/s, 100 execs/s -> 15 forks/s, 11 execs/s
Stage-to-result latency for a no-op job, idle and back to back, stayed at
about 0.8-1.2s in both versions (dominated by job execution, not pickup).

* perf(bin): drop per-cycle forks from watcher, drain, and lock helpers

The watcher, drain, inactive-reconcile scan, and branch-outcome reads forked
small external commands on every cycle where bash can do the same work.

- fm-wake-lib.sh gains fm_dirname_to, fm_basename_to, and
  fm_epoch_seconds_to, exact stand-ins for $(dirname --), $(basename --),
  and $(date +%s); the clock uses printf %(%s)T on bash 4.2+ and still forks
  date exactly once on stock macOS bash 3.2.
- fm_lock_abs_path, fm_wake_signal_seen_path, fm_path_age, the watcher's
  age_of and wedge timer, and the recovery-marker line count use them or
  plain reads instead of dirname/basename/tr/date/wc.
- window_to_task reads a meta file once instead of two
  grep | tail -1 | cut -d= -f2- pipelines per file per call.
- fm-classify-lib.sh reads uname -s once at source time instead of in every
  status stat helper.
- Libraries sourced every cycle derive their own directory without forking
  dirname, including the backend adapter siblings a subshell re-sources on
  each probe.

tests/fm-fork-free-helpers.test.sh pins each replacement against the command
it replaces on edge-case inputs, under every available bash and both the C
and a UTF-8 locale; CI's stock macOS bash lane runs it under /bin/bash 3.2.

Measured with a fork/execve-interposing counter in a disposable home, one
tmux crew task, FM_POLL=1 (forks and execs per watcher cycle, per run
otherwise):
  watcher cycle      bash 5.3  299/138 -> 199/66   bash 3.2  341/146 -> 224/80
  drain              bash 5.3  492/238 -> 430/200  bash 3.2  567/250 -> 491/212
  inactive scan      bash 5.3   27/14  ->  17/4    bash 3.2   37/14  ->  17/4
  branch-outcome     bash 5.3   40/21  ->  35/16   bash 3.2   48/24  ->  38/19

* test: note the interpreter-expanded version probe for shellcheck

* no-mistakes(review): Fix worker idle bounds and fork-free contributions snapshot

* no-mistakes(review): Coalesce buffered worker wake nudges into one wake

* no-mistakes(review): Coalesce wake nudges via pending marker so publishers never block

* no-mistakes(review): Claim wake nudges atomically via noclobber pending marker

* no-mistakes(review): Release abandoned wake claims only after a 30-second bound

* no-mistakes(review): Drop worker wake FIFO; load path helpers side-effect free

* no-mistakes(document): Document remote worker polling and preemption cadence

* no-mistakes(ci): Fixed both failing CI shards: isolated remote and teardown test fixtures now include fm-path-lib.sh, which fm-wake-lib.sh requires. The three affected tests, fm-lint.sh, and git diff --check pass locally
Brings kunchenguid/firstmate main through kunchenguid#5889 into the fork's house line
at 79ef0f4. Conflicts resolved keeping both sides, except that a silent
routine outcome now updates the task's status-coverage index as upstream
kunchenguid#5808 requires. The supervision-host fixtures now report once per wake row
under house's per-row receipts.
@jazz127
jazz127 merged commit 8036859 into house Sep 28, 2026
1 check passed
@jazz127
jazz127 deleted the fm/firstmate-house-upstream-merge-r6 branch September 28, 2026 20:21
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.

10 participants