Repository navigation
Conversation
…ocal.json in dirty check fm-spawn waits specifically for a */.treehouse/* cwd rather than any change off the project dir, so a transient default-cwd reading is never misrecorded as the worktree. fm-teardown's dirty check ignores the tracked .claude/settings.local.json that the turn-end hook modifies, so teardown is not blocked by firstmate's own hook.
Crash/reboot resilience: a WSL VM teardown (host sleep, idle timeout, Windows Update reboot) kills tmux and every crewmate at once and nothing relaunched firstmate afterward. systemd/firstmate.service runs bin/fm-resume.sh as a watchdog that recreates the persistent firstmate tmux session on boot and self-heals if it dies (KillMode=process, so stopping the unit never kills a live firstmate). bin/fm-install-autostart.sh installs/removes it. Pair with ~/.wslconfig vmIdleTimeout=-1 to prevent the idle teardown in the first place. Lock correctness: the wake-queue/singleton lock used mkdir as its atomic primitive, but mkdir is NOT atomic on WSL2's filesystem (verified: 4 concurrent mkdir calls succeeded on one path in a barrier race), so the lock double-granted under contention - duplicate watchers, raced wake-queue drains, flaky tests. Replaced with an O_EXCL (noclobber) create, atomic on Linux, WSL2, and macOS, which also writes the holder pid in the same step (no empty-pid window). Dead holders are reclaimed in one call; a live holder's lock is never stolen. Tests: fm-lock-exclusivity (canonical mutex probe + reclaim) and fm-resume (base-index-safe create + idempotency) guard both fixes; the singleton-start test now polls for the invariant instead of a fixed sleep.
tommy230
force-pushed
the
fm/crash-resilience
branch
from
June 23, 2026 19:19
b8a5466 to
7e0eade
Compare
This was referenced Aug 9, 2026
This was referenced Aug 11, 2026
This was referenced Aug 29, 2026
This was referenced Aug 29, 2026
|
@greptileai review |
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
…nchenguid#55) * docs(toolchain-manifest): add verified opencode row, correct absence notes Isolated toolchain probes on 2026-08-03 produced the verification this file was explicitly waiting for on opencode, and disproved one of its stated facts. The header claimed the local opencode install had "no platform binary". It has one and it runs: opencode-darwin-arm64/bin/opencode reports 1.18.3. The install is unusable because the package's postinstall never ran, so bin/opencode.exe is still the shipped 479-byte error stub and npm produced no PATH symlink. That is a wiring defect, not a missing build, and the note now says so. Add the opencode row. This file's rule is that a runtime is listed once its --version output has been parsed on a real machine, and the header named that as the pending action. The parse happened twice here: 1.18.3 from the platform binary above, and 1.17.18 from an isolated scratch-prefix install of the certified build. certified is transcribed from docs/watcher-continuity.md, not guessed. The row stays silent until opencode is back on PATH, per this file's absent-binary contract. Sharpen the grok note from "not installed here" to the measured cause: the x.ai installer left a truncated 59170816-byte download under ~/.grok/downloads and an empty ~/.grok/bin. That is 48.7% of the 121600480-byte certified artifact, and the partial binary is SIGKILLed on launch as an unsigned Mach-O. No grok row is added, because no --version output could be parsed. Pi and quota-axi certified versions are deliberately unchanged. Both were smoke- tested in isolation this session and both look safe to take, but an isolated smoke test is evidence for a decision, not a certification. tests/fm-toolchain-drift.test.sh and tests/fm-dispatch-select.test.sh pass. * no-mistakes(review): fix opencode manifest row why column and header note * no-mistakes(review): drop "full" from manifest certification rule * test(gotmp): link fm-busy-lib.sh into both fake-root fixtures tests/fm-gotmp.test.sh builds fake FM_ROOT trees and symlinks in the real scripts that fm-teardown.sh resolves. bin/fm-tmux-lib.sh has sourced bin/fm-busy-lib.sh since kunchenguid#51, but neither fixture links it, so the teardown subprocess could not load its tmux adapter and the suite failed on "teardown exited non-zero with a valid tasktmp". This is pre-existing on the default branch and unrelated to this branch's change: bin/ and tests/fm-gotmp.test.sh were both byte-identical to the base commit, and the only other file this branch touches is a data file no test in this suite reads. It is fixed here only because it blocks this lane's validation. Two fixtures needed the link, not one. test_teardown_skips_gracefully_without_tasktmp builds its own fake root inline rather than calling make_fake_root, so it duplicates the symlink block and drifted the same way. Verified: all 4 assertions in tests/fm-gotmp.test.sh now pass, and tests/fm-toolchain-drift.test.sh (9) and tests/fm-dispatch-select.test.sh (8) still pass. bin/fm-lint.sh is clean. * feat(primary): warn instead of blocking on Kimi version drift bin/fm-primary.sh gated the Kimi primary on exact string equality with KIMI_VALIDATED_VERSION. Kimi ships a self-updater, so that gate turned every publisher release into an unscheduled outage of the certified primary rather than leaving it merely uncertified. It then stayed down permanently: the pinned 0.27.0 build no longer exists anywhere on the captain's machine, not in ~/.kimi-code/bin and not in the /tmp lab docs/kimi-harness.md records, so no value of FM_KIMI_BIN could satisfy it. Drift now warns on stderr and launches. The functional gate is unchanged: `kimi doctor` against the managed home still fails a launch closed when the integration is actually broken, as do the managed-path symlink refusals. This is the reasoning bin/fm-toolchain-lib.sh already applies fleet-wide; its header cited this exact pin as the counter-example and now records that it was fixed. Cursor keeps its exact-match block deliberately. Its Stop turn-end hook is unverified rather than merely drifted (docs/cursor-harness.md), so drift there is not the same class of problem. KIMI_VALIDATED_VERSION moves to 0.31.1 because that build's primary hook mechanics were re-verified live today, so the warning now fires only on genuinely unevidenced builds. Verified in a scratch FM_HOME, scratch Kimi source home, and scratch managed home, with the captain's ~/.kimi-code read through symlinks and never written, and with the plugin's hook commands swapped for logging stubs so the probe never ran Firstmate's real guards: - sessionStart skill injection PASS. The model reported the injected system-reminder and emitted its token instead of answering the prompt. - PreToolUse (Bash) PASS. PRETOOL_FIRED logged when the model ran a command, and the command was permitted. - Stop turn-end PASS. STOP_FIRED logged once per completed turn. - `kimi doctor` against the managed home: all config files valid. The plugin manifest schema fm-primary.sh writes is still accepted unchanged. Evidence recorded in docs/kimi-harness.md, which the toolchain manifest's certified column now transcribes. Stale claims updated where this change makes them false: the kimi manifest row, bin/fm-toolchain-lib.sh's header, AGENTS.md, docs/configuration.md, and the harness-adapters skill. Dated historical certification records in docs/architecture.md and the worker sections are left alone; they remain accurate history. tests/fm-primary.test.sh now asserts the new contract - drift warns, reaches the launch command, and doctor still fails closed. All 12 assertions pass, as do fm-toolchain-drift (9), fm-kimi-worker (5), fm-gotmp (4), and fm-dispatch-select (8). bin/fm-lint.sh is clean. * no-mistakes(review): revert kimi certified to 0.27.0, align docs and fixtures * no-mistakes(review): accept both evidenced Kimi builds without warning * no-mistakes(review): clarify Kimi evidence wording, guard certified constant * no-mistakes(review): move certified-constant guard into manifest test suite * no-mistakes(document): align onboarding and Kimi doc scope with warn-not-block * fix(test-run): map ONBOARDING.md as documentation-only source The changed-test map had no entry for ONBOARDING.md, so the required fork-surface step failed closed the first time this branch touched that file. fork-surface.conf already declares the onboarding-guide capability as documentation-only with proves = none, so the guide belongs in the same prose branch as README.md rather than owning a behavior family. The empty-selection fixture now touches ONBOARDING.md alongside README.md so the classification stays covered.
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 2, 2026
kunchenguid#59) * fix: restore stock macOS Bash 3.2 brief scaffolding Hand-port upstream 514f0ab while preserving the fork's brief and lint contracts. * fix(bin): normalize relative durable paths Hand-port upstream 6ec5e08 into the fork's spawn, lock, X-mode, and isolated-secondmate paths. * fix(bin): allow session-local todo tools in the subagent guard Hand-port upstream 7cbb3f6 while retaining the fork's tracked status-line boundary and exact delegation guard. * test: replace temp-root source assertions with behavioral coverage Adapt upstream a2d5f26 by moving GOTMPDIR coverage through the real spawn interface. Retain fork capability tests and shard ownership that upstream deleted because they protect declared fork-surface contracts. * fix(bin): preserve full task contract in no-mistakes intent Hand-port upstream 68641a3 into the fork's generated no-mistakes brief without changing faster delivery paths. * fix(bin): parse punctuated secondmate registry entries safely Adapt upstream 1e24757c8e394532579a3ac0d43fe87dddc626b0 around this fork's isolated secondmate homes. Centralize suffix parsing and binding validation while preserving seeded-home, operational-directory, and cleanup boundaries. * test: register and tighten the secondmate parser adaptation Declare the converged upstream 1e24757 surface, preserve established nested-home refusal wording, and keep the touched snapshot script ShellCheck-clean. * fix(bin): scope registry defects to the entry under validation Add a scoped validation mode so a defect in one secondmate registry entry stops only that entry, and keep strict mode for a deliberate whole-registry audit. A malformed or unresolvable line for an unrelated secondmate must never abort spawning or tearing down a healthy one, and only the duplicate and overlap checks the expected entry genuinely takes part in can refuse it. Tolerate an absent binding in scoped mode and report it through SECONDMATE_REGISTRY_MATCH_FOUND, so a caller holding other proof of ownership can still reach guarded cleanup. A binding that exists but points elsewhere still refuses in either mode. Name a refused symlinked registry as its own condition instead of returning the same empty result as an unregistered id, so read paths can report the real cause. Trim trailing whitespace from every parsed field, which the parsers this library replaced all did, and resolve paths inside a subshell so the caller's working directory is never relocated. Collapse the ten repeated temp-directory removals into one cleanup owned by the entry point. * fix(bin): consolidate the durable path normalizer behind one owner Five near-identical copies of the relative-path normalizer had drifted across brief, spawn, afk launch, and bootstrap, all spelling the same resolution and the same operator diagnostic. Give them one owner in bin/fm-path-lib.sh, keep that diagnostic byte-identical because three test files assert on it, and keep bootstrap reporting through its own arm-failed path rather than exiting. Normalize FM_HOME in teardown through the same owner. The registry isolation check resolves that home with a resolver that refuses a relative path, so a relative FM_HOME refused every guarded secondmate and child home removal - the exact bug class this batch exists to close. Resolve inside a subshell so no caller's working directory is relocated, and declare the new fork-only path in fork-surface.conf. * fix(fork-surface): point the normalizer capability at its landed commit The declaration was written alongside the implementation and briefly referenced an amended-away commit, which resolves as a dangling object but is not in this branch's history and would rot exactly like the stale pre-merge refs already corrected on the default branch. Point it at the commit that actually carries bin/fm-path-lib.sh. * fix(bin): stop unrelated registry entries blocking spawn and teardown Spawn and teardown validated the whole secondmate registry and refused on the first defect anywhere, so one malformed or unresolvable line for an unrelated secondmate aborted work on a perfectly healthy one. That changes which worker runs the captain's work and strands guarded cleanup. Both now validate in scoped mode: defects of the entry being acted on still refuse, along with the duplicate and overlap checks that entry genuinely takes part in. Validate a nested secondmate against its parent home's own registry rather than the top-level one. Nested entries are only ever registered in the parent, and teardown already reads that file, so a forced teardown of a secondmate owning a nested secondmate refused with a binding it could never have found. Tolerate an absent binding when the on-disk marker has already proved ownership, so a home deregistered early or orphaned by a partial decommission stays removable through the guard instead of only by hand. Source the registry library explicitly in spawn and update instead of relying on fm-ff-lib.sh pulling it in, and drop the unreachable projects default. * fix(bin): name a refused registry symlink without changing its established wording Keep the operator-facing "unavailable or unsafe" phrasing the seeding tests assert on, and append the actual cause so a symlinked registry is no longer indistinguishable from a missing one. Link the libraries teardown really sources into both fake-root fixtures. The path library is new, and the busy library has been a transitive requirement of the tmux adapter since kunchenguid#51, so without them the teardown subprocess failed before reaching the behaviour under test. Drop the fakebin and backends scaffolding, which nothing writes into now that the adapter is an inline stub. * fix(bin): report a refused registry symlink on every read path The shared lookup refuses a symlinked secondmate registry, which is right, but three read paths had no error branch and turned that refusal into silence: the live-secondmate listing and the nudge retry both fell through as "no home", and backlog handoff reported that the secondmate had no home at all. An operator who symlinked the registry saw every secondmate look unregistered with nothing naming the real cause. Each read path now distinguishes a refused registry from an unregistered id and says which one it hit. The listing reports once per listing rather than once per secondmate. A silent wrong answer is the failure class this fleet never accepts. * test: restore the lint severity contract and stop leaking task temp roots The canonical-set refactor dropped the two guards that kept bin/fm-lint.sh from lowering severity below the CI default or blanket-excluding checks CI enforces, and put nothing in their place. Prove that contract through the real lint interface instead of grepping the owner's source: a fixture carrying a default-severity finding must still fail, and must still name it. Follow symlinks when building the expected inventory. The owner globs those directories and a glob includes symlinked scripts, so plain -type f would false-fail as soon as a symlinked test is added - a pattern this suite already uses elsewhere. Derive the task temp root from the meta value spawn publishes rather than repeating spawn's own spelling, so a directory left by an earlier failed run cannot make the assertion pass spuriously. Clear every spawn's root from one exit trap: the leak was suite-wide, not confined to the three cases that lacked an explicit cleanup line. * fix(bin): give the snapshot one registry grammar and stop conflict probes failing open The fleet snapshot carried a second, hand-maintained copy of the registry suffix grammar that had already drifted from the shared parser: it accepted a looser id charset and an empty scope, so lines the parser rejects were reported as healthy bindings while every other consumer refused the registry. Feed jq records the shared parser produced instead, and report a line it rejects as malformed rather than as a home. Separate "no conflict found" from "registry entry is malformed" in the home assignment probes. Both returned 1, and the callers gate on empty output, so a malformed registry read as a clean bill of health and skipped the duplicate-home and duplicate-id guards entirely. * test: cover the scoped-validation and shared-grammar rulings Prove the behaviour the rulings settled rather than the shape of the code. A healthy secondmate still tears down when unrelated registry entries are malformed or point at a vanished home. A home whose registry entry was already removed is still removable once its on-disk marker proves ownership, while a binding that exists and points elsewhere still refuses and says so. The fleet snapshot and the shared parser agree on entries the parser rejects, so a bad id or an empty scope can no longer surface as a healthy home in one consumer while every other one refuses it. * fix(fork-surface): repoint capability refs at their rebased commits Rebasing onto the current default branch rewrote the two commits this batch's capability entries named, leaving them pointing at objects that are no longer in this branch's history. They still resolve while the old objects survive, so the check stays green and the rot is invisible - the same stale pre-merge reference class already corrected on the default branch. Point both at the commits that actually carry the declared paths. * no-mistakes(review): name refused registry symlinks on every read path * no-mistakes(document): docs: cover new path and registry libs, teardown normalization
Refresh the installed page on the TB14 (after merge)Pull, then copy the page over the installed copy. This works at a cmd prompt ( Reload the page in the browser afterwards. Ticks are kept: they live in the browser's storage, keyed |
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 18, 2026
…a job's report (kunchenguid#51) * feat(bin): read a call's or job's report from the Factory pane with r or a click, and ask scouts for a page beside their report * no-mistakes(review): Allow indented Lavish launch line in fm-read fork-surface anchor * no-mistakes(document): List scout page.html in the home layout inventory * no-mistakes(review): Make r on a factory read only drawn jobs * no-mistakes(document): Clarify that r on a factory reads the first shown job --------- Co-authored-by: Starship <[email protected]>
fritznoff
pushed a commit
to fritznoff/starship
that referenced
this pull request
Nov 18, 2026
Brings in the Factory pane report line (kunchenguid#51) so the pipeline sees the branch on top of the current main and keeps the upstream merge commit intact instead of replaying its commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
O_EXCLfile locks, preserving legacy lock compatibility, and tightening spawn/teardown safety checks.Risk Assessment
Testing
Captain, I ran the targeted regression tests for lock atomicity, resume/autostart behavior, spawn worktree detection, teardown safety, and wake-queue supervision; then manually demonstrated the operator-facing CLI flow for autostart rendering and
fm-resumesession resurrection. All checks passed, with no UI surface involved, so no screenshot evidence was applicable.Evidence: Relevant shell test transcript
Evidence: Rendered firstmate.service
Evidence: Autostart installer CLI transcript
installed and enabled firstmate.service firstmate will now auto-resurrect on every boot and self-heal if it dies. --- unit --- enabled: no active: no --- session --- firstmate tmux session: not presentEvidence: fm-resume create transcript
fm-resume: created session 'evidence-firstmate' running firstmateEvidence: fm-resume idempotent transcript
fm-resume: session 'evidence-firstmate' already liveEvidence: Firstmate launch evidence
fake codex launched: cwd=/Users/thomascarney/.no-mistakes/worktrees/73d6a10257e9/01KVTJ77EVGGTJX83VHV0SGHAN args=--dangerously-bypass-approvals-and-sandboxPipeline
Updates from git push no-mistakes
⏭️ **intent** - skipped
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 2 issues found → auto-fixed (8) ✅
bin/fm-wake-lib.sh:98- Legacy directory locks with an empty or not-yet-written pid are reclaimed immediately. During a rolling update, an old mkdir-based holder can create the directory before writing pid; this branch will remove that fresh live lock and allow a second holder. Apply the same fresh-empty stale grace used for file locks beforerm -rf.bin/fm-resume.sh:32- Autostart defaults are machine- and harness-specific: the service launches Claude with/mnt/c/Users/Owenz/.claude-orchestrator. In this shared repo, a default install on another user, another Windows profile, or a Codex/opencode firstmate will resurrect the wrong command or fail. Decide whether to render configured harness/bin/config into the unit or keep this intentionally single-machine.🔧 Fix: Captain, fix autostart and legacy lock races
1 error still open:
tests/fm-lock-exclusivity.test.sh:1- CI executes everytests/*.test.shdirectly, but this new test andtests/fm-resume.test.shwere added with mode100644, so the behavior-test job will hitPermission deniedbefore running them. Commit both with executable mode100755.🔧 Fix: Captain, make new tests executable
2 issues (1 error, 1 warning) still open:
systemd/firstmate.service:10- The systemd unit always runs the resumed session as root. A normal captain running firstmate as their own user will get a separate root-owned tmux server, root HOME/config/auth, andtmux attach -t firstmatefrom their account will not see the resurrected session. Render the intended user into the unit or make this a user service.bin/fm-teardown.sh:398- The dirty check now ignores any status line containing.claude/settings.local.json, including tracked or modified files. If a project tracks that path, teardown can proceed and thenrm -fit, discarding unlanded work. Restrict the exclusion to the generated untracked file, or rely on the git-info exclude path instead of suppressing tracked changes.🔧 Fix: Fix autostart user and teardown dirty check
3 issues (2 warnings, 1 info) still open:
bin/fm-install-autostart.sh:118-firstmate_commandfailures are hidden by the nested command substitution, so an unknown harness or missing binary can still install a unit withFM_FIRSTMATE_COMMAND=blank. Capture the raw command withcommand=$(firstmate_command) || return 1before quoting, so install fails instead of writing a broken autostart unit, captain.bin/fm-resume.sh:93- In--watchmode,ensure_session || truedisableserrexitinside the function; iffirstmate_commandfails here, the function continues, creates the tmux session, sends onlycd <root> &&, and future iterations no-op because the empty session now exists. Explicitly return on launch-command failure beforetmux new-session.bin/fm-install-autostart.sh:173- The status fallback never runs whensystemctl is-enabledoris-activefails because the failing command is piped intosedwithoutpipefail; a missing unit prints neitherenabled: nonoractive: no. Use anifor enablepipefailfor these checks.🔧 Fix: Captain, fix autostart failure handling
1 warning still open:
bin/fm-install-autostart.sh:152- The installer needs system privileges for/etc/systemd/system, but the unit is rendered in the same process that performs the privileged install. A normal user run can infer the active harness but fails atinstall; asudorun can write the unit but commonly loses the harness ancestry, user PATH, and nvm-installed binary paths, so default install can fail or require undocumented env overrides. Render the unit as the invoking user before privilege escalation, or document/enforce the requiredsudo -E/FM_FIRSTMATE_COMMANDflow.🔧 Fix: Captain, fix autostart privilege split
1 error still open:
bin/fm-spawn.sh:333-fm-spawn.shnow accepts only pane cwd paths containing/.treehouse/, buttreehouse getcan return worktrees outside the project, for example the installedtreehouse statusreports paths under~/.treehouse/.... Those valid spawns will wait 60s and fail even though the subshell entered a worktree. Validate the cwd as a git worktree for$PROJ_ABSinstead of hardcoding the path substring.🔧 Fix: Captain, validate spawn worktrees by git registration
2 warnings still open:
bin/fm-install-autostart.sh:69- IfFM_FIRSTMATE_HARNESSnames a supported harness but the binary is not onPATHand noFM_<HARNESS>_BINoverride is set,firstmate_binreturns nonzero but the caller continues with an emptybinbecause it is invoked underraw_command=$(firstmate_command) || return 1. This can install a unit with a brokenexec --...launch command; make eachbin=$(firstmate_bin ...)explicitly|| return 1, captain.bin/fm-resume.sh:60- The same missing-binary path exists in directfm-resume.shuse: a supported-but-unavailable harness can produce an emptyexeccommand, create the tmux session, and then future watchdog iterations no-op because the session exists. Explicitly return whenfirstmate_binfails before building the launch command.🔧 Fix: Captain, guard missing harness binaries
1 warning still open:
bin/fm-wake-lib.sh:102- Legacy stale directory cleanup now usesrm -rf "$lockfile"; if two new processes race on the same stale legacy lock, one can remove the directory while another creates the new O_EXCL file lock, and the delayedrm -rfcan delete that live file lock. Move the legacy directory aside first, or remove it with pid-file plusrmdir, so cleanup cannot unlink a replacement lock.🔧 Fix: Captain, harden legacy lock cleanup
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
tests/fm-lock-exclusivity.test.shtests/fm-resume.test.shtests/fm-install-autostart.test.shtests/fm-spawn-worktree.test.shtests/fm-teardown.test.shtests/fm-wake-queue.test.shManualbin/fm-install-autostart.sh installusing fake systemd tools withFM_UNIT_DSTwritingrendered-firstmate.serviceinto the evidence directoryManualbin/fm-resume.shcreate/no-op run against an isolated tmux socket, verifying the fake firstmate process launched from the worktree with the expected codex bypass argumentgit status --shortto confirm no working-tree artifacts remained✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.