feat(bearings): fleet snapshot, view, and /bearings report (bearings stack) - #34
Merged
Merged
Conversation
Port upstream's primary-session PreToolUse guard subsystem, adapted to Claude-only. The two guards deny agent-mistake command shapes before they run. - bin/fm-arm-command-policy.mjs: the sole owner of firstmate's shell command classification (ported verbatim) plus the watcher-arm decision procedure. Drops the Codex-only checkpoint identity and the X-mode source-setup blessing (this fork has neither), leaving the arm/watch identities and cd/export setup nodes. - bin/fm-cd-command-policy.mjs: reuses that classifier to block a persistent top-level cd/pushd/popd that would relocate the primary shell. - bin/fm-arm-pretool-check.sh, bin/fm-cd-pretool-check.sh: Claude PreToolUse transports (upstream's multi-harness transport trimmed to Claude), wired in .claude/settings.json on the Bash matcher. The cd-guard is scoped to a real primary checkout and is inert in a linked crew/scout worktree; both fail open on transport uncertainty, and the arm classifier fails closed on an unclassifiable protected command. - docs/cd-guard.md, docs/arm-pretool-check.md, docs/scripts.md, AGENTS.md 8: the contracts and a one-line enforcement pointer. - tests: fm-cd-pretool-check (full 63-case decision matrix + scoping) and fm-arm-pretool-check (representative matrix + reason codes + transport + fail-open + prefilter). Local gate: shellcheck bin/*.sh tests/*.sh clean; all 23 tests/*.test.sh pass.
…stack kunchenguid#343+kunchenguid#300) Port upstream's bearings stack - a "pick up where I left off" report over the live fleet - adapted to the fork's herdr-native, Claude-only model. - bin/fm-fleet-snapshot.sh: read-only structured (JSON, fm-fleet-snapshot.v1) snapshot of the whole fleet. Rewrote the backend-abstraction layer to herdr primitives: meta reads via grep, endpoint presence via fm_herdr_pane_exists, and a fork-native open-decision model (the last unresolved needs-decision or blocked line, cleared by a resolving verb, since the fork emits no [key=...] decision markers). Dropped the fm-backend.sh source (a CLI here, not a lib) and the fm_backend_* / fm_meta_get / keyed status_open_decisions deps the fork lacks. - bin/fm-fleet-view.sh: verbatim human renderer over the snapshot JSON. - bin/fm-bearings-snapshot.sh: verbatim TOON projection; local-only by default, with --include-prs the only network path (plain gh is present in the fork env). - .agents/skills/bearings/SKILL.md: the /bearings skill (the four-section report). - docs/scripts.md, AGENTS.md: the three script rows and the status-report artifact. - tests: fm-fleet-snapshot-view (schema, backlog, endpoint, open-decision lifecycle, view render) and fm-bearings-snapshot (projection, local-only, landed). Local gate: shellcheck bin/*.sh tests/*.sh clean; all 25 tests/*.test.sh pass.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cd6240a7-dce9-4d9e-86dc-7a951481534b) |
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.
Ports upstream's bearings stack — a "pick up where I left off" report over the live fleet — adapted to the fork's herdr-native, Claude-only model.
What it adds
bin/fm-fleet-snapshot.sh— the read-only structured foundation (--json, schemafm-fleet-snapshot.v1): backlog (In flight / Queued / Done), one row per task meta with reconciled current state and herdr endpoint presence, open-decision hints, scout reports, and a secondmate-landed roll-up. No locks, wakes, or mutations.bin/fm-fleet-view.sh— a human fleet table rendered from the snapshot JSON.bin/fm-bearings-snapshot.sh— a compact TOON projection for the catch-up read; local-only by default (zero network), with--include-prsthe sole opt-in that touches GitHub..agents/skills/bearings/SKILL.md— the/bearingsskill: a dateddata/status-report-<date>.mdplus a four-section chat digest (Captain's Call / Recently Landed / Underway / Charted Next).Fork adaptation
The snapshot is written against upstream's multi-backend abstraction; the fork is herdr-native with no
fm_backend_*layer, so its backend integration was rewritten:grephelper instead offm_meta_get.fm_herdr_pane_exists(and secondmate agent-liveness the same way) instead offm_backend_target_exists/fm_backend_agent_alive.fm-backend.shsource — in this fork it is a CLI that dispatches on$@when sourced, not a library.[key=...]decision markers, so upstream's keyedstatus_open_decisionsfold would degenerate; replaced with tracking the last unresolvedneeds-decision/blockedline, cleared by a later resolving verb, and reconciled againstfm-crew-state(a provably-resumed run-step clears a stale gate).fm-fleet-view.shandfm-bearings-snapshot.shport verbatim (plainghis present in the fork env, so the opt-in PR path needs no change).Validation
Local gate:
shellcheck bin/*.sh tests/*.sh— clean (exit 0).tests/*.test.shpass, including the two new tests:fm-fleet-snapshot-view— schema, backlog parsing, a task row's kind/endpoint/current-state, the open-decision hint AND its lifecycle clearing when a run resumes, and the view render.fm-bearings-snapshot— the projected schema, the local-only default (a stubbedghis never invoked), and the landed roll-up from the Done backlog.Note
Medium Risk
Large new surface area touches supervision hooks (fail-closed arm policy) and fleet state interpretation; read-only snapshot paths are lower risk than the PreToolUse deny paths on every Bash tool call.
Overview
Adds a bearings stack for “pick up where I left off” reads: a read-only
fm-fleet-snapshot.sh(fm-fleet-snapshot.v1JSON over backlog, task metas, reconciled crew state, herdr endpoint presence, open-decision hints, scout reports, and secondmate-landed roll-up),fm-fleet-view.shas a human table renderer, andfm-bearings-snapshot.shas a bounded TOON projection (local-only by default;--include-prsis the only network path). The newbearingsskill drives/bearings: one dateddata/status-report-<date>.mdplus a fixed four-section chat digest, read-mostly with no fleet mutations.Fork-specific snapshot behavior uses grep-based meta reads,
fm_herdr_pane_existsfor endpoints, and a last-unresolvedneeds-decision/blockedopen-decision model cleared whenfm-crew-stateshows the crew resumed—instead of upstream’s multi-backend / keyed decision markers.Also wires Claude
PreToolUseBash hooks in.claude/settings.json:fm-arm-pretool-check.sh(fail-closed on bad watcher arms and broadpkill -f fm-watch) andfm-cd-pretool-check.sh(blocks persistent top-levelcd/pushd/popdin the primary checkout only), backed by shared shell lexing infm-arm-command-policy.mjsand siblingfm-cd-command-policy.mjs, with docs and behavior tests.Reviewed by Cursor Bugbot for commit 2a51552. Bugbot is set up for automated code reviews on this repo. Configure here.