@azure-id/orc 1.9.0 → 1.9.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.
Files changed (134) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/README-id.md +57 -59
  3. package/README.md +53 -54
  4. package/bin/build-agents.js +109 -109
  5. package/bin/cli.js +262 -58
  6. package/bin/graph-audit.js +235 -0
  7. package/bin/graph-extract.js +308 -3
  8. package/bin/graph-gain.js +23 -3
  9. package/bin/graph-map.js +9 -1
  10. package/bin/graph-query.js +152 -10
  11. package/bin/graph-shard.js +6 -1
  12. package/bin/graph-signals.js +287 -4
  13. package/bin/graph.js +717 -658
  14. package/bin/onboarding-content.js +4 -4
  15. package/bin/pricing.json +207 -200
  16. package/bin/verify-contracts.js +117 -2
  17. package/bin/verify-package.js +11 -7
  18. package/bin/webui/css/04-motion.css +162 -152
  19. package/bin/webui/css/panels/knowledge.css +563 -116
  20. package/bin/webui/fixtures/extra.js +2036 -2036
  21. package/bin/webui/fixtures/hookui.js +5 -5
  22. package/bin/webui/fixtures/knowledge.js +21 -4
  23. package/bin/webui/fixtures/settings.js +305 -305
  24. package/bin/webui/i18n/en/knowledge.json +122 -4
  25. package/bin/webui/i18n/id/knowledge.json +122 -4
  26. package/bin/webui/js/panels/knowledge.js +573 -9
  27. package/bin/webui/js/panels/overview.js +13 -4
  28. package/mock-run/context-combiner.md +100 -100
  29. package/mock-run/orc-budget.md +534 -534
  30. package/mock-run/orc-challenge-council.md +262 -262
  31. package/mock-run/orc-ultra.md +103 -103
  32. package/package.json +1 -1
  33. package/templates/agents/MODEL-MAPPING.md +43 -43
  34. package/templates/agents/orc-advisor-opus-5-xhigh.md +56 -56
  35. package/templates/agents/orc-analyze-mini-opus-5-med.md +60 -60
  36. package/templates/agents/orc-analyze-mini-sonnet-5-high.md +58 -58
  37. package/templates/agents/orc-challenge-advisor-opus-5-med.md +75 -75
  38. package/templates/agents/orc-challenge-contrarian-opus-5-high.md +110 -110
  39. package/templates/agents/orc-challenge-executor-opus-5-med.md +114 -114
  40. package/templates/agents/orc-challenge-expansionist-opus-5-med.md +112 -112
  41. package/templates/agents/orc-challenge-judge-opus-5-high.md +132 -132
  42. package/templates/agents/orc-challenge-outsider-opus-5-low.md +109 -109
  43. package/templates/agents/orc-challenge-principles-opus-5-high.md +109 -109
  44. package/templates/agents/orc-challenge-reader-opus-5-low.md +90 -90
  45. package/templates/agents/orc-claude-writer-opus-5-med.md +55 -55
  46. package/templates/agents/orc-context-combiner-opus-5-high.md +88 -88
  47. package/templates/agents/orc-doc-checker-opus-5-low.md +108 -108
  48. package/templates/agents/orc-doc-writer-opus-5-med.md +134 -134
  49. package/templates/agents/orc-executor-haiku-4-5.md +2 -1
  50. package/templates/agents/orc-executor-opus-4-7-high.md +2 -1
  51. package/templates/agents/orc-executor-opus-4-7-med.md +2 -1
  52. package/templates/agents/orc-executor-opus-4-8-high.md +2 -1
  53. package/templates/agents/orc-executor-opus-5-high.md +4 -3
  54. package/templates/agents/orc-executor-opus-5-low.md +4 -3
  55. package/templates/agents/orc-executor-opus-5-med.md +4 -3
  56. package/templates/agents/orc-executor-sonnet-4-6-high.md +2 -1
  57. package/templates/agents/orc-executor-sonnet-4-6-med.md +2 -1
  58. package/templates/agents/orc-executor-sonnet-5-high.md +2 -1
  59. package/templates/agents/orc-graph-noter-sonnet-4-6-med.md +1 -1
  60. package/templates/agents/orc-judge-opus-5-xhigh.md +85 -85
  61. package/templates/agents/orc-learn-writer-opus-5-low.md +73 -73
  62. package/templates/agents/orc-pattern-codifier-opus-5-med.md +65 -65
  63. package/templates/agents/orc-planner-mini-opus-5-med.md +4 -4
  64. package/templates/agents/orc-planner-mini-sonnet-5-high.md +1 -1
  65. package/templates/agents/orc-planner-opus-5-med.md +160 -160
  66. package/templates/agents/orc-recon-opus-5-low.md +18 -8
  67. package/templates/agents/orc-recon-sonnet-4-6-med.md +15 -5
  68. package/templates/agents/orc-retro-opus-5-med.md +3 -3
  69. package/templates/agents/orc-reviewer-opus-5-med.md +60 -60
  70. package/templates/agents/orc-scout-opus-5-low.md +40 -40
  71. package/templates/agents/orc-system-analyst-opus-5-high.md +120 -120
  72. package/templates/agents/orc-test-author-opus-5-med.md +71 -71
  73. package/templates/agents/orc-test-designer-opus-5-high.md +158 -158
  74. package/templates/agents/orc-test-interpreter-opus-5-low.md +130 -130
  75. package/templates/agents/orc-verifier-opus-5-med.md +69 -69
  76. package/templates/agents/orc-wiki-scanner-opus-5-med.md +81 -81
  77. package/templates/commands/orc-ultra.md +17 -17
  78. package/templates/commands/orc-verify.md +11 -11
  79. package/templates/hooks/README.md +13 -3
  80. package/templates/hooks/orc-effort-guard.js +178 -178
  81. package/templates/hooks/orc-graph-hook.js +53 -7
  82. package/templates/hooks/orc-statusline.js +6 -6
  83. package/templates/skills/_shared/code-graph.md +57 -18
  84. package/templates/skills/_shared/config-precedence.md +198 -198
  85. package/templates/skills/_shared/extra-dispatch.md +1346 -1346
  86. package/templates/skills/_shared/opus5-only.md +8 -8
  87. package/templates/skills/_shared/phases/analyst-gates.md +136 -136
  88. package/templates/skills/_shared/phases/execution.md +4 -4
  89. package/templates/skills/_shared/phases/planning.md +3 -3
  90. package/templates/skills/_shared/phases/preflight.md +1 -1
  91. package/templates/skills/_shared/phases/review.md +4 -2
  92. package/templates/skills/_shared/phases/ship.md +1 -1
  93. package/templates/skills/_shared/phases/trace.md +3 -2
  94. package/templates/skills/_shared/read-ladder.md +14 -1
  95. package/templates/skills/_shared/return-validation.md +1 -1
  96. package/templates/skills/context-combiner/SKILL.md +1 -1
  97. package/templates/skills/context-combiner/schemas/combined-report.md +78 -78
  98. package/templates/skills/orc/README.md +2 -2
  99. package/templates/skills/orc/SKILL.md +8 -8
  100. package/templates/skills/orc/config.md +9 -9
  101. package/templates/skills/orc/examples/full-run-mock.md +73 -73
  102. package/templates/skills/orc/references/effort-and-mode.md +222 -222
  103. package/templates/skills/orc/references/preflight-report.md +2 -2
  104. package/templates/skills/orc/references/ultra-mode.md +3 -3
  105. package/templates/skills/orc/subskills/orc-planner/SKILL.md +2 -2
  106. package/templates/skills/orc/subskills/orc-planner-mini/SKILL.md +121 -121
  107. package/templates/skills/orc/subskills/orc-review-verify/SKILL.md +76 -76
  108. package/templates/skills/orc/subskills/orc-testgen/SKILL.md +45 -45
  109. package/templates/skills/orc-analyze/SKILL.md +2 -2
  110. package/templates/skills/orc-analyze/examples/analyze-mock.md +42 -42
  111. package/templates/skills/orc-analyze/schemas/report-audit.md +83 -83
  112. package/templates/skills/orc-analyze/schemas/report-prose.md +63 -63
  113. package/templates/skills/orc-analyze/schemas/report-requirement.md +78 -78
  114. package/templates/skills/orc-challenge/README.md +142 -142
  115. package/templates/skills/orc-challenge/examples/council-full-roster.md +273 -273
  116. package/templates/skills/orc-challenge/references/council.md +315 -315
  117. package/templates/skills/orc-challenge/references/intake.md +171 -171
  118. package/templates/skills/orc-claude/SKILL.md +14 -14
  119. package/templates/skills/orc-diy/README.md +143 -143
  120. package/templates/skills/orc-diy/references/flow-schema.md +1 -1
  121. package/templates/skills/orc-doc/README.md +229 -229
  122. package/templates/skills/orc-doc/examples/orc-doc-prd-run.md +325 -325
  123. package/templates/skills/orc-doc/references/chunking.md +527 -527
  124. package/templates/skills/orc-fast/SKILL.md +4 -4
  125. package/templates/skills/orc-learn/SKILL.md +14 -14
  126. package/templates/skills/orc-learn/examples/learn-run-mock.md +61 -61
  127. package/templates/skills/orc-mini/SKILL.md +16 -20
  128. package/templates/skills/orc-mini/references/complexity.md +25 -11
  129. package/templates/skills/orc-quick/SKILL.md +12 -13
  130. package/templates/skills/orc-quick/references/gh-mode.md +1 -1
  131. package/templates/skills/orc-quick/references/look.md +5 -5
  132. package/templates/skills/orc-verify/SKILL.md +15 -15
  133. package/templates/skills/orc-verify/examples/verify-mock.md +33 -33
  134. package/templates/skills/orc-wiki/references/extra.md +1 -1
