|
10 | 10 | * node scripts/test-skills.mjs structure # run one group |
11 | 11 | * node scripts/test-skills.mjs portability links # run multiple groups |
12 | 12 | * |
13 | | - * Groups: structure, codex, consistency, portability, links, routing, generation, loopdocs, hooks, modes, handoffs, trace, discovery, parking, witnessing, timinghook, crosstalk |
| 13 | + * Groups: structure, codex, consistency, portability, links, routing, generation, loopdocs, hooks, modes, handoffs, trace, reduce, discovery, parking, witnessing, timinghook, crosstalk |
14 | 14 | * |
15 | 15 | * All groups except discovery, parking, witnessing and crosstalk are offline (free, fast); |
16 | 16 | * those four require --live and make Claude API calls. |
@@ -734,6 +734,52 @@ if (shouldRun("hooks")) { |
734 | 734 | } |
735 | 735 | } |
736 | 736 |
|
| 737 | +// --------------------------------------------------------------------------- |
| 738 | +// Reduce — the fan-out reduce step (driving-the-loop §6 + integrating-slices). |
| 739 | +// Pins the constructs that make the reduce a real procedure, so a reword can't |
| 740 | +// silently drop them: the reference doc exists and is linked from §6, the |
| 741 | +// cross-check runs `allium analyse` over all slices, and the seam-signal |
| 742 | +// diagnostic is documented in actioning-findings. Offline and deterministic. |
| 743 | +// --------------------------------------------------------------------------- |
| 744 | + |
| 745 | +if (shouldRun("reduce")) { |
| 746 | + console.log("\n── reduce: the fan-out integration (reduce) step ──\n"); |
| 747 | + |
| 748 | + const integ = path.join(ROOT, "skills", "allium", "references", "integrating-slices.md"); |
| 749 | + const loop = path.join(ROOT, "skills", "allium", "references", "driving-the-loop.md"); |
| 750 | + const findings = path.join(ROOT, "skills", "allium", "references", "actioning-findings.md"); |
| 751 | + |
| 752 | + if (existsSync(integ)) pass("integrating-slices.md exists"); |
| 753 | + else fail("integrating-slices.md", "reduce-step reference doc missing"); |
| 754 | + |
| 755 | + const integSrc = existsSync(integ) ? readFileSync(integ, "utf-8") : ""; |
| 756 | + // The reduce leans on the CLI cross-checking all slices at once. |
| 757 | + /allium analyse/.test(integSrc) |
| 758 | + ? pass("integrating-slices: cross-checks with allium analyse") |
| 759 | + : fail("integrating-slices: analyse", "must run `allium analyse` over the slices"); |
| 760 | + // Canonical owner for shared entities is the assembly rule. |
| 761 | + /canonical owner/i.test(integSrc) |
| 762 | + ? pass("integrating-slices: canonical owner rule") |
| 763 | + : fail("integrating-slices: canonical owner", "must state the canonical-owner rule for shared entities"); |
| 764 | + // No new agent: edits are delegated to existing phase agents. |
| 765 | + /\btend\b/.test(integSrc) && /\bwitness\b/.test(integSrc) |
| 766 | + ? pass("integrating-slices: delegates to existing phase agents") |
| 767 | + : fail("integrating-slices: delegation", "must route edits through tend and witness the whole"); |
| 768 | + |
| 769 | + const loopSrc = readFileSync(loop, "utf-8"); |
| 770 | + loopSrc.includes("integrating-slices.md") |
| 771 | + ? pass("driving-the-loop §6 links the reduce reference") |
| 772 | + : fail("driving-the-loop §6 link", "§6 must link integrating-slices.md"); |
| 773 | + /reduce step/i.test(loopSrc) |
| 774 | + ? pass("driving-the-loop §6 names the reduce step") |
| 775 | + : fail("driving-the-loop §6", 'must name the "reduce step"'); |
| 776 | + |
| 777 | + const findingsSrc = readFileSync(findings, "utf-8"); |
| 778 | + findingsSrc.includes("allium.reference.unknownName") |
| 779 | + ? pass("actioning-findings documents the seam signal (reference.unknownName)") |
| 780 | + : fail("actioning-findings seam signal", "must document allium.reference.unknownName as a seam signal"); |
| 781 | +} |
| 782 | + |
737 | 783 | // --------------------------------------------------------------------------- |
738 | 784 | // Modes — the interaction-mode contract is stated everywhere it must be. |
739 | 785 | // The skill is the single source of truth for each agent-backed capability; |
|
0 commit comments