R76.P2 Packet — δ Phase 1.5 Graduation Plan
Execution plan for the 5-step chain. Implementation step (4) writes ONE file (plus two small edits); the 10 prompts inside it are listed here as one-liner summaries so the shape of the deliverable is reviewable before it’s written.
1. Deliverable tree
docs/
├── audits/r76-p2-delta-15-planning-audit.md (step 1 — written)
├── contracts/r76-p2-delta-15-planning-contract.md (step 2 — written)
├── packets/r76-p2-delta-15-planning-packet.md (step 3 — this file)
├── guides/implementation/task-prompts/
│ ├── p1.5-delta-router-graduation.md (step 4 — NEW, main deliverable)
│ └── index.md (step 4 — EDIT)
├── architecture/decisions/
│ └── ADR-005-multi-model-defer.md (step 4 — EDIT, 1 line)
└── verification/r76-p2-delta-15-planning-verification.md (step 5 — pending)
No src/ tree. No test tree. No concept docs. No roadmap.
2. The 10 Phase 1.5 sub-task one-liners
| ID | Title | Effort | Depends on | Files to create | Files to modify |
|---|---|---|---|---|---|
| P1.5.1 | Real 7-dim intent scoring | M | R91+ κ Rule Engine (weights); P1.5.9 (candidate table schema) | — | src/domains/router/scoring.ts (body only; signature frozen) |
| P1.5.2 | Adapter: Kimi K2 | M | P1.5.1; src/domains/integrations/claude.ts (reference shape) |
src/domains/router/adapters/kimi.ts, src/__tests__/domains/router/adapters/kimi.test.ts |
src/domains/router/index.ts (re-export) |
| P1.5.3 | Adapter: Codex | M | P1.5.1 | src/domains/router/adapters/codex.ts, src/__tests__/domains/router/adapters/codex.test.ts |
src/domains/router/index.ts |
| P1.5.4 | Adapter: OpenAI (GPT-4o family) | M | P1.5.1 | src/domains/router/adapters/openai.ts, src/__tests__/domains/router/adapters/openai.test.ts |
src/domains/router/index.ts |
| P1.5.5 | N-member fallback + circuit breaker | L | P1.5.2, P1.5.3, P1.5.4 | src/domains/router/circuit.ts (in-memory CB state), src/__tests__/domains/router/circuit.test.ts |
src/domains/router/fallback.ts (body; ROUTER_PHASE_0_SHAPE flip); src/__tests__/domains/router/fallback.test.ts (drop single-member assertions, add cascade + CB coverage) |
| P1.5.6 | Cost accounting | M | P1.5.5 | src/domains/router/cost.ts (per-call → USD + aggregates), src/__tests__/domains/router/cost.test.ts |
src/domains/router/fallback.ts (emit cost + tokens in RouteResult) |
| P1.5.7 | router_* MCP tools |
M | P1.5.6 | src/domains/router/tools.ts (4 tools: router_score, router_call, router_fallback, router_stats), src/__tests__/domains/router/tools.test.ts |
src/server.ts (register the 4 tools); src/domains/router/index.ts (re-export) |
| P1.5.8 | Cross-model parity test suite | L | P1.5.7 | src/__tests__/domains/router/parity.test.ts (contract suite across all adapters) |
— |
| P1.5.9 | Model candidates table population | S | P1.5.1 | src/db/migrations/NNN-model-candidates-seed.sql (7 additional rows) |
src/db/schema.sql (candidate-table columns if not already present) |
| P1.5.10 | ζ decision-trail integration | M | P1.5.7 | — | src/domains/router/fallback.ts + src/domains/router/tools.ts (emit thought_record of shape routing_decision per concept doc §Decision-trail recording) |
Note: P1.5.9 ships BEFORE P1.5.1 in logical order (scoring needs candidates to score against), but the Phase 0 schema already has the single-row candidate table. For Phase 1.5 the sequence is P1.5.9 (seed rows) → P1.5.1 (scoring over seeded rows), and the depends-on DAG in the prompts file reflects that. The order in the table above matches how the scope was given in the R76.P2 brief.
3. Prompt-file skeleton
Each of the 10 blocks below gets fleshed out in step 4 following the
p0.9-nu-integrations.md template shape:
- Frontmatter:
title,tags,type: agent-prompts,status: spec-ready,round: R91-plan,updated: 2026-04-18. - Front-of-doc banner: “Phase 1.5 plan. Do not execute in Phase 0. Activates at R91+ per roadmap §Phase 1.5. Trigger conditions from ADR-005 §Implementation.”
- Group summary table (same 10-row table as §2 here, minus the “files to modify” column).
- Then for each sub-task:
- Spec source + extraction reference + worktree + branch command + effort + depends-on + unblocks.
- Files to create.
- Acceptance criteria (6–10 checkbox items).
- Pre-flight reading.
- Ready-to-paste agent prompt.
- Verification checklist (for reviewer agent).
- Writeback template.
- Common gotchas.
4. Edits outside the main file
4.1 docs/guides/implementation/task-prompts/index.md
Append a new section after “After Phase 0”:
## Phase 1.5 — δ Multi-Model Router (R91+, planned)
See [ADR-005](../../architecture/decisions/ADR-005-multi-model-defer.md)
for the trigger conditions and upgrade path. The prompts below activate
when all four ADR-005 trigger conditions hold.
| Group | File | Sub-tasks |
|-------|------|-----------|
| P1.5 — δ Router Graduation | [p1.5-delta-router-graduation.md](p1.5-delta-router-graduation.md) | P1.5.1 – P1.5.10 |
No edits to the Phase 0 table or the critical-path summary.
4.2 docs/architecture/decisions/ADR-005-multi-model-defer.md
Add a single line at the end of the R75 Wave I postscript (the existing trailing sentence stays; this appends a pointer):
**Phase 1.5 graduation prompts:** see
[`docs/guides/implementation/task-prompts/p1.5-delta-router-graduation.md`](../../guides/implementation/task-prompts/p1.5-delta-router-graduation.md)
for the 10-sub-task plan activating at R91+.
5. Step-5 verification plan
- Count sub-task blocks in the new file — must equal 10.
- Grep for
AMS_MODEL/AMS_*— must return zero hits in the new file. - Grep for each of the 4 tool names (
router_score,router_call,router_fallback,router_stats) — must each appear at least once in the new file. - Grep for each of the 8 candidate model ids (claude sonnet, claude haiku, gpt-4o, gpt-4o mini, gemini, llama, mixtral, kimi k2) — must appear in the P1.5.9 candidates block.
- Confirm
index.mdhas the new Phase 1.5 heading. - Confirm ADR-005 has the one-line pointer at the end.
- Run
npm run build && npm run lint && npm testand record the pass count (expected: 1085/1085 unchanged; docs-only round).
6. Risk ledger (carry-forward from audit §9)
All risks are mitigated by template fidelity + explicit citation. The only residual risk is that some future round changes the 7-dimension formula or the candidate cohort after this file lands; in that case the Phase 1.5 prompts rebase from the concept doc as part of the R91+ kickoff, not this round.
7. Time budget
- Step 1 (audit): ~15 min (done).
- Step 2 (contract): ~10 min (done).
- Step 3 (packet): ~10 min (this file).
- Step 4 (impl): ~60 min — one large file (~800–1100 lines) plus 2 small edits.
- Step 5 (verify): ~15 min — counting + gates.
Written 2026-04-18 as step 3 of the R76.P2 5-step chain. Step 4 follows.