oh-my-codex 0.8.6 → 0.8.7

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 (146) hide show
  1. package/README.md +16 -1
  2. package/dist/agents/definitions.js +7 -7
  3. package/dist/agents/definitions.js.map +1 -1
  4. package/dist/agents/native-config.d.ts.map +1 -1
  5. package/dist/agents/native-config.js +18 -6
  6. package/dist/agents/native-config.js.map +1 -1
  7. package/dist/cli/__tests__/index.test.js +9 -6
  8. package/dist/cli/__tests__/index.test.js.map +1 -1
  9. package/dist/cli/__tests__/package-bin-contract.test.d.ts +2 -0
  10. package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +1 -0
  11. package/dist/cli/__tests__/package-bin-contract.test.js +29 -0
  12. package/dist/cli/__tests__/package-bin-contract.test.js.map +1 -0
  13. package/dist/cli/index.d.ts.map +1 -1
  14. package/dist/cli/index.js +9 -8
  15. package/dist/cli/index.js.map +1 -1
  16. package/dist/config/__tests__/generator-notify.test.js +3 -4
  17. package/dist/config/__tests__/generator-notify.test.js.map +1 -1
  18. package/dist/config/generator.js +1 -1
  19. package/dist/config/generator.js.map +1 -1
  20. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +5 -38
  21. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +1 -1
  22. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +6 -51
  23. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +1 -1
  24. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +2 -0
  25. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +1 -0
  26. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +45 -0
  27. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +1 -0
  28. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +7 -26
  29. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +1 -1
  30. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +4 -0
  31. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +1 -0
  32. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +16 -0
  33. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +1 -0
  34. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +19 -47
  35. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +1 -1
  36. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +2 -0
  37. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +1 -0
  38. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +37 -0
  39. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +1 -0
  40. package/dist/hooks/__tests__/skill-guidance-contract.test.js +5 -25
  41. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +1 -1
  42. package/dist/hooks/prompt-guidance-contract.d.ts +14 -0
  43. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -0
  44. package/dist/hooks/prompt-guidance-contract.js +160 -0
  45. package/dist/hooks/prompt-guidance-contract.js.map +1 -0
  46. package/dist/mcp/__tests__/bootstrap.test.js +51 -13
  47. package/dist/mcp/__tests__/bootstrap.test.js.map +1 -1
  48. package/dist/mcp/__tests__/code-intel-server.test.js +4 -3
  49. package/dist/mcp/__tests__/code-intel-server.test.js.map +1 -1
  50. package/dist/mcp/__tests__/memory-server.test.js +4 -2
  51. package/dist/mcp/__tests__/memory-server.test.js.map +1 -1
  52. package/dist/mcp/__tests__/server-lifecycle.test.d.ts +2 -0
  53. package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +1 -0
  54. package/dist/mcp/__tests__/server-lifecycle.test.js +159 -0
  55. package/dist/mcp/__tests__/server-lifecycle.test.js.map +1 -0
  56. package/dist/mcp/bootstrap.d.ts +7 -0
  57. package/dist/mcp/bootstrap.d.ts.map +1 -1
  58. package/dist/mcp/bootstrap.js +51 -0
  59. package/dist/mcp/bootstrap.js.map +1 -1
  60. package/dist/mcp/code-intel-server.js +4 -7
  61. package/dist/mcp/code-intel-server.js.map +1 -1
  62. package/dist/mcp/memory-server.js +2 -6
  63. package/dist/mcp/memory-server.js.map +1 -1
  64. package/dist/mcp/state-server.d.ts.map +1 -1
  65. package/dist/mcp/state-server.js +2 -6
  66. package/dist/mcp/state-server.js.map +1 -1
  67. package/dist/mcp/team-server.d.ts.map +1 -1
  68. package/dist/mcp/team-server.js +2 -6
  69. package/dist/mcp/team-server.js.map +1 -1
  70. package/dist/mcp/trace-server.d.ts.map +1 -1
  71. package/dist/mcp/trace-server.js +2 -6
  72. package/dist/mcp/trace-server.js.map +1 -1
  73. package/dist/team/__tests__/hardening-e2e.test.d.ts +2 -0
  74. package/dist/team/__tests__/hardening-e2e.test.d.ts.map +1 -0
  75. package/dist/team/__tests__/hardening-e2e.test.js +71 -0
  76. package/dist/team/__tests__/hardening-e2e.test.js.map +1 -0
  77. package/dist/team/__tests__/model-contract.test.js +9 -6
  78. package/dist/team/__tests__/model-contract.test.js.map +1 -1
  79. package/dist/team/__tests__/runtime.test.js +34 -6
  80. package/dist/team/__tests__/runtime.test.js.map +1 -1
  81. package/dist/team/__tests__/state.test.js +28 -1
  82. package/dist/team/__tests__/state.test.js.map +1 -1
  83. package/dist/team/__tests__/team-ops-contract.test.js +1 -0
  84. package/dist/team/__tests__/team-ops-contract.test.js.map +1 -1
  85. package/dist/team/__tests__/worktree.test.js +22 -0
  86. package/dist/team/__tests__/worktree.test.js.map +1 -1
  87. package/dist/team/runtime.d.ts.map +1 -1
  88. package/dist/team/runtime.js +27 -13
  89. package/dist/team/runtime.js.map +1 -1
  90. package/dist/team/state/tasks.d.ts +2 -1
  91. package/dist/team/state/tasks.d.ts.map +1 -1
  92. package/dist/team/state/tasks.js +46 -5
  93. package/dist/team/state/tasks.js.map +1 -1
  94. package/dist/team/state/types.d.ts +8 -0
  95. package/dist/team/state/types.d.ts.map +1 -1
  96. package/dist/team/state/types.js.map +1 -1
  97. package/dist/team/state.d.ts +9 -0
  98. package/dist/team/state.d.ts.map +1 -1
  99. package/dist/team/state.js +14 -1
  100. package/dist/team/state.js.map +1 -1
  101. package/dist/team/team-ops.d.ts +2 -1
  102. package/dist/team/team-ops.d.ts.map +1 -1
  103. package/dist/team/team-ops.js +1 -0
  104. package/dist/team/team-ops.js.map +1 -1
  105. package/dist/team/tmux-session.d.ts.map +1 -1
  106. package/dist/team/tmux-session.js +3 -2
  107. package/dist/team/tmux-session.js.map +1 -1
  108. package/dist/team/worktree.d.ts.map +1 -1
  109. package/dist/team/worktree.js +14 -0
  110. package/dist/team/worktree.js.map +1 -1
  111. package/package.json +2 -2
  112. package/prompts/analyst.md +56 -42
  113. package/prompts/api-reviewer.md +42 -38
  114. package/prompts/architect.md +53 -47
  115. package/prompts/build-fixer.md +45 -32
  116. package/prompts/code-reviewer.md +53 -46
  117. package/prompts/code-simplifier.md +128 -97
  118. package/prompts/critic.md +49 -34
  119. package/prompts/debugger.md +50 -38
  120. package/prompts/dependency-expert.md +50 -34
  121. package/prompts/designer.md +52 -41
  122. package/prompts/executor.md +96 -71
  123. package/prompts/explore.md +57 -47
  124. package/prompts/git-master.md +43 -32
  125. package/prompts/information-architect.md +101 -67
  126. package/prompts/performance-reviewer.md +41 -37
  127. package/prompts/planner.md +68 -53
  128. package/prompts/product-analyst.md +69 -76
  129. package/prompts/product-manager.md +85 -107
  130. package/prompts/qa-tester.md +43 -32
  131. package/prompts/quality-reviewer.md +51 -45
  132. package/prompts/quality-strategist.md +116 -81
  133. package/prompts/researcher.md +47 -36
  134. package/prompts/security-reviewer.md +54 -48
  135. package/prompts/sisyphus-lite.md +145 -0
  136. package/prompts/style-reviewer.md +40 -36
  137. package/prompts/test-engineer.md +53 -40
  138. package/prompts/ux-researcher.md +98 -65
  139. package/prompts/verifier.md +48 -33
  140. package/prompts/vision.md +44 -32
  141. package/prompts/writer.md +44 -32
  142. package/scripts/dev-refresh-prompts.sh +83 -0
  143. package/scripts/dev-watch-prompts.sh +139 -0
  144. package/scripts/sync-prompt-guidance-fragments.js +51 -0
  145. package/scripts/team-hardening-benchmark.mjs +90 -0
  146. package/templates/AGENTS.md +14 -2
