Skip to content

feat(runtime): add opt-in Jev task routing - #77

Merged
lg2m merged 5 commits into
feat/eng-791-jev-routingfrom
feat/eng-791-jev-routing-accounting
Sep 19, 2026
Merged

lg2m merged 5 commits into
feat/eng-791-jev-routingfrom
feat/eng-791-jev-routing-accounting

Conversation

@lg2m

@lg2m lg2m commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

J6b: opt-in model and effort routing

Jev can choose an authorized model and declared effort before a task starts. Routing is independently off by default; stored credentials do not activate it, and explicit model/profile/worker choices remain pinned. This PR is stacked on #76 (feat/eng-791-jev-routing).

Spec: J6. Tracking: ENG-791; Linear connector still requires reauthentication.

Behavior

  • One bounded decision among at most eight authenticated, authorized configured models and 32 combined choices. Automatic effort requires declared model reasoning_efforts; unknown support preserves omission.
  • Invalid/uncertain answers, timeout or unavailable selected routes retain the configured choice. No live model discovery, SDK dependency or new execution engine.
  • Session routing starts durably before inference; known/unknown spend survives cancellation, provider loading and restart. Budgets charge it once before main-model work.
  • Owned children inherit the parent's routing policy, including off. Direct ask uses the same router and loader, reports decisions/spend on stderr and retains its existing ephemeral execution contract.
  • Candidate/constraint fingerprints invalidate stale cached routing behavior when model metadata or pin intent changes.

Verification

At cf61126: 1,597 workspace tests passed, five ignored. Final configuration representation check: 249 application/config tests passed, one ignored. Formatting, strict all-target/all-feature Clippy and workspace build pass. Independent Spec and Standards rechecks approved the fixes.

Commands used --locked --offline and the shared target directory: env -u NO_COLOR cargo test --workspace --no-fail-fast --quiet, cargo test -p qq -p qq-config --quiet, cargo fmt --all -- --check, cargo clippy --workspace --all-targets --all-features -- -D warnings, cargo build --workspace.

Tests cover HTTP masking/body bounds, strict choice validation, pin/profile/cache precedence, inherited policy, migration/replay/cancellation, unknown spend and exact-once budget accounting. No live paid inference was performed.

Performance and remaining qualification

30 alternating release A/B pairs against retained #76 binaries, plus 30 A/A pairs:

Fixture Base median Candidate median Change
Disabled read-tool loop 54,392 ns 56,136.5 ns +3.21%
Plan compilation 24,977.5 ns 24,715.5 ns −1.05%
Descriptor digest 2,381.5 ns 2,398 ns +0.69%

Tool p95: 70,945→70,783 ns; A/A median +1.23%. This incremental median fits the 5% budget, but the earlier #76 performance gate and quiet-host full-stack qualification remain open. Raw evidence: target/qq-perf/jev-routing-2026-09-18/paired.json. This is not proof of Jev acceleration or task-quality improvement. Hosted checks for this head remain pending.

Compatibility and docs

Protocol 24→25 (old/new fixtures retained), schema 30→32 (durable routing and conservative model-pin migration), descriptor 8→9. ADRs 0032–0034, architecture/protocol/provider docs, Jev runbook, plan and ledger are updated. Passive advisory observation remains the next separate slice; this draft does not claim the entire stack is merge-ready.

J6b core foundation. Start with routing_spend_survives_preparation_cancellation_and_recovery; preserve pending and known spend through cancellation, reload and recovery. Seed budgets once without changing context occupancy. Production Jev activation, model-pin provenance and child inheritance remain unfinished.
J6b: persist fallback provenance without opting legacy sessions into routing. Cover pinned-route rejection, loader precedence, migration and wire defaults; update ADR and design documentation.
J6b: use bounded authorized candidates, preserve declared model capabilities and explicit pins, inherit parent routing activation, and expose direct ask decisions. Include candidate identity in cached plans and retain shared spend accounting. Validate with 1597 workspace tests and independent reviews.
@lg2m
lg2m added this pull request to stack #75 September 18, 2026 23:53
@lg2m
lg2m marked this pull request as ready for review September 18, 2026 23:54
@lg2m
lg2m merged commit 5955d89 into main Sep 19, 2026
4 checks passed
@lg2m
lg2m deleted the feat/eng-791-jev-routing-accounting branch September 19, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant