Repository navigation
Merge upstream: PR-poll security hardening, decision holds, instruction-ownership cleanup - #23
Merged
Merged
Conversation
…d#587) * fix: close away-mode blocker supervision gap * no-mistakes(review): Gate teardown retries and verify U+2063 dedupe * no-mistakes(test): Fail closed on incomplete Pi composer separators * no-mistakes(document): Document Pi composer recognition and return gating
* support Pi max thinking profiles * no-mistakes(review): Captain, allow Pi max dispatch profiles
…nguid#595) * Clarify validation response ownership * no-mistakes(document): Clarify yolo response ownership
* Add instruction owners foundation * no-mistakes(document): Refresh project-management owner pointers
…kunchenguid#626) * docs: compress firstmate operating contract * docs: make delivery rigor single-owner PR B already removed personal and stacked review requirements, but it did not explicitly assign rigor to the selected delivery path or forbid risk-based manual clean gates. That gap still permitted the Hi Bit inversion. * no-mistakes(review): Honor configured merge authority across faster delivery paths * no-mistakes(document): Align docs with compressed operating contract
* Add durable captain decision holds * no-mistakes(review): Validate decision hold retries and origin paths * no-mistakes(review): Enforce durable decision lifecycle boundaries * no-mistakes(review): Harden decision display and partial retry recovery * no-mistakes(test): Update scout teardown fixtures for decision inventory * no-mistakes(document): Align decision lifecycle and scout teardown documentation * no-mistakes: apply CI fixes * no-mistakes(review): Reconcile terminal decision holds * no-mistakes(document): Align captain decision-hold documentation
* fix: harden PR check artifacts * fix: close PR check migration gaps * fix: close PR check retry gaps * fix: clarify migration outcomes and ESM boundary * fix: keep failed migrations authoritative * test: use inert PR validation fixtures * no-mistakes(review): Reserve noncanonical PR quarantine namespace * no-mistakes(review): Prevalidate final PR-check teardown artifacts * no-mistakes(review): Preserve X metadata and validate teardown IDs * no-mistakes(review): Initialize migration state before watcher exclusion * no-mistakes(review): Isolate failed poll migrations from bootstrap recovery * no-mistakes(review): Allow safe polling during incomplete private repairs * no-mistakes(review): Authenticate watcher checks at execution time * no-mistakes(review): Preserve custom checks with hash-bound registration * no-mistakes(review): Clean custom check snapshots on watcher signals * no-mistakes(review): Stop watcher checks promptly on signals * no-mistakes(review): Terminate watcher check groups before cleanup * no-mistakes(document): Correct stale X-mode watcher documentation * fix: drain returned watcher check groups * no-mistakes(review): Harden quarantine links and recover validated replacement polls * no-mistakes(review): Preserve X mode across shim version transitions * no-mistakes(review): Refresh legacy X shims before marker short-circuits * no-mistakes(document): Correct persisted PR-check artifact documentation * no-mistakes(document): Correct stale PR-check documentation * fix: bind PR poll repair provenance * no-mistakes(review): Enforce single-link ownership for custom check artifacts * no-mistakes(review): Preserve private checks, X polling, and lifecycle IDs * no-mistakes(review): Separate task creation and legacy teardown validation * no-mistakes(review): Restore safe legacy operations and teardown validation * no-mistakes(review): Disambiguate migration obligations and preserve legacy retries * no-mistakes(review): Preserve fail-closed diagnostics and legacy quarantine evidence * no-mistakes(review): Reconcile legacy migration retries and teardown collisions * no-mistakes(review): Force legacy namespace reconciliation before marker short-circuits * no-mistakes(document): Document private poll artifact safety contracts * no-mistakes(lint): Suppress intentional literal-dollar lint finding * fix: migrate historical X poll identity * fix: harden PR check artifacts * no-mistakes(review): Preserve fail-closed diagnostics and legacy quarantine evidence * no-mistakes(review): Reconcile legacy migration retries and teardown collisions * fix: migrate historical X poll identity * no-mistakes(review): Harden X-mode artifact publication against symlink corruption * no-mistakes(review): Guard X artifact publication * no-mistakes(review): Enforce private X artifact reads * no-mistakes(test): Fix backend compatibility fixture dependencies * no-mistakes(document): Refresh PR-check documentation * no-mistakes(lint): Remove unused x-mode test locals * no-mistakes: apply CI fixes
* fix: compact session-start backlog digest * no-mistakes(test): Fix legacy backend fixture helper * no-mistakes(test): Fix watcher exit wait helper * no-mistakes(document): Document compact backlog digest
* fix: dedupe stale watcher guard banner * no-mistakes(review): Keep read-only guard state nonmutating * no-mistakes(document): Clarify stale watcher docs
* fix: balance bearings landed defaults * no-mistakes(document): Document balanced landed baseline * no-mistakes: apply CI fixes
* docs: clarify captain-facing translation contract * no-mistakes(review): Restore runtime fallback mandate * no-mistakes(document): Align Bearings translation wording
…#646) * fix: make bootstrap nudges deterministic * no-mistakes(review): Honor state override for bootstrap nudges * no-mistakes(review): Update benign bootstrap documentation labels * no-mistakes(review): Validate bootstrap nudge retry markers * no-mistakes(document): Align bootstrap nudge documentation * no-mistakes: apply CI fixes
…nchenguid#649) * Clarify concise secondmate registry contract * no-mistakes(review): Expand secondmate registry boilerplate coverage * no-mistakes(document): Point route docs to owner
…kunchenguid#654) * fix(bin): strip quotes on blocked_by in decision-hold resolve tasks-axi quotes multi-entry blocked_by as "a,b,c", so the comma-boundary membership test only matched middle elements. Strip surrounding quotes before matching so first and last hold ids resolve correctly. * no-mistakes(document): Refresh decision-hold regression evidence
* feat(secondmate): inherit shared captain preferences * no-mistakes(review): Honor shared captain data overrides * no-mistakes(review): Honor bootstrap data override registry * no-mistakes(document): Refresh shared inheritance docs * no-mistakes(document): Clarify inherited local-material docs
* feat(spawn): gate local agent secret injection * fix(spawn): align final Keychain slot * no-mistakes: apply CI fixes
* test: isolate herdr autodetect smoke session * no-mistakes(review): Restored autodetect smoke gate bypass * no-mistakes(test): Harden Herdr lab provisioning * no-mistakes(document): Refresh Herdr lab docs
# Conflicts: # AGENTS.md # bin/backends/herdr.sh # bin/fm-brief.sh # bin/fm-pr-check.sh # bin/fm-watch.sh # docs/scripts.md
…unchenguid#668) This reverts commit c27135c.
Several upstream changes merged silently (no textual conflict) against fork-only additions in ways that broke at runtime rather than at merge time: - fm-bootstrap.sh: upstream renamed the shared write_if_changed helper to the hardened x_mode_write_if_changed(dest, content, mode), but the fork's ClickStack/BetterStack webhook shim setup still called the old, now-deleted name on non-overlapping lines. Switched both call sites to the new helper. - Upstream's PR-poll security hardening made the watcher require every state/*.check.sh file to be either the x-mode shim or a registered custom check; the fork's ClickStack/BetterStack poll shims were neither, so the new migration step quarantined them as ambiguous legacy polls on first run, permanently breaking both alerts features. Registered both shims via bin/fm-check-register.sh at arm time (and clean up the resulting check-trust file on opt-out), updating the two tests' "no duplicate artifact" counts to include it. - bin/fm-brief.sh: a merge conflict resolution kept the fork's stale "firstmate reviews, captain approves" local-only wording instead of upstream's updated "captain approves" phrasing, tripping the new instruction-owners test that forbids the old personal-review phrasing. - tests/fm-spawn-agent-secrets.test.sh: the "op absent" gate case let a real system-installed op leak in through the ambient PATH tail; added a fake failing systemd-run so the fork's separate memory-cap wrapper (tests/fm-crew-memory-cap.test.sh) doesn't interfere with either.
# Conflicts: # tests/fm-spawn-agent-secrets.test.sh
This was referenced Jul 24, 2026
Merged
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.
Intent
upstream/main(kunchenguid/firstmate, 19 commits) into the fork'smainvia a true merge commit.bin/fm-pr-poll.sh) driven by a validated, atomically-published private sidecar (bin/fm-pr-lib.sh), replacing the old approach of writing task-controlled data into a generatedcheck.sh. A non-executing migration (bin/fm-pr-check-migrate.sh) quarantines older-format polls instead of ever running them.bin/fm-decision-hold.shplus the newdecision-hold-lifecycleskill formalize completing investigations/visual reviews without losing an unresolved captain decision.AGENTS.mdshrank from ~800 to ~480 lines by moving detail intoproject-managementanddiagnostic-reasoningskills and tightening cross-references instead of restating mechanics inline.blocked_byparsing fix (fix(bin): strip quoted blocked_by values during decision hold resolve kunchenguid/firstmate#654).Conflict resolution (7 files)
All conflicts were resolved by integrating both sides; no fork-only file or behavior was dropped.
AGENTS.md- three conflicts, all upstream's condensation of already-shared sections (wake-handling list, escalation phrasing, crewmate-brief scaffolding). Kept upstream's tightened prose in each, but preserved the fork-only lines it would otherwise have swept away: paging the captain viabin/fm-notify-captain.sh(section 9) and the--fork-onlybrief flag /docs/fork-only-delivery.mdpointer (section 11). Section 13's fork-only skill entries (clickstack-alert-response,betterstack-alert-response) sat outside any conflict and merged in cleanly alongside upstream's newdecision-hold-lifecycle/project-management/diagnostic-reasoningskills.bin/backends/herdr.sh- one conflict infm_backend_herdr_composer_state. Upstream added the Pi native-identity/separator-pair detection this fork's copy predates; the fork's own recent fix (PR fix(herdr): recognize queued-message hint and use unwrapped captures in composer_state #22, unshipped upstream) captures withrecent-unwrappedinstead of the width-dependentrecentsource so a narrow pane's word-wrap can't split or miscount the composer row. Took upstream's structure (session/pane setup, Pi detection) and layered the fork'srecent-unwrappedcapture calls on top - both fixes now apply together.bin/fm-brief.sh- one header-comment wording conflict (local-only mode's done line). During resolution I initially kept the fork's older wording ("firstmate reviews, captain approves..."), which turned out to be stale against upstream's own "firstmate never personally reviews code" contract change; a later commit on this branch corrects it to upstream's "captain approves, firstmate merges to local main". The--fork-only/--amendflags and their full contracts sat outside the conflict and were untouched.bin/fm-pr-check.sh- two conflicts: adopted upstream's hardened arm flow in full (validated atomic sidecar + static template, replacing the fork's old dynamiccheck.shheredoc). The fork-only PR-activity-poll feature (bin/fm-pr-activity-poll.sh, surfacing new PR comments/reviews aspr-commentwakes) no longer needs a hand-rolledcheck.sh; it's re-wired one layer up, in the watcher itself (next bullet), so it benefits from upstream's security hardening instead of fighting it.bin/fm-watch.sh- two conflicts. (1) Sequencing: upstream now runs the non-executing PR-check migration before lock acquisition; the fork writes its own watcher identity into the lock owner dir via aprep_fnhook for the turnend-guard race fix (PRs fix(watcher): publish watch lock identity atomically to close turnend-guard race #19-21). Kept both, migration first, identity-write during lock acquire. (2) Wired the fork-only activity poll into the per-task check loop: after the byte-static merge poll finds a tracked PR still open (empty output), the watcher now also runsbin/fm-pr-activity-poll.shand surfaces itspr-commentlines as the wake reason - merge still takes precedence and a merged PR never triggers an activity-pollgh apicall, same contract as before.docs/scripts.md- two conflicts, purely from the same file list growing on both sides; combined rows for upstream's newfm-decision-hold.sh,fm-check-register.sh,fm-check-lib.sh,fm-pr-lib.sh,fm-pr-poll.sh,fm-pr-check-migrate.shplus the fork'sfm-pr-activity-poll.sh(updated to describe it as watcher-run rather than check.sh-run) and thefm-brief.shrow's fork-only-delivery mention.tests/fm-spawn-agent-secrets.test.sh- a modify/delete conflict from the mid-pull upstream revert of feat: gate local agent secret injection kunchenguid/firstmate#658: upstream deleted this test along with the feature it covered; took the deletion.Fixes for silent (non-textual) integration gaps
Three problems surfaced only by running the test suite, not by
git mergeitself - each is an upstream refactor or new invariant landing on lines that never textually overlapped the fork's own code, so the merge produced no conflict but broke at runtime:bin/fm-bootstrap.sh: upstream renamed the sharedwrite_if_changed(dest, content)helper to the hardenedx_mode_write_if_changed(dest, content, mode)(atomic write + mode/device/link-count validation) and updated its own X-mode call sites, but the fork's ClickStack and BetterStack webhook shim setup (added on non-overlapping lines) still called the old, now-deleted name. Fixed both call sites to use the new helper.state/*.check.shto be either the exact-content-validated X-mode shim or a registered custom check (bin/fm-check-register.sh); anything else is treated as a legacy poll needing migration. The fork's ClickStack/BetterStack poll shims were neither, sobin/fm-pr-check-migrate.shquarantined them as ambiguous legacy polls on the very first post-merge bootstrap+watcher cycle, permanently breaking both alert features. Fixed by registering both shims viafm-check-register.shat arm time (and removing the resulting.check-trustfile on opt-out); updated the two suites' "no duplicate artifact" file-count assertions to account for it.bin/fm-brief.sh: a merge-conflict resolution mistake (see above) left a phrase upstream's own newfirstmate-instruction-ownerstest explicitly forbids; corrected to upstream's wording.Validation
bash -non everybin/*.shandbin/backends/*.sh- clean.shellcheck -x -S warningon every file touched by the merge or the follow-up fixes - clean, no findings.tests/fm-pr-check.test.sh(fork-only) for the new architecture: it previously drove the old dynamiccheck.shdirectly, which no longer exists. It now testsfm-pr-activity-poll.shstandalone (watermark init/preservation, item formatting/truncation, gh api error handling) plus integration tests that run the realbin/fm-watch.shbounded to verify it surfaces apr-commentwake when the tracked PR is open and never calls the activity poll once merged. All 7 pass.tests/*.test.shsuite (82 files after the deletion above): every file passes, includingtests/fm-pr-check-security.test.sh(upstream's own hardening tests, unmodified - confirms the fork's watcher and bootstrap changes don't regress the security properties it tests) andtests/fm-crew-memory-cap.test.sh(confirms the fork's per-crewsystemd-runmemory cap, unrelated to and unaffected by the reverted secrets feature, still works).tests/fm-afk-launch.test.sh("launcher signal: interrupted lifecycle resumed or retained its lock") reproduced identically on a clean pre-merge fork checkout, confirming it predates this pull (same flake PR fix(herdr): recognize queued-message hint and use unwrapped captures in composer_state #22 already documented).main: no files were deleted; every fork-only file (bin/fm-notify-captain.sh,bin/fm-fork-deliver.sh,bin/fm-pr-activity-poll.sh,bin/fm-clickstack-recv.sh,docs/fork-only-delivery.md,docs/clickstack-webhook.md,docs/betterstack-webhook.md, the ClickStack/BetterStack alert-response skills) is present and unchanged in content.