@@ -1,30 +1,11 @@
1
1
  import { describe, it } from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import { readFileSync } from 'node:fs';
4
- import { dirname, join } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- const __dirname = dirname(fileURLToPath(import.meta.url));
7
- const executorPrompt = readFileSync(join(__dirname, '../../../prompts/executor.md'), 'utf-8');
8
- const plannerPrompt = readFileSync(join(__dirname, '../../../prompts/planner.md'), 'utf-8');
9
- const verifierPrompt = readFileSync(join(__dirname, '../../../prompts/verifier.md'), 'utf-8');
2
+ import { SCENARIO_ROLE_CONTRACTS } from '../prompt-guidance-contract.js';
3
+ import { assertContractSurface } from './prompt-guidance-test-helpers.js';
10
4
  describe('prompt guidance scenario examples', () => {
11
- it('executor prompt documents scoped updates for continue / PR / merge-if-green flows', () => {
12
- assert.match(executorPrompt, /user says `continue`/i);
13
- assert.match(executorPrompt, /make a PR targeting dev/i);
14
- assert.match(executorPrompt, /merge to dev if CI green/i);
15
- assert.match(executorPrompt, /Check the PR checks, confirm CI is green, then merge/i);
16
- });
17
- it('planner prompt documents scoped planning updates for continue / PR / merge-if-green flows', () => {
18
- assert.match(plannerPrompt, /user says `continue`/i);
19
- assert.match(plannerPrompt, /user says `make a PR`/i);
20
- assert.match(plannerPrompt, /user says `merge if CI green`/i);
21
- assert.match(plannerPrompt, /scoped condition on the next operational step/i);
22
- });
23
- it('verifier prompt documents evidence-first handling of merge-if-green and continue flows', () => {
24
- assert.match(verifierPrompt, /user says `merge if CI green`/i);
25
- assert.match(verifierPrompt, /confirm they are green/i);
26
- assert.match(verifierPrompt, /user says `continue`/i);
27
- assert.match(verifierPrompt, /keep gathering the required evidence/i);
28
- });
5
+ for (const contract of SCENARIO_ROLE_CONTRACTS) {
6
+ it(`${contract.id} documents the expected scenario examples`, () => {
7
+ assertContractSurface(contract);
8
+ });
9
+ }
29
10
  });
30
11
  //# sourceMappingURL=prompt-guidance-scenarios.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-guidance-scenarios.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-guidance-scenarios.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9F,MAAM,aAAa,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,6BAA6B,CAAC,EAAE,OAAO,CAAC,CAAC;AAC5F,MAAM,cAAc,GAAG,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,OAAO,CAAC,CAAC;AAE9F,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;IACjD,EAAE,CAAC,mFAAmF,EAAE,GAAG,EAAE;QAC3F,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC;QACtD,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,0BAA0B,CAAC,CAAC;QACzD,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,2BAA2B,CAAC,CAAC;QAC1D,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,uDAAuD,CAAC,CAAC;IACxF,CAAC,CAAC,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
