feat(agents): W2/S2 doc pipeline two-mode + last inline conversions (BDR-077)
doc-syncer: ONE agent, TWO dispatch modes around the dispatcher's gate — MODE: audit (model="opus" call-site override, READ-ONLY, drafts + PATCH PLAN) / MODE: patch (sonnet pin, applies the APPROVED plan, shape oracle w/ revert-on-fail, emits CHANGE SUMMARY + PATCHED_FILES). Deviation from plan's 2-file split, per the challenge's own commit-changer mode precedent: zero text duplication, zero lock moves. Fixes a LATENT DEFECT: /doc dispatched an agent whose STEP 8 gate could never fire (dispatched agents cannot ask) — the gate now lives in the dispatcher (DISPATCHER PROTOCOL section). doc-commit.md consumes the patcher's CHANGE SUMMARY (the in-thread context now crosses the dispatch boundary, LRN-126). Consumers rewired: /doc (audit→gate→patch→commit), onboard (audit report-only, opus), doc-commit steps in bugfix/hotfix/feat/ship-feature/ init-project(5b+10c); scaffolder loses PHASE 6 (README = init 5b's job); scaffolder + onboarder now DISPATCHED in init-project/onboard (pins live, was inline on session model). In-wave planted-drift smoke PASSED end-to-end, disk-verified (audit caught npm-run-dev drift → [MINOR] plan → patch applied → summary crossed). Census §14-15 (103 pass), make test exit 0. Typed plugin-probe dispatch resolution verified post-restart.
This commit is contained in:
+13
-8
@@ -17,23 +17,28 @@ and any SIGNIFICANT-gated patch), with the code already committed.
|
||||
- Orchestrators (ship-feature / init-project): run it BEFORE the FINISH step — otherwise
|
||||
the doc commit strands outside the merge/PR (the exact bug this fixes). See ORDERING.
|
||||
|
||||
doc-syncer runs IN-THREAD (the orchestrator loads it), so the list of files it patched is
|
||||
already in hand — surfaced as `PATCHED_FILES:` in doc-syncer's OUTPUT, ONE PATH PER LINE.
|
||||
Pass each line as a SEPARATE argument (see DO step 3).
|
||||
doc-syncer runs DISPATCHED (BDR-077: `MODE: audit` on opus → dispatcher gate
|
||||
→ `MODE: patch` on sonnet); its patch-mode report hands the orchestrator BOTH
|
||||
machine blocks: `PATCHED_FILES:` (ONE PATH PER LINE — pass each line as a
|
||||
SEPARATE argument, see DO step 3) and `CHANGE SUMMARY` (one line per patched
|
||||
file — the patch context that used to be in-thread now crosses the dispatch
|
||||
boundary through this block, LRN-126).
|
||||
|
||||
## DO
|
||||
|
||||
1. Collect `PATCHED_FILES` — the public-doc paths doc-syncer wrote this run (its OUTPUT
|
||||
block, ONE PATH PER LINE). Empty → nothing to commit; the helper no-ops.
|
||||
|
||||
2. Compose — from the patch context the AGENT holds (doc-syncer ran in-thread, so the
|
||||
agent knows exactly what changed) — BOTH artifacts:
|
||||
2. Compose — from doc-syncer's `CHANGE SUMMARY` block (the patcher held the
|
||||
patch context and reported it; a dispatched patcher with NO summary block
|
||||
in its report = incomplete report, re-dispatch rather than invent) —
|
||||
BOTH artifacts:
|
||||
- the COMMIT MESSAGE, repo style `docs: <summary> — <flow>`
|
||||
(`docs: README features + USAGE flags — ship-feature dark-mode`);
|
||||
- the CHANGE SUMMARY for the rc 0 surface (e.g. "README features section + USAGE
|
||||
--export flag").
|
||||
Both are the AGENT's to write — the helper produces NEITHER (its only stdout is the
|
||||
hash). This is the load-bearing point of the visible surface: see the rc 0 row.
|
||||
--export flag") — derived from the block, never a bare file count.
|
||||
Both are the ORCHESTRATOR's to write — the helper produces NEITHER (its only stdout
|
||||
is the hash). This is the load-bearing point of the visible surface: see the rc 0 row.
|
||||
|
||||
3. Commit surgically via the helper, passing EXACTLY the patched files — each path as a
|
||||
SEPARATE argument (split `PATCHED_FILES` on NEWLINES only), capturing the hash:
|
||||
|
||||
@@ -97,6 +97,34 @@ for s in plugin-check onboard init-project ship-feature; do
|
||||
# shellcheck disable=SC2016 # literal $HOME wanted: matching the exact inline-load string
|
||||
lacks "skills/$s/SKILL.md" 'Load `$HOME/.claude/agents/plugin-advisor.md`'
|
||||
done
|
||||
# 14) BDR-077 W2/S2 — doc pipeline: ONE agent, TWO modes around the
|
||||
# dispatcher's gate (audit = opus via call-site override — documented
|
||||
# precedence over the sonnet pin; patch = sonnet pin). Gate hoisted out
|
||||
# of the agent (a dispatched agent cannot ask); CHANGE SUMMARY crosses
|
||||
# the dispatch boundary into doc-commit (LRN-126); scaffolder carries no
|
||||
# doc step; no consumer inline-loads doc-syncer anymore.
|
||||
has "agents/doc-syncer.md" 'MODE: audit'
|
||||
has "agents/doc-syncer.md" 'MODE: patch'
|
||||
has "agents/doc-syncer.md" 'CHANGE SUMMARY'
|
||||
has "agents/doc-syncer.md" 'DISPATCHER PROTOCOL'
|
||||
has "lib/doc-commit.md" 'CHANGE SUMMARY'
|
||||
has "skills/doc/SKILL.md" 'model="opus"'
|
||||
has "skills/doc/SKILL.md" 'MODE: patch'
|
||||
lacks "agents/scaffolder.md" 'INLINE-LOAD'
|
||||
for s in bugfix hotfix feat ship-feature init-project; do
|
||||
has "skills/$s/SKILL.md" 'MODE: audit'
|
||||
# shellcheck disable=SC2016 # literal $HOME wanted: matching the exact inline-load string
|
||||
lacks "skills/$s/SKILL.md" 'Load `$HOME/.claude/agents/doc-syncer.md`'
|
||||
done
|
||||
# 15) BDR-077 W2 — last inline execution converted: scaffolder + onboarder
|
||||
# are DISPATCHED (pins live); their gates/arbitration stay in the
|
||||
# orchestrator loop
|
||||
has "skills/init-project/SKILL.md" 'subagent_type="scaffolder"'
|
||||
has "skills/onboard/SKILL.md" 'subagent_type="onboarder"'
|
||||
# shellcheck disable=SC2016
|
||||
lacks "skills/init-project/SKILL.md" 'Load `$HOME/.claude/agents/scaffolder.md`'
|
||||
# shellcheck disable=SC2016
|
||||
lacks "skills/onboard/SKILL.md" 'Load `$HOME/.claude/agents/onboarder.md`'
|
||||
|
||||
printf 'model-routing census: %d pass, %d fail\n' "$pass" "$fail"
|
||||
[ "$fail" -eq 0 ]
|
||||
|
||||
Reference in New Issue
Block a user