@azure-id/orc 1.9.2 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +321 -0
- package/README-id.md +21 -36
- package/README.md +25 -36
- package/bin/build-agents.js +117 -20
- package/bin/cli.js +725 -29
- package/bin/gotcha-import.js +1081 -0
- package/bin/gotcha.js +1286 -0
- package/bin/graph-query.js +1 -1
- package/bin/graph.js +717 -717
- package/bin/habit.js +1453 -0
- package/bin/mockrun-catalog.js +281 -276
- package/bin/run-undo.js +398 -0
- package/bin/trace-write.js +657 -0
- package/bin/verify-contracts.js +525 -79
- package/bin/verify-package.js +51 -4
- package/bin/webui/api.js +26 -0
- package/bin/webui/app.html +239 -232
- package/bin/webui/css/00-tokens.css +110 -92
- package/bin/webui/css/04-motion.css +87 -0
- package/bin/webui/css/06-responsive.css +203 -178
- package/bin/webui/css/panels/behaviour.css +205 -0
- package/bin/webui/fixtures/behaviour.js +532 -0
- package/bin/webui/fixtures/index.js +34 -0
- package/bin/webui/fixtures/knowledge.js +7 -1
- package/bin/webui/fixtures/stats.js +16 -0
- package/bin/webui/i18n/en/behaviour.json +143 -0
- package/bin/webui/i18n/en/nav.json +25 -24
- package/bin/webui/i18n/en/tour.json +37 -35
- package/bin/webui/i18n/id/behaviour.json +143 -0
- package/bin/webui/i18n/id/nav.json +25 -24
- package/bin/webui/i18n/id/tour.json +37 -35
- package/bin/webui/js/01-i18n.js +155 -154
- package/bin/webui/js/90-tour.js +498 -494
- package/bin/webui/js/91-shortcuts.js +126 -126
- package/bin/webui/js/99-boot.js +121 -118
- package/bin/webui/js/panels/behaviour.js +1022 -0
- package/mock-run/INDEX.md +109 -107
- package/mock-run/gotcha-import.md +118 -0
- package/mock-run/habits.md +129 -0
- package/mock-run/orc-quick.md +6 -1
- package/package.json +1 -1
- package/templates/agents/MODEL-MAPPING.md +7 -7
- package/templates/agents/orc-advisor-opus-5-xhigh.md +1 -7
- package/templates/agents/orc-analyze-mini-opus-5-med.md +1 -6
- package/templates/agents/orc-analyze-mini-sonnet-5-high.md +1 -4
- package/templates/agents/orc-claude-writer-opus-4-8-high.md +48 -53
- package/templates/agents/orc-claude-writer-opus-5-med.md +1 -8
- package/templates/agents/orc-context-combiner-opus-5-high.md +1 -11
- package/templates/agents/orc-executor-haiku-4-5.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-high.md +14 -6
- package/templates/agents/orc-executor-opus-4-7-med.md +14 -6
- package/templates/agents/orc-executor-opus-4-8-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-high.md +14 -6
- package/templates/agents/orc-executor-opus-5-low.md +14 -6
- package/templates/agents/orc-executor-opus-5-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-high.md +14 -6
- package/templates/agents/orc-executor-sonnet-4-6-med.md +14 -6
- package/templates/agents/orc-executor-sonnet-5-high.md +14 -6
- package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -10
- package/templates/agents/orc-judge-opus-5-xhigh.md +5 -9
- package/templates/agents/orc-learn-writer-opus-5-low.md +1 -7
- package/templates/agents/orc-pattern-codifier-opus-5-med.md +1 -8
- package/templates/agents/orc-pattern-codifier-sonnet-5-high.md +58 -63
- package/templates/agents/orc-planner-mini-opus-5-med.md +1 -4
- package/templates/agents/orc-planner-mini-sonnet-5-high.md +1 -2
- package/templates/agents/orc-planner-opus-5-med.md +1 -4
- package/templates/agents/orc-recon-opus-5-low.md +1 -8
- package/templates/agents/orc-recon-sonnet-4-6-med.md +1 -8
- package/templates/agents/orc-retro-opus-5-med.md +6 -8
- package/templates/agents/orc-retro-sonnet-5-high.md +6 -7
- package/templates/agents/orc-reviewer-opus-5-med.md +52 -16
- package/templates/agents/orc-scout-opus-5-low.md +1 -6
- package/templates/agents/orc-scout-sonnet-4-6-high.md +35 -39
- package/templates/agents/orc-system-analyst-opus-5-high.md +1 -6
- package/templates/agents/orc-test-author-opus-5-med.md +4 -5
- package/templates/agents/orc-trace-writer-haiku-4-5.md +3 -7
- package/templates/agents/orc-verifier-opus-5-med.md +16 -8
- package/templates/agents/orc-wiki-scanner-opus-4-8-high.md +74 -79
- package/templates/agents/orc-wiki-scanner-opus-5-med.md +1 -8
- package/templates/agents/orc-wiki-scanner-sonnet-5-high.md +97 -106
- package/templates/commands/orc-analyze.md +13 -21
- package/templates/commands/orc-fast.md +10 -15
- package/templates/commands/orc-poly.md +12 -21
- package/templates/commands/orc-pr-driver.md +11 -30
- package/templates/commands/orc-pr-setup.md +10 -31
- package/templates/commands/orc-route.md +11 -41
- package/templates/commands/orc-test.md +5 -60
- package/templates/hooks/README.md +34 -0
- package/templates/hooks/orc-session-hook.js +264 -0
- package/templates/hooks/orc-statusline.js +3 -1
- package/templates/skills/_shared/README.md +9 -0
- package/templates/skills/_shared/code-graph.md +47 -55
- package/templates/skills/_shared/config-precedence.md +3 -1
- package/templates/skills/_shared/extra-dispatch.md +73 -88
- package/templates/skills/_shared/gotchas.md +228 -177
- package/templates/skills/_shared/habits.md +101 -0
- package/templates/skills/_shared/lane-contract.md +84 -0
- package/templates/skills/_shared/phases/README.md +142 -83
- package/templates/skills/_shared/phases/analyst-gates.md +10 -21
- package/templates/skills/_shared/phases/execution.md +8 -14
- package/templates/skills/_shared/phases/house-rules.md +27 -32
- package/templates/skills/_shared/phases/intake.md +127 -133
- package/templates/skills/_shared/phases/mock-example.md +46 -56
- package/templates/skills/_shared/phases/plan-handoff.md +91 -97
- package/templates/skills/_shared/phases/planning.md +7 -17
- package/templates/skills/_shared/phases/preflight.md +19 -42
- package/templates/skills/_shared/phases/review.md +23 -27
- package/templates/skills/_shared/phases/rules.md +18 -42
- package/templates/skills/_shared/phases/scoring.md +55 -65
- package/templates/skills/_shared/phases/security-checklist.md +46 -50
- package/templates/skills/_shared/phases/security.md +45 -55
- package/templates/skills/_shared/phases/ship.md +6 -15
- package/templates/skills/_shared/phases/stop-resume.md +2 -5
- package/templates/skills/_shared/phases/summary.md +73 -48
- package/templates/skills/_shared/phases/testgen.md +41 -51
- package/templates/skills/_shared/phases/trace-verbs.md +433 -0
- package/templates/skills/_shared/phases/trace.md +136 -367
- package/templates/skills/_shared/phases/verify.md +62 -70
- package/templates/skills/_shared/phases/wave-grouping.md +128 -133
- package/templates/skills/_shared/phases/wiki-consult.md +10 -6
- package/templates/skills/_shared/read-ladder.md +2 -55
- package/templates/skills/_shared/return-validation.md +17 -70
- package/templates/skills/_shared/review-slice.md +79 -0
- package/templates/skills/_shared/smoke-gate.md +46 -28
- package/templates/skills/context-combiner/SKILL.md +15 -44
- package/templates/skills/orc/SKILL.md +34 -62
- package/templates/skills/orc/references/pattern-gate.md +89 -89
- package/templates/skills/orc/references/phases/intake.md +41 -47
- package/templates/skills/orc/references/phases/integration.md +13 -19
- package/templates/skills/orc/references/preflight-report.md +8 -9
- package/templates/skills/orc/references/ultra-mode.md +8 -6
- package/templates/skills/orc/subskills/orc-execution/SKILL.md +27 -73
- package/templates/skills/orc/subskills/orc-execution/core.md +12 -99
- package/templates/skills/orc/subskills/orc-execution/subagent.md +14 -13
- package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +11 -52
- package/templates/skills/orc/subskills/orc-review-verify/core.md +52 -135
- package/templates/skills/orc/subskills/orc-review-verify/subagent.md +7 -7
- package/templates/skills/orc/subskills/orc-testgen/SKILL.md +11 -22
- package/templates/skills/orc/subskills/orc-testgen/core.md +20 -59
- package/templates/skills/orc/subskills/orc-testgen/subagent.md +7 -7
- package/templates/skills/orc-advisor/SKILL.md +56 -60
- package/templates/skills/orc-analyze/SKILL.md +30 -66
- package/templates/skills/orc-analyze/schemas/report-audit.md +2 -1
- package/templates/skills/orc-analyze/schemas/report-prose.md +2 -1
- package/templates/skills/orc-analyze-mini/SKILL.md +35 -70
- package/templates/skills/orc-diy/README.md +31 -0
- package/templates/skills/orc-diy/SKILL.md +23 -74
- package/templates/skills/orc-diy/references/blocks/pattern.md +18 -18
- package/templates/skills/orc-fast/SKILL.md +44 -72
- package/templates/skills/orc-judge/SKILL.md +77 -82
- package/templates/skills/orc-mini/SKILL.md +61 -109
- package/templates/skills/orc-pattern/SKILL.md +27 -48
- package/templates/skills/orc-poly/SKILL.md +32 -61
- package/templates/skills/orc-pr-driver/SKILL.md +25 -51
- package/templates/skills/orc-pr-driver/references/green-gate.md +113 -105
- package/templates/skills/orc-pr-setup/SKILL.md +20 -45
- package/templates/skills/orc-quick/README.md +43 -2
- package/templates/skills/orc-quick/SKILL.md +76 -107
- package/templates/skills/orc-quick/references/dispatch-gate.md +16 -5
- package/templates/skills/orc-quick/references/gh-mode.md +48 -1
- package/templates/skills/orc-quick/references/look.md +3 -1
- package/templates/skills/orc-retro/SKILL.md +19 -18
- package/templates/skills/orc-retro/examples/retro-mock.md +1 -1
- package/templates/skills/orc-route/SKILL.md +25 -45
- package/templates/skills/orc-test/SKILL.md +16 -37
- package/templates/skills/orc-verify/SKILL.md +14 -32
- package/templates/skills/orc-wait/SKILL.md +156 -163
- package/templates/skills/orc-wiki/references/phases/phase-0.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-1.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-2.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3.md +1 -6
- package/templates/skills/orc-wiki/references/phases/phase-3c.md +1 -6
package/bin/build-agents.js
CHANGED
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* frontmatter (
|
|
6
|
-
*
|
|
7
|
-
* agents-src/executor.template.md
|
|
8
|
-
*
|
|
4
|
+
* Agent generator. Two sets, one rule: a file that differs from its siblings
|
|
5
|
+
* ONLY in frontmatter and the "You are … (<model>, <effort>)" line is GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* 1. The 10 executors — agents-src/executor.template.md × VARIANTS
|
|
8
|
+
* (name/model/effort + score band).
|
|
9
|
+
* 2. The 8 model-twin pairs (v2.0.0 T15) — agents-src/twins/<family>.template.md
|
|
10
|
+
* × TWINS (name/model/effort/description + the `who` line). One body per
|
|
11
|
+
* family: before T15 each pair was two hand-kept copies that nothing
|
|
12
|
+
* checked against each other.
|
|
13
|
+
*
|
|
14
|
+
* Edit the template (or the table), run `npm run build:agents`, and every copy
|
|
15
|
+
* is stamped out identically. A model change is still a RENAME: a new row, not
|
|
16
|
+
* an edited one.
|
|
9
17
|
*
|
|
10
18
|
* Modes:
|
|
11
|
-
* node bin/build-agents.js write templates/agents/
|
|
19
|
+
* node bin/build-agents.js write both sets into templates/agents/
|
|
12
20
|
* node bin/build-agents.js --check fail if any generated file drifted from
|
|
13
|
-
*
|
|
21
|
+
* its template (runs in `npm run verify`
|
|
14
22
|
* and prepack — a hand-edit to a generated
|
|
15
|
-
*
|
|
23
|
+
* agent file fails the build)
|
|
16
24
|
*/
|
|
17
25
|
const fs = require("fs");
|
|
18
26
|
const path = require("path");
|
|
@@ -43,12 +51,71 @@ const VARIANTS = [
|
|
|
43
51
|
{ name: "orc-executor-haiku-4-5", model: "claude-haiku-4-5", effort: null, band: "lowest-complexity [0,30)" },
|
|
44
52
|
// NAMED BY NO BAND since v1.0.0 W4 (D14) — kept on disk, dispatched only when a
|
|
45
53
|
// user names one explicitly.
|
|
46
|
-
{ name: "orc-executor-opus-5-high", model: "claude-opus-5-5", effort: "high", band: "
|
|
47
|
-
{ name: "orc-executor-opus-4-8-high", model: "claude-opus-4-8", effort: "high", band: "
|
|
48
|
-
{ name: "orc-executor-opus-4-7-high", model: "claude-opus-4-7", effort: "high", band: "
|
|
49
|
-
{ name: "orc-executor-opus-4-7-med", model: "claude-opus-4-7", effort: "medium", band: "
|
|
54
|
+
{ name: "orc-executor-opus-5-high", model: "claude-opus-5-5", effort: "high", band: "none (opt-in only, see MODEL-MAPPING.md)" },
|
|
55
|
+
{ name: "orc-executor-opus-4-8-high", model: "claude-opus-4-8", effort: "high", band: "none (opt-in only, see MODEL-MAPPING.md)" },
|
|
56
|
+
{ name: "orc-executor-opus-4-7-high", model: "claude-opus-4-7", effort: "high", band: "none (opt-in only, see MODEL-MAPPING.md)" },
|
|
57
|
+
{ name: "orc-executor-opus-4-7-med", model: "claude-opus-4-7", effort: "medium", band: "none (opt-in only, see MODEL-MAPPING.md)" },
|
|
50
58
|
];
|
|
51
59
|
|
|
60
|
+
// v2.0.0 T15 — the model twins. Each family is one template under
|
|
61
|
+
// agents-src/twins/; a row fills five placeholders: {{NAME}}, {{MODEL}},
|
|
62
|
+
// {{EFFORT}}, {{DESC}} (the one-line frontmatter description) and {{WHO}} (the
|
|
63
|
+
// "(Sonnet 5, high)" part of the "You are …" line — absent for a family whose
|
|
64
|
+
// body never names its own model). The pair is a runtime choice (`opus5_only`,
|
|
65
|
+
// the recon gate, the wiki tier ladder), so both halves always ship.
|
|
66
|
+
const TWIN_DIR = path.join(ROOT, "agents-src", "twins");
|
|
67
|
+
const TWINS = [
|
|
68
|
+
{ family: "analyze-mini", variants: [
|
|
69
|
+
{ name: "orc-analyze-mini-sonnet-5-high", model: "claude-sonnet-5", effort: "high", who: "Sonnet 5, high",
|
|
70
|
+
desc: "ORC mini System Analyst — claude-sonnet-5, high effort. Dispatched by /orc-mini and /orc-analyze-mini at analysis: single pass, no deep mode, no scouts." },
|
|
71
|
+
{ name: "orc-analyze-mini-opus-5-med", model: "claude-opus-5-5", effort: "medium", who: "Opus 5.5, medium",
|
|
72
|
+
desc: "ORC mini System Analyst — claude-opus-5-5, medium effort. Dispatched by /orc-mini and /orc-analyze-mini, instead of orc-analyze-mini-sonnet-5-high when `opus5_only: true`." },
|
|
73
|
+
] },
|
|
74
|
+
{ family: "planner-mini", variants: [
|
|
75
|
+
{ name: "orc-planner-mini-sonnet-5-high", model: "claude-sonnet-5", effort: "high", who: "Sonnet 5, high",
|
|
76
|
+
desc: "ORC mini Requirement Planner — claude-sonnet-5, high effort. Dispatched by /orc-mini at planning." },
|
|
77
|
+
{ name: "orc-planner-mini-opus-5-med", model: "claude-opus-5-5", effort: "medium", who: "Opus 5.5, medium",
|
|
78
|
+
desc: "ORC mini Requirement Planner — claude-opus-5-5, medium effort. Dispatched by /orc-mini at planning, instead of orc-planner-mini-sonnet-5-high when `opus5_only: true`." },
|
|
79
|
+
] },
|
|
80
|
+
{ family: "pattern-codifier", variants: [
|
|
81
|
+
{ name: "orc-pattern-codifier-sonnet-5-high", model: "claude-sonnet-5", effort: "high",
|
|
82
|
+
desc: "ORC Pattern Codifier — claude-sonnet-5, high effort. Dispatched by orc-pattern (lazy /orc miss, eager orc-wiki, or manual /orc-pattern) for ONE language." },
|
|
83
|
+
{ name: "orc-pattern-codifier-opus-5-med", model: "claude-opus-5-5", effort: "medium",
|
|
84
|
+
desc: "ORC Pattern Codifier — claude-opus-5-5, medium effort. Dispatched by orc-pattern, instead of orc-pattern-codifier-sonnet-5-high when `opus5_only: true`." },
|
|
85
|
+
] },
|
|
86
|
+
{ family: "recon", variants: [
|
|
87
|
+
{ name: "orc-recon-sonnet-4-6-med", model: "claude-sonnet-4-6", effort: "medium", who: "Sonnet 4.6, medium",
|
|
88
|
+
desc: "ORC Recon — claude-sonnet-4-6, medium effort. Dispatched by /orc-quick at the dispatch gate, for a read-only question. It never edits." },
|
|
89
|
+
{ name: "orc-recon-opus-5-low", model: "claude-opus-5-5", effort: "low", who: "Opus 5.5, low",
|
|
90
|
+
desc: "ORC Recon — claude-opus-5-5, low effort. Dispatched by /orc-quick at the dispatch gate, for a WIDE or SUBTLE read-only question. It never edits." },
|
|
91
|
+
] },
|
|
92
|
+
{ family: "retro", variants: [
|
|
93
|
+
{ name: "orc-retro-sonnet-5-high", model: "claude-sonnet-5", effort: "high", who: "Sonnet 5, high",
|
|
94
|
+
desc: "ORC Retro miner — claude-sonnet-5, high effort. Dispatched by /orc-retro to mine the behavior traces. Read-only, report-only." },
|
|
95
|
+
{ name: "orc-retro-opus-5-med", model: "claude-opus-5-5", effort: "medium", who: "Opus 5.5, medium",
|
|
96
|
+
desc: "ORC Retro miner — claude-opus-5-5, medium effort. Dispatched by /orc-retro, instead of orc-retro-sonnet-5-high when `opus5_only: true`. Read-only." },
|
|
97
|
+
] },
|
|
98
|
+
{ family: "scout", variants: [
|
|
99
|
+
{ name: "orc-scout-sonnet-4-6-high", model: "claude-sonnet-4-6", effort: "high", who: "Sonnet 4.6, high",
|
|
100
|
+
desc: "ORC Code Scout — claude-sonnet-4-6, high effort. Dispatched by orc in the analyst's DEEP mode (≤max_scouts in parallel), ONE coverage area each." },
|
|
101
|
+
{ name: "orc-scout-opus-5-low", model: "claude-opus-5-5", effort: "low", who: "Opus 5.5, low",
|
|
102
|
+
desc: "ORC Code Scout — claude-opus-5-5, low effort. Dispatched by orc in the analyst's DEEP mode, instead of orc-scout-sonnet-4-6-high when `opus5_only: true`." },
|
|
103
|
+
] },
|
|
104
|
+
{ family: "claude-writer", variants: [
|
|
105
|
+
{ name: "orc-claude-writer-opus-4-8-high", model: "claude-opus-4-8", effort: "high", who: "Opus 4.8, high",
|
|
106
|
+
desc: "ORC CLAUDE.md Writer — claude-opus-4-8, high effort. Dispatched by /orc-claude to create, update or refresh the repo-root CLAUDE.md." },
|
|
107
|
+
{ name: "orc-claude-writer-opus-5-med", model: "claude-opus-5-5", effort: "medium", who: "Opus 5.5, medium",
|
|
108
|
+
desc: "ORC CLAUDE.md Writer — claude-opus-5-5, medium effort. Dispatched by /orc-claude, instead of orc-claude-writer-opus-4-8-high when `opus5_only: true`." },
|
|
109
|
+
] },
|
|
110
|
+
{ family: "wiki-scanner", variants: [
|
|
111
|
+
{ name: "orc-wiki-scanner-opus-4-8-high", model: "claude-opus-4-8", effort: "high",
|
|
112
|
+
desc: "ORC Wiki Scanner — claude-opus-4-8, high effort. Dispatched by orc-wiki per scan-task (DEEP tier), ONE coverage area each." },
|
|
113
|
+
{ name: "orc-wiki-scanner-opus-5-med", model: "claude-opus-5-5", effort: "medium",
|
|
114
|
+
desc: "ORC Wiki Scanner — claude-opus-5-5, medium effort. Dispatched by orc-wiki per scan-task, for BOTH tiers when `opus5_only: true`." },
|
|
115
|
+
] },
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
|
|
52
119
|
// Line endings are NOT content here: .gitattributes stores these files with LF
|
|
53
120
|
// and checks them out native, so a Windows worktree is CRLF and a Linux one LF.
|
|
54
121
|
// The injected frontmatter line therefore borrows the TEMPLATE's own ending, and
|
|
@@ -68,17 +135,44 @@ function render(template, v) {
|
|
|
68
135
|
.replace(/\{\{BAND\}\}/g, v.band);
|
|
69
136
|
}
|
|
70
137
|
|
|
71
|
-
function
|
|
72
|
-
|
|
138
|
+
function renderTwin(template, v) {
|
|
139
|
+
return template
|
|
140
|
+
.replace(/\{\{NAME\}\}/g, v.name)
|
|
141
|
+
.replace(/\{\{MODEL\}\}/g, v.model)
|
|
142
|
+
.replace(/\{\{EFFORT\}\}/g, v.effort)
|
|
143
|
+
.replace(/\{\{DESC\}\}/g, v.desc)
|
|
144
|
+
.replace(/\{\{WHO\}\}/g, v.who || "");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Every [template, row, renderer] the generator owns, executors first.
|
|
148
|
+
function jobs() {
|
|
73
149
|
const template = fs.readFileSync(TEMPLATE, "utf8");
|
|
74
150
|
if (/\{\{(?!NAME|MODEL|EFFORT_DESC|EFFORT_FM|BAND)\w/.test(template)) {
|
|
75
151
|
console.error("❌ build-agents: unknown {{placeholder}} in executor.template.md");
|
|
76
152
|
process.exit(1);
|
|
77
153
|
}
|
|
154
|
+
const out = VARIANTS.map((v) => ({ v, out: render(template, v), src: "agents-src/executor.template.md" }));
|
|
155
|
+
for (const fam of TWINS) {
|
|
156
|
+
const src = "agents-src/twins/" + fam.family + ".template.md";
|
|
157
|
+
const t = fs.readFileSync(path.join(TWIN_DIR, fam.family + ".template.md"), "utf8");
|
|
158
|
+
if (/\{\{(?!(?:NAME|MODEL|EFFORT|DESC|WHO)\}\})\w/.test(t)) {
|
|
159
|
+
console.error("❌ build-agents: unknown {{placeholder}} in " + src);
|
|
160
|
+
process.exit(1);
|
|
161
|
+
}
|
|
162
|
+
if (/\{\{WHO\}\}/.test(t) !==fam.variants.every((v) => v.who)) {
|
|
163
|
+
console.error("❌ build-agents: " + src + " and its TWINS rows disagree about {{WHO}}");
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
for (const v of fam.variants) out.push({ v, out: renderTwin(t, v), src });
|
|
167
|
+
}
|
|
168
|
+
return out;
|
|
169
|
+
}
|
|
78
170
|
|
|
171
|
+
function main() {
|
|
172
|
+
const checkMode = process.argv.includes("--check");
|
|
173
|
+
const all = jobs();
|
|
79
174
|
let drifted = 0;
|
|
80
|
-
for (const v of
|
|
81
|
-
const out = render(template, v);
|
|
175
|
+
for (const { v, out, src } of all) {
|
|
82
176
|
const dest = path.join(OUT_DIR, v.name + ".md");
|
|
83
177
|
if (checkMode) {
|
|
84
178
|
const current = fs.existsSync(dest) ? fs.readFileSync(dest, "utf8") : null;
|
|
@@ -86,8 +180,8 @@ function main() {
|
|
|
86
180
|
drifted++;
|
|
87
181
|
console.error(
|
|
88
182
|
`❌ generated agent drifted: templates/agents/${v.name}.md\n` +
|
|
89
|
-
`
|
|
90
|
-
` (or bin/build-agents.js
|
|
183
|
+
` This agent is GENERATED — edit ${src}\n` +
|
|
184
|
+
` (or the VARIANTS / TWINS table in bin/build-agents.js) and run: npm run build:agents`
|
|
91
185
|
);
|
|
92
186
|
}
|
|
93
187
|
} else {
|
|
@@ -98,12 +192,15 @@ function main() {
|
|
|
98
192
|
|
|
99
193
|
if (checkMode) {
|
|
100
194
|
if (drifted) process.exit(1);
|
|
101
|
-
|
|
195
|
+
const twins = all.length - VARIANTS.length;
|
|
196
|
+
console.log(
|
|
197
|
+
`✅ ORC executor agents OK — ${VARIANTS.length} files match the template; ${twins} model twins match agents-src/twins/.`
|
|
198
|
+
);
|
|
102
199
|
}
|
|
103
200
|
}
|
|
104
201
|
|
|
105
202
|
// Required by test/payload.test.js, which checks the line-ending rule above
|
|
106
203
|
// without writing to templates/agents/.
|
|
107
|
-
module.exports = { VARIANTS, render, lf, eolOf };
|
|
204
|
+
module.exports = { VARIANTS, TWINS, render, renderTwin, lf, eolOf };
|
|
108
205
|
|
|
109
206
|
if (require.main === module) main();
|