session-orchestrator 5.6.0 → 5.8.0

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 (207) hide show
  1. package/.agents/skills/architecture/SKILL.md +3 -0
  2. package/.agents/skills/architecture/agents/openai.yaml +5 -0
  3. package/.agents/skills/claude-md-drift-check/SKILL.md +1 -0
  4. package/.agents/skills/eval/SKILL.md +1 -1
  5. package/.agents/skills/frontmatter-guard/SKILL.md +1 -0
  6. package/.agents/skills/gitlab-portfolio/SKILL.md +1 -0
  7. package/.agents/skills/hook-development/SKILL.md +1 -0
  8. package/.agents/skills/mcp-builder/SKILL.md +1 -0
  9. package/.agents/skills/tmux-layout/SKILL.md +3 -0
  10. package/.agents/skills/tmux-layout/agents/openai.yaml +5 -0
  11. package/.agents/skills/vault-mirror/SKILL.md +1 -0
  12. package/.agents/skills/vault-sync/SKILL.md +1 -0
  13. package/.agents/skills/write-executable-plan/SKILL.md +3 -0
  14. package/.agents/skills/write-executable-plan/agents/openai.yaml +5 -0
  15. package/.claude-plugin/marketplace.json +1 -1
  16. package/.claude-plugin/plugin.json +1 -1
  17. package/.codex-plugin/plugin.json +1 -1
  18. package/.codex-plugin/skills/architecture/SKILL.md +3 -0
  19. package/.codex-plugin/skills/architecture/agents/openai.yaml +5 -0
  20. package/.codex-plugin/skills/claude-md-drift-check/SKILL.md +1 -0
  21. package/.codex-plugin/skills/eval/SKILL.md +1 -1
  22. package/.codex-plugin/skills/frontmatter-guard/SKILL.md +1 -0
  23. package/.codex-plugin/skills/gitlab-portfolio/SKILL.md +1 -0
  24. package/.codex-plugin/skills/hook-development/SKILL.md +1 -0
  25. package/.codex-plugin/skills/mcp-builder/SKILL.md +1 -0
  26. package/.codex-plugin/skills/tmux-layout/SKILL.md +3 -0
  27. package/.codex-plugin/skills/tmux-layout/agents/openai.yaml +5 -0
  28. package/.codex-plugin/skills/vault-mirror/SKILL.md +1 -0
  29. package/.codex-plugin/skills/vault-sync/SKILL.md +1 -0
  30. package/.codex-plugin/skills/write-executable-plan/SKILL.md +3 -0
  31. package/.codex-plugin/skills/write-executable-plan/agents/openai.yaml +5 -0
  32. package/.cursor/commands/architecture.md +13 -0
  33. package/.cursor/commands/eval.md +1 -1
  34. package/.cursor/commands/tmux-layout.md +13 -0
  35. package/.cursor/commands/write-executable-plan.md +13 -0
  36. package/.cursor/skills/architecture/SKILL.md +0 -1
  37. package/.cursor/skills/eval/SKILL.md +1 -1
  38. package/.cursor/skills/tmux-layout/SKILL.md +0 -1
  39. package/.cursor/skills/write-executable-plan/SKILL.md +0 -1
  40. package/.cursor-plugin/plugin.json +1 -1
  41. package/CHANGELOG.md +75 -0
  42. package/README.md +10 -10
  43. package/agents/eval-judge.md +5 -5
  44. package/docs/USER-GUIDE.md +1 -1
  45. package/docs/baseline.md +4 -3
  46. package/docs/codex-setup.md +6 -4
  47. package/docs/components.md +5 -4
  48. package/docs/events-schema.md +4 -3
  49. package/docs/github-mirror-protection.md +3 -2
  50. package/docs/install.md +39 -3
  51. package/docs/pi-setup.md +1 -1
  52. package/docs/rule-authoring.md +12 -2
  53. package/docs/session-config-reference.md +8 -6
  54. package/docs/session-config-template.md +4 -3
  55. package/evals/README.md +60 -0
  56. package/evals/instruction-ablation/README.md +147 -0
  57. package/evals/instruction-ablation/cases/psa-003-foreign-work.json +34 -0
  58. package/evals/instruction-ablation/cases/sec-007-sql-parameterisation.json +32 -0
  59. package/evals/instruction-ablation/cases/vbc-001-verify-before-claiming.json +41 -0
  60. package/evals/instruction-ablation/run.mjs +336 -0
  61. package/evals/psa-003-foreign-work/case.yaml +16 -0
  62. package/evals/psa-003-foreign-work/fixture.sh +12 -0
  63. package/evals/psa-003-foreign-work/graders/foreign-file-intact.md +7 -0
  64. package/evals/psa-003-foreign-work/graders/names-foreign-work.md +6 -0
  65. package/evals/psa-003-foreign-work/graders/no-destructive-git.md +8 -0
  66. package/evals/psa-003-foreign-work/graders/ran-git.md +7 -0
  67. package/evals/psa-003-foreign-work/prompt.md +6 -0
  68. package/hooks/_lib/hook-import-set.json +10 -2
  69. package/hooks/hooks-codex.json +1 -1
  70. package/hooks/hooks.json +1 -1
  71. package/hooks/post-tool-batch-wave-signal.mjs +1 -0
  72. package/hooks/post-tooluse-frontend-slop.mjs +11 -1
  73. package/hooks/pre-task-scope-disjoint.mjs +8 -6
  74. package/hooks/wave-scope-commit-guard.mjs +41 -10
  75. package/monitors/monitors.json +1 -1
  76. package/package.json +3 -1
  77. package/pi/prompts/architecture.md +11 -0
  78. package/pi/prompts/eval.md +1 -1
  79. package/pi/prompts/tmux-layout.md +11 -0
  80. package/pi/prompts/write-executable-plan.md +11 -0
  81. package/scripts/backfill-abandoned-sessions.mjs +6 -8
  82. package/scripts/backfill-learnings-from-vault.mjs +17 -6
  83. package/scripts/backfill-sessions.mjs +9 -7
  84. package/scripts/codex-install.mjs +108 -23
  85. package/scripts/emit-session.mjs +15 -2
  86. package/scripts/fleet-auflagen.mjs +54 -0
  87. package/scripts/generate-agents-skills.mjs +9 -16
  88. package/scripts/generate-codex-skills.mjs +8 -6
  89. package/scripts/generate-cursor-adapter.mjs +9 -74
  90. package/scripts/generate-pi-prompts.mjs +8 -74
  91. package/scripts/github-protection-audit.mjs +8 -0
  92. package/scripts/lib/auto-dialectic.mjs +10 -9
  93. package/scripts/lib/auto-dream.mjs +8 -10
  94. package/scripts/lib/autopilot/telemetry.mjs +12 -6
  95. package/scripts/lib/bootstrap-lock-refresh.mjs +8 -12
  96. package/scripts/lib/config/drift-check.mjs +1 -1
  97. package/scripts/lib/config/frontend-slop-hook.mjs +6 -0
  98. package/scripts/lib/config.mjs +5 -1
  99. package/scripts/lib/convergence-monitor.mjs +5 -3
  100. package/scripts/lib/dispatcher/rank.mjs +5 -1
  101. package/scripts/lib/ecosystem-health.mjs +5 -3
  102. package/scripts/lib/eval/engine.mjs +61 -27
  103. package/scripts/lib/eval/judge.mjs +14 -8
  104. package/scripts/lib/eval/session-resolve.mjs +7 -2
  105. package/scripts/lib/events-retention-banner.mjs +5 -2
  106. package/scripts/lib/events.mjs +81 -54
  107. package/scripts/lib/fleet-protocol.mjs +98 -1
  108. package/scripts/lib/instruction-budget-guard.mjs +25 -18
  109. package/scripts/lib/io.mjs +181 -39
  110. package/scripts/lib/learnings/candidates.mjs +14 -44
  111. package/scripts/lib/learnings/io.mjs +7 -2
  112. package/scripts/lib/learnings/judgment.mjs +5 -8
  113. package/scripts/lib/learnings/select.mjs +3 -3
  114. package/scripts/lib/maintenance-due-banner.mjs +2 -2
  115. package/scripts/lib/memory-proposals/sink.mjs +5 -6
  116. package/scripts/lib/memory-proposals/store.mjs +12 -7
  117. package/scripts/lib/mirror-issues-banner.mjs +11 -1
  118. package/scripts/lib/native-command.mjs +48 -0
  119. package/scripts/lib/orphan-reaper/scan.mjs +29 -3
  120. package/scripts/lib/peer-cards/writer.mjs +6 -18
  121. package/scripts/lib/platform.mjs +113 -4
  122. package/scripts/lib/plugin-package-stage.mjs +169 -0
  123. package/scripts/lib/plugin-surface.mjs +121 -0
  124. package/scripts/lib/quality-gate.mjs +30 -25
  125. package/scripts/lib/reconcile/idempotency.mjs +9 -10
  126. package/scripts/lib/reconcile/rule-expiry-sweep.mjs +97 -8
  127. package/scripts/lib/reconcile/writer.mjs +11 -17
  128. package/scripts/lib/rule-loader.mjs +32 -6
  129. package/scripts/lib/scope-echo.mjs +12 -2
  130. package/scripts/lib/scope-gate.mjs +2 -1
  131. package/scripts/lib/session-close-backfill.mjs +21 -4
  132. package/scripts/lib/session-id.mjs +2 -1
  133. package/scripts/lib/session-record-repair.mjs +9 -13
  134. package/scripts/lib/session-schema/constants.mjs +20 -5
  135. package/scripts/lib/session-start-probes.mjs +2 -2
  136. package/scripts/lib/sessions-staleness-banner.mjs +2 -3
  137. package/scripts/lib/skill-evolution/engine.mjs +6 -9
  138. package/scripts/lib/skill-evolution/idempotency.mjs +8 -10
  139. package/scripts/lib/slopcheck.mjs +9 -7
  140. package/scripts/lib/sunset/walker.mjs +3 -3
  141. package/scripts/lib/telemetry/sync.mjs +3 -1
  142. package/scripts/lib/telemetry-flush-health-banner.mjs +2 -2
  143. package/scripts/lib/test-sibling-coverage.mjs +167 -0
  144. package/scripts/lib/tmux-layout/telemetry-stats.mjs +5 -7
  145. package/scripts/lib/tmux-layout/telemetry.mjs +8 -10
  146. package/scripts/lib/user-invocable-skills.mjs +37 -10
  147. package/scripts/lib/ux-grill/run-record.mjs +5 -3
  148. package/scripts/lib/validate/check-banner-parity.mjs +1 -0
  149. package/scripts/lib/validate/check-skills.mjs +12 -2
  150. package/scripts/lib/validate/check-test-fixture-shapes.mjs +3 -3
  151. package/scripts/lib/validate/check-test-value-bans.mjs +12 -2
  152. package/scripts/lib/validate/check-unicode-safety.mjs +1 -1
  153. package/scripts/lib/validate/check-unwired-features.mjs +1 -1
  154. package/scripts/lib/vault-archive.mjs +2 -4
  155. package/scripts/lib/vault-mirror/process.mjs +585 -72
  156. package/scripts/lib/vault-mirror/prune.mjs +413 -0
  157. package/scripts/lib/vault-mirror/render-sessions.mjs +13 -5
  158. package/scripts/lib/vault-mirror/retention.mjs +388 -0
  159. package/scripts/lib/vault-mirror/utils.mjs +16 -1
  160. package/scripts/lib/vault-status/board-writer.mjs +6 -6
  161. package/scripts/lib/vault-sync-baseline.mjs +9 -8
  162. package/scripts/lib/wave-transcript-tail.mjs +19 -6
  163. package/scripts/lib/worktree/meta.mjs +7 -3
  164. package/scripts/mcp-server.mjs +158 -0
  165. package/scripts/migrate-sessions-jsonl.mjs +7 -5
  166. package/scripts/migrate-vault-paths.mjs +7 -4
  167. package/scripts/print-applicable-rules.mjs +1 -25
  168. package/scripts/print-learnings-index.mjs +2 -1
  169. package/scripts/release.mjs +4 -0
  170. package/scripts/relocate-vault-corpus.mjs +5 -3
  171. package/scripts/run-migrate-v2-cross-repo.mjs +9 -7
  172. package/scripts/self-update.mjs +179 -39
  173. package/scripts/site-numbers.mjs +4 -3
  174. package/scripts/sweep-expired-learnings.mjs +6 -4
  175. package/scripts/sync-vault-schema.mjs +3 -7
  176. package/scripts/vault-mirror-prune.mjs +145 -0
  177. package/scripts/vault-mirror.mjs +77 -12
  178. package/scripts/windows-setup.mjs +45 -0
  179. package/skills/_shared/fleet-protocol.md +8 -0
  180. package/skills/architecture/SKILL.md +1 -0
  181. package/skills/bootstrap/_shared-template.md +5 -2
  182. package/skills/claude-md-drift-check/SKILL.md +4 -1
  183. package/skills/claude-md-drift-check/checker.mjs +89 -26
  184. package/skills/discovery/probes/ssot-code-diff.mjs +3 -3
  185. package/skills/eval/SKILL.md +12 -13
  186. package/skills/eval/rubric-v3.md +521 -0
  187. package/skills/frontmatter-guard/SKILL.md +1 -0
  188. package/skills/gitlab-portfolio/SKILL.md +1 -0
  189. package/skills/hook-development/SKILL.md +1 -0
  190. package/skills/mcp-builder/SKILL.md +1 -0
  191. package/skills/repo-audit/SKILL.md +2 -2
  192. package/skills/session-end/SKILL.md +32 -1
  193. package/skills/session-end/vault-operations.md +12 -2
  194. package/skills/session-start/SKILL.md +2 -2
  195. package/skills/session-start/phase-7-1-premise-check.md +2 -1
  196. package/skills/session-start/references/operations-contract.md +4 -1
  197. package/skills/tmux-layout/SKILL.md +1 -0
  198. package/skills/vault-mirror/SKILL.md +28 -2
  199. package/skills/vault-sync/SKILL.md +6 -6
  200. package/skills/vault-sync/validator.sh +29 -10
  201. package/skills/wave-executor/references/wave-loop-scope-manifest.md +5 -3
  202. package/skills/write-executable-plan/SKILL.md +1 -0
  203. package/hooks/agent-teams-h3-test.sh +0 -362
  204. package/scripts/spikes/h3-agent-teams/preflight.sh +0 -53
  205. package/scripts/spikes/h3-agent-teams/run-h3.sh +0 -112
  206. package/scripts/spikes/h3-agent-teams/setup.sh +0 -137
  207. package/scripts/spikes/h3-agent-teams/toggle.sh +0 -38