1
+ import type { GuidanceSurfaceContract } from '../prompt-guidance-contract.js';
2
+ export declare function loadSurface(path: string): string;
3
+ export declare function assertContractSurface(contract: GuidanceSurfaceContract): void;
4
+ //# sourceMappingURL=prompt-guidance-test-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-guidance-test-helpers.d.ts","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-guidance-test-helpers.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAK9E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,uBAAuB,GAAG,IAAI,CAK7E"}
@@ -0,0 +1,16 @@
1
+ import assert from 'node:assert/strict';
2
+ import { readFileSync } from 'node:fs';
3
+ import { dirname, join } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ const __dirname = dirname(fileURLToPath(import.meta.url));
6
+ const repoRoot = join(__dirname, '../../../');
7
+ export function loadSurface(path) {
8
+ return readFileSync(join(repoRoot, path), 'utf-8');
9
+ }
10
+ export function assertContractSurface(contract) {
11
+ const content = loadSurface(contract.path);
12
+ for (const pattern of contract.requiredPatterns) {
13
+ assert.match(content, pattern, `${contract.id} missing required pattern: ${pattern}`);
14
+ }
15
+ }
16
+ //# sourceMappingURL=prompt-guidance-test-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-guidance-test-helpers.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-guidance-test-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC1D,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE9C,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,QAAiC;IACrE,MAAM,OAAO,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3C,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAChD,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,EAAE,8BAA8B,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;AACH,CAAC"}
@@ -1,56 +1,28 @@
1
1
  import { describe, it } from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
