feat: integrate upstream runtime and dispatch updates - #19
Merged
Merged
Conversation
…chenguid#2570) * fix(bin): report remote secondmate delivery and state truthfully A steer to a remote secondmate crosses fm-on.sh to a host-local fm-send leg whose unconfirmed submit read-back (verdict=pending, typically a busy mate whose harness queues the steer) was flattened into exit 1, so the parent printed "error: text not submitted" / "error: text not sent" and discarded the pending-reply expectation for a steer that had actually landed. fm-send now carries the verdict across the ssh boundary as a documented delivered-unconfirmed exit 3: the parent reports the steer as delivered with confirmation pending, exits 0, keeps the expectation armed (awaiting_report), and closes --resolve-key decisions, while transport loss (ssh 255) and real remote failures keep failing loudly with the remote leg's stderr attached. A local unconfirmed submit now also exits 3 with an honest non-error message and still never closes a decision key. fm-crew-state.sh and fm-peek.sh no longer read a remote mate's endpoint through local probes (which misreported a healthy mate as "worktree gone" / "can't find session: remote"): both now use the true remote source over fm-on.sh, and an unreachable or unreadable remote reads as unknown-remote, never as gone or dead. * no-mistakes(document): Document remote delivery and state truth * no-mistakes: apply CI fixes
* Adopt quota-axi 0.1.29 spendPriority-primary array dispatch. quota-axi 0.1.29 publishes schema 5 with selection.spendPriority as the primary comparative signal and demotes derivation fields out of default --json. Rank comparable-fit candidates on that scalar, keep runway versus the completion horizon as a hard gate, and raise the compatibility floor so a pre-consolidation build cannot reach dispatch intake. * no-mistakes(review): Correct schema fixtures and remove prescriptive selection prompts * no-mistakes(document): Correct quota verification evidence chronology * Collapse quota-array-dispatch onto TOON-first spendPriority ranking. Decide from quota-axi's default TOON; keep --json as a rare defensive fallback. Rank by spendPriority after eligibility, reasoning-class, and runway-feasibility gates, and drop the hand-computed Pareto, pace, reserve, and window-id layers. * no-mistakes(review): Permit ambiguous JSON fallback and correct reset fixtures * no-mistakes(review): Correct runway semantics and escalate unresolved uncertainty * no-mistakes(document): Document TOON-first quota dispatch evidence
* docs: add GROK_BOT.md Grok Bot system prompt * docs: amend GROK_BOT.md with charter report-back and delegation marker * docs: classify GROK_BOT.md as public-product * docs: make GROK_BOT.md the plain Grok Bot system prompt
Refine language for clarity and consistency in instructions.
…#2595) * fix(bin): guarantee inactive-reconcile scan progress under second quantization The inactive-outcome scan computed its aggregate deadline in whole seconds, so a 1-second budget's effective value lands anywhere in (0,1]; a scan starting just before a wall-clock second boundary rounded its whole budget away mid-scan and exited having visited no child, while the durable cursor had already advanced past the never-examined child. This is the CI flake behind tests/fm-inactive-reconcile.test.sh's 'next bounded scan did not resume with the following child' (watcher-wake-lock family, portable serial 2, seen on the PR kunchenguid#2590 run). Every scan now visits at least its first due child with the per-child state-read bound floored at one second, so no invocation can be a zero-work no-op. The outer process-group kill moves to budget+1s: the scan's own deadline enforces the budget, and the kill is a backstop for a scan wedged in an unbounded wait instead of a racer that routinely preempts the clean bounded exit. The wake-lock-wait test bound tracks the backstop (3s -> 4s); the previously flaky assertion is unchanged. * no-mistakes(document): Document inactive-reconcile deadline backstop
Refactor the guidelines for Firstmate's role and delegation process, emphasizing the importance of crewmates and asynchronous work.
Clarified guidelines for handing off work to crewmates and managing secrets.
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
Integrate official upstream into the permanent personal-fork main, as the captain ruled on 2026-08-18 and as tracked by firstmate-upstream-integration-2026-08-18. This is a scheduled upstream synchronization, not a feature change: the goal is that fork main carries every official upstream commit while still carrying every deliberate fork divergence, so live homes can keep consuming validated fork main by fast-forward.
It is also a hard precondition for separate work. The divergence integration for firstmate-declared-pause-not-absorbed is blocked behind it, because bin/fm-fork-topic.sh integrate refuses to add a divergence topic while official upstream is not integrated and validated into fork main.
What this candidate contains: fork main c88b1ff merged with upstream/main 03bb1d8, bringing the 8 upstream commits fork main lacked - remote secondmate delivery and state reporting (kunchenguid#2570), spendPriority quota dispatch (kunchenguid#2574), the GROK_BOT.md system prompt and its follow-ups (kunchenguid#2590, kunchenguid#2592), inactive reconciliation scan progress (kunchenguid#2595), and three documentation revisions. The merge was prepared through the owning helper in an isolated worktree of the private fork-integration clone, never in an operating checkout, and it resolved cleanly with no product conflicts, so no divergence re-justification decision was raised and no rerere resolution had to be settled.
Verification already performed before starting validation, per the fork-main-integration procedure:
Acceptance for this change is that fork main ends up with official upstream as an ancestor while every deliberate divergence is still carried and the manifest stays healthy. Nothing here should alter product behaviour beyond what those upstream commits already carry, and no divergence may be silently dropped or weakened to make the merge succeed.
Constraints in force: never force-push or rewrite a published topic or pull-request branch; the delivery must go to fork main through this isolated fork-target registration rather than to official upstream; and the resulting fork pull request requires genuinely green fork CI and the captain's explicit merge approval using the regular merge method, so the inner topic merges stay reachable.
What Changed
03bb1d8while preserving the fork’s tracked divergences and recording the synchronization in the manifest.spendPriorityflow and add updated Grok, delegation, and secret-handling guidance.Risk Assessment
Testing
After recreating the stripped remote-ref context in a disposable clone and enabling the quota suite’s explicit live mode, candidate health, the 35-commit range-diff, ancestry/content checks, six focused behavior suites, and manual remote-send/peek evidence all passed; this is a CLI/Git change with no UI screenshot applicable, and the worktree is clean.
Evidence: Candidate fork-health report
Evidence: Carried-divergence range-diff
Evidence: Remote secondmate CLI transcript
Evidence: Integration acceptance facts
Evidence: Live spendPriority decisions
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-crew-state.sh:163- The new remote state read has no local deadline. A busy or wedged remote worker can leavefm-on.shwaiting for minutes;fm-fleet-snapshot.shcalls this helper before its existing 8-second remote probe, defeating its invariant that one broken home cannot hang the snapshot. Bound remote reads with the shared timeout mechanism, propagate the snapshot timeout, and apply the same contract tofm-peek.shremote capture.✅ **Test** - passed
✅ No issues found.
git show --no-patch --format=... 41a78196b191942570edc1a907b32ccfe10a6fe5andgit log --reverse c88b1ff..03bb1d8bin/fm-fork-status.sh --repo "$PWD" --fork-ref HEAD --facts-only(initial setup lacked the strippedupstreamremote), then candidate health in a disposable clone with reconstructed canonical refsgit range-diff --remerge-diff d023c451..c88b1ff 03bb1d8..HEADtests/fm-send-remote-delivery.test.shtests/fm-peek-remote.test.shtests/fm-crew-state.test.shtests/fm-inactive-reconcile.test.shtests/fm-quota-array-dispatch-live-e2e.test.sh(default skip), thenFM_QUOTA_ARRAY_DISPATCH_LIVE_E2E=1 tests/fm-quota-array-dispatch-live-e2e.test.shtests/fm-fork-main.test.shManualbin/fm-send.shdelivery, persisted pending-reply inspection, andbin/fm-peek.shagainst a deterministic remote transport fixtureDirect ancestry/content checks for merge parents, eight upstream commits, four upstreamAGENTS.mdadditions,GROK_BOT.md, the Bash 3.2 guard, and six fork helpersFinal evidence integrity, upstream ancestry, transient-file cleanup, andgit status --porcelain=v1verification✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.