Skip to content

feat: merge upstream Firstmate main through ea7c7f70 into house - #54

Merged
jazz127 merged 12 commits into
housefrom
fm/firstmate-house-upstream-merge-r3
Sep 26, 2026
Merged

jazz127 merged 12 commits into
housefrom
fm/firstmate-house-upstream-merge-r3

Conversation

@jazz127

@jazz127 jazz127 commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

Intent

when we have a spare moment, we need to merge main into our house branches again. i have a feeling Kun merged some of the things we built

Context for reading that ask. The fork's house (jazz127/firstmate, now 0fcba623 after house PR 49) last took upstream Firstmate main (kunchenguid/firstmate) at 8d2ee29 through house PR 45. Upstream main has since added nine commits, up to ea7c7f7:

The merge should bring all of that into house while keeping every house behavior. For the "Kun merged some of the things we built" part: say in the PR body, for each house feature, whether any of these upstream commits now covers it (by commit, with evidence), or that none does.

ok, well ummmn, 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

What Changed

Did upstream cover any house feature?

None of the nine upstream commits covers a house feature. I compared each commit's changed files against every house-only first-parent change in ea7c7f70..85e02d9b. Where they overlap, the upstream change does something different:

I only ran the test cases the conflicts touched. As requested, a full suite run is left as a follow-up after this merge.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: This is an upstream merge of nine already-landed commits: conflicts were only in two test files and both were resolved keeping house and upstream behavior, and the auto-merged source files where house and upstream overlap stay compatible.

Testing