- import { readFileSync } from 'node:fs';
4
- import { dirname, join } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- const __dirname = dirname(fileURLToPath(import.meta.url));
7
- function loadPrompt(name) {
8
- return readFileSync(join(__dirname, `../../../prompts/${name}.md`), 'utf-8');
9
- }
3
+ import { WAVE_TWO_CONTRACTS } from '../prompt-guidance-contract.js';
4
+ import { assertContractSurface, loadSurface } from './prompt-guidance-test-helpers.js';
10
5
  describe('prompt guidance wave two contract', () => {
11
- const prompts = {
12
- architect: loadPrompt('architect'),
13
- critic: loadPrompt('critic'),
14
- debugger: loadPrompt('debugger'),
15
- testEngineer: loadPrompt('test-engineer'),
16
- codeReviewer: loadPrompt('code-reviewer'),
17
- qualityReviewer: loadPrompt('quality-reviewer'),
18
- securityReviewer: loadPrompt('security-reviewer'),
19
- researcher: loadPrompt('researcher'),
20
- explore: loadPrompt('explore'),
21
- };
22
- for (const [label, content] of Object.entries(prompts)) {
23
- it(`${label} defaults to concise output and localized task-update handling`, () => {
24
- assert.match(content, /Default final-output shape: concise and evidence-dense/i);
25
- assert.match(content, /Treat newer user task updates as local overrides/i);
6
+ for (const contract of WAVE_TWO_CONTRACTS) {
7
+ it(`${contract.id} satisfies the wave-two contract`, () => {
8
+ assertContractSurface(contract);
26
9
  });
27
10
  }
28
- it('wave two prompts encode persistent evidence gathering with role-appropriate wording', () => {
29
- assert.match(prompts.architect, /keep using those tools until the analysis is grounded/i);
30
- assert.match(prompts.critic, /keep doing so until the verdict is grounded/i);
31
- assert.match(prompts.debugger, /keep using those tools until the diagnosis is grounded/i);
32
- assert.match(prompts.testEngineer, /keep using those tools until the recommendation is grounded/i);
33
- assert.match(prompts.codeReviewer, /keep using those tools until the review is grounded/i);
34
- assert.match(prompts.qualityReviewer, /keep using those tools until the review is grounded/i);
35
- assert.match(prompts.securityReviewer, /keep using those tools until the security verdict is grounded/i);
36
- assert.match(prompts.researcher, /keep researching until the answer is grounded/i);
37
- assert.match(prompts.explore, /keep using those tools until the answer is grounded/i);
11
+ it('wave-two prompts encode role-appropriate grounded-evidence wording', () => {
12
+ assert.match(loadSurface('prompts/architect.md'), /analysis is grounded/i);
13
+ assert.match(loadSurface('prompts/critic.md'), /verdict is grounded/i);
14
+ assert.match(loadSurface('prompts/debugger.md'), /diagnosis is grounded/i);
15
+ assert.match(loadSurface('prompts/test-engineer.md'), /recommendation is grounded/i);
16
+ assert.match(loadSurface('prompts/code-reviewer.md'), /review is grounded/i);
17
+ assert.match(loadSurface('prompts/quality-reviewer.md'), /review is grounded/i);
18
+ assert.match(loadSurface('prompts/security-reviewer.md'), /security verdict is grounded/i);
19
+ assert.match(loadSurface('prompts/researcher.md'), /answer is grounded/i);
20
+ assert.match(loadSurface('prompts/explore.md'), /answer is grounded/i);
38
21
  });
39
- it('wave two prompts contain scenario examples for continue and scoped update handling', () => {
40
- assert.match(prompts.architect, /user says `continue`/i);
41
- assert.match(prompts.critic, /user says `continue`/i);
42
- assert.match(prompts.debugger, /user says `continue`/i);
43
- assert.match(prompts.testEngineer, /user says `continue`/i);
44
- assert.match(prompts.codeReviewer, /user says `continue`/i);
45
- assert.match(prompts.qualityReviewer, /user says `continue`/i);
46
- assert.match(prompts.securityReviewer, /user says `continue`/i);
47
- assert.match(prompts.researcher, /user says `continue`/i);
48
- assert.match(prompts.explore, /user says `continue`/i);
49
- });
50
- it('security and verifier-adjacent prompts preserve merge-if-green as downstream context, not replacement evidence', () => {
51
- assert.match(prompts.securityReviewer, /merge if CI green/i);
52
- assert.match(prompts.critic, /later workflow condition|downstream context/i);
53
- assert.match(prompts.testEngineer, /merge if CI green/i);
22
+ it('security and verifier-adjacent prompts preserve merge-if-green as downstream context', () => {
23
+ assert.match(loadSurface('prompts/security-reviewer.md'), /merge if CI green/i);
24
+ assert.match(loadSurface('prompts/critic.md'), /later workflow condition|downstream context/i);
25
+ assert.match(loadSurface('prompts/test-engineer.md'), /merge if CI green/i);
54
26
  });
55
27
  });
56
28
  //# sourceMappingURL=prompt-guidance-wave-two.test.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt-guidance-wave-two.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-guidance-wave-two.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,IAA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QAC7E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,6BAA6B,CAAC,EAAE,qBAAqB,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,8BAA8B,CAAC,EAAE,+BAA+B,CAAC,CAAC;QAC3F,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,uBAAuB,CAAC,EAAE,qBAAqB,CAAC,CAAC;QAC1E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,oBAAoB,CAAC,EAAE,qBAAqB,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sFAAsF,EAAE,GAAG,EAAE;QAC9F,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,8BAA8B,CAAC,EAAE,oBAAoB,CAAC,CAAC;QAChF,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,EAAE,8CAA8C,CAAC,CAAC;QAC/F,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,0BAA0B,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAC9E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=prompt-orchestration-boundary.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-orchestration-boundary.test.d.ts","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-orchestration-boundary.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ import assert from 'node:assert/strict';
2
+ import { readdirSync, readFileSync } from 'node:fs';
3
+ import { join } from 'node:path';
4
+ import { describe, it } from 'node:test';
5
+ import { loadSurface } from './prompt-guidance-test-helpers.js';
6
+ const PROMPTS_DIR = join(process.cwd(), 'prompts');
7
+ const promptFiles = readdirSync(PROMPTS_DIR).filter((name) => name.endsWith('.md'));
8
+ const FORBIDDEN_PROMPT_PATTERNS = [
9
+ ['direct handoff heading', /Hand off to:|##\s+Hand Off To\b/i],
10
+ ['child request-agent phrasing', /Request\s+\*\*[^*]+\*\*\s+agent/i],
11
+ ['child spawn-agent phrasing', /Spawn\s+the\s+`explore`\s+agent|spawn\s+explore\s+agent/i],
12
+ ['direct delegate-to-agent phrasing', /delegate to specialized agents|delegate to\s+[a-z-]+\s+agent/i],
13
+ ['soft explore-agent routing', /use explore agent|via explore agent/i],
14
+ ['soft next-agent chain phrasing', /next agent in the chain|next agent \(researcher|next agent \(analyst|next agent \(.*planner/i],
15
+ ['soft delegated-checklist phrasing', /delegated to test-engineer/i],
16
+ ['legacy explore-high escalation', /explore-high/i],
17
+ ['external AI routing', /Use an external AI assistant|Use an external long-context AI assistant/i],
18
+ ];
19
+ describe('prompt orchestration boundary', () => {
20
+ for (const file of promptFiles) {
21
+ it(`${file} avoids recursive orchestration language`, () => {
22
+ const content = readFileSync(join(PROMPTS_DIR, file), 'utf-8');
23
+ for (const [label, pattern] of FORBIDDEN_PROMPT_PATTERNS) {
24
+ assert.doesNotMatch(content, pattern, `${file} should not include ${label}`);
25
+ }
26
+ });
27
+ }
28
+ it('root AGENTS contract states that child prompts report handoffs upward', () => {
29
+ assert.match(loadSurface('AGENTS.md'), /report recommended handoffs upward/i);
30
+ assert.match(loadSurface('templates/AGENTS.md'), /report recommended handoffs upward/i);
31
+ });
32
+ it('guidance schema documents upward-only handoff limits for role prompts', () => {
33
+ assert.match(loadSurface('docs/guidance-schema.md'), /report upward, do not recursively orchestrate/i);
34
+ assert.match(loadSurface('docs/guidance-schema.md'), /recommend handoffs upward to the orchestrator/i);
35
+ });
36
+ });
37
+ //# sourceMappingURL=prompt-orchestration-boundary.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-orchestration-boundary.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/prompt-orchestration-boundary.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,C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C/E,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IAED,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,qCAAqC,CAAC,CAAC;QAC9E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,qBAAqB,CAAC,EAAE,qCAAqC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC/E,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,yBAAyB,CAAC,EAAE,gDAAgD,CAAC,CAAC;QACvG,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,yBAAyB,CAAC,EAAE,gDAAgD,CAAC,CAAC;IACzG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,30 +1,10 @@
1
1
  import { describe, it } from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import { readFileSync } from 'node:fs';
4
- import { dirname, join } from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- const __dirname = dirname(fileURLToPath(import.meta.url));
7
- function loadSkill(name) {
8
- return readFileSync(join(__dirname, `../../../skills/${name}/SKILL.md`), 'utf-8');
9
- }
2
+ import { SKILL_CONTRACTS } from '../prompt-guidance-contract.js';
3
+ import { assertContractSurface } from './prompt-guidance-test-helpers.js';
10
4
  describe('execution-heavy skill guidance contract', () => {
11
- const skills = {
12
- analyze: loadSkill('analyze'),
13
- autopilot: loadSkill('autopilot'),
14
- buildFix: loadSkill('build-fix'),
15
- codeReview: loadSkill('code-review'),
16
- securityReview: loadSkill('security-review'),
17
- plan: loadSkill('plan'),
18
- ralph: loadSkill('ralph'),
19
- ralplan: loadSkill('ralplan'),
20
- team: loadSkill('team'),
21
- ultraqa: loadSkill('ultraqa'),
22
- };
23
- for (const [label, content] of Object.entries(skills)) {
24
- it(`${label} includes guidance for concise reporting, local overrides, and continue scenarios`, () => {
25
- assert.match(content, /concise, evidence-dense progress and completion reporting|concise, evidence-dense progress and completion reporting/i);
26
- assert.match(content, /local overrides for the active workflow branch|local overrides for the active workflow branch while preserving/i);
27
- assert.match(content, /user says `continue`/i);
5
+ for (const contract of SKILL_CONTRACTS) {
6
+ it(`${contract.id} satisfies the execution-heavy skill guidance contract`, () => {
7
+ assertContractSurface(contract);
28
8
  });
29
9
  }
30
10
  });
@@ -1 +1 @@
1
- {"version":3,"file":"skill-guidance-contract.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/skill-guidance-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAE1D,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,mBAAmB,IAAI,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;AACpF,CAAC;AAED,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,MAAM,MAAM,GAAG;QACb,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;QAC7B,SAAS,EAAE,SAAS,CAAC,WAAW,CAAC;QACjC,QAAQ,EAAE,SAAS,CAAC,WAAW,CAAC;QAChC,UAAU,EAAE,SAAS,CAAC,aAAa,CAAC;QACpC,cAAc,EAAE,SAAS,CAAC,iBAAiB,CAAC;QAC5C,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;QACvB,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC;QACzB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;QAC7B,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC;QACvB,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC;KAC9B,CAAC;IAEF,KAAK,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACtD,EAAE,CAAC,GAAG,KAAK,mFAAmF,EAAE,GAAG,EAAE;YACnG,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,sHAAsH,CAAC,CAAC;YAC9I,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,iHAAiH,CAAC,CAAC;YACzI,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;QACjD,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"skill-guidance-contract.test.js","sourceRoot":"","sources":["../../../src/hooks/__tests__/skill-guidance-contract.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,QAAQ,CAAC,yCAAyC,EAAE,GAAG,EAAE;IACvD,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,CAAC;QACvC,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,wDAAwD,EAAE,GAAG,EAAE;YAC9E,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface GuidanceSurfaceContract {
2
+ id: string;
3
+ path: string;
4
+ requiredPatterns: RegExp[];
5
+ }
6
+ export declare const ROOT_TEMPLATE_CONTRACTS: GuidanceSurfaceContract[];
7
+ export declare const CORE_ROLE_CONTRACTS: GuidanceSurfaceContract[];
8
+ export declare const SCENARIO_ROLE_CONTRACTS: GuidanceSurfaceContract[];
9
+ export declare const WAVE_TWO_CONTRACTS: GuidanceSurfaceContract[];
10
+ export declare const CATALOG_CONTRACTS: GuidanceSurfaceContract[];
11
+ export declare const LEGACY_PROMPT_CONTRACTS: GuidanceSurfaceContract[];
12
+ export declare const SPECIALIZED_PROMPT_CONTRACTS: GuidanceSurfaceContract[];
13
+ export declare const SKILL_CONTRACTS: GuidanceSurfaceContract[];
14
+ //# sourceMappingURL=prompt-guidance-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-guidance-contract.d.ts","sourceRoot":"","sources":["../../src/hooks/prompt-guidance-contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B;AAkDD,eAAO,MAAM,uBAAuB,EAAE,uBAAuB,EAG5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,uBAAuB,EAIxD,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,uBAAuB,EA+B5D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,uBAAuB,EAcrD,CAAC;AAEJ,eAAO,MAAM,iBAAiB,EAAE,uBAAuB,EAqBpD,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,uBAAuB,EAU5D,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,uBAAuB,EAWjE,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,uBAAuB,EAelD,CAAC"}
@@ -0,0 +1,160 @@
1
+ function rx(pattern) {
2
+ return new RegExp(pattern, 'i');
3
+ }
4
+ const ROOT_TEMPLATE_PATTERNS = [
5
+ rx('compact, information-dense responses'),
6
+ rx('clear, low-risk, reversible next steps'),
7
+ rx('local overrides?.*non-conflicting instructions'),
8
+ rx('do not skip prerequisites|task is grounded and verified'),
9
+ rx('concise evidence summaries'),
10
+ ];
11
+ const CORE_ROLE_PATTERNS = {
12
+ executor: [
13
+ rx('compact, information-dense outputs'),
14
+ rx('local overrides?.*non-conflicting constraints'),
15
+ rx('task is grounded and verified'),
16
+ ],
17
+ planner: [
18
+ rx('compact, information-dense plan summaries'),
19
+ rx('local overrides?.*non-conflicting constraints'),
20
+ rx('plan is grounded in evidence'),
21
+ ],
22
+ verifier: [
23
+ rx('concise, evidence-dense summaries'),
24
+ rx('verdict is grounded'),
25
+ rx('non-conflicting acceptance criteria'),
26
+ ],
27
+ };
28
+ const WAVE_TWO_PATTERNS = [
29
+ rx('Default final-output shape: concise and evidence-dense'),
30
+ rx('Treat newer user task updates as local overrides'),
31
+ rx('user says `continue`'),
32
+ ];
33
+ const CATALOG_PATTERNS = [
34
+ rx('Default final-output shape: concise and evidence-dense'),
35
+ rx('Treat newer user task updates as local overrides'),
36
+ rx('user says `continue`'),
37
+ ];
38
+ const SKILL_PATTERNS = [
39
+ rx('concise, evidence-dense progress and completion reporting'),
40
+ rx('local overrides for the active workflow branch'),
41
+ rx('user says `continue`'),
42
+ ];
43
+ export const ROOT_TEMPLATE_CONTRACTS = [
44
+ { id: 'agents-root', path: 'AGENTS.md', requiredPatterns: ROOT_TEMPLATE_PATTERNS },
45
+ { id: 'agents-template', path: 'templates/AGENTS.md', requiredPatterns: ROOT_TEMPLATE_PATTERNS },
46
+ ];
47
+ export const CORE_ROLE_CONTRACTS = [
48
+ { id: 'executor', path: 'prompts/executor.md', requiredPatterns: CORE_ROLE_PATTERNS.executor },
49
+ { id: 'planner', path: 'prompts/planner.md', requiredPatterns: CORE_ROLE_PATTERNS.planner },
50
+ { id: 'verifier', path: 'prompts/verifier.md', requiredPatterns: CORE_ROLE_PATTERNS.verifier },
51
+ ];
52
+ export const SCENARIO_ROLE_CONTRACTS = [
53
+ {
54
+ id: 'executor-scenarios',
55
+ path: 'prompts/executor.md',
56
+ requiredPatterns: [
57
+ rx('user says `continue`'),
58
+ rx('make a PR targeting dev'),
59
+ rx('merge to dev if CI green'),
60
+ rx('confirm CI is green, then merge'),
61
+ ],
62
+ },
63
+ {
64
+ id: 'planner-scenarios',
65
+ path: 'prompts/planner.md',
66
+ requiredPatterns: [
67
+ rx('user says `continue`'),
68
+ rx('user says `make a PR`'),
69
+ rx('user says `merge if CI green`'),
70
+ rx('scoped condition on the next operational step'),
71
+ ],
72
+ },
73
+ {
74
+ id: 'verifier-scenarios',
75
+ path: 'prompts/verifier.md',
76
+ requiredPatterns: [
77
+ rx('user says `merge if CI green`'),
78
+ rx('confirm they are green'),
79
+ rx('user says `continue`'),
80
+ rx('keep gathering the required evidence'),
81
+ ],
82
+ },
83
+ ];
84
+ export const WAVE_TWO_CONTRACTS = [
85
+ 'architect',
86
+ 'critic',
87
+ 'debugger',
88
+ 'test-engineer',
89
+ 'code-reviewer',
90
+ 'quality-reviewer',
91
+ 'security-reviewer',
92
+ 'researcher',
93
+ 'explore',
94
+ ].map((name) => ({
95
+ id: name,
96
+ path: `prompts/${name}.md`,
97
+ requiredPatterns: WAVE_TWO_PATTERNS,
98
+ }));
99
+ export const CATALOG_CONTRACTS = [
100
+ 'analyst',
101
+ 'api-reviewer',
102
+ 'build-fixer',
103
+ 'dependency-expert',
104
+ 'designer',
105
+ 'git-master',
106
+ 'information-architect',
107
+ 'performance-reviewer',
108
+ 'product-analyst',
109
+ 'product-manager',
110
+ 'qa-tester',
111
+ 'quality-strategist',
112
+ 'style-reviewer',
113
+ 'ux-researcher',
114
+ 'vision',
115
+ 'writer',
116
+ ].map((name) => ({
117
+ id: name,
118
+ path: `prompts/${name}.md`,
119
+ requiredPatterns: CATALOG_PATTERNS,
120
+ }));
121
+ export const LEGACY_PROMPT_CONTRACTS = [
122
+ {
123
+ id: 'code-simplifier',
124
+ path: 'prompts/code-simplifier.md',
125
+ requiredPatterns: [
126
+ rx('local overrides for the active simplification scope'),
127
+ rx('simplification result is grounded'),
128
+ rx('<Scenario_Examples>'),
129
+ ],
130
+ },
131
+ ];
132
+ export const SPECIALIZED_PROMPT_CONTRACTS = [
133
+ {
134
+ id: 'sisyphus-lite',
135
+ path: 'prompts/sisyphus-lite.md',
136
+ requiredPatterns: [
137
+ rx('compact, information-dense outputs'),
138
+ rx('Treat newer user instructions as local overrides'),
139
+ rx('No evidence = not complete'),
140
+ rx('specialized worker behavior prompt|worker behavior prompt'),
141
+ ],
142
+ },
143
+ ];
144
+ export const SKILL_CONTRACTS = [
145
+ 'analyze',
146
+ 'autopilot',
147
+ 'build-fix',
148
+ 'code-review',
149
+ 'plan',
150
+ 'ralph',
151
+ 'ralplan',
152
+ 'security-review',
153
+ 'team',
154
+ 'ultraqa',
155
+ ].map((name) => ({
156
+ id: name,
157
+ path: `skills/${name}/SKILL.md`,
158
+ requiredPatterns: SKILL_PATTERNS,
159
+ }));
160
+ //# sourceMappingURL=prompt-guidance-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompt-guidance-contract.js","sourceRoot":"","sources":["../../src/hooks/prompt-guidance-contract.ts"],"names":[],"mappings":"AAMA,SAAS,EAAE,CAAC,OAAe;IACzB,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,sBAAsB,GAAG;IAC7B,EAAE,CAAC,sCAAsC,CAAC;IAC1C,EAAE,CAAC,wCAAwC,CAAC;IAC5C,EAAE,CAAC,gDAAgD,CAAC;IACpD,EAAE,CAAC,yDAAyD,CAAC;IAC7D,EAAE,CAAC,4BAA4B,CAAC;CACjC,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACzB,QAAQ,EAAE;QACR,EAAE,CAAC,oCAAoC,CAAC;QACxC,EAAE,CAAC,+CAA+C,CAAC;QACnD,EAAE,CAAC,+BAA+B,CAAC;KACpC;IACD,OAAO,EAAE;QACP,EAAE,CAAC,2CAA2C,CAAC;QAC/C,EAAE,CAAC,+CAA+C,CA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ACR,QAAQ;CACT,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACf,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,WAAW,IAAI,KAAK;IAC1B,gBAAgB,EAAE,gBAAgB;CACnC,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,uBAAuB,GAA8B;IAChE;QACE,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,4BAA4B;QAClC,gBAAgB,EAAE;YAChB,EAAE,CAAC,qDAAqD,CAAC;YACzD,EAAE,CAAC,mCAAmC,CAAC;YACvC,EAAE,CAAC,qBAAqB,CAAC;SAC1B;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAA8B;IACrE;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,0BAA0B;QAChC,gBAAgB,EAAE;YAChB,EAAE,CAAC,oCAAoC,CAAC;YACxC,EAAE,CAAC,kDAAkD,CAAC;YACtD,EAAE,CAAC,4BAA4B,CAAC;YAChC,EAAE,CAAC,2DAA2D,CAAC;SAChE;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,SAAS;IACT,WAAW;IACX,WAAW;IACX,aAAa;IACb,MAAM;IACN,OAAO;IACP,SAAS;IACT,iBAAiB;IACjB,MAAM;IACN,SAAS;CACV,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACf,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,UAAU,IAAI,WAAW;IAC/B,gBAAgB,EAAE,cAAc;CACjC,CAAC,CAAC,CAAC"}
@@ -1,25 +1,63 @@
1
1
  import { describe, it } from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
+ import { readFile } from 'node:fs/promises';
4
+ import { join } from 'node:path';
3
5
  import { shouldAutoStartMcpServer } from '../bootstrap.js';
6
+ const ALL_SERVERS = [
7
+ 'state',
8
+ 'memory',
9
+ 'code_intel',
10
+ 'trace',
11
+ 'team',
12
+ ];
13
+ const SERVER_DISABLE_ENV = {
14
+ state: 'OMX_STATE_SERVER_DISABLE_AUTO_START',
15
+ memory: 'OMX_MEMORY_SERVER_DISABLE_AUTO_START',
16
+ code_intel: 'OMX_CODE_INTEL_SERVER_DISABLE_AUTO_START',
17
+ trace: 'OMX_TRACE_SERVER_DISABLE_AUTO_START',
18
+ team: 'OMX_TEAM_SERVER_DISABLE_AUTO_START',
19
+ };
20
+ const SERVER_ENTRYPOINTS = [
21
+ { server: 'state', file: 'src/mcp/state-server.ts' },
22
+ { server: 'memory', file: 'src/mcp/memory-server.ts' },
23
+ { server: 'code_intel', file: 'src/mcp/code-intel-server.ts' },
24
+ { server: 'trace', file: 'src/mcp/trace-server.ts' },
25
+ { server: 'team', file: 'src/mcp/team-server.ts' },
26
+ ];
4
27
  describe('mcp bootstrap auto-start guard', () => {
5
- it('allows auto-start by default', () => {
6
- assert.equal(shouldAutoStartMcpServer('state', {}), true);
7
- assert.equal(shouldAutoStartMcpServer('memory', {}), true);
8
- assert.equal(shouldAutoStartMcpServer('code_intel', {}), true);
9
- assert.equal(shouldAutoStartMcpServer('trace', {}), true);
28
+ it('allows auto-start by default for every OMX MCP server', () => {
29
+ for (const server of ALL_SERVERS) {
30
+ assert.equal(shouldAutoStartMcpServer(server, {}), true, `${server} should auto-start by default`);
31
+ }
10
32
  });
11
33
  it('disables all servers when global disable flag is set', () => {
12
34
  const env = { OMX_MCP_SERVER_DISABLE_AUTO_START: '1' };
13
- assert.equal(shouldAutoStartMcpServer('state', env), false);
14
- assert.equal(shouldAutoStartMcpServer('memory', env), false);
15
- assert.equal(shouldAutoStartMcpServer('code_intel', env), false);
16
- assert.equal(shouldAutoStartMcpServer('trace', env), false);
35
+ for (const server of ALL_SERVERS) {
36
+ assert.equal(shouldAutoStartMcpServer(server, env), false, `${server} should honor global disable flag`);
37
+ }
17
38
  });
18
39
  it('disables per-server using server-specific flags', () => {
19
- assert.equal(shouldAutoStartMcpServer('state', { OMX_STATE_SERVER_DISABLE_AUTO_START: '1' }), false);
20
- assert.equal(shouldAutoStartMcpServer('memory', { OMX_MEMORY_SERVER_DISABLE_AUTO_START: '1' }), false);
21
- assert.equal(shouldAutoStartMcpServer('code_intel', { OMX_CODE_INTEL_SERVER_DISABLE_AUTO_START: '1' }), false);
22
- assert.equal(shouldAutoStartMcpServer('trace', { OMX_TRACE_SERVER_DISABLE_AUTO_START: '1' }), false);
40
+ for (const server of ALL_SERVERS) {
41
+ assert.equal(shouldAutoStartMcpServer(server, { [SERVER_DISABLE_ENV[server]]: '1' }), false, `${server} should honor ${SERVER_DISABLE_ENV[server]}`);
42
+ }
43
+ });
44
+ });
45
+ describe('mcp shared stdio lifecycle contract', () => {
46
+ it('keeps shared stdio lifecycle wiring in bootstrap', async () => {
47
+ const src = await readFile(join(process.cwd(), 'src/mcp/bootstrap.ts'), 'utf8');
48
+ assert.match(src, /StdioServerTransport/, 'bootstrap should own stdio transport creation');
49
+ assert.match(src, /server\.connect\(/, 'bootstrap should own MCP server connection');
50
+ assert.match(src, /stdin/i, 'bootstrap should react to stdin/client disconnect');
51
+ assert.match(src, /SIGTERM/, 'bootstrap should handle SIGTERM');
52
+ assert.match(src, /SIGINT/, 'bootstrap should handle SIGINT');
53
+ });
54
+ it('keeps individual server entrypoints free of duplicated raw stdio connect snippets', async () => {
55
+ for (const { server, file } of SERVER_ENTRYPOINTS) {
56
+ const src = await readFile(join(process.cwd(), file), 'utf8');
57
+ assert.match(src, new RegExp(`autoStartStdioMcpServer\\(['\"]${server}['\"],\\s*server\\)`), `${file} should delegate ${server} startup to the shared stdio lifecycle helper`);
58
+ assert.doesNotMatch(src, /new StdioServerTransport\(\)/, `${file} should delegate stdio transport construction to the shared lifecycle helper`);
59
+ assert.doesNotMatch(src, /server\.connect\(transport\)\.catch\(console\.error\);/, `${file} should not duplicate raw server.connect(transport) bootstrap`);
60
+ }
23
61
  });
24
62
  });
25
63
  //# sourceMappingURL=bootstrap.test.js.map
@@ -1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DAA+D,CACvE,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -23,10 +23,11 @@ describe('mcp/code-intel-server module contract', () => {
23
23
  assert.match(src, /const args = \['--noEmit', '--pretty', 'false'\]/);
24
24
  assert.match(src, /new Server\(\s*\{ name: 'omx-code-intel', version: '0\.1\.0' \}/);
25
25
  });
26
- it('keeps stdio auto-connect bootstrap', async () => {
26
+ it('delegates stdio lifecycle bootstrapping to the shared MCP bootstrap helper', async () => {
27
27
  const src = await readFile(join(process.cwd(), 'src/mcp/code-intel-server.ts'), 'utf8');
28
- assert.match(src, /const transport = new StdioServerTransport\(\);/);
29
- assert.match(src, /server\.connect\(transport\)\.catch\(console\.error\);/);
28
+ assert.match(src, /autoStartStdioMcpServer\('code_intel', server\)/);
29
+ assert.doesNotMatch(src, /new StdioServerTransport\(\)/);
30
+ assert.doesNotMatch(src, /server\.connect\(transport\)\.catch\(console\.error\);/);
30
31
  });
31
32
  it('applies ast-grep rewrites only when dryRun=false', async () => {
32
33
  const src = await readFile(join(process.cwd(), 'src/mcp/code-intel-server.ts'), 'utf8');
@@ -1 +1 @@
1
- {"version":3,"file":"code-intel-server.test.js","sourceRoot":"","sources":["../../../src/mcp/__tests__/code-intel-server.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,cAAc,GAAG;IACrB,iBAAiB;IACjB,2BAA2B;IAC3B,sBAAsB;IACtB,uBAAuB;IACvB,WAAW;IACX,qBAAqB;IACrB,aAAa;IACb,iBAAiB;IACjB,kBAAkB;CACV,CAAC;AAEX,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,EAAE,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AI,EAAE;QACtE,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,8BAA8B,CAAC,EAAE,MAAM,CAAC,CAAC;QACxF,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,gCAAgC,CAAC,CAAC;QACpD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,mCAAmC,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -22,13 +22,15 @@ describe('mcp/memory-server module contract', () => {
22
22
  assert.ok(toolNames.includes(tool), `missing tool declaration: ${tool}`);
23
23
  }
24
24
  });
25
- it('retains section helpers and stdio bootstrap', async () => {
25
+ it('retains section helpers while delegating stdio lifecycle bootstrapping', async () => {
26
26
  const src = await readFile(join(process.cwd(), 'src/mcp/memory-server.ts'), 'utf8');
27
27
  assert.match(src, /resolveWorkingDirectoryForState/);
28
28
  assert.match(src, /function extractSection\(content: string, section: string\): string/);
29
29
  assert.match(src, /function replaceSection\(content: string, section: string, newContent: string\): string/);
30
30
  assert.match(src, /function appendToSection\(content: string, section: string, entry: string\): string/);
31
- assert.match(src, /server\.connect\(transport\)\.catch\(console\.error\);/);
31
+ assert.match(src, /autoStartStdioMcpServer\('memory', server\)/);
32
+ assert.doesNotMatch(src, /new StdioServerTransport\(\)/);
33
+ assert.doesNotMatch(src, /server\.connect\(transport\)\.catch\(console\.error\);/);
32
34
  });
33
35
  });
34
36
  //# sourceMappingURL=memory-server.test.js.map