feat(ADAPT-2): canonical adaptive route authority #323

Merged
conductor merged 1 commits from adapt2-route-authority into master 2026-09-10 06:43:37 +01:00
Owner

ADAPT-2: Canonical adaptive route authority (closes #291)

scripts/adaptive_router.py — deterministic-first route selection. Route by uncertainty and risk, not "bug vs feature".

Routes:

  • LOCAL_FIX: all conditions met (reproducible, owned, testable, narrow, reversible) + zero risk/uncertainty → skip research entirely. Measured B1-v2 evidence: 384s wasted on research that found nothing.
  • STANDARD_CHANGE: clear change, existing authority, no tech selection → bounded DESIGN-LITE. Measured B2-v2 evidence: 733s wasted.
  • RESEARCHED_CHANGE: any risk or uncertainty trigger → the full ratified research pipeline. Measured B3-v3 evidence: 4897s wall but produced real grounding evidence, 7 classified candidates, 21 adversarial attacks, 18 invariants, and a PROCEED verdict.

Key design decisions:

  • Deterministic-first (no heavyweight triage LLM)
  • RouteDecision dataclass with full auditability (reasons, risk_flags, uncertainty_flags, escalation_conditions, downgrade_conditions, confidence, decided_by)
  • Routes are reversible: escalation and downgrade are first-class
  • record_route_decision(): append-only JSONL for post-hoc route accuracy evaluation
  • Semantic arbiter reserved for future (not needed for deterministic cases)

Measured baseline comparison:

Route Cost Useful findings Quality
Fixed-depth on LOCAL_FIX 384s wasted ZERO n/a (couldn't complete)
Fixed-depth on RESEARCHED_CHANGE 4897s total Real grounding evidence, 21 attacks, 18 invariants PROCEED

8 tests; 1187 suite; ruff clean.

## ADAPT-2: Canonical adaptive route authority (closes #291) scripts/adaptive_router.py — deterministic-first route selection. Route by uncertainty and risk, not "bug vs feature". **Routes:** - **LOCAL_FIX**: all conditions met (reproducible, owned, testable, narrow, reversible) + zero risk/uncertainty → skip research entirely. Measured B1-v2 evidence: 384s wasted on research that found nothing. - **STANDARD_CHANGE**: clear change, existing authority, no tech selection → bounded DESIGN-LITE. Measured B2-v2 evidence: 733s wasted. - **RESEARCHED_CHANGE**: any risk or uncertainty trigger → the full ratified research pipeline. Measured B3-v3 evidence: 4897s wall but produced real grounding evidence, 7 classified candidates, 21 adversarial attacks, 18 invariants, and a PROCEED verdict. **Key design decisions:** - Deterministic-first (no heavyweight triage LLM) - RouteDecision dataclass with full auditability (reasons, risk_flags, uncertainty_flags, escalation_conditions, downgrade_conditions, confidence, decided_by) - Routes are reversible: escalation and downgrade are first-class - record_route_decision(): append-only JSONL for post-hoc route accuracy evaluation - Semantic arbiter reserved for future (not needed for deterministic cases) **Measured baseline comparison:** | Route | Cost | Useful findings | Quality | |---|---|---|---| | Fixed-depth on LOCAL_FIX | 384s wasted | ZERO | n/a (couldn't complete) | | Fixed-depth on RESEARCHED_CHANGE | 4897s total | Real grounding evidence, 21 attacks, 18 invariants | PROCEED | 8 tests; 1187 suite; ruff clean.
conductor added 1 commit 2026-09-10 06:41:07 +01:00
feat(ADAPT-2): canonical adaptive route authority — LOCAL_FIX | STANDARD_CHANGE | RESEARCHED_CHANGE (closes #291)
Auto-label / priority-gate (pull_request) Skipped
Auto-label / auto-label (pull_request) Successful in 6s
CI Pipeline / best-practices (push) Successful in 4s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / canary (push) Successful in 31s
CI Pipeline / lint (push) Successful in 41s
CI Pipeline / type-check (push) Successful in 31s
CI Pipeline / gitea-offline (push) Successful in 16s
CI Pipeline / unit-tests (push) Successful in 54s
CI Pipeline / best-practices (pull_request) Successful in 5s
CI Pipeline / documentation (pull_request) Successful in 4s
CI Pipeline / lint (pull_request) Successful in 38s
CI Pipeline / canary (pull_request) Successful in 34s
CI Pipeline / gitea-offline (pull_request) Successful in 15s
CI Pipeline / type-check (pull_request) Successful in 42s
Spec gate (headless) / spec-gate (pull_request) Successful in 11s
CI Pipeline / unit-tests (pull_request) Successful in 1m1s
CI Pipeline / required-checks (push) Successful in 1s
CI Pipeline / required-checks (pull_request) Successful in 1s
Auto-version and Release / release (pull_request) Successful in 44s
6b5ca4ec71
scripts/adaptive_router.py:
- classify_route(): deterministic-first routing by uncertainty and risk,
  NOT by 'bug vs feature'
- RouteDecision dataclass: route, reasons, risk_flags, uncertainty_flags,
  escalation_conditions, downgrade_conditions, confidence, decided_by,
  decided_at, task_description, baseline_sha
- LOCAL_FIX: all conditions met (reproducible, owned, testable, narrow,
  reversible) + zero risk/uncertainty flags → skip research entirely
- STANDARD_CHANGE: clear change, existing authority, no tech selection →
  bounded DESIGN-LITE, no external research
- RESEARCHED_CHANGE: any risk or uncertainty trigger → the full ratified
  research pipeline (this is the proven path from #161/#163/#165)
- Routes are reversible: escalation and downgrade triggers are first-class
- record_route_decision(): append-only JSONL for auditability
- Semantic arbiter reserved for future use (not needed for deterministic cases)

The B3-v3 baseline (#165, 4897s wall, 12 stages, all completed) provides
the measured fixed-depth RESEARCHED_CHANGE baseline. The B1/B2 probes
provide the measured evidence that LOCAL/STANDARD work wastes 384-733s
on research stages that produce zero implementation-relevant findings.

8 tests; full suite 1187 passed; ruff clean.
gitea-actions Bot added the bugcustodiangovernanceperception labels 2026-09-10 06:41:19 +01:00

🤖 Headless spec gate (non-blocking, #204 first slice)

Spec-gate agent produced no text output — check runner logs.

Deterministic floors still govern the merge

This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.

🤖 **Headless spec gate (non-blocking, #204 first slice)** Spec-gate agent produced no text output — check runner logs. <details><summary>Deterministic floors still govern the merge</summary> This comment is advisory. Required checks (lint, tests, canaries, type-check, coverage, dependency lock, impact gate) remain the merge authority per docs/adversarial-review.md proportionality.</details>
conductor merged commit 536b41a7ad into master 2026-09-10 06:43:37 +01:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: conductor/rune#323