@@ -1,109 +1,109 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * Executor-agent generator. The 6 executor agent files differ ONLY in
5
- * frontmatter (name/model/effort + score band); their body is one shared
6
- * contract. This script is the single source of truth: edit
7
- * agents-src/executor.template.md (or the VARIANTS table), run
8
- * `npm run build:agents`, and every copy is stamped out identically.
9
- *
10
- * Modes:
11
- * node bin/build-agents.js write templates/agents/orc-executor-*.md
12
- * node bin/build-agents.js --check fail if any generated file drifted from
13
- * the template (runs in `npm run verify`
14
- * and prepack — a hand-edit to a generated
15
- * executor file fails the build)
16
- */
17
- const fs = require("fs");
18
- const path = require("path");
19
-
20
- const ROOT = path.join(__dirname, "..");
21
- const TEMPLATE = path.join(ROOT, "agents-src", "executor.template.md");
22
- const OUT_DIR = path.join(ROOT, "templates", "agents");
23
-
24
- // Score→model bands mirror templates/agents/MODEL-MAPPING.md and the single
25
- // score→model table in skills/orc/config.md (documented drift — change
26
- // together). `effort: null` = a model with NO effort ladder (haiku): the
27
- // generator omits the `effort:` frontmatter line entirely.
28
- //
29
- // v1.0.0 W4 — the table is SIX bands, not eight, and the `opus5_only` ladder is
30
- // TWO, not three. Four of these agents are named by NO default row:
31
- // names them, and they ship anyway (D14). They stay reachable through
32
- // `rubric_bands_override`, `orc diy` `fixed_executor` and `extra_fallback_agent`,
33
- // and deleting a generated file that no row happens to name today would be a
34
- // rename-shaped migration for what is only a table change. Their `band` string
35
- // says so rather than naming a range that no longer exists — a band label that
36
- // lies is worse than one that admits it is unreachable by default.
37
- const VARIANTS = [
38
- { name: "orc-executor-opus-5-med", model: "claude-opus-5", effort: "medium", band: "highest-complexity [90,100]" },
39
- { name: "orc-executor-opus-5-low", model: "claude-opus-5", effort: "low", band: "upper-complexity [65,90)" },
40
- { name: "orc-executor-sonnet-5-high", model: "claude-sonnet-5", effort: "high", band: "mid-complexity [55,65)" },
41
- { name: "orc-executor-sonnet-4-6-high", model: "claude-sonnet-4-6", effort: "high", band: "low-mid-complexity [40,55)" },
42
- { name: "orc-executor-sonnet-4-6-med", model: "claude-sonnet-4-6", effort: "medium", band: "low-complexity [30,40)" },
43
- { name: "orc-executor-haiku-4-5", model: "claude-haiku-4-5", effort: null, band: "lowest-complexity [0,30)" },
44
- // NAMED BY NO BAND since v1.0.0 W4 (D14) — kept on disk, dispatched only when a
45
- // user names one explicitly.
46
- { name: "orc-executor-opus-5-high", model: "claude-opus-5", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
47
- { name: "orc-executor-opus-4-8-high", model: "claude-opus-4-8", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
48
- { name: "orc-executor-opus-4-7-high", model: "claude-opus-4-7", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
49
- { name: "orc-executor-opus-4-7-med", model: "claude-opus-4-7", effort: "medium", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
50
- ];
51
-
52
- // Line endings are NOT content here: .gitattributes stores these files with LF
53
- // and checks them out native, so a Windows worktree is CRLF and a Linux one LF.
54
- // The injected frontmatter line therefore borrows the TEMPLATE's own ending, and
55
- // --check compares LF-normalized text — otherwise the guard fails on Windows for
56
- // a difference git itself does not record.
57
- const eolOf = (s) => (/\r\n/.test(s) ? "\r\n" : "\n");
58
- const lf = (s) => s.replace(/\r\n/g, "\n");
59
-
60
- function render(template, v) {
61
- const effortDesc = v.effort ? `, ${v.effort} effort` : " (no effort ladder)";
62
- const effortFm = v.effort ? `effort: ${v.effort}${eolOf(template)}` : "";
63
- return template
64
- .replace(/\{\{NAME\}\}/g, v.name)
65
- .replace(/\{\{MODEL\}\}/g, v.model)
66
- .replace(/\{\{EFFORT_DESC\}\}/g, effortDesc)
67
- .replace(/\{\{EFFORT_FM\}\}/g, effortFm)
68
- .replace(/\{\{BAND\}\}/g, v.band);
69
- }
70
-
71
- function main() {
72
- const checkMode = process.argv.includes("--check");
73
- const template = fs.readFileSync(TEMPLATE, "utf8");
74
- if (/\{\{(?!NAME|MODEL|EFFORT_DESC|EFFORT_FM|BAND)\w/.test(template)) {
75
- console.error("❌ build-agents: unknown {{placeholder}} in executor.template.md");
76
- process.exit(1);
77
- }
78
-
79
- let drifted = 0;
80
- for (const v of VARIANTS) {
81
- const out = render(template, v);
82
- const dest = path.join(OUT_DIR, v.name + ".md");
83
- if (checkMode) {
84
- const current = fs.existsSync(dest) ? fs.readFileSync(dest, "utf8") : null;
85
- if (current === null || lf(current) !== lf(out)) {
86
- drifted++;
87
- console.error(
88
- `❌ generated agent drifted: templates/agents/${v.name}.md\n` +
89
- ` Executor agents are GENERATED — edit agents-src/executor.template.md\n` +
90
- ` (or bin/build-agents.js VARIANTS) and run: npm run build:agents`
91
- );
92
- }
93
- } else {
94
- fs.writeFileSync(dest, out);
95
- console.log(` gen templates/agents/${v.name}.md`);
96
- }
97
- }
98
-
99
- if (checkMode) {
100
- if (drifted) process.exit(1);
101
- console.log(`✅ ORC executor agents OK — ${VARIANTS.length} files match the template.`);
102
- }
103
- }
104
-
105
- // Required by test/payload.test.js, which checks the line-ending rule above
106
- // without writing to templates/agents/.
107
- module.exports = { VARIANTS, render, lf, eolOf };
108
-
109
- if (require.main === module) main();
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Executor-agent generator. The 6 executor agent files differ ONLY in
5
+ * frontmatter (name/model/effort + score band); their body is one shared
6
+ * contract. This script is the single source of truth: edit
7
+ * agents-src/executor.template.md (or the VARIANTS table), run
8
+ * `npm run build:agents`, and every copy is stamped out identically.
9
+ *
10
+ * Modes:
11
+ * node bin/build-agents.js write templates/agents/orc-executor-*.md
12
+ * node bin/build-agents.js --check fail if any generated file drifted from
13
+ * the template (runs in `npm run verify`
14
+ * and prepack — a hand-edit to a generated
15
+ * executor file fails the build)
16
+ */
17
+ const fs = require("fs");
18
+ const path = require("path");
19
+
20
+ const ROOT = path.join(__dirname, "..");
21
+ const TEMPLATE = path.join(ROOT, "agents-src", "executor.template.md");
22
+ const OUT_DIR = path.join(ROOT, "templates", "agents");
23
+
24
+ // Score→model bands mirror templates/agents/MODEL-MAPPING.md and the single
25
+ // score→model table in skills/orc/config.md (documented drift — change
26
+ // together). `effort: null` = a model with NO effort ladder (haiku): the
27
+ // generator omits the `effort:` frontmatter line entirely.
28
+ //
29
+ // v1.0.0 W4 — the table is SIX bands, not eight, and the `opus5_only` ladder is
30
+ // TWO, not three. Four of these agents are named by NO default row:
31
+ // names them, and they ship anyway (D14). They stay reachable through
32
+ // `rubric_bands_override`, `orc diy` `fixed_executor` and `extra_fallback_agent`,
33
+ // and deleting a generated file that no row happens to name today would be a
34
+ // rename-shaped migration for what is only a table change. Their `band` string
35
+ // says so rather than naming a range that no longer exists — a band label that
36
+ // lies is worse than one that admits it is unreachable by default.
37
+ const VARIANTS = [
38
+ { name: "orc-executor-opus-5-med", model: "claude-opus-5-5", effort: "medium", band: "highest-complexity [90,100]" },
39
+ { name: "orc-executor-opus-5-low", model: "claude-opus-5-5", effort: "low", band: "upper-complexity [65,90)" },
40
+ { name: "orc-executor-sonnet-5-high", model: "claude-sonnet-5", effort: "high", band: "mid-complexity [55,65)" },
41
+ { name: "orc-executor-sonnet-4-6-high", model: "claude-sonnet-4-6", effort: "high", band: "low-mid-complexity [40,55)" },
42
+ { name: "orc-executor-sonnet-4-6-med", model: "claude-sonnet-4-6", effort: "medium", band: "low-complexity [30,40)" },
43
+ { name: "orc-executor-haiku-4-5", model: "claude-haiku-4-5", effort: null, band: "lowest-complexity [0,30)" },
44
+ // NAMED BY NO BAND since v1.0.0 W4 (D14) — kept on disk, dispatched only when a
45
+ // user names one explicitly.
46
+ { name: "orc-executor-opus-5-high", model: "claude-opus-5-5", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
47
+ { name: "orc-executor-opus-4-8-high", model: "claude-opus-4-8", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
48
+ { name: "orc-executor-opus-4-7-high", model: "claude-opus-4-7", effort: "high", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
49
+ { name: "orc-executor-opus-4-7-med", model: "claude-opus-4-7", effort: "medium", band: "no default band — reachable via rubric_bands_override, orc diy fixed_executor, or extra_fallback_agent" },
50
+ ];
51
+
52
+ // Line endings are NOT content here: .gitattributes stores these files with LF
53
+ // and checks them out native, so a Windows worktree is CRLF and a Linux one LF.
54
+ // The injected frontmatter line therefore borrows the TEMPLATE's own ending, and
55
+ // --check compares LF-normalized text — otherwise the guard fails on Windows for
56
+ // a difference git itself does not record.
57
+ const eolOf = (s) => (/\r\n/.test(s) ? "\r\n" : "\n");
58
+ const lf = (s) => s.replace(/\r\n/g, "\n");
59
+
60
+ function render(template, v) {
61
+ const effortDesc = v.effort ? `, ${v.effort} effort` : " (no effort ladder)";
62
+ const effortFm = v.effort ? `effort: ${v.effort}${eolOf(template)}` : "";
63
+ return template
64
+ .replace(/\{\{NAME\}\}/g, v.name)
65
+ .replace(/\{\{MODEL\}\}/g, v.model)
66
+ .replace(/\{\{EFFORT_DESC\}\}/g, effortDesc)
67
+ .replace(/\{\{EFFORT_FM\}\}/g, effortFm)
68
+ .replace(/\{\{BAND\}\}/g, v.band);
69
+ }
70
+
71
+ function main() {
72
+ const checkMode = process.argv.includes("--check");
73
+ const template = fs.readFileSync(TEMPLATE, "utf8");
74
+ if (/\{\{(?!NAME|MODEL|EFFORT_DESC|EFFORT_FM|BAND)\w/.test(template)) {
75
+ console.error("❌ build-agents: unknown {{placeholder}} in executor.template.md");
76
+ process.exit(1);
77
+ }
78
+
79
+ let drifted = 0;
80
+ for (const v of VARIANTS) {
81
+ const out = render(template, v);
82
+ const dest = path.join(OUT_DIR, v.name + ".md");
83
+ if (checkMode) {
84
+ const current = fs.existsSync(dest) ? fs.readFileSync(dest, "utf8") : null;
85
+ if (current === null || lf(current) !== lf(out)) {
86
+ drifted++;
87
+ console.error(
88
+ `❌ generated agent drifted: templates/agents/${v.name}.md\n` +
89
+ ` Executor agents are GENERATED — edit agents-src/executor.template.md\n` +
90
+ ` (or bin/build-agents.js VARIANTS) and run: npm run build:agents`
91
+ );
92
+ }
93
+ } else {
94
+ fs.writeFileSync(dest, out);
95
+ console.log(` gen templates/agents/${v.name}.md`);
96
+ }
97
+ }
98
+
99
+ if (checkMode) {
100
+ if (drifted) process.exit(1);
101
+ console.log(`✅ ORC executor agents OK — ${VARIANTS.length} files match the template.`);
102
+ }
103
+ }
104
+
105
+ // Required by test/payload.test.js, which checks the line-ending rule above
106
+ // without writing to templates/agents/.
107
+ module.exports = { VARIANTS, render, lf, eolOf };
108
+
109
+ if (require.main === module) main();