feat(ultraplan-local): parallelize Phase 9 review with inline dedup

Strengthen single-message reinforcement for plan-critic + scope-guardian
parallel dispatch in commands/ultraplan-local.md Phase 9 and mirror in
agents/planning-orchestrator.md Phase 6. Reviewers now write structured JSON
to /tmp/{plan-critic,scope-guardian}-out.json which is merged via the
lib/review/plan-review-dedup.mjs CLI shim from S8.

The merged set lets us revise the plan once for duplicate findings instead
of twice. Source: research/05 R1 + R2.

Pin in tests/lib/doc-consistency.test.mjs locks both files against
single-message + dedup-helper regressions.
This commit is contained in:
Kjell Tore Guttormsen 2026-05-04 07:43:50 +02:00
commit 272638aec1
3 changed files with 57 additions and 4 deletions

View file

@ -158,6 +158,29 @@ test('rule-catalogue has exactly 12 entries', async () => {
);
});
test('Phase 9 prose mandates parallel single-message dispatch + inline dedup', () => {
const cmd = read('commands/ultraplan-local.md');
const orch = read('agents/planning-orchestrator.md');
// Single-message reinforcement appears in both (command + orchestrator)
assert.ok(
cmd.includes('single assistant message turn'),
'commands/ultraplan-local.md Phase 9 should reinforce single-message parallel dispatch',
);
assert.ok(
orch.includes('single assistant message turn'),
'agents/planning-orchestrator.md Phase 6 should mirror the single-message parallel-dispatch contract',
);
// Dedup CLI shim is wired in both
assert.ok(
cmd.includes('plan-review-dedup.mjs'),
'commands/ultraplan-local.md Phase 9 should call lib/review/plan-review-dedup.mjs after both reviewers complete',
);
assert.ok(
orch.includes('plan-review-dedup.mjs'),
'agents/planning-orchestrator.md Phase 6 should reference the dedup helper',
);
});
test('commands/ultraplan-local.md Phase 8 seals Opus-4.7 schema-drift defense', () => {
const cmd = read('commands/ultraplan-local.md');
// Locate Phase 8 section