@@ -32,6 +32,7 @@
32
32
  import fs from 'node:fs';
33
33
  import path from 'node:path';
34
34
 
35
+ import { atomicWriteWithBackup, envelopeToError } from '../io.mjs';
35
36
  import { findingsPath, runRecordPath } from './paths.mjs';
36
37
  import { makeRunRecord } from './schema.mjs';
37
38
 
@@ -290,9 +291,10 @@ export function updateRunRecordCompare(repoRoot, runId, compare) {
290
291
  out.push(raw);
291
292
  }
292
293
 
293
- const tmp = `${ledger}.${process.pid}.tmp`;
294
- fs.writeFileSync(tmp, out.length > 0 ? `${out.join('\n')}\n` : '', 'utf8');
295
- fs.renameSync(tmp, ledger);
294
+ const res = atomicWriteWithBackup(ledger, out.length > 0 ? `${out.join('\n')}\n` : '', {
295
+ tmpPrefix: `.${path.basename(ledger)}.tmp`,
296
+ });
297
+ if (!res.ok) throw envelopeToError(res);
296
298
  return { updated, skippedLines };
297
299
  }
298
300
 
@@ -187,6 +187,7 @@ export function collectMarkdownFiles(pluginRoot) {
187
187
  const output = execFileSync('git', ['ls-files', '-z', '--', ...SCAN_DIRS], {
188
188
  cwd: pluginRoot,
189
189
  encoding: 'utf8',
190
+ maxBuffer: 64 * 1024 * 1024,
190
191
  stdio: ['ignore', 'pipe', 'ignore'],
191
192
  env,
192
193
  });
@@ -93,7 +93,7 @@ function collectSkillFiles(skillsDir) {
93
93
  *
94
94
  * Rules: R1 frontmatter block present · R8 block parses as a YAML mapping ·
95
95
  * R2 `name` present · R3 `name` is kebab-case · R5 `name` === directory name ·
96
- * R6 `description` present and non-empty.
96
+ * R6 `description` present and non-empty · R9 `user-invocable` stated explicitly.
97
97
  *
98
98
  * @param {{ dirName: string, relPath: string, absPath: string }} skill
99
99
  * @returns {boolean} true when every rule holds
@@ -148,6 +148,16 @@ function validateSkillFrontmatter(skill) {
148
148
  fail(`${skill.relPath}: missing or empty required frontmatter field: description`);
149
149
  }
150
150
 
151
+ // R9 — `user-invocable` written down. Claude Code lists a skill WITHOUT the
152
+ // key in the `/` picker (#1515: 37 entries against a documented 27, from 10
153
+ // keyless skills). The census and the adapter generators now follow that
154
+ // reading (`isUserInvocableSkill`), but a forgotten key is still an
155
+ // unreviewed picker entry — so the decision must be explicit: `true` for an
156
+ // operator command, `false` for a helper the model dispatches.
157
+ if (!Object.hasOwn(frontmatter, 'user-invocable')) {
158
+ fail(`${skill.relPath}: missing required frontmatter field: user-invocable (Claude Code treats an absent key as true and lists the skill in the / picker — write \`user-invocable: true\` for an operator command or \`user-invocable: false\` for a helper)`);
159
+ }
160
+
151
161
  return failed === before;
152
162
  }
153
163
 
@@ -180,7 +190,7 @@ if (!existsSync(skillsDir)) {
180
190
  }
181
191
 
182
192
  if (valid === skills.length) {
183
- pass(`all ${skills.length} ${SKILL_FILE} frontmatter blocks parse as YAML and carry a kebab-case name matching their directory plus a non-empty description`);
193
+ pass(`all ${skills.length} ${SKILL_FILE} frontmatter blocks parse as YAML and carry a kebab-case name matching their directory, a non-empty description and an explicit user-invocable`);
184
194
  }
185
195
  }
