R76.P2 Contract — δ Phase 1.5 Graduation Plan

0. One-line summary

Write a spec-only task-prompts file with 10 ready-to-paste T3 agent prompts for δ Phase 1.5 graduation (R91+), preserving the Phase 0 interface per ADR-005 §Decision.


1. Behavioural contract

1.1 Inputs

  • ADR-005 §Decision, §Implementation, §Phase 1.5 upgrade path, §R75 Wave I postscript.
  • docs/3-world/social/llm.md δ concept doc — scoring formula (7 dimensions), candidate cohort (8 models), fallback semantics, decision-trail shape.
  • Shipped Phase 0 stubs: src/domains/router/scoring.ts, src/domains/router/fallback.ts, src/domains/router/index.ts.
  • Existing tests: src/__tests__/domains/router/scoring.test.ts, src/__tests__/domains/router/fallback.test.ts (75 tests).
  • Template file: docs/guides/implementation/task-prompts/p0.9-nu-integrations.md (most recent spec-ready prompt file in the correct namespace).
  • Roadmap anchor: docs/5-time/roadmap.md §Phase 1.5 (R91–R100).

1.2 Outputs

Path Action
docs/guides/implementation/task-prompts/p1.5-delta-router-graduation.md create
docs/guides/implementation/task-prompts/index.md edit — add Phase 1.5 section + new entry
docs/architecture/decisions/ADR-005-multi-model-defer.md edit — one-line pointer in Wave I postscript
docs/audits/r76-p2-delta-15-planning-audit.md create
docs/contracts/r76-p2-delta-15-planning-contract.md create (this file)
docs/packets/r76-p2-delta-15-planning-packet.md create
docs/verification/r76-p2-delta-15-planning-verification.md create

1.3 Acceptance invariants

  • A1. New prompts file contains exactly 10 sub-task blocks, labelled P1.5.1 through P1.5.10.
  • A2. Every sub-task block declares: Depends on + Input + Output (file paths) + Acceptance criteria (6–10 checkbox items) + Effort (S/M/L/XL) + Agent prompt (self-contained text fence).
  • A3. Sub-task scopes match the R76.P2 task brief 1:1:
    • P1.5.1 Real 7-dim intent scoring.
    • P1.5.2 Kimi K2 adapter.
    • P1.5.3 Codex adapter.
    • P1.5.4 OpenAI adapter.
    • P1.5.5 N-member fallback + circuit breaker.
    • P1.5.6 Cost accounting.
    • P1.5.7 router_* MCP tool registration (4 tools).
    • P1.5.8 Cross-model parity test suite.
    • P1.5.9 Model candidates table population.
    • P1.5.10 ζ decision-trail integration.
  • A4. No sub-task block introduces a TypeScript type or function signature that conflicts with the frozen Phase 0 interface (scoreIntent, routeRequest, ModelId, ScoreContext, IntentScore, RouteOptions, RouteResult, FallbackAttempt, FallbackChainExhaustedError, ROUTER_PHASE_0_SHAPE, CompletionFn, ScoringFn).
  • A5. Every env var reference uses the COLIBRI_* namespace (S17 §3). Zero AMS_* references in the new file.
  • A6. The 7-dimension scoring table in P1.5.1 matches the δ concept doc §Target shape table (dimension names, formulas, default weights) exactly.
  • A7. The candidate cohort table in P1.5.9 matches the δ concept doc §Phase 1.5 candidate cohort table (8 models with their window/cost/latency/ strengths columns) exactly.
  • A8. The ζ decision-trail shape in P1.5.10 matches the δ concept doc §Decision-trail recording JSON exactly.
  • A9. The router_* tool list in P1.5.7 is exactly the 4 tools named in ADR-005 §Decision: router_score, router_call, router_fallback, router_stats.
  • A10. The circuit-breaker rules in P1.5.5 are exactly: 3-consecutive-failure trip, 60s unavailability window, 30s per-attempt timeout (COLIBRI_MODEL_TIMEOUT), per-model state, time-bound reset (not success-bound).
  • A11. docs/guides/implementation/task-prompts/index.md has a new Phase 1.5 heading with the new file entry; the 28-task Phase 0 table is untouched.
  • A12. ADR-005 Wave I postscript ends with a single new sentence pointing to the new file; no other ADR content changes.
  • A13. No file under src/ is created or modified.
  • A14. npm run build && npm run lint && npm test exits clean (docs-only round — expect the shipped test count to stay identical).

2. Non-goals (explicit out-of-scope)

  • No δ TypeScript code. Phase 1.5 activation lands at R91+ per roadmap.
  • No changes to src/domains/router/* or src/__tests__/domains/router/*.
  • No changes to the Phase 0 interface. Forward-compat means Phase 1.5 widens ModelId, replaces bodies, and flips ROUTER_PHASE_0_SHAPE — but the exports stay.
  • No changes to the δ concept doc. Its Phase 1.5 shape is already authoritative.
  • No changes to docs/5-time/roadmap.md (P3’s file this round).
  • No changes to κ prompt files (P1’s file this round).
  • No changes to docs/guides/implementation/task-breakdown.md (Phase 0 breakdown, not Phase 1.5).

3. Rules of engagement

  • Template fidelity: follow the shape of p0.9-nu-integrations.md — same section order, same YAML frontmatter keys, same writeback template format.
  • Namespace rigour: COLIBRI_* only. Donor AMS_* is forbidden text in the new file.
  • Interface rigour: every Phase 1.5 sub-task’s “Forbiddens” block restates the Phase 0 interface freeze.
  • Forward-citation rigour: every sub-task cites the authoritative section of ADR-005 or the concept doc that governs it.
  • Self-containment: each agent prompt is paste-able cold — no implicit context from prior sub-tasks beyond explicit Depends on declarations.

4. Review gates

  • 5-step chain docs exist (audit, contract, packet, verification).
  • Invariants A1–A14 hold.
  • Test gate green (no code changed; pass/fail count should not move from the main baseline at e455b00a which is 1085/1085 per the post-Wave-I memory).

5. Signatures


Written 2026-04-18 as step 2 of the R76.P2 5-step chain.


Back to top

Colibri — documentation-first MCP runtime. Apache 2.0 + Commons Clause.

This site uses Just the Docs, a documentation theme for Jekyll.