Live checks that passed: the operational-input doorbell CLI in a disposable lab home (a forged doorbell and a record that isn't Firstmate input are refused), house's Herdr per-project task spaces in a real Herdr 0.9.1 lab session with the default session left untouched, the kunchenguid#5707 dialog mirror with a real Claude 2.1.283, and house's Calm mod hiding the upstream doorbell in a real Claude 2.1.283 session. Eight focused serial scripts passed. fm-remote-secondmate-relaunch failed, and it fails identically on upstream ea7c7f7 alone. It was a test-script run, not a live run, so the kunchenguid#5583 scenario is marked untested. fm-supervision-host and the second batch over files both house and upstream changed had not finished. As the user asked, I did not run the full suite. There is no screenshot; the Calm UI behavior is evidenced by the live e2e's assertions on the captured Claude terminal.

  • Live validation: ⚠️ inconclusive - 5 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Upstream kunchenguid#5664: a Claude-bound watcher input is written as a record plus a plain-ASCII doorbell, and the doorbell resolves back to its kind and body ✅ pass live doorbell-cli-transcript.txt
Adversarial: a forged doorbell naming a missing record, or a record that isn't Firstmate input, is refused ✅ pass live doorbell-cli-transcript.txt: exit=1 for both
House feature (PR 53): Herdr per-project task spaces still work in a real Herdr lab after the merge ✅ pass live herdr-project-spaces-live.log: exit=0
Upstream kunchenguid#5707: a real Claude primary's prompt and reply are recorded in the dialog mirror, and a turn Claude started on its own is not ✅ pass live host-mirror-claude-live.log: exit=0; fm-host-mirror.test.sh exit=0
House Calm mod plus upstream doorbell: in a real Claude session the doorbell and tool rows are hidden, /calm shows and hides them, and resuming keeps them hidden ✅ pass live calm-claude-doorbell-live.log: 3 ok, exit=0
Upstream kunchenguid#5583: after a remote secondmate relaunch, the parent's metadata is republished and an already-armed PR poll keeps authenticating ⏸️ untested no This behavior was never driven against the live product, so there is no live result. The only evidence is a test-script run: tests/fm-remote-secondmate-relaunch.test.sh fails in its fixture setup, and…
The remaining upstream behaviors (kunchenguid#5731, kunchenguid#5733, kunchenguid#5710) and the house behavior in files both sides changed survive the merge ⏸️ untested no The focused serial runs had not finished: house-overlap.log had not started and fm-supervision-host was still running. The user chose to run the suite after the merge and follow up on the results.
Evidence: Operational-input doorbell CLI transcript (lab home)

Source: Operational-input doorbell CLI transcript (lab home)

+(eval):3> DB=+(eval):3> printf 'wake: check-row ready'
+(eval):3> DB=+(eval):3> env -u FM_STATE_OVERRIDE -u FM_ROOT_OVERRIDE 'FM_HOME=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG' bin/fm-operational-input.sh record watcher
+(eval):3> DB=': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.' 
+(eval):3> echo 'doorbell=: Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.'
doorbell=: Firstmate operational input waiting: read '/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg' and handle its contents as Firstmate operational input.
+(eval):4> printf %s ': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.'
+(eval):4> LC_ALL=C +(eval):4> grep -c '[^ -~]'
+grep:1> local _cc_a
+grep:2> _cc_a=-c
+grep:3> case -c (-*-filter* | -*-pager* | -*-view* | -*-format-open* | -*-config* | ---* | -@* | -*-save-config* | -[Zz]* | -[!-]*[Zz]* | --null | --null-data)
+grep:2> _cc_a=[^ -~]
+grep:3> case [^ -~] (-*-filter* | -*-pager* | -*-view* | -*-format-open* | -*-config* | ---* | -@* | -*-save-config* | -[Zz]* | -[!-]*[Zz]* | --null | --null-data)
+grep:5> local _cc_bin=~/.local/share/claude/versions/2.1.283
+grep:6> [[ -x ~/.local/share/claude/versions/2.1.283 ]]
+grep:7> [[ ! -x ~/.local/share/claude/versions/2.1.283 ]]
+grep:8> [[ -n 5.9 ]]
+grep:9> ARGV0=ugrep ugrep -G --ignore-files --hidden -I '--exclude-dir=.git' '--exclude-dir=.svn' '--exclude-dir=.hg' '--exclude-dir=.bzr' '--exclude-dir=.jj' '--exclude-dir=.sl' -c '[^ -~]'
0
+(eval):5> printf %s ': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.'
+(eval):5> FM_HOME=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG bin/fm-operational-input.sh doorbell-kind
watcher
+(eval):5> echo 'exit=0'
exit=0
+(eval):6> REC=+(eval):6> ls /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg
+(eval):6> REC=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg 
+(eval):6> FM_HOME=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG bin/fm-operational-input.sh open /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg
wake: check-row ready+(eval):6> echo ' exit=0'
 exit=0
+(eval):7> FORGED=+(eval):7> printf %s ': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.'
+(eval):7> FORGED=+(eval):7> basename /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg
+(eval):7> FORGED=+(eval):7> sed 's#1790410224-b43db8fbb42a3d72.msg#forged-00.msg#'
+(eval):7> FORGED=': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/forged-00.msg'\'' and handle its contents as Firstmate operational input.' 
+(eval):7> echo 'forged=: Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/forged-00.msg'\'' and handle its contents as Firstmate operational input.'
forged=: Firstmate operational input waiting: read '/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/forged-00.msg' and handle its contents as Firstmate operational input.
+(eval):8> printf %s ': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/forged-00.msg'\'' and handle its contents as Firstmate operational input.'
+(eval):8> FM_HOME=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG bin/fm-operational-input.sh doorbell-kind
+(eval):8> echo 'forged exit=1'
forged exit=1
+(eval):9> echo 'not firstmate'
+(eval):10> printf %s ': Firstmate operational input waiting: read '\''/private/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T/fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg'\'' and handle its contents as Firstmate operational input.'
+(eval):10> basename /var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG/state/operational-inbox/1790410224-b43db8fbb42a3d72.msg
+(eval):10> FM_HOME=/var/folders/9h/6hvtvt257md69k7nq7ycyq5h0000gn/T//fm-lab.zDUXPG bin/fm-operational-input.sh doorbell-kind
+(eval):10> sed 's#1790410224-b43db8fbb42a3d72.msg#plain-01.msg#'
+(eval):10> echo 'non-envelope record exit=1'
non-envelope record exit=1
+(eval):11> set +x
Evidence: Herdr project-spaces live e2e log

Source: Herdr project-spaces live e2e log

ok - real Herdr lab: tasks of one project share one labelled workspace, another project gets its own, and a same-labelled captain workspace keeps its focus and contents
ok - real Herdr lab: a project space outlives every task but its last, and its removal keeps the captain's focus
ok - real Herdr lab: after its last task a project reopens a fresh space and every space is removed with its last task
ok - real Herdr lab validation completed on Herdr 0.9.1 with the default-session tripwire intact
exit=0
Evidence: Host dialog mirror live e2e with real Claude

Source: Host dialog mirror live e2e with real Claude

ok - claude 2.1.283 (Claude Code): a turn the harness started itself was not mirrored as the captain's words
ok - claude 2.1.283 (Claude Code): the tracked registrations mirrored the captain prompt and main reply
ok - host mirror live: 1 harness(es) proved their writers
exit=0
Evidence: Calm Claude mod + doorbell live e2e

Source: Calm Claude mod + doorbell live e2e

ok - Claude Code 2.1.283 (Claude Code) with the flag unset: no hooks module, no /calm, stock working row, stock tool rows, preference on ignored
ok - Claude Code 2.1.283 (Claude Code) with the flag on: the mod auto-loads from .claude/skills, /calm exists, the sailboat replaces and moves in the working row, tool rows and the record-backed operational doorbell draw at zero height, /calm restores and re-hides them while persisting the shared preference
ok - Claude Code 2.1.283 (Claude Code) resumes the transcript with Calm's hidden rows still hidden and the preference intact
exit=0
Evidence: Focused upstream-behavior test log (includes relaunch failure)

Source: Focused upstream-behavior test log (includes relaunch failure)

FM_TEST_BEGIN 2026-09-26T08:10:04Z tests/fm-lint.test.sh family=pure-contract-unit expected_gate_skip=none
FM_TEST_BEGIN 2026-09-26T08:10:04Z tests/fm-test-run.test.sh family=pure-contract-unit expected_gate_skip=none
ok - fm-lint.sh --help reports the complete executable interface
ok - fm-lint.sh --list-files reports the complete shell inventory
ok - two canonical lint partitions preserve complete source-aware coverage and reject weakened modes
ok - fm-lint.sh --fast disables ShellCheck extended analysis
ok - fm-lint.sh keeps full ShellCheck analysis by default in CI
ok - fm-lint.sh rejects explicit --fast mode in CI
ok - fm-lint.sh --fast catches an ordinary shell lint defect
ok - fm-lint.sh pins an explicit ShellCheck version (0.11.0)
ok - ShellCheck installer retries a transient download failure
ok - ShellCheck installer selects the official archive, URL, and checksum per OS/arch
ok - ShellCheck installer rejects a wrong checksum
ok - ShellCheck installer falls back to shasum -a 256 when sha256sum is absent
ok - ShellCheck installer prefers sha256sum when both hashers are present
ok - ShellCheck installer rejects an unsupported OS or architecture
ok - missing ShellCheck fails closed
ok - fm-lint.sh refuses to lint under a non-pinned ShellCheck version
ok - fm-lint.sh catches a real lint defect the old no-op gate passed
ok - fm-lint.sh rejects direct Beads CLI invocations in firstmate core
ok - fm-lint.sh enforces backend purity for explicit core paths
ok - fm-lint.sh ignores ambient ShellCheck options
ok - fm-lint.sh passes a clean fixture
ok - jobs=1 and jobs=2 preserve deterministic diagnostics, failures, cleanup bounds, and quiet telemetry
ok - jobs=1 and jobs=2 stop complete worker trees with and without telemetry
ok - seeded dispatcher, adapter, production-owner, and test-local diagnostics preserve parity
ok - fm-lint.sh changed mode lints only the changed canonical file
ok - fm-lint.sh forces a full lint in CI even when the local diff would be empty
ok - fm-lint.sh forces a full lint when HEAD is on main
ok - fm-lint.sh explicit paths bypass changed-file mode selection
ok - fm-lint.sh exits 0 with a note when the local branch has no changed lint targets
ok - fm-lint.sh --list-files reports the would-be changed set in changed mode
ok - fm-lint.sh changed mode drops source following and excludes cross-file codes
ok - fm-lint.sh changed mode invokes ShellCheck once per root
ok - fm-lint.sh CI keeps source following without the local exclusion list
ok - fm-lint.sh on main keeps source following without the local exclusion list
ok - fm-lint.sh without a merge-base keeps source following without the local exclusion list
ok - fm-lint.sh explicit paths keep source following
ok - fm-lint.sh --fast on a local branch keeps source following
ok - fm-lint.sh changed mode excludes cross-file codes that explicit paths still report
ok - local exclusion list covers every no-external-sources ShellCheck code
FM_TEST_END 2026-09-26T08:12:49Z tests/fm-lint.test.sh exit=0 duration_ms=164812 gate_skip=false
ok - exact suite coverage: --all lists every tests/*.test.sh once
ok - family selection returns a proper subset of the suite
ok - single-script selection lists exactly that path
ok - changed-file selection stays conservative (never silent full suite)
ok - a task marker refuses execution in the primary checkout and leaves worktrees and inspection alone
ok - runner and its documentation surfaces select their curated family, not just their contract owners
ok - shell line-ending policy selects runner coverage
fm-test-run: no tests selected for changes vs HEAD (map is conservative; use --all for the complete suite)
ok - changed selection covers dependents, fails closed for live unmapped source, and accepts retired unconsumed source
ok - a bin reference selects the referencing scripts, and consumers still select their curated families
ok - changed defaults to bounded automatic scheduling with serial override
ok - Windows emulation exempts only synthetic POSIX modes
ok - a plain script list defaults to bounded automatic concurrency without an automatic timeout
ok - family proofs run concurrently only within separate family phases
ok - empty changed selection emits deterministic text and JSON summaries
ok - timing markers and JSON artifact are valid
ok - aggregate exit reflects any script failure
ok - gate-skip accounting is honest and non-failing
ok - a gate skip records why it skipped
ok - a script that actually ran records no skip reason
ok - live guards are recorded as a capability class, not a bare env opt-in
ok - fail-on-gate-skip converts herdr-not-found into a hard failure
ok - exclude-family drops the named primary family after selection
ok - proven-isolated scheduling ignores parallel hints
ok - family, all, changed, and script selections ignore parallel hints
ok - portable shard union, disjointness, and coverage guard hold
ok - portable parallel lanes are fully hinted and packed within 5% of each other
ok - portable serial shards are a deterministic disjoint cover of the serial lane
ok - coverage guard reports and bounds the unmeasured portable serial share
ok - portable serial shard lanes refuse mismatched, out-of-range, and countless names
ok - --jobs refuses non-proven / stateful selections
ok - --jobs admits and schedules a family with a recorded concurrent proof
ok - an unclassified new test stays serial while the proven residual family runs concurrently
ok - a changed shared test fixture selects its readers while an unread tests/ path still refuses
ok - a concurrent run starts the longest-hint script first
ok - --per-script-timeout-secs turns a hung script into a bounded failure
ok - the automatic --changed bound gives the slow watcher suite at least 1500s
ok - --max-wall-ms fails an over-budget run and refuses a malformed budget
ok - jobs scheduler runs proven scripts; failure propagates; non-proven refused
ok - Herdr CI family-run step times out at 20 min under a 75 min job backstop
ok - aggregate-json merges lane timing artifacts
FM_TEST_END 2026-09-26T08:13:40Z tests/fm-test-run.test.sh exit=0 duration_ms=215843 gate_skip=false
FM_TEST_BEGIN 2026-09-26T08:13:40Z tests/fm-watcher-lock.test.sh family=watcher-wake-lock expected_gate_skip=none
FM_TEST_BEGIN 2026-09-26T08:13:40Z tests/fm-wake-queue.test.sh family=watcher-wake-lock expected_gate_skip=none
ok - wait deadline diagnoses and reaps a stopped test child without hanging
ok - simultaneous watcher starts leave exactly one live process
ok - fm_pid_identity real ps fallback is locale-invariant
ok - fm_pid_identity is locale-invariant across LC_ALL/LC_TIME
ok - fm_pid_identity ps fallback is terminal-width-invariant
ok - /proc process identity ignores simulated btime changes
ok - /proc process identity detects pid reuse
ok - MSYS /proc process identity regression skipped on non-Windows host
ok - killed watcher stale lock is reclaimed
tests/fm-watcher-lock.test.sh: line 1469: 78630 Killed: 9               FM_STATE_OVERRIDE="$state" bash -c '
    . "$1"
    fm_lock_remove_path() {
      if [ "$1" = "$STATE/.watch.lock" ]; then
        kill -KILL "${BASHPID:-$$}"
      fi
      return 1
    }
    fm_lock_try_acquire "$2"
  ' _ "$LIB" "$lockdir" > /dev/null 2>&1
ok - stale watcher reclaim publishes durable recovery evidence before clear
ok - live watcher lock with stale heartbeat is actionable
ok - live watcher lock with a beacon past the hard bound is replaced, under it is still refused
ok - guard banner leads when down with pending wakes (repair-after-drain) and stays silent when live and fresh
ok - concurrent fm_lock_try_acquire yields exactly one winner
ok - dead-pid stale lock is reclaimed by a single acquirer
ok - concurrent stale-lock steal yields exactly one winner
ok - dead steal owner is reclaimed once without a nested steal marker
ok - dead nested steal chain from an interrupted reclaim is recovered
ok - a competing reaper cannot remove the successor's steal mutex
ok - a steal mutex abandoned by this process does not block its own reclaim
ok - a steal reap interrupted in this process is resumed from its own tombstone
ok - live steal mutex is not reclaimed
ok - live-held lock is 

... [13903 bytes truncated] ...

stale-owner recovery leaves the AFK and supervision-need gates unchanged
ok - auto-arm: resolves the outermost pid of a nested contiguous claude ancestry (bg-spare chain)
ok - auto-arm: inert with nothing in flight and no X-mode need
ok - auto-arm: actionable close translates to exactly one exit-2 rewake with reason
ok - auto-arm: actionable close survives a healthy successor without duplicate delivery
ok - auto-arm: an attached cycle's end starts a handling successor named after the closed arm before the rewake
ok - auto-arm: an unconfirmed handling successor is reported in the rewake instead of blocking it
ok - auto-arm: bounded failure verification emits one automatic-mechanism alarm
ok - auto-arm: consecutive failures keep Stop-owned retry without repeating notice
ok - auto-arm: marker-write refusal defers delivery until one successor commits the notice
ok - auto-arm: unverified clean close exhausts retries and fails closed
ok - auto-arm: post-alarm actionable outcomes cannot continue or reset failure state
ok - auto-arm: benign cycle end with a live watcher and fresh beacon stays silent across the next cycle
ok - auto-arm: budget contention preserves the episode and forces a reset retry
ok - auto-arm: owner-mutex contention preserves successor episode state
ok - auto-arm: X-mode poll need arms the cycle even with no tasks in flight
ok - auto-arm: a registered custom check arms the cycle even with no tasks in flight
ok - auto-arm: concurrent firings admit one owner and one rewake translation
ok - auto-arm: TERM mid-arm commits a durable failure and exits 2 for rewake
ok - auto-arm: an abandoned owner claim is reclaimed so a lapsed cycle re-arms
ok - auto-arm: an abandoned-claim reclaim reaps a dead steal mutex without nesting
ok - auto-arm: a legacy owner still arming is never reclaimed while its watcher keeps beating
ok - auto-arm: a fresh legacy arming claim is never reclaimed while its startup window is still open
ok - auto-arm: a live claim the ledger does not name is never reclaimed
ok - auto-arm: a claim whose pid was reused is reclaimed even while its ledger entry still reads arming
ok - auto-arm: a reused-pid claim is reclaimed even with no ledger entry to prove it
ok - auto-arm: an identity-matched owner still arming is never reclaimed
ok - auto-arm: the guard's terminal-check claim is never reclaimed
ok - auto-arm: a stuck live legacy owner is retired via TERM and its lock reclaimed
ok - auto-arm: a SIGSTOPped legacy owner is reclaimed with TERM pending and dies on continue
ok - auto-arm: a live open generation claim defers concurrent firings with no lock held
ok - auto-arm: a hung generation owner with no watcher beat is superseded so re-arming self-heals
ok - auto-arm: an identityless arming ledger never defers the gate (reused-pid loophole closed)
ok - auto-arm: a superseded owner never re-invokes the arm and leaves its successor's claim untouched
ok - auto-arm: a superseded owner goes silent - one supersession episode, one translation, no held mutex
ok - auto-arm: need vanishing mid-cycle closes without a rewake
ok - auto-arm: mid-cycle AFK hands triage to the daemon with no rewake
ok - auto-arm: active in a marked secondmate home
ok - auto-arm: a long FM_POLL with FM_GUARD_GRACE unset reaches fm-watch-arm.sh with the derived grace
ok - auto-arm: without config/supervision-host the hook runs the arm exactly as before
ok - auto-arm: an opted-in home runs the host bound to its generation, and a host line rewakes like a wake
ok - auto-arm: a wake the host hands back under the away record says it is automatic supervision, not a return
ok - auto-arm: without the host the rewake banner is unchanged, eight wake lines at most
ok - auto-arm: a host handback delivers every host line, while its wake lines keep their cap
ok - auto-arm: a host that stood down closes silently without a retry
ok - auto-arm: a host that died without a close is retried, then reported as a failure
ok - fm-lock: shared session-lock lib preserves the status path
ok - auto-arm: stands down only on a pi-code-delivered transcript_path (/.pi/)
FM_TEST_END 2026-09-26T08:17:52Z tests/fm-claude-stop-autoarm.test.sh exit=0 duration_ms=54654 gate_skip=false
FM_TEST_BEGIN 2026-09-26T08:17:52Z tests/fm-host-mirror.test.sh family=afk expected_gate_skip=none
ok - mirror: the Claude and Cursor registrations each write the captain's prompt and main's reply
ok - mirror: writers stay silent and write nothing on a home that did not opt in
ok - mirror: a home without the flag is untouched by every tracked mirror registration
ok - mirror: operational input, a harness-started turn, a foreign host's payload, other events, and a session without the lock are never mirrored
ok - mirror: a captain prompt and a main reply keep their internal whitespace and newlines verbatim
ok - mirror: a repeated entry is recorded once, and a long entry keeps its head and tail within the cap
ok - mirror: a later different reply under the same id is recorded, while an identical repeat is recorded once
ok - mirror: an entry id already recorded by an earlier main session does not drop a later session's dialog
ok - mirror: a failed append leaves the mirror valid, prints nothing, and later dialog still lands
ok - mirror: the captain's dialog lands only in an owner-only mirror, even when the file already existed readable by others
ok - mirror: captain prompts and main replies reach the mirror without ever entering a process argument list
ok - mirror: the feed resumes from its committed cursor, re-anchors on a new conversation or session, and is bounded
ok - mirror: the feed's bound includes the note naming how many earlier entries it left out
ok - mirror: a later lock holder with a recycled pid is a new main session
ok - mirror: the feed refuses a mirror with a zero, fractional, or non-rising sequence, or an unterminated final record
ok - mirror: a recreated mirror continues past the committed and staged cursors, so a resumed conversation still gets new dialog
FM_TEST_END 2026-09-26T08:18:04Z tests/fm-host-mirror.test.sh exit=0 duration_ms=11587 gate_skip=false
FM_TEST_BEGIN 2026-09-26T08:18:04Z tests/fm-supervision-host.test.sh family=afk expected_gate_skip=none
ok - report surface: only the branch actor's current turn and exact wake row may report
ok - report surface: concurrent claims on one wake row serialize through the receipt lock
ok - report surface: an outcome recorded after the captain returned is queued durably for main
ok - dispatch entry: the host reads branch eligibility and the wake prompt from the Pi branch's own owner
ok - host: an attended close reaches main exactly as the plain arm delivers it
ok - host: an away wake is handled on the engine through the branch contract and never reaches main
ok - host: an engine turn that records no outcome hands its durable wake to main
ok - host: a captain return during an engine turn hands that turn's outcomes to main
ok - host: an outcome recorded after the return reaches main even when its host dies at the turn's end
ok - host: the next host stops the engine a killed predecessor left mid-turn and removes that turn's files
ok - host: a turn that reports but leaves its granted rows queued hands the wake to main
ok - host: a captain return during a failed engine turn still hands that turn's outcomes to main
ok - host: an engine turn whose result is incomplete hands its wake to main
ok - host: two engine errors latch the session, main keeps every away wake in the cooldown, a failed probe doubles it up to its cap, and a report recovers it silently
ok - host: the latch changes nothing for an attended close or a home without config/supervision-host
ok - host: an engine turn is bounded, and tool processes outside its process group are reaped
ok - host: a restarted host stops, by recorded identity, the cycle a killed predecessor left running
ok - host: the park ends itself with a boundary wake and a stopped watcher
ok - host: waiting closes cannot carry the park past its boundary
ok - host: a close whose margin runs out while the successor starts reaches main at the boundary without a turn
ok - host: the park's test clock is inert without the test marker
Evidence: Relaunch-ordering failure reason (same result on merge and on upstream ea7c7f7)
error: ios is a secondmate, not a delivery lane - https://github.com/example/repo/pull/1 was reported on its status channel but belongs to a task in the mate's own home, which arms its own merge watch
not ok - could not arm the PR poll fixture for the relaunch-ordering test
- Outcome: ⚠️ 2 warnings across 1 run (12m11s)

Worker test triage

Targeted tests run by the worker before publication, on firstmate's instruction to skip the full suite before merge: both conflicted test files, every test file the upstream commits changed, and the PR 53 overlap set (fm-backend-herdr, fm-backend-herdr-project-spaces-e2e, fm-operational-input, fm-afk-inject-e2e, fm-afk-inject-herdr-e2e, fm-control, fm-calm-claude-mod, fm-inactive-reconcile, fm-supervision-host, fm-wake-queue, fm-watcher-lock) pass on this branch, except the failures listed here.
bin/fm-lint.sh and bin/fm-doc-audience-check.sh pass.

Known upstream failures: tests/fm-remote-secondmate-relaunch.test.sh, upstream kunchenguid#5583's relaunch-ordering case, cannot arm its PR poll fixture because its fixture registers a PR for a secondmate, which bin/fm-pr-check.sh refuses since upstream kunchenguid#5696; it fails identically on upstream ea7c7f70 alone and is carried unchanged, with house's copy of the test left matching upstream.

Pre-existing failures - follow-up: full-suite run after merge

None of these is caused by this merge, and each is left as-is; the first six fail the same way on origin/house alone, and the last three are environmental, a load flake, or lint in a file house CI does not check:

  • tests/fm-contributions.test.sh, tests/fm-fleet-ledger.test.sh, tests/fm-secondmate-safety.test.sh, tests/fm-teardown.test.sh: house's scratch-file publish guard reads the PR's file list through gh, which these fixtures do not stub ("cannot inspect the published file list"); fail on origin/house.
  • tests/fm-mail-check.test.sh: its fixture copies bin/fm-pr-lib.sh without house's bin/fm-scratch-lib.sh; fails on origin/house.
  • tests/fm-gotmp.test.sh: teardown exits non-zero with a valid task temp; fails on origin/house.
  • tests/fm-captain-hold-lifecycle.test.sh: the PR merge refusal for an unreadable backlog no longer names it; fails on origin/house, passes on upstream main.
  • tests/fm-pr-merge.test.sh: github-unreadable-queue-rules case; fails on origin/house.
  • tests/fm-spawn-dispatch-profile.test.sh: the Herdr-backed Codex Luna seat case is not sealed off from a surrounding Herdr pane (known PR 43 follow-up); fails on origin/house.
  • tests/fm-composer-codex-idle-live-e2e.test.sh: an opt-in Codex harness check that stopped at Codex's trust prompt for this worktree's folder; environmental, not caused by this merge.
  • tests/fm-home-summary-refresh.test.sh hit its 7-second bound once under load and passed on rerun.
  • Canonical CI-mode lint flags SC2031 three times in tests/fm-afk-return.test.sh; the same explicit lint fails on origin/house and passes on upstream main, and house CI does not lint that file.

evidence-artifact: /tmp/fm-firstmate-house-upstream-merge-r3/pr-evidence.txt
evidence-command: cat pipeline evidence files from git show 6826c90:.no-mistakes/evidence/fm/firstmate-house-upstream-merge-r3/ and /tmp/fm-firstmate-house-upstream-merge-r3/evidence.txt > /tmp/fm-firstmate-house-upstream-merge-r3/pr-evidence.txt
evidence-captured: 2026-09-26T08:29:22Z

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

⚠️ **Test** - 2 warnings
Scenario Result Live Evidence
Upstream kunchenguid#5664: a Claude-bound watcher input is written as a record plus a plain-ASCII doorbell, and the doorbell resolves back to its kind and body ✅ pass live doorbell-cli-transcript.txt
Adversarial: a forged doorbell naming a missing record, or a record that isn't Firstmate input, is refused ✅ pass live doorbell-cli-transcript.txt: exit=1 for both
House feature (PR 53): Herdr per-project task spaces still work in a real Herdr lab after the merge ✅ pass live herdr-project-spaces-live.log: exit=0
Upstream kunchenguid#5707: a real Claude primary's prompt and reply are recorded in the dialog mirror, and a turn Claude started on its own is not ✅ pass live host-mirror-claude-live.log: exit=0; fm-host-mirror.test.sh exit=0
House Calm mod plus upstream doorbell: in a real Claude session the doorbell and tool rows are hidden, /calm shows and hides them, and resuming keeps them hidden ✅ pass live calm-claude-doorbell-live.log: 3 ok, exit=0
Upstream kunchenguid#5583: after a remote secondmate relaunch, the parent's metadata is republished and an already-armed PR poll keeps authenticating ⏸️ untested no This behavior was never driven against the live product, so there is no live result. The only evidence is a test-script run: tests/fm-remote-secondmate-relaunch.test.sh fails in its fixture setup, and…
The remaining upstream behaviors (kunchenguid#5731, kunchenguid#5733, kunchenguid#5710) and the house behavior in files both sides changed survive the merge ⏸️ untested no The focused serial runs had not finished: house-overlap.log had not started and fm-supervision-host was still running. The user chose to run the suite after the merge and follow up on the results.
  • FM_HOME=$LAB bin/fm-operational-input.sh record watcher / doorbell-kind / open in a throwaway lab home, plus a forged doorbell and a record that isn't Firstmate input
  • tests/fm-backend-herdr-project-spaces-e2e.test.sh (real Herdr 0.9.1 lab session through bin/fm-herdr-lab.sh)
  • FM_HOST_MIRROR_LIVE_E2E=1 FM_HOST_MIRROR_LIVE_HARNESSES=claude tests/fm-host-mirror-live-e2e.test.sh (real Claude 2.1.283)
  • FM_CLAUDE_CALM_LIVE_E2E=1 tests/fm-calm-claude-mod-live-e2e.test.sh (real Claude 2.1.283)
  • Serial bin/fm-test-run.sh: fm-lint, fm-test-run, fm-watcher-lock, fm-wake-queue, fm-calm-claude-mod, fm-operational-input, fm-claude-stop-autoarm, fm-host-mirror passed; fm-remote-secondmate-relaunch failed; fm-supervision-host and the second batch over files both house and upstream changed had not finished
  • tests/fm-remote-secondmate-relaunch.test.sh run against a git archive ea7c7f70 export of upstream main alone, to check whether the merge caused the failure
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

kunchenguid and others added 12 commits September 25, 2026 16:48
…unchenguid#5707)

* feat(bin): record the supervision host's dialog mirror on Claude and Cursor

Add bin/fm-host-mirror.sh, the one owner of the supervision host's dialog
mirror file, cursor, lock, and feed, plus the main-session key it keys
entries to. The tracked Claude UserPromptSubmit and Stop hooks and the
Cursor beforeSubmitPrompt and afterAgentResponse hooks record the captain's
prompt and main's reply, only on a home with config/supervision-host, from
a genuine primary checkout, for the lock-owning session. The mirror lands
inert: writers record and nothing reads it yet; attended supervision on the
host is the later step that consumes the feed.

Codex, Grok, OpenCode, and omp have no writer here.

* no-mistakes(review): Scope mirror dedup to session, atomic appends, marker-inclusive caps

* no-mistakes(document): Clarify dialog mirror scope and remove duplicate contract details

* no-mistakes(document): Correct Cursor hook documentation for dialog mirror registration

* no-mistakes(review): Pass mirrored dialog text to jq via stdin

* no-mistakes(document): Clarify dialog mirror documentation and remove duplicate claims

* no-mistakes(review): Preserve internal dialog whitespace; drop mirror check and verified modes

* no-mistakes(review): Drop only identical mirror repeats; remove redundant chmod guard
… escalations are not repeated (kunchenguid#5731)

* fix(bin): retire check-row receipts on branch acks and report an unchanged situation once

* fix(bin): scope a branch acknowledgement's check-row receipt retirement to
  its granted sequences

The away posture lifts the attended partition's check/decision exclusions, so
a branch grant can name check-kind rows - but the branch-actor ack still
assumed check rows were main-only and skipped every receipt scan. The queue
row was consumed while its terminal-outcome .pending receipt stayed behind,
and each inactive-reconcile cadence scan re-queued the same fingerprint. In
the first real away window on the supervision host that re-escalated one
unchanged held-PR situation on every cycle (~1,734 of 4,149 outcomes).

A branch ack now scans inactive-outcome and inactive-reconcile receipts and
commits secondmate stall receipts against exactly the sequences in its
eligible-row snapshot - the same rows it consumes - instead of none. Attended
grants still name no check row, so the scans find nothing.

* fix(bin): store a repeated captain verdict as routine while the task's
  durable situation is provably unchanged

fm-branch-outcome.sh append computes a mechanical situation key per captain
row - metadata bytes, captured status-log endpoint and identity, live
crew-state verb, worktree head - and anchors it in
state/.<task>.branch-captain-key. A later captain verdict whose recomputed key
matches is stored as routine with "unchanged since seq <N>:" prefixed to its
summary, so one situation escalates once until something provably changes. A
task with no readable status ledger is never demoted, an unreadable record
fails toward reporting, and teardown removes the sidecar with the task's
other branch records. The append-only store schema is unchanged.

This covers both hosts: the Pi supervision branch and the supervision host
both funnel reports through append.

* docs: check rows are main-owned only while attended; the away posture grants
  them to the branch, whose ack retires their receipts exactly

* test: the away-flood reproduction as a regression test (branch ack retires
  the receipt and later scans stay quiet), store-level dedupe coverage, and a
  branch-ack secondmate stall receipt case

* fix(bin): restore the secondmate child devin-config cleanup path

The branch-captain-key sidecar addition mistyped the sibling entry as
.$child_id.devin-config.json, so a forced secondmate teardown would have
stopped removing each child's real <id>.devin-config.json. Restore the
original path and add a behavioral test that stops the child sweep mid-loop
on a refused close, proving the cleaned child's devin config and captain
anchor are both removed while the unconsumed child's records are retained.

* no-mistakes(review): Key captain dedupe on the covered wake rows' fingerprint

* no-mistakes(review): Drop captain-key demotion; prove one escalation on both surfaces

* no-mistakes(review): Drop unrelated teardown test; cite both receipt test files

* no-mistakes(document): Docs already match branch-ack check-receipt retirement
…oorbell (kunchenguid#5664)

* fix(calm): deliver Claude-bound operational input as a record-backed doorbell

Claude Code 2.1.280 removes U+2063 from every submitted prompt, so a typed
operational envelope reaches a Claude Code primary as plain text. The away
daemon now writes the envelope to a record under state/operational-inbox and
types only a plain doorbell naming it; the /afk return check and the Calm mod
recognize the doorbell only when that record holds a current envelope. Marker-
preserving harnesses keep the typed envelope. The live Calm guard accepts the
2.1.280 module-load log line, drives the doorbell, and asserts thinking stays
hidden.

* no-mistakes(review): Fix operational record retention at 7 days and document prune limit

* no-mistakes(document): Point Calm bounds at 2.1.280 evidence; fix afk-exit comment

* no-mistakes(lint): Pick newest Calm e2e transcript without parsing ls

* docs(calm): add a minimal turning-Calm-on step for Claude Code

* fix(spawn): deliver the Claude launch brief as a record-backed doorbell

Claude Code strips U+2063 from the launch-prompt argument too, so a
worker's launch brief arrived with its operational marker removed.
Publish the brief as a record in the receiving home's operational
inbox - a secondmate's own state, not the primary's - and pass only
the printable doorbell naming it, falling back to the typed envelope
when the record cannot be published so the brief body still delivers.

Unwrap doorbell-carried digests in the daemon digest tests that still
read the raw send log under the claude pin, and update the documented
bounds now that launch briefs hide like the other operational rows.

* test(spawn): cover a secondmate's launch-brief record landing in its own home

The record-backed doorbell resolves its state through the receiving
pane's home, so prove a claude secondmate launch publishes into the
seeded secondmate's operational inbox and never leaks a record into
the primary's.

* no-mistakes(review): Pass primary harness to daemon, tighten retention, refresh verdicts

* no-mistakes(review): Prune operational records by exact seven-day elapsed age

* no-mistakes(review): Batch record pruning so large inboxes still expire

* no-mistakes(review): Refuse Claude spawn when brief record cannot publish

* no-mistakes(review): Drop thinking probe from Claude Calm live test and docs

* no-mistakes(review): Record dated Claude Code 2.1.282 reproduction evidence

* no-mistakes(document): Clarify operational doorbell documentation and record expiry

* no-mistakes(document): Correct AFK escalation carrier guidance

* no-mistakes(review): Describe operational record retention as about seven days

* no-mistakes(document): Clarify Calm delivery and operational record retention

* no-mistakes(review): Remove out-of-scope Calm launch guide from Claude docs

* no-mistakes(document): Document Claude launch-brief delivery and refusal

* no-mistakes(document): Correct stale operational-input documentation

* no-mistakes(ci): Fixed the stale Claude trust test to verify that worker and secondmate launches deliver readable, record-backed briefs instead of expecting brief paths in their commands. Annotated the daemon’s output variable for ShellCheck without changing behavior. The affected tests, daemon tests, ShellCheck, and diff check pass locally

* no-mistakes(ci): parse rebased Claude launch after trailer hook prefix

* no-mistakes(review): Trust launch-brief record and restore thinking bound doc

* no-mistakes(review): Parse final Claude launch statement; drop Stop-hook docs

---------

Co-authored-by: Mike Sewell <maikunari@protonmail.com>
Co-authored-by: no-mistakes <no-mistakes@localhost>
kunchenguid#5583)

A host-local relaunch rewrote only the far endpoint, so this home kept the old harness, model, and effort, and appending those keys after pr= broke pull-request poll authentication.
…ound (kunchenguid#5516)

tests/fm-watch-triage.test.sh finishes in about 434s alone and about 698s
under CI load, so the 900s bound the changed-suite runner applies produced
a false timeout under ordinary concurrent validation. Raise the automatic
bound to 1500s, which keeps every measured script under it while staying
below the 30-minute normal CI tier so a genuinely hung script still fails
here with its output before the job cap cancels the lane.

Fixes kunchenguid#3869
Refs kunchenguid#3565
…kunchenguid#5728)

* Fix nested watcher lock reclaim

* no-mistakes(review): Elect a single steal-mutex reaper and bound arm TERM wait

* no-mistakes(review): Reclaim self-held steal mutex and unify autoarm steal reaping

* no-mistakes(review): Resume own interrupted steal reap from its tombstone
…nguid#5710)

* test: hold the back-to-back boundary close on the host's own clock

test_park_boundary_holds_under_back_to_back_closes assumed two engine
turns fit in the ~16s pre-refusal window and that the stub finished a
turn in 3s. Under load the stub's real drain, report, and
acknowledgement take ~13s, so the turn either died at its bound (which
hands the wake to main, no boundary line) or the second close landed
past the window and the fixture failed while the boundary held. 3
failures in 5 runs at a load average near 11.

Hold the first turn on a release file instead: once the engine is in
flight, a second close is appended mid-turn and the turn is released as
the refusal window opens (park bound minus turn bound and grace, read
off the host's own start record). The queued close can then only wait
for the boundary on any machine speed, which is what the test asserts:
the boundary line ends the output, the demo.status row stays queued for
main, and no second engine turn ever starts. A host too loaded to start
the turn at all hands the first close to the same boundary exit.

After: 12/12 at load ~15-42.

* no-mistakes(review): Print boundary test deadline as a decimal integer

* no-mistakes(review): Hold boundary test turn on a FIFO, require full sequence

* no-mistakes(review): Remove stray before/after supervision-host test copies

* test: hold the late close's render until the refusal window opens

The boundary recheck test's node shim slept a fixed 10s, which assumed
the first close was read before the host's refusal window opened. Under
load the close arrived after the refusal check, so the host correctly
refused it before the successor started and the render snapshot never
appeared. Block the wake-prompt render on a FIFO released at the
refusal-open instant read from the host's own start record, so the
pre-turn recheck must refuse on any machine speed.

* no-mistakes(review): Derive minimal park bounds and refresh supervision-host shard hint

* no-mistakes(review): Drive park-boundary tests from a seam-gated host test clock
* fix(bin): stage remote home clones before publishing them

A remote home provision cloned the code root directly into the public
FM_HOME path while rollback() claimed rm -rf of that same path on any
failure. Bash defers trapped signals past a foreground child, but any
other cleanup or lifecycle path that removes the home directory races
the live clone's object copy, producing the CI flake "fatal: failed to
copy file to .../.git/objects/...: No such file or directory".

Clone into a private staging directory beside the home and publish with
an atomic rename once complete, so no cleanup can remove a directory a
live clone is still writing; a home that appears mid-provision now dies
cleanly instead of inheriting torn state. The regression coverage holds
a real clone mid-copy, removes the public path, and requires the
provision to finish and publish intact.

* no-mistakes(review): Prove home ownership by sentinel and hold only a live clone

* no-mistakes(review): Assert raced provision publishes a complete, intact clone

* no-mistakes(document): Document remote home staging and publication safety

* no-mistakes(lint): Fix ShellCheck warning in clone integrity assertion

* no-mistakes(document): Clarify remote home publication and rollback guarantees
Brings upstream kunchenguid/firstmate main through ea7c7f7 (kunchenguid#5707, kunchenguid#5731,
kunchenguid#5664, kunchenguid#5727, kunchenguid#5583, kunchenguid#5516, kunchenguid#5728, kunchenguid#5710, kunchenguid#5733) into the house line.

Conflicts resolved keeping both sides:
- tests/fm-inactive-reconcile.test.sh: house's validation-handoff backstop
  tests and upstream's branch-ack receipt retirement test both kept.
- tests/fm-supervision-host.test.sh: the engine stub keeps house's per-row
  --row reports and adds upstream's captain and held modes; upstream's
  removal of the chain mode is kept.
Upstream kunchenguid#5664 added a doorbell parity case that interpolates paths with
${var@Q}, which macOS /bin/bash 3.2 rejects as a bad substitution. Pass
the mod and case directory through run_node's environment like the rest
of this file already does on house.
@jazz127
jazz127 merged commit 7cbaf4b into house Sep 26, 2026
1 check passed
@jazz127
jazz127 deleted the fm/firstmate-house-upstream-merge-r3 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.

4 participants