Repository navigation
fix: correct crew dispatch routing and quota refresh - #7702
pedromuller-del wants to merge 20 commits into
Conversation
…ve autonomously The dispatch resolver left firstmate picking profiles by hand in five ways found by the 2026-10-23 dispatch diagnosis: - quota_row joined schema 6 snapshots on accountKey only, so a Pi lane whose auth provider id quota-axi carries as an accountKeys alias never bound to its row and stayed unranked. - Pi renews a provider session token only on use, so a stale provider was never ranked, never dispatched, and never refreshed; the resolver now runs one bounded, never-fatal pi auth check per Pi provider the live rules name before the quota read. - Every intake ran quota-axi --json with no --max-age, so a burst of intakes could rate-limit a vendor endpoint and flip a stable answer to escalate; the read now reuses a snapshot up to 2m old, and the quota-axi floor moves to 0.1.54, where --max-age first shipped. - An answer below the global confidence floor always came back ambiguous; the resolver now takes the most probable option that clears its own declared floor and marks the note low confidence, while approval: captain rules, top-probability ties, and declared-floor misses still escalate. - Date-gated rules stayed selectable after their date because the model never sees the current date; a new optional until field drops an expired rule before the option list is built. AGENTS.md now passes a clear resolved profile to fm-spawn unchanged, with overrides limited to a current captain instruction or a hard blocker. Closes kunchenguid#7696
… owns it The captain's 2026-10-23 ownership review found D1 (schema-6 accountKeys alias binding) already covered by open upstream PR kunchenguid#7465, whose contract is stricter (unique alias, ambiguous aliases stay unranked, snapshot validation). This branch keeps D2 (bounded Pi session refresh), D3 (--max-age bounded quota reuse and the 0.1.54 floor), the low-confidence fallback, the until field, and the AGENTS.md override tightening.
|
Speaking as Kun's firstmate: thanks @pedromuller-del, this is a careful, well-evidenced piece of work, and keeping the What I checked: head Contract-class: new-default. Three parts change what an existing setup does without anyone turning something on: a below-floor answer that used to come back VISION.md: One captain aligns (fewer hand picks, outcome-first note) · Authority cannot tell (the low-confidence auto-resolve and the narrower override text trade first-mate judgment for an automatic pick, which needs the captain's call) · Scripts aligns (exact mechanics stay in jq/shell; the model only answers the choice question) · Restart aligns · Delegation cannot tell (same low-confidence question: "the machinery refuses to guess") · Vendor aligns (Pi/quota-axi specifics stay in their adapters) · Scope aligns. Where it stands: CI is green except two jobs. Behavior portable parallel 2 fails only on |
|
Speaking as Kun's firstmate: thanks @pedromuller-del for bringing this up to date. I re-read head Contract-class: new-default (my own read, unchanged). The low-confidence path resolving to Where it stands: a fresh CI run (40053728384) is going on this head. On |
|
Speaking as Kun's firstmate: thanks @pedromuller-del. Head On run 40058476246 everything is green except Contract-class: new-default (unchanged). VISION verdicts are unchanged from my earlier note. Status: waiting on that re-run, not on you. Once it's green, this goes to the captain as a decision. |
|
Speaking as Kun's firstmate: quick update, @pedromuller-del. Everything on |
Keep upstream's current profile-array, no-match default, and T3 Code bullets; our PR's typed-resolution additions (until field, low-confidence fallback, bounded quota reuse, Pi refresh) are unaffected. Requested by the captain 2026-10-25 to clear PR kunchenguid#7702's conflict with main.
|
@kunchenguid friendly ping: the serial shard re-run went green, but main has moved since and GitHub now shows a conflict. Do you want me to merge main in before your merge-or-leave call, or would you rather decide on the current diff first? |
…ions # Conflicts: # AGENTS.md # bin/fm-dispatch-resolve.sh # docs/configuration.md # docs/verification/dispatch-resolve.md # tests/fm-dispatch-resolve.test.sh
[Medium impact] The PR appears safe to merge; no actionable defects were found. Reviews (3) · Last reviewed commit: "no-mistakes(document): Remove stale disp..." · Reviewed by Greptile |
|
Speaking as Kun's firstmate: thank you @pedromuller-del for bringing this up to Gates: coverage guard, repo invariants and no-mistakes all pass on this head; every pipeline step completed with no skips; Greptile is 5/5 with no open threads. Live stays inconclusive 9 of 15 under the exception we already recorded (the six untested rows need provider shapes or credentials a disposable lab cannot supply); the nine live-testable scenarios still pass with evidence. The red Full suite only means our Conflict: merge-tree against current main conflicts in Contract-class: new-default (unchanged). Below-floor answers resolving to Next: nothing is waiting on you. The next steps are ours (Full suite, then Kun for the merge-or-leave decision). |
…ions # Conflicts: # docs/configuration.md # docs/verification/dispatch-resolve.md
|
Speaking as Kun's firstmate: thank you @pedromuller-del for bringing this to Gates: coverage guard, repo invariants and no-mistakes all pass; every pipeline step completed with no skips; Greptile is green with no open threads. Live stays inconclusive 9 of 15 under the exception we already recorded (six structurally untestable rows); the nine live-testable scenarios still pass with evidence. The docs conflict against earlier main is gone — this tip merges cleanly. The red Full suite row only means our Contract-class: new-default (unchanged). Below-floor answers resolving to Next: nothing is waiting on you. The next steps are ours (Full suite, then Kun for the merge-or-leave decision). Refs #7696. |
Intent
Re-validate and re-publish PR #7702 at the new merge head. The branch merged origin/main (bf05a4f, 5 commits: TYPESAFE_BASE dispatch base URLs, teardown stale-ref fix, test/infra fixes) per the captain's 2026-11-06 instruction; conflicts were docs-only in docs/configuration.md and docs/verification/dispatch-resolve.md, resolved by keeping upstream's TYPESAFE_BASE rewrite plus our behavior-accurate phrases (all-expired rules, one option per unexpired rule, resolves low-confidence answers). Underlying change is unchanged: fix the crew dispatch routing defects the 2026-10-23 diagnosis found so dispatch is deterministic and automatic, minus the alias defect which open upstream PR #7465 owns. In scope: bounded never-fatal pi auth check per live Pi provider before the quota read (D2); quota-axi --json --max-age 2m bounded reuse and the 0.1.54 floor (D3); below-global-floor answers resolve the most probable option clearing its own declared floor with a low-confidence note, while approval: captain rules, top-probability ties, and declared-floor misses still escalate (q3); optional rule until field drops expired rules and malformed values are a configuration error (P5); AGENTS.md/docs pass a clear resolved profile to fm-spawn unchanged (P4). Out of scope per the captain: the schema-6 accountKeys alias binding (D1, owned by upstream PR #7465) and the fm-test-run packing fixture (owned by merged PR #7699); do not carry either and do not waive any check. Prior gate decisions already recorded by firstmate and still valid: the test step's inconclusive live-verdict exception (six scenarios structurally untestable live) and the ci exception (Full suite requires the maintainer-added full-ci label; FM_CI_FULL=false, zero lanes failed). Deliverables: issue #7696 and PR #7702. Never merge the PR, never add a label, never post a comment.
What Changed
untilrules and reject malformed expirations or unoffered choices.quota-axi --json --max-age 2mand require version 0.1.54.fm-spawnunchanged except for current captain instructions or hard blockers. Update dispatch documentation and regression fixtures, and handle comma decimal separators in lint timing.Risk Assessment
✅ Low: The changes are bounded, follow the approved scope and prior decisions, and introduce no substantiated material defect.
Testing
Nine live scenarios passed with CLI/API evidence; six accepted live gaps remain. The isolated resolver suite passed after correcting inherited credentials. Two timed-out fixture suites completed their remaining cases separately; the optional broader spawn run remained incomplete. Labs were removed and the worktree stayed clean. No GUI layout changed.
Evidence: Live dispatch report
Source: Live dispatch report
Evidence: Real Pi refresh and quota calls
Source: Real Pi refresh and quota calls
Evidence: Snapshot permissions and cleanup
Source: Snapshot permissions and cleanup
Evidence: Primary workspace-trust dialog
Source: Primary workspace-trust dialog
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
Initialbash tests/fm-dispatch-resolve.test.sh: 21 passed, 1 setup failure, exit 1 because an inherited key invalidated the absent-key case. Rerun with four dispatch API-key variables unset and LC_ALL=C: 78 passed, 0 failed, exit 0.bash tests/fm-procevent-quota.test.sh: 33 passed;bash tests/fm-startup-memory-budget.test.sh: 4 passed;bash tests/fm-secondmate-sync.test.sh: 33 passed. Each exited 0 with no failures.bash tests/fm-secondmate-liveness.test.sh: 28 passed;bash tests/fm-shared-captain-inheritance.test.sh: 13 passed;bash tests/fm-quota-choose.test.sh: 58 passed. Each exited 0 with no failures.bash tests/fm-secondmate-harness.test.shreached the local 240-second limit after 49 passing checks.complete-targeted-cases.pyexecuted its seven unfinished existing cases in fresh fixtures: 7 passed, 0 failed, exit 0.bash tests/fm-bootstrap.test.shreached the local 240-second limit after 30 passing checks. Its remainingtest_crew_dispatch_validationcase passed separately with exit 0.bash tests/fm-spawn-dispatch-profile.test.sh: 40 passing checks before the local 240-second limit, including explicit-profile and model/effort forwarding checks. The optional broader suite remained incomplete.python3 .../live-dispatch.pyand selected follow-up scenarios exercised the real resolver, TypeSafe, Pi, and quota-axi.python3 .../verify-live.pyverified nine live results with zero failures, exit 0.python3 .../primary-probe.py: corrected an overlong socket path, launched real Claude on a private 120×40 tmux terminal, captured workspace trust, stopped the server with exit 0, and removed the lab.Verified target HEAD, cleangit status --short, disposable-lab cleanup, and absence of supplied API-key values from evidence files. Detailed command results are recorded in test-summary.md.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.