feat: add bootstrap and watcher drift checks#3
Closed
Freudator86 wants to merge 3 commits into
Closed
Conversation
Freudator86
force-pushed
the
fm/fork-recover-k9
branch
from
July 19, 2026 17:21
b3de017 to
e416ee5
Compare
Owner
Author
|
Superseded - PR #4 (fm/fm-recover-fork-drift) already merged the same reconciliation independently (same 12 recovered commits, same genuine two-parent merge goal). Not merging this one. |
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
Reconcile two diverged histories of firstmate's own repo into a single branch via a GENUINE MERGE COMMIT (not a rebase, squash, or manual re-application). origin/main advanced 34 commits after the 2026-07-13 origin repoint, while 12 real fork-maintenance commits (fork-sync detection, Bridge-inbox wake handling, the AXI-suite self-update mechanism, an upstream-firstmate-update check, and two watcher Bridge-inbox dedup fixes) were merged locally but never landed on origin. Those 12 were preserved on branch fm/recover-unlanded-fork-commits-2026-07-19; this branch merges them back with git merge --no-ff so BOTH parent histories stay intact. The single commit on this branch is intentionally a 2-parent merge commit and MUST stay one - it must not be squashed or flattened (firstmate will land the PR with --merge). All 12 conflicts across 12 files were resolved by hand on merit, not blind ours/theirs. Guiding principle: origin/main had condensed its instruction surface (moving detail into docs/skills), while the recovered side carried older verbose prose plus genuinely-new functionality, so I kept origin/main's newer condensed structure and layered in the recovered features where additive. Key deliberate decisions a diff-only reviewer would not know: (1) In bin/fm-watch.sh I kept origin/main's process-group-aware run_check_process and bounded capture machinery AND added the recovered run_bounded helper plus the full Bridge-inbox scanning functions - they are separate helpers, both needed, not either/or; run_check stays origin/main's version. (2) In AGENTS.md I took origin/main's condensed sections 4 and 8, deliberately dropped a duplicate 'digest's context section' paragraph that origin/main had already removed, folded the recovered fork-sync/upstream-update tooling into section 12, and preserved the Bridge-inbox wake as a check: source. (3) I intentionally did NOT add an inline '### AXI-suite currency' subsection to AGENTS.md because that functionality is already owned by docs/configuration.md and the bootstrap-diagnostics skill (per this repo's one-owner/size-discipline coding guidelines). (4) I corrected one semantic inconsistency the textual 3-way merge could not catch: AGENTS.md section 3 said 'five MUTATING sweeps' but the merged bootstrap now runs six (the recovered AXI-suite currency check is a sixth lock-gated sweep), so I updated it to 'six'. (5) For the pi extension test conflicts I took origin/main's 'loader' structure (its .mjs loader), dropping the recovered node-version skip guard, because the merged pi source is origin/main's and its shared test bodies reference the loader. Repo is firstmate's own shared template; changes respect firstmate-coding-guidelines (one sentence per line in Markdown, plain dash, no agent co-author, shellcheck-clean, colocated tests). All bin scripts pass bash -n; every conflict-resolved and directly-affected test passes locally; the pinned ShellCheck 0.11.0 lint is not installable in my worktree so CI/no-mistakes owns it.
What Changed
Risk Assessment
Testing
Captain, the previously successful full baseline is accounted for; I reran the smallest directly relevant automated tests for Bridge inbox, fork-sync, AXI-suite, and upstream-update behavior, then captured ancestry and Bridge wake transcripts. Runtime behavior passed, but validation fails on the user-intent requirement that the branch tip itself be a two-parent merge commit.
Evidence: Merge Ancestry Evidence
Shows HEAD has one parent, while HEAD^^ is the two-parent merge commit.Evidence: Bridge Inbox Wake Evidence
Shows a configured Bridge inbox producingcheck: bridge-inbox..., durable.wake-queueentry, and no working-tree envelope mutation.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
⏭️ **Rebase** - skipped
.agents/skills/afk/SKILL.md- branch carries 12 commit(s) that exist on your local main branch but were never pushed to origin/main; rebasing would bundle this unrelated work (146 file(s)) into the PR:Push main to origin, or rebase your branch onto origin/main, before gating.
🔧 **Review** - 2 issues found → auto-fixed (2) ✅
bin/fm-watch.sh:531- Bridge priority parsing depends onjq, but a missing or failingjqis silently mapped tonormal, so configured Bridge homes withoutjqwill not tighten polling forhighorimmediateenvelopes. Requirejqwhen Bridge scanning is enabled or make the fallback preserve urgent priorities withoutjq.bin/fm-fork-sync-check.sh:113- The fork-sync diagnostic writes the full upstream-only and fork-only commit lists, and bootstrap later cats this persisted file verbatim on every session start. A large divergence can bloat startup output and context; cap the listed commits and include a truncated count or follow-up command for the full list.🔧 Fix: Captain, bound fork-sync diagnostics
2 issues (1 error, 1 warning) still open:
bin/fm-axi-suite.sh:207- Locked bootstrap callsfm-axi-suite.shwithout--check-only, so thisnpm install -gpath can upgrade globally installed tools during session start without the current-session approval required byAGENTS.md. Captain, either explicitly approve that policy change or make bootstrap report eligible updates for approval before installing.bin/fm-watch.sh:603- When the inbox signature changes but the priority scan times out or fails, this falls back to the previous cached priority.bridge_inbox_checkcan then surface and mark the new signature as handled with stale priority data, so an urgent new envelope may never be retried with the correcthigh/immediatepriority. Returnnone/unknown for a changed signature on scan failure so the next cycle retries instead of surfacing with stale cache.🔧 Fix: Captain: avoid stale Bridge priority cache
✅ Re-checked - no issues remain.
git show --pretty=%P HEADreports only parent6cd8ad48...; the actual two-parent merge isHEAD^^(85b42b15...) with parents2bdd0f14...and8a5fd11.... This conflicts with the stated intent that the single commit on the branch must stay a genuine merge commit, because the branch now has two one-parent no-mistakes review commits on top.command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"Baseline already completed before this run:command -v tmux >/dev/null || { echo "tmux is required for e2e tests" >&2; exit 1; }; tmux -V; rc=0; for t in tests/*.test.sh; do echo "== $t =="; bash "$t" || rc=1; done; exit "$rc"git show --no-patch --pretty='format:%H%n%P%n%s' HEADandgit show --no-patch --pretty='format:%H%n%P%n%s' HEAD^^git log --oneline --graph --decorate --max-count=10bash tests/fm-watch-bridge-inbox.test.shbash tests/fm-fork-sync-check.test.shbash tests/fm-axi-suite.test.shbash tests/fm-firstmate-update-check.test.shManual Bridge inbox CLI scenario usingFM_HOME=<evidence-home> FM_BRIDGE_VESSEL=coditan FM_POLL=1 ... bin/fm-watch.sh, with watcher output and.wake-queuecaptured✅ **Document** - passed
✅ No issues found.
🔧 Fix: Captain, verify pinned ShellCheck lint passes
1 warning still open:
🔧 Fix: Captain, verify pinned ShellCheck lint passes
1 warning still open:
🔧 Fix: Captain, verify pinned ShellCheck lint passes
1 warning still open:
✅ **Push** - passed
✅ No issues found.