Merge feature/model-tiering-w4-handover into develop

This commit is contained in:
Bastien Chanot
2026-07-19 22:59:35 +02:00
3 changed files with 67 additions and 5 deletions
+28 -4
View File
@@ -1072,11 +1072,30 @@ If `OUTPUT` resolved to `skip-write`, still dispatch — the doc-writer
reports `MD: skipped` and stops before rendering, per its own reports `MD: skipped` and stops before rendering, per its own
contract. contract.
Dispatch: Dispatch the two-mode pipeline (BDR-077 — synthesis on opus, render on the
sonnet pin, full PACKAGE both times per LRN-126). Mint a RUNID first
(`RUNID=$(date +%s)`); the draft crosses via the run-scoped, gitignored
`.audit/handover-draft-<RUNID>.md`; clean it after 9.7.
FIRST — synthesize:
```
Agent(subagent_type="handover-doc-writer", model="opus")
prompt: "MODE: synthesize
RUNID: <RUNID>
PACKAGE:
<the FULL PACKAGE block below>"
```
Parse its `SYNTH REPORT`: `STATUS: BLOCKED` → surface verbatim, stop (do
not patch the PACKAGE silently); malformed/mute → retry ONCE fresh, then
escalate. `STATUS: DONE` → THEN render:
``` ```
Agent(subagent_type="handover-doc-writer") Agent(subagent_type="handover-doc-writer")
prompt: "PACKAGE: prompt: "MODE: render
RUNID: <RUNID>
PACKAGE:
LANG: <LANG> LANG: <LANG>
PROJECT: name=<name> root=<root> type=<type> sub-type=<sub-type> PROJECT: name=<name> root=<root> type=<type> sub-type=<sub-type>
is_local_business=<bool> deployed_url=<url> period=<first→last> is_local_business=<bool> deployed_url=<url> period=<first→last>
@@ -1092,10 +1111,15 @@ PRECHECK_DONE: <list>
CLIENT_NAME: <name|—> CLIENT_NAME: <name|—>
OUTPUT: <overwrite <path> | versioned <path> | skip-write> OUTPUT: <overwrite <path> | versioned <path> | skip-write>
Synthesize + write + render the deliverable per your steps. Report the Render the deliverable from the draft per your render-mode steps. Report
HANDOVER-DOC REPORT." the HANDOVER-DOC REPORT."
``` ```
(The PACKAGE block is IDENTICAL in both dispatches — write it once,
paste it twice. A render `STATUS: BLOCKED` on draft absence/RUNID
mismatch means the synthesize leg failed silently: re-run 9.6 from the
synthesize dispatch, never hand-write the draft.)
### 9.7 — Parse the report, tell the user ### 9.7 — Parse the report, tell the user
Parse the returned `HANDOVER-DOC REPORT`: Parse the returned `HANDOVER-DOC REPORT`:
+30 -1
View File
@@ -1,6 +1,6 @@
--- ---
name: handover-doc-writer name: handover-doc-writer
description: Deliverable writer — dispatched by client-handover with a resolved PACKAGE. Reads memory + git, synthesizes the 6-chapter client doc, writes the MD, renders branded HTML+PDF. No audits, no questions, no dispatch. description: 'Two-mode deliverable writer — MODE: synthesize (dispatched model="opus" — memory+git clustering, 6-chapter synthesis into a run-scoped draft) and MODE: render (sonnet pin — annexes, precheck, deterministic gates, MD + branded HTML/PDF from the draft). Dispatched twice by client-handover with the resolved PACKAGE. No audits, no questions, no dispatch.'
tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, WebFetch
model: sonnet model: sonnet
--- ---
@@ -43,6 +43,29 @@ name the missing field.
--- ---
## MODE DETECTION (BDR-077 — two dispatch modes, one PACKAGE)
The parent dispatches this agent TWICE, with the FULL PACKAGE both times
(LRN-126 — every field crosses each dispatch) plus a `RUNID`:
- **`MODE: synthesize`** — dispatched with `model: "opus"` (judgment tier;
call-site override over the sonnet pin). Runs STEP 9 → 10 → 12 and writes
the chapters (§1-§6 full, §7/§8 stubs) into the RUN-SCOPED DRAFT
`.audit/handover-draft-<RUNID>.md`, ending the file with the line
`DRAFT COMPLETE — RUNID: <RUNID>`. Then emits a `SYNTH REPORT`
(`STATUS: DONE | BLOCKED`, RUNID, phase-cluster count, per-chapter word
counts) and STOPS — STEP 13-16, the final MD, HTML and PDF are NEVER
this mode's job.
- **`MODE: render`** — runs on the sonnet frontmatter pin. FIRST loads the
draft: absent file, RUNID mismatch, or missing `DRAFT COMPLETE` sentinel
→ `STATUS: BLOCKED` naming the cause (fail closed — never synthesize a
missing draft, never render a partial one). Then runs STEP 13 → 14 →
14.5 → 15 → 16 on the draft + PACKAGE and emits the `HANDOVER-DOC
REPORT`. `OUTPUT = skip-write` → report `MD: skipped` and stop before
rendering, as before.
---
## STEP 9 — LOAD MEMORY REGISTRIES ## STEP 9 — LOAD MEMORY REGISTRIES
```bash ```bash
@@ -452,6 +475,12 @@ des audits de santé. Pour toute question, contactez [contact].*
--- ---
> **MODE BOUNDARY.** STEP 12 is the last synthesize-mode step: write the
> drafted chapters to `.audit/handover-draft-<RUNID>.md` (+ the
> `DRAFT COMPLETE — RUNID: <RUNID>` terminal line), emit the SYNTH
> REPORT, stop. Everything below (STEP 13-16) is `MODE: render` and
> operates ON that draft.
## STEP 13 — SEO/GEO MANUAL CHECKLIST (web projects only) ## STEP 13 — SEO/GEO MANUAL CHECKLIST (web projects only)
If `PROJECT_TYPE=web` AND `PACKAGE.SKIP_SEO` is not `yes`, append this chapter If `PROJECT_TYPE=web` AND `PACKAGE.SKIP_SEO` is not `yes`, append this chapter
+9
View File
@@ -131,6 +131,15 @@ lacks "skills/onboard/SKILL.md" 'Load `$HOME/.claude/agents/onboard
has "skills/commit-change/SKILL.md" 'model="opus"' has "skills/commit-change/SKILL.md" 'model="opus"'
has "agents/commit-changer.md" 'MODE: propose' has "agents/commit-changer.md" 'MODE: propose'
has "agents/commit-changer.md" 'model: sonnet' has "agents/commit-changer.md" 'model: sonnet'
# 17) BDR-077 W4 — handover two-mode: synthesize = opus at the call site
# (STEP 9/10/12 → run-scoped .audit/ draft + DRAFT COMPLETE sentinel),
# render = sonnet pin (STEP 13-16, fail-closed on absent/mismatched
# draft). Name + dispatch-string locks of §9 survive untouched.
has "agents/handover-doc-writer.md" 'MODE: synthesize'
has "agents/handover-doc-writer.md" 'MODE: render'
has "agents/handover-doc-writer.md" 'DRAFT COMPLETE'
has "agents/client-handover-writer.md" 'MODE: synthesize'
has "agents/client-handover-writer.md" 'handover-doc-writer", model="opus"'
printf 'model-routing census: %d pass, %d fail\n' "$pass" "$fail" printf 'model-routing census: %d pass, %d fail\n' "$pass" "$fail"
[ "$fail" -eq 0 ] [ "$fail" -eq 0 ]