Repository navigation
research(jev-task-fit): assess fast-role/model-choice extension without promoting unproved decisions #517
Description
SDK/agent comparison and role-fit boundary update — 2026-10-17
Native JEV is now supported in Vercel AI SDK 7 TS (experimental_decide, ai >=7.0.128), and Vercel AI SDK for Python (ai.ops.experimental.evaluate via AI Gateway). PydanticAI documents a native OpenAIDecisionsModel for OpenAI's Decisions API, NOT proof of free OpenCode / TypeSafe System One compatibility. The existing PStack decision adapter and resolver are Python; adding Bun/Node runtime or Python generative-agent framework just for decision I/O is avoidable. Choose ONE typesafe-sdk Python transport as B in the code/LOC/dependency trade study, subject to actual provider fixtures. Alternative C AI SDK Python if another host need already adopts AI Gateway; D PydanticAI only if used as the execution-agent stack independently (not a prerequisite). All model-choice / fast-role / leaf-skill routing hypotheses remain shadow research and must bind to host #429 available models, explicit poteto-mode triggers, QStack thin overlay, and quant risk exclusions. Compare A deterministic baseline vs B TypeSafe classifier vs C conditional SDK alternative on real task success, latency and cost; no mandatory new generic framework. Draft PR #522.
Why new scope
Completed PStack Jev program #193 phase 1 explicitly excluded model-tier selection and had no grounded skill-suggestion taxonomy. references/decision-routing.md says skill suggestions are not exposed; references/decision-routing.json only permits playbook semantic candidates. User now wants best-fit fast worker roles/models and leaf skill suggestions for QStack. Do not treat completed phase 1 as proof of new authority.
Research-only work
- Reuse model-role contract [Program] Harness-neutral pstack role/model contracts and pstack-claude parity #429 and real host /setup-pstack model availability/effort mapping. Candidate model identifiers must be from an actual host catalog; no hard-coded or invented slugs. Require model-family independence for arena/interrogate.
- Compare (A) existing role/model policy (baseline), (B) purely deterministic task features and budget routing, (C) opt-in Jev closed-set suggestion for low-risk fast workers. Keep architecture and multi-agent verification on configured high-capability independent models regardless of Jev.
- Characterize task properties (complexity, code vs docs, context, tool support, latency/cost, privacy, reasoning, uncertainty). Benchmark route accuracy, task quality and total elapsed time/cost including Jev overhead. Use holdouts incl. QStack-specific replay/OMS/research tasks from https://github.com/tommy-ca/qstack/issues/1791.
- Before skills hints are even shadow-exposed, ground eligible skill ids and host-owned discovery metadata; do not expand the existing route registry with a QStack duplicate taxonomy.
Acceptance
- Explicit source/spec delta and optional new OpenSpec requirements; no production behavior change in this research issue.
- Class-specific risk/budget/threshold predeclaration, accurate capability and panel policy, source-pinned blinded evaluation with an allowed no-change verdict.
- Implementation-only child when evidence supports net value and fix(jev): implement ONE native Python System One SDK adapter behind existing DecisionProvider #515/fix(jev-policy): align per-class confidence calibration with accepted decision spec #516 corrections satisfy admission; crosslink QStack https://github.com/tommy-ca/qstack/issues/1786, #1789/#1790/#1791.
New provider availability evidence — 2026-10-17
For any role-fit evaluation, use host-resolved available worker models, not the Jev decision model as a coding worker. Source-confirmed PStack Jev provider candidates include OpenCode Console/Zen jev-1.13-free (limited-time, no Go subscription needed) and paid jev-1.13, plus OpenRouter paid typesafe/jev-1.14 and typesafe/jev-1.13. OpenCode Go subscriptions are for coding worker models and its current official list has no Jev; keep separate model-role vs decision-provider capabilities. Integration implementation owned by #519/#520, provider selection & cross-provider acceptance by #521. Compare transport- and version-specific task-fit on the same labeled fixture before asserting superiority.
Activity
tommy-ca commentedon Oct 20, 2026
JEV Boundary & Resilience Update (Post-Epic #657)
In accordance with strict boundary containment discipline (keeping JEV integration lean and clean within
pstackwith zero bloat toqstack):Defect Leaves Resolved & Shipped:
questionsand keyedanswers([JEV][P1] Replace self-consistent mock wire with official System One questions/answers contract #664).max_spend_usdenforcement ([JEV][P1] Reject nonfinite confidence, incomplete response identity and unbounded paid calls #660).88d47514), root tree (6e60624e), router blob (21993f54), and all 23 playbooks with fail-closed behavior on drift ([JEV][P1] Fail closed when decision-routing registry drifts from applied canonical pin #663).references/calibrated-evidence.json), eliminating synthetic self-authorization ([JEV][P1] Gate advisory promotion on persisted pre-existing calibrated evidence #659).Containment Discipline:
qstack.pstack).tommy-ca commentedon Oct 20, 2026
Thermo-Nuclear Code Quality Review Summary
Audit Scope: JEV Resilience Implementation (
dea54d5..804df41, PRs #662, #665, #666, #667) & Issue #517Base Revision:
dea54d5cd723e06aa6a3afb78f9c3a79e82abb32Head Revision:
804df416c1ec0ce9f6888fbf02a43fe9714c776aVerdict: CONDITIONAL PASS WITH REQUIRED REMEDIATIONS
Audit Artifacts:
docs/audit/thermo-nuclear-517/(summary.md+ detail reports01_through05_)Audit Findings & Code-Judo Remediation Plan
Route Resolver Procedural Sprawl (Rule 0 & Rule 2):
resolve_skill_order_with_shadowinscripts/route_resolver.pyhas grown into a 180-line procedural conditional ladder across 13 inline checks with 14 return statements._is_egress_bypassed,_load_semantic_candidates,_evaluate_advisory_promotion), cutting cognitive complexity and dropping function length to ~35 lines while preserving 100% of behavior.docs/audit/thermo-nuclear-517/01_route_resolver_pipeline_and_bypass_chain.md.Decision Adapter Validation & Transport Boilerplate (Rule 4 & Rule 6):
scripts/decision_adapter.pyrepeats finite unit-interval validation blocks acrossconfidenceandprobabilities, and constructsProviderObservation(status="invalid")verbatim 8 times._parse_unit_interval(val)and_invalid_obsfactory helper, cutting 35 lines of duplicate boilerplate.docs/audit/thermo-nuclear-517/02_decision_adapter_validation_and_transport.md.Receipt Lifecycle Cohesion & Serialization Redundancy (Rule 3 & Rule 5):
DecisionReceipt,CalibratedEvidenceReceipt, andCheckEvidenceReceiptinscripts/evidence_receipts.pyduplicateto_dictandto_json, while deserialization is fragmented between manual 13-field parsing and fragile**kwargsunpacking.ReceiptBasemixin with standardizedto_dict,to_json, and schema-safefrom_dict/loadclass methods.docs/audit/thermo-nuclear-517/03_evidence_receipts_and_lifecycle_cohesion.md.1,000-Line File Threshold Near-Breach in Model Role Tests (Rule 1):
tests/test_model_role_policy.pyhas reached 995 lines (5 lines from the 1,000-line ceiling). Adding any new test for Issue research(jev-task-fit): assess fast-role/model-choice extension without promoting unproved decisions #517 would breach this strict limit.test_model_role_schema.py(~250 lines),test_model_role_constraints.py(~380 lines), andtest_model_role_profiles.py(~415 lines).docs/audit/thermo-nuclear-517/04_model_role_policy_test_decomposition.md.Strict PStack/QStack Architecture Boundary & Role-Fit Discipline (Rule 6):
qstack. All decision transport, receipt validation, and host catalog bindings remain strictly inpstack./setup-pstack(Contract [Program] Harness-neutral pstack role/model contracts and pstack-claude parity #429).architect,independent-verifier,arena-cross-judge-pool) remain strictly pinned to configured frontier models; fast-worker role-fit is restricted exclusively to low-risk execution roles.docs/audit/thermo-nuclear-517/05_qstack_boundary_and_task_fit_architecture.md.Phased Remediation Work Breakdown
ReceiptBase.test_model_role_policy.pyto keep all test files <500 lines.qstack#1791) and generate calibrated receipts inreferences/calibrated-evidence.jsonbefore any advisory promotion.tommy-ca commentedon Oct 20, 2026
Follow-Up Remediation Issues Filed (Issue Graph Update)
The recursive planning breakdown from the Thermo-Nuclear Code Quality Review has been converted into tracking issues in the issue graph:
docs/audit/thermo-nuclear-517/(summary.md,01_through05_)refactor(jev-judo): decouple route resolver pipeline and unify decision adapter validationtest(model-role): decompose test_model_role_policy.py to respect 1k-line ceilingresearch(jev-task-fit): benchmark fast-role fit against holdout tasks before advisory promotiondocs(audit): add thermo-nuclear code quality review for JEV resilienc…
feat(jev-task-fit): benchmark fast-role fit against holdout tasks bef…
tommy-ca commentedon Oct 21, 2026
Wave 1–3 Remediation & Benchmarking Complete
All three follow-up remediation waves established by the Thermo-Nuclear Code Quality Review (
docs/audit/thermo-nuclear-517/) have been implemented, independently verified, tested, and merged intomain:Summary of Completed Waves
Wave 1 (Refactor & Judo, refactor(jev-judo): decouple route resolver pipeline and unify decision adapter validation #668 / PR refactor(jev-judo): decouple route resolver pipeline and unify decision adapter validation (#668) #671 —
9e73423):resolve_skill_order_with_shadowinscripts/route_resolver.pyinto a 3-stage pure pipeline (_is_egress_bypassed,_load_semantic_candidates,_evaluate_advisory_promotion)._parse_unit_interval,_invalid_obs) inscripts/decision_adapter.py.ReceiptBaseinscripts/evidence_receipts.py.Wave 2 (Test Decomposition & Rule 1 Compliance, test(model-role): decompose test_model_role_policy.py to respect 1k-line ceiling #669 / PR test(model-role): decompose test_model_role_policy.py to respect 1k-line ceiling (#669) #672 —
4b4fb98):tests/test_model_role_policy.pyinto 3 modular suites, all strictly under the 500-line ceiling:tests/model_role_helpers.py(86 lines)tests/test_model_role_schema.py(195 lines)tests/test_model_role_constraints.py(244 lines)tests/test_model_role_profiles.py(497 lines)scripts/select_checks.pyand CI workflow.Wave 3 (Shadow Benchmarking & Task-Fit, research(jev-task-fit): benchmark fast-role fit against holdout tasks before advisory promotion #670 / PR feat(jev-task-fit): benchmark fast-role fit against holdout tasks before advisory promotion (#670, #517) #673 —
a737926):openspec/changes/2026-10-21-fast-role-task-fit/(proposal.md,design.md,adr.md,tasks.md).scripts/eval_fast_role_task_fit.pybenchmarking 12 holdout tasks (including 4 Quant OMS replay tasks fromqstack#1791) across Baseline (A), Deterministic (B), and Semantic JEV (C).references/calibrated-evidence.json.architect-runners,independent-verifier,arena-cross-judge-pool,judgment-and-prose,feature).qstack): all decision logic remains 100% inpstack.tests/test_fast_role_task_fit.py(214 lines, Rule 1 compliant). All offline contracts pass in CI.Verification Summary
main.docs(audit): add post-implementation thermo-nuclear code quality revi…
tommy-ca commentedon Oct 21, 2026
Final Thermo-Nuclear Review & Issue Closure Report
The comprehensive post-implementation Thermo-Nuclear Code Quality Review has been completed and published under
docs/audit/thermo-nuclear-517-final/(commit6664808).Audit Verdict: UNCONDITIONAL PASS
All 8 non-negotiable Thermo-Nuclear standards have been audited and met:
Rule 0 (Code Judo & Structural Simplification):
resolve_skill_order_with_shadowfrom a 180-line conditional ladder with 14 return points into a 3-stage pure pipeline (_is_egress_bypassed,_load_semantic_candidates,_evaluate_advisory_promotion) in PR refactor(jev-judo): decouple route resolver pipeline and unify decision adapter validation (#668) #671._parse_unit_intervalinscripts/decision_adapter.py.ReceiptBaseinscripts/evidence_receipts.py.Rule 1 (1,000-Line Ceiling Strictly Respected):
tests/test_model_role_policy.pyinto 3 modular suites (< 500 lines each) in PR test(model-role): decompose test_model_role_policy.py to respect 1k-line ceiling (#669) #672.tests/test_fast_role_task_fit.py(214 lines),scripts/eval_fast_role_task_fit.py(561 lines).scripts/andtests/exceed 1,000 lines.Rule 2 & Rule 5 (Spaghetti Control & Type Boundaries):
SafeContextandEgressClassenums.[0.0, 1.0].Rule 4 & Rule 7 (Empirical Superiority of Deterministic Routing):
qstack#1791) proves that Deterministic Routing (B) achieves 21.3% cost reduction with 0.0ms decision latency and zero external network calls.references/calibrated-evidence.json.Rule 6 (Architectural Containment & Zero External Bloat):
tests/test_context_overlays.py: 0 external coupling strings or duplicate routers inqstack.architect-runners,independent-verifier,arena-cross-judge-pool,judgment-and-prose,feature) immutably protected against demotion.Delivered Artifacts & PR Graph
docs/audit/thermo-nuclear-517-final/summary.mddocs/audit/thermo-nuclear-517-final/01_code_judo_and_structural_simplification.mddocs/audit/thermo-nuclear-517-final/02_file_size_and_modular_decomposition.mddocs/audit/thermo-nuclear-517-final/03_spaghetti_control_and_type_boundary_integrity.mddocs/audit/thermo-nuclear-517-final/04_architectural_containment_and_zero_bloat.mddocs/audit/thermo-nuclear-517-final/05_holdout_empirical_benchmarking_and_trade_study.mdopenspec/changes/2026-10-21-fast-role-task-fit/(proposal.md,design.md,adr.md,tasks.md)9e734234b4fb98a737926All research-only and implementation criteria for Issue #517 are fulfilled. Closing issue as resolved.
docs(openspec): record task-fit ship evidence - PR 673 merged, issues…
fix(jev): gate semantic promotion on validated receipt, not file pres…
fix(jev): pin expected provider/model in benchmark gate (#693)