186
196
  }
@@ -154,10 +154,10 @@ const MAGIC_COMMENT_SCAN_LINES = 5;
154
154
  function getTrackedTestFiles() {
155
155
  let output;
156
156
  try {
157
- output = execFileSync('git', ['ls-files'], { cwd: pluginRoot, encoding: 'utf8' });
157
+ output = execFileSync('git', ['ls-files'], { cwd: pluginRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], maxBuffer: 64 * 1024 * 1024 });
158
158
  } catch {
159
- // Not a git repo or git unavailable — return empty (caller treats as pass)
160
- return [];
159
+ console.error('Error: unable to enumerate tracked test files with git ls-files');
160
+ process.exit(2);
161
161
  }
162
162
  return output
163
163
  .split('\n')
@@ -406,6 +406,15 @@ const SEAM_CLOCK_ARG = new RegExp(`${CLOCK_NAME}:`);
406
406
  * `{ now }` or a positional `now` loses its seam proof and its bombs go unseen.
407
407
  * REVISIT on the first B5 finding whose subject is a helper, or the first CI
408
408
  * `test-value-bans` B5 finding the ±days clock-shift probe shows to be false.
409
+ *
410
+ * CEILING (#1507 item 3) — three known blind spots of the SCREAMING_CASE forms,
411
+ * left deliberately: (a) a bare `NOW)` / `NOW,` counts as a handover, whatever
412
+ * the constant holds; (b) arithmetic on a collected clock (`NOW - DAY`) is NOT
413
+ * seen as a handover, the terminator follows the operand, not the name; (c) an
414
+ * IMPORTED clock constant is not checked for provenance — `NOW` from a helper
415
+ * module that holds `Date.now()` reads as controlled. Measured impact
416
+ * 2026-10-03: 0 changed findings over 722 test files.
417
+ * REVISIT on the first B5 miss or false finding traced to (a), (b) or (c).
409
418
  */
410
419
  const CONTROL_CLOCK_ARG = new RegExp(String.raw`${CLOCK_NAME}(:|,|\}|\))`, 'g');
411
420
 
@@ -452,9 +461,10 @@ const LOCAL_IMPORT = new RegExp(
452
461
  function trackedTestFiles() {
453
462
  let out;
454
463
  try {
455
- out = execFileSync('git', ['ls-files'], { cwd: repoRoot, encoding: 'utf8' });
464
+ out = execFileSync('git', ['ls-files'], { cwd: repoRoot, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], maxBuffer: 64 * 1024 * 1024 });
456
465
  } catch {
457
- return []; // not a git repo — nothing to scan
466
+ console.error('Error: unable to enumerate tracked test files with git ls-files');
467
+ process.exit(2);
458
468
  }
459
469
  return out
460
470
  .split('\n')
@@ -114,7 +114,7 @@ function walkDir(root, dir, acc = []) {
114
114
  export function getTrackedFiles(root) {
115
115
  let files;
116
116
  try {
117
- const output = execFileSync('git', ['ls-files'], { cwd: root, encoding: 'utf8' });
117
+ const output = execFileSync('git', ['ls-files'], { cwd: root, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
118
118
  files = output.split('\n').filter(Boolean).map((f) => join(root, f));
119
119
  } catch {
120
120
  files = walkDir(root, root);
@@ -451,7 +451,7 @@ const ALLOWLIST = Object.freeze({
451
451
  'auto-skill-dispatch':
452
452
  'prose-only consumer — skills/using-orchestrator/SKILL.md + skills/_shared/bootstrap-gate.md read this key as an LLM instruction; there is no .mjs gate by design',
453
453
  'auto-commit-per-wave':
454
- 'prose-only consumer — skills/wave-executor/wave-loop.md gates the per-wave commit step on this key; the commit itself is a coordinator action, not a script',
454
+ 'planned no-op (#1219) — only skills/wave-executor/references/wave-loop-review.md names this key, as contract prose; no per-wave commit step runs on it yet (scripts/lib/auto-commit.mjs does not exist)',
455
455
  'instruction-budget':
456
456
  'dedicated reader outside the parser layer — scripts/lib/instruction-budget-guard.mjs parses this block itself (S2 exemption only; S1 evidence is real)',
457
457
  });
@@ -16,10 +16,8 @@
16
16
  *
17
17
  * ── Frontmatter schema (mirror, not import) ─────────────────────────────────
18
18
  * The canonical vault frontmatter schema is the GENERATED Zod block in
19
- * skills/vault-sync/validator.mjs (Z.104-134). That schema is NOT exported, and
20
- * `zod` is not a dependency of scripts/ (it lives only as a skill-local shim in
21
- * skills/vault-sync/node_modules/). So the field constraints below are a
22
- * hand-rolled MIRROR of that schema. If the canonical schema changes, update the
19
+ * skills/vault-sync/validator.mjs (Z.104-134). That schema is NOT exported, so
20
+ * the field constraints below are a hand-rolled MIRROR of that schema. If the canonical schema changes, update the
23
21
  * constants here to match. The mirror is proven equivalent by an integration
24
22
  * test that runs the REAL validator subprocess over generated output
25
23
  * (tests/lib/vault-archive.test.mjs § "REAL validator").