@danielblomma/cortex-mcp 2.4.0 → 2.4.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 (214) hide show
  1. package/CHANGELOG.md +226 -0
  2. package/README.md +24 -3
  3. package/bin/cli/arguments.mjs +60 -0
  4. package/bin/cli/context-passthrough.mjs +129 -0
  5. package/bin/cli/daemon.mjs +157 -0
  6. package/bin/cli/enterprise.mjs +516 -0
  7. package/bin/cli/help.mjs +88 -0
  8. package/bin/cli/hooks.mjs +199 -0
  9. package/bin/cli/mcp-command.mjs +87 -0
  10. package/bin/cli/paths.mjs +14 -0
  11. package/bin/cli/process.mjs +49 -0
  12. package/bin/cli/project-commands.mjs +237 -0
  13. package/bin/cli/project-runtime.mjs +34 -0
  14. package/bin/cli/query-command.mjs +18 -0
  15. package/bin/cli/router.mjs +66 -0
  16. package/bin/cli/run-command.mjs +44 -0
  17. package/bin/cli/scaffold-ownership.mjs +936 -0
  18. package/bin/cli/scaffold.mjs +687 -0
  19. package/bin/cli/stage-command.mjs +9 -0
  20. package/bin/cli/telemetry-command.mjs +18 -0
  21. package/bin/cli/trusted-runtime.mjs +18 -0
  22. package/bin/cortex.mjs +12 -1607
  23. package/bin/daemon-control.mjs +162 -0
  24. package/mcp-registry-submission.json +1 -1
  25. package/package.json +8 -3
  26. package/scaffold/mcp/dist/.cortex-build-hash +1 -0
  27. package/scaffold/mcp/dist/cli/enterprise-setup.js +134 -0
  28. package/scaffold/mcp/dist/cli/govern.js +937 -0
  29. package/scaffold/mcp/dist/cli/query.js +409 -0
  30. package/scaffold/mcp/dist/cli/run.js +295 -0
  31. package/scaffold/mcp/dist/cli/stage.js +308 -0
  32. package/scaffold/mcp/dist/cli/telemetry-test.js +141 -0
  33. package/scaffold/mcp/dist/cli/ungoverned-detector.js +133 -0
  34. package/scaffold/mcp/dist/contextEntities.js +282 -0
  35. package/scaffold/mcp/dist/core/audit/query.js +72 -0
  36. package/scaffold/mcp/dist/core/audit/writer.js +28 -0
  37. package/scaffold/mcp/dist/core/config.js +235 -0
  38. package/scaffold/mcp/dist/core/enterprise-host-identity.js +193 -0
  39. package/scaffold/mcp/dist/core/enterprise-identity.js +18 -0
  40. package/scaffold/mcp/dist/core/enterprise-rotation.js +158 -0
  41. package/scaffold/mcp/dist/core/govern-paths.js +21 -0
  42. package/scaffold/mcp/dist/core/index.js +14 -0
  43. package/scaffold/mcp/dist/core/license.js +278 -0
  44. package/scaffold/mcp/dist/core/policy/enforce.js +66 -0
  45. package/scaffold/mcp/dist/core/policy/injection.js +172 -0
  46. package/scaffold/mcp/dist/core/policy/store.js +179 -0
  47. package/scaffold/mcp/dist/core/rbac/check.js +30 -0
  48. package/scaffold/mcp/dist/core/secure-endpoint.js +25 -0
  49. package/scaffold/mcp/dist/core/telemetry/collector.js +285 -0
  50. package/scaffold/mcp/dist/core/telemetry/state-dir.js +31 -0
  51. package/scaffold/mcp/dist/core/validators/builtins.js +632 -0
  52. package/scaffold/mcp/dist/core/validators/config.js +44 -0
  53. package/scaffold/mcp/dist/core/validators/engine.js +120 -0
  54. package/scaffold/mcp/dist/core/validators/evaluators/code_comments.js +236 -0
  55. package/scaffold/mcp/dist/core/validators/evaluators/regex.js +116 -0
  56. package/scaffold/mcp/dist/core/workflow/artifact-io.js +103 -0
  57. package/scaffold/mcp/dist/core/workflow/capabilities.js +88 -0
  58. package/scaffold/mcp/dist/core/workflow/default-workflows.js +102 -0
  59. package/scaffold/mcp/dist/core/workflow/enforcement.js +164 -0
  60. package/scaffold/mcp/dist/core/workflow/envelope.js +132 -0
  61. package/scaffold/mcp/dist/core/workflow/index.js +11 -0
  62. package/scaffold/mcp/dist/core/workflow/mcp-tools.js +175 -0
  63. package/scaffold/mcp/dist/core/workflow/resolution.js +69 -0
  64. package/scaffold/mcp/dist/core/workflow/run-lifecycle.js +123 -0
  65. package/scaffold/mcp/dist/core/workflow/schemas.js +141 -0
  66. package/scaffold/mcp/dist/core/workflow/synced-capability-registry.js +60 -0
  67. package/scaffold/mcp/dist/core/workflow/synced-registry.js +60 -0
  68. package/scaffold/mcp/dist/daemon/capability-sync-checker.js +242 -0
  69. package/scaffold/mcp/dist/daemon/client.js +130 -0
  70. package/scaffold/mcp/dist/daemon/egress-proxy.js +288 -0
  71. package/scaffold/mcp/dist/daemon/global-host-events.js +222 -0
  72. package/scaffold/mcp/dist/daemon/heartbeat-pusher.js +116 -0
  73. package/scaffold/mcp/dist/daemon/heartbeat-tracker.js +165 -0
  74. package/scaffold/mcp/dist/daemon/host-events-pusher.js +249 -0
  75. package/scaffold/mcp/dist/daemon/main.js +449 -0
  76. package/scaffold/mcp/dist/daemon/paths.js +36 -0
  77. package/scaffold/mcp/dist/daemon/project-service-registry.js +78 -0
  78. package/scaffold/mcp/dist/daemon/protocol.js +8 -0
  79. package/scaffold/mcp/dist/daemon/server.js +180 -0
  80. package/scaffold/mcp/dist/daemon/skill-sync-checker.js +557 -0
  81. package/scaffold/mcp/dist/daemon/sync-checker.js +165 -0
  82. package/scaffold/mcp/dist/daemon/ungoverned-scanner.js +136 -0
  83. package/scaffold/mcp/dist/daemon/workflow-sync-checker.js +249 -0
  84. package/scaffold/mcp/dist/defaults.js +6 -0
  85. package/scaffold/mcp/dist/embed.js +627 -0
  86. package/scaffold/mcp/dist/embedScheduler.js +479 -0
  87. package/scaffold/mcp/dist/embeddings.js +167 -0
  88. package/scaffold/mcp/dist/enterprise/audit/push.js +66 -0
  89. package/scaffold/mcp/dist/enterprise/index.js +327 -0
  90. package/scaffold/mcp/dist/enterprise/model/deploy.js +27 -0
  91. package/scaffold/mcp/dist/enterprise/policy/sync.js +129 -0
  92. package/scaffold/mcp/dist/enterprise/privacy/boundary.js +184 -0
  93. package/scaffold/mcp/dist/enterprise/reviews/changed-files.js +33 -0
  94. package/scaffold/mcp/dist/enterprise/reviews/pattern-context.js +202 -0
  95. package/scaffold/mcp/dist/enterprise/reviews/policy-selection.js +46 -0
  96. package/scaffold/mcp/dist/enterprise/reviews/push.js +102 -0
  97. package/scaffold/mcp/dist/enterprise/reviews/trust-state.js +186 -0
  98. package/scaffold/mcp/dist/enterprise/telemetry/sync.js +57 -0
  99. package/scaffold/mcp/dist/enterprise/tools/enterprise.js +826 -0
  100. package/scaffold/mcp/dist/enterprise/tools/harness.js +40 -0
  101. package/scaffold/mcp/dist/enterprise/tools/walk.js +73 -0
  102. package/scaffold/mcp/dist/enterprise/violations/push.js +77 -0
  103. package/scaffold/mcp/dist/enterprise/workflow/push.js +44 -0
  104. package/scaffold/mcp/dist/enterprise/workflow/state.js +329 -0
  105. package/scaffold/mcp/dist/frontmatter.js +33 -0
  106. package/scaffold/mcp/dist/graph.js +769 -0
  107. package/scaffold/mcp/dist/graphCsv.js +55 -0
  108. package/scaffold/mcp/dist/graphMetrics.js +8 -0
  109. package/scaffold/mcp/dist/hooks/permission-request.js +89 -0
  110. package/scaffold/mcp/dist/hooks/post-tool-use.js +105 -0
  111. package/scaffold/mcp/dist/hooks/pre-compact.js +29 -0
  112. package/scaffold/mcp/dist/hooks/pre-tool-use.js +78 -0
  113. package/scaffold/mcp/dist/hooks/session-end.js +43 -0
  114. package/scaffold/mcp/dist/hooks/session-start.js +41 -0
  115. package/scaffold/mcp/dist/hooks/shared.js +194 -0
  116. package/scaffold/mcp/dist/hooks/stop.js +28 -0
  117. package/scaffold/mcp/dist/hooks/user-prompt-submit.js +33 -0
  118. package/scaffold/mcp/dist/impactPresentation.js +137 -0
  119. package/scaffold/mcp/dist/impactRanking.js +191 -0
  120. package/scaffold/mcp/dist/impactResponse.js +30 -0
  121. package/scaffold/mcp/dist/impactResults.js +105 -0
  122. package/scaffold/mcp/dist/impactSeed.js +20 -0
  123. package/scaffold/mcp/dist/impactTraversal.js +64 -0
  124. package/scaffold/mcp/dist/jsonl.js +77 -0
  125. package/scaffold/mcp/dist/loadGraph.js +759 -0
  126. package/scaffold/mcp/dist/lruCache.js +38 -0
  127. package/scaffold/mcp/dist/paths.js +97 -0
  128. package/scaffold/mcp/dist/patternEvidence.js +272 -0
  129. package/scaffold/mcp/dist/plugin.js +81 -0
  130. package/scaffold/mcp/dist/presets.js +78 -0
  131. package/scaffold/mcp/dist/relatedResponse.js +18 -0
  132. package/scaffold/mcp/dist/relatedTraversal.js +78 -0
  133. package/scaffold/mcp/dist/rules.js +23 -0
  134. package/scaffold/mcp/dist/search.js +212 -0
  135. package/scaffold/mcp/dist/searchCore.js +457 -0
  136. package/scaffold/mcp/dist/searchResults.js +230 -0
  137. package/scaffold/mcp/dist/server.js +317 -0
  138. package/scaffold/mcp/dist/types.js +1 -0
  139. package/scaffold/mcp/package-lock.json +321 -200
  140. package/scaffold/mcp/package.json +15 -6
  141. package/scaffold/mcp/src/cli/enterprise-setup.ts +82 -8
  142. package/scaffold/mcp/src/cli/govern.ts +137 -52
  143. package/scaffold/mcp/src/cli/run.ts +53 -19
  144. package/scaffold/mcp/src/cli/stage.ts +8 -3
  145. package/scaffold/mcp/src/core/config.ts +9 -2
  146. package/scaffold/mcp/src/core/enterprise-host-identity.ts +259 -0
  147. package/scaffold/mcp/src/core/enterprise-identity.ts +20 -0
  148. package/scaffold/mcp/src/core/enterprise-rotation.ts +185 -0
  149. package/scaffold/mcp/src/core/govern-paths.ts +30 -0
  150. package/scaffold/mcp/src/core/license.ts +186 -17
  151. package/scaffold/mcp/src/core/secure-endpoint.ts +23 -0
  152. package/scaffold/mcp/src/core/workflow/enforcement.ts +8 -1
  153. package/scaffold/mcp/src/core/workflow/mcp-tools.ts +3 -0
  154. package/scaffold/mcp/src/core/workflow/resolution.ts +9 -1
  155. package/scaffold/mcp/src/core/workflow/synced-capability-registry.ts +15 -0
  156. package/scaffold/mcp/src/core/workflow/synced-registry.ts +15 -0
  157. package/scaffold/mcp/src/daemon/capability-sync-checker.ts +38 -2
  158. package/scaffold/mcp/src/daemon/egress-proxy.ts +14 -8
  159. package/scaffold/mcp/src/daemon/global-host-events.ts +288 -0
  160. package/scaffold/mcp/src/daemon/heartbeat-pusher.ts +4 -0
  161. package/scaffold/mcp/src/daemon/heartbeat-tracker.ts +2 -0
  162. package/scaffold/mcp/src/daemon/host-events-pusher.ts +5 -0
  163. package/scaffold/mcp/src/daemon/main.ts +99 -25
  164. package/scaffold/mcp/src/daemon/project-service-registry.ts +107 -0
  165. package/scaffold/mcp/src/daemon/skill-sync-checker.ts +368 -31
  166. package/scaffold/mcp/src/daemon/sync-checker.ts +4 -0
  167. package/scaffold/mcp/src/daemon/ungoverned-scanner.ts +57 -25
  168. package/scaffold/mcp/src/daemon/workflow-sync-checker.ts +41 -2
  169. package/scaffold/mcp/src/enterprise/audit/push.ts +8 -0
  170. package/scaffold/mcp/src/enterprise/policy/sync.ts +12 -0
  171. package/scaffold/mcp/src/enterprise/reviews/push.ts +9 -0
  172. package/scaffold/mcp/src/enterprise/reviews/trust-state.ts +3 -1
  173. package/scaffold/mcp/src/enterprise/telemetry/sync.ts +9 -0
  174. package/scaffold/mcp/src/enterprise/violations/push.ts +9 -0
  175. package/scaffold/mcp/src/enterprise/workflow/push.ts +7 -0
  176. package/scaffold/mcp/src/plugin.ts +20 -0
  177. package/scaffold/mcp/tests/copilot-shim.test.mjs +19 -1
  178. package/scaffold/mcp/tests/egress-proxy.test.mjs +37 -0
  179. package/scaffold/mcp/tests/enterprise-identity-sync.test.mjs +401 -0
  180. package/scaffold/mcp/tests/enterprise-setup.test.mjs +189 -0
  181. package/scaffold/mcp/tests/global-host-events.test.mjs +81 -0
  182. package/scaffold/mcp/tests/govern-install.test.mjs +95 -2
  183. package/scaffold/mcp/tests/govern-repair.test.mjs +20 -3
  184. package/scaffold/mcp/tests/heartbeat-tracker.test.mjs +26 -0
  185. package/scaffold/mcp/tests/license.test.mjs +367 -0
  186. package/scaffold/mcp/tests/project-service-registry.test.mjs +172 -0
  187. package/scaffold/mcp/tests/review-trust-contract.test.mjs +18 -0
  188. package/scaffold/mcp/tests/secure-enterprise-endpoint.test.mjs +46 -0
  189. package/scaffold/mcp/tests/skill-sync-checker.test.mjs +446 -2
  190. package/scaffold/mcp/tests/ungoverned-scanner.test.mjs +104 -22
  191. package/scaffold/mcp/tests/workflow-cli.test.mjs +14 -1
  192. package/scaffold/mcp/tests/workflow-synced-capabilities.test.mjs +37 -0
  193. package/scaffold/mcp/tests/workflow-synced-registry.test.mjs +40 -1
  194. package/scaffold/ownership/baseline-v2.4.1.json +22 -0
  195. package/scaffold/ownership/current.json +4 -0
  196. package/scaffold/ownership/v1.json +456 -0
  197. package/scaffold/scripts/ingest-parsers.mjs +1 -387
  198. package/scaffold/scripts/ingest-worker.mjs +4 -1
  199. package/scaffold/scripts/ingest.mjs +5 -3899
  200. package/scaffold/scripts/lib/ingest/arguments.mjs +78 -0
  201. package/scaffold/scripts/lib/ingest/chunks.mjs +212 -0
  202. package/scaffold/scripts/lib/ingest/config.mjs +120 -0
  203. package/scaffold/scripts/lib/ingest/constants.mjs +222 -0
  204. package/scaffold/scripts/lib/ingest/files.mjs +387 -0
  205. package/scaffold/scripts/lib/ingest/incremental-state.mjs +131 -0
  206. package/scaffold/scripts/lib/ingest/io.mjs +78 -0
  207. package/scaffold/scripts/lib/ingest/main.mjs +76 -0
  208. package/scaffold/scripts/lib/ingest/parser-composition.mjs +140 -0
  209. package/scaffold/scripts/lib/ingest/parser-registry.mjs +387 -0
  210. package/scaffold/scripts/lib/ingest/pipeline-stages.mjs +1625 -0
  211. package/scaffold/scripts/lib/ingest/projects.mjs +272 -0
  212. package/scaffold/scripts/lib/ingest/relations.mjs +860 -0
  213. package/scaffold/scripts/lib/ingest/runtime-paths.mjs +11 -0
  214. package/scaffold/scripts/lib/ingest/workers.mjs +264 -0
@@ -10,6 +10,7 @@ import {
10
10
  } from "../dist/core/workflow/synced-capability-registry.js";
11
11
  import { evaluateToolCall } from "../dist/core/workflow/enforcement.js";
12
12
  import { createRun } from "../dist/core/workflow/run-lifecycle.js";
13
+ import { enterpriseCredentialId } from "../dist/core/license.js";
13
14
 
14
15
  function makeWorkspace() {
15
16
  return fs.mkdtempSync(path.join(os.tmpdir(), "cortex-synced-caps-"));
@@ -49,6 +50,23 @@ function writeCache(dir, payload) {
49
50
  );
50
51
  }
51
52
 
53
+ function configureEnterprise(cwd) {
54
+ const endpoint = "https://licenses.example.com";
55
+ const apiKey = "ent_capability_12345678";
56
+ fs.mkdirSync(path.join(cwd, ".context"), { recursive: true });
57
+ fs.writeFileSync(
58
+ path.join(cwd, ".context", "enterprise.yml"),
59
+ [
60
+ "enterprise:",
61
+ ` api_key: ${apiKey}`,
62
+ ` endpoint: ${endpoint}`,
63
+ "",
64
+ ].join("\n"),
65
+ "utf8",
66
+ );
67
+ return enterpriseCredentialId(endpoint, apiKey);
68
+ }
69
+
52
70
  test("syncedCapabilitiesCachePath: defaults to ~/.cortex/capabilities.local.json", () => {
53
71
  const expected = path.join(os.homedir(), ".cortex", "capabilities.local.json");
54
72
  assert.equal(syncedCapabilitiesCachePath(), expected);
@@ -107,16 +125,33 @@ test("loadSyncedCapabilities: returns valid capability definitions", () => {
107
125
  assert.deepEqual(loaded["frontend-builder"].write_globs, ["src/components/**"]);
108
126
  });
109
127
 
128
+ test("loadSyncedCapabilities: rejects a cache bound to another Enterprise identity", () => {
129
+ const dir = makeWorkspace();
130
+ writeCache(dir, {
131
+ credential_id: "identity-a",
132
+ capabilities: {
133
+ "frontend-builder": {
134
+ capability_name: "frontend-builder",
135
+ updated_at: "2026-05-07T12:00:00.000Z",
136
+ definition: FRONTEND_BUILDER,
137
+ },
138
+ },
139
+ });
140
+ assert.deepEqual(loadSyncedCapabilities(dir, "identity-b"), {});
141
+ });
142
+
110
143
  test("evaluateToolCall integration: synced capability is consulted via merged registry", () => {
111
144
  const cwd = makeWorkspace();
112
145
  // Sandbox the home-dir-based loader.
113
146
  const fakeHome = makeWorkspace();
114
147
  process.env.HOME = fakeHome;
115
148
  try {
149
+ const credentialId = configureEnterprise(cwd);
116
150
  fs.mkdirSync(path.join(fakeHome, ".cortex"), { recursive: true });
117
151
  fs.writeFileSync(
118
152
  path.join(fakeHome, ".cortex", "capabilities.local.json"),
119
153
  JSON.stringify({
154
+ credential_id: credentialId,
120
155
  capabilities: {
121
156
  "frontend-builder": {
122
157
  capability_name: "frontend-builder",
@@ -163,6 +198,7 @@ test("evaluateToolCall integration: synced capability with same name as bundled
163
198
  const fakeHome = makeWorkspace();
164
199
  process.env.HOME = fakeHome;
165
200
  try {
201
+ const credentialId = configureEnterprise(cwd);
166
202
  // Override the bundled "builder" capability with a much stricter version
167
203
  // — only test files writable.
168
204
  const stricterBuilder = {
@@ -176,6 +212,7 @@ test("evaluateToolCall integration: synced capability with same name as bundled
176
212
  fs.writeFileSync(
177
213
  path.join(fakeHome, ".cortex", "capabilities.local.json"),
178
214
  JSON.stringify({
215
+ credential_id: credentialId,
179
216
  capabilities: {
180
217
  builder: {
181
218
  capability_name: "builder",
@@ -11,6 +11,7 @@ import {
11
11
  import { resolveWorkflowDefinition } from "../dist/core/workflow/resolution.js";
12
12
  import { runWorkflowStart } from "../dist/core/workflow/mcp-tools.js";
13
13
  import { SECURE_BUILD_WORKFLOW } from "../dist/core/workflow/default-workflows.js";
14
+ import { enterpriseCredentialId } from "../dist/core/license.js";
14
15
 
15
16
  function makeWorkspace() {
16
17
  return fs.mkdtempSync(path.join(os.tmpdir(), "cortex-synced-registry-"));
@@ -49,6 +50,23 @@ function writeCache(dir, payload) {
49
50
  );
50
51
  }
51
52
 
53
+ function configureEnterprise(cwd) {
54
+ const endpoint = "https://licenses.example.com";
55
+ const apiKey = "ent_workflow_12345678";
56
+ fs.mkdirSync(path.join(cwd, ".context"), { recursive: true });
57
+ fs.writeFileSync(
58
+ path.join(cwd, ".context", "enterprise.yml"),
59
+ [
60
+ "enterprise:",
61
+ ` api_key: ${apiKey}`,
62
+ ` endpoint: ${endpoint}`,
63
+ "",
64
+ ].join("\n"),
65
+ "utf8",
66
+ );
67
+ return enterpriseCredentialId(endpoint, apiKey);
68
+ }
69
+
52
70
  test("syncedWorkflowsCachePath: defaults to ~/.cortex/workflows.local.json", () => {
53
71
  const expected = path.join(os.homedir(), ".cortex", "workflows.local.json");
54
72
  assert.equal(syncedWorkflowsCachePath(), expected);
@@ -110,6 +128,22 @@ test("loadSyncedWorkflows: returns valid workflow definitions keyed by workflow_
110
128
  assert.equal(loaded.tiny.stages.length, 2);
111
129
  });
112
130
 
131
+ test("loadSyncedWorkflows: rejects a cache bound to another Enterprise identity", () => {
132
+ const dir = makeWorkspace();
133
+ writeCache(dir, {
134
+ credential_id: "identity-a",
135
+ workflows: {
136
+ tiny: {
137
+ workflow_id: "tiny",
138
+ version: 1,
139
+ updated_at: "2026-05-06T12:00:00.000Z",
140
+ definition: TINY_WORKFLOW,
141
+ },
142
+ },
143
+ });
144
+ assert.deepEqual(loadSyncedWorkflows(dir, "identity-b"), {});
145
+ });
146
+
113
147
  test("resolveWorkflow integration: synced workflow takes precedence over bundled default", () => {
114
148
  // We can't easily intercept loadSyncedWorkflows() from inside
115
149
  // mcp-tools.ts (it reads from a fixed home-dir path). Instead, exercise
@@ -148,10 +182,12 @@ test("resolveWorkflow integration: synced cache adds new workflow_ids beyond def
148
182
  const fakeHome = makeWorkspace();
149
183
  process.env.HOME = fakeHome;
150
184
  try {
185
+ const credentialId = configureEnterprise(cwd);
151
186
  fs.mkdirSync(path.join(fakeHome, ".cortex"), { recursive: true });
152
187
  fs.writeFileSync(
153
188
  path.join(fakeHome, ".cortex", "workflows.local.json"),
154
189
  JSON.stringify({
190
+ credential_id: credentialId,
155
191
  workflows: {
156
192
  tiny: {
157
193
  workflow_id: "tiny",
@@ -215,7 +251,10 @@ test("resolveWorkflowDefinition: unknown workflow errors list bundled and synced
215
251
  const fakeHome = makeWorkspace();
216
252
  process.env.HOME = fakeHome;
217
253
  try {
254
+ const cwd = makeWorkspace();
255
+ const credentialId = configureEnterprise(cwd);
218
256
  writeCache(path.join(fakeHome, ".cortex"), {
257
+ credential_id: credentialId,
219
258
  workflows: {
220
259
  tiny: {
221
260
  workflow_id: "tiny",
@@ -226,7 +265,7 @@ test("resolveWorkflowDefinition: unknown workflow errors list bundled and synced
226
265
  },
227
266
  });
228
267
  assert.throws(
229
- () => resolveWorkflowDefinition("missing-workflow"),
268
+ () => resolveWorkflowDefinition("missing-workflow", { cwd }),
230
269
  /Available bundled: secure-build\. Available synced: tiny\./,
231
270
  );
232
271
  } finally {
@@ -0,0 +1,22 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "baselineId": "v2.4.1",
4
+ "sourceCommit": "5ae3b00948bad26af2e5eaea60ce0b52567db352",
5
+ "files": [
6
+ {
7
+ "target": ".context/scripts/ingest-parsers.mjs",
8
+ "sha256": "e971886462c23cd832474729928207985d4fc8e3c60dcf5cf9a0e5f3f8ce5591",
9
+ "legacyTarget": "scripts/ingest-parsers.mjs"
10
+ },
11
+ {
12
+ "target": ".context/scripts/ingest-worker.mjs",
13
+ "sha256": "5240b2339b152908dba06d349c2190ecca1881b5be4808cf8021f63fb9557aba",
14
+ "legacyTarget": "scripts/ingest-worker.mjs"
15
+ },
16
+ {
17
+ "target": ".context/scripts/ingest.mjs",
18
+ "sha256": "359f213f868e280212c44972a9fc8af58edb6cba28bc3c767d0ec288b52ee6e6",
19
+ "legacyTarget": "scripts/ingest.mjs"
20
+ }
21
+ ]
22
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "manifestVersion": 1
4
+ }
@@ -0,0 +1,456 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "manifestVersion": 1,
4
+ "managedRoots": [
5
+ {
6
+ "source": "mcp",
7
+ "target": ".context/mcp",
8
+ "optionalPrefixes": [
9
+ "dist"
10
+ ],
11
+ "files": [
12
+ "build.mjs",
13
+ "dist/.cortex-build-hash",
14
+ "dist/cli/enterprise-setup.js",
15
+ "dist/cli/govern.js",
16
+ "dist/cli/query.js",
17
+ "dist/cli/run.js",
18
+ "dist/cli/stage.js",
19
+ "dist/cli/telemetry-test.js",
20
+ "dist/cli/ungoverned-detector.js",
21
+ "dist/contextEntities.js",
22
+ "dist/core/audit/query.js",
23
+ "dist/core/audit/writer.js",
24
+ "dist/core/config.js",
25
+ "dist/core/enterprise-host-identity.js",
26
+ "dist/core/enterprise-identity.js",
27
+ "dist/core/enterprise-rotation.js",
28
+ "dist/core/govern-paths.js",
29
+ "dist/core/index.js",
30
+ "dist/core/license.js",
31
+ "dist/core/policy/enforce.js",
32
+ "dist/core/policy/injection.js",
33
+ "dist/core/policy/store.js",
34
+ "dist/core/rbac/check.js",
35
+ "dist/core/secure-endpoint.js",
36
+ "dist/core/telemetry/collector.js",
37
+ "dist/core/telemetry/state-dir.js",
38
+ "dist/core/validators/builtins.js",
39
+ "dist/core/validators/config.js",
40
+ "dist/core/validators/engine.js",
41
+ "dist/core/validators/evaluators/code_comments.js",
42
+ "dist/core/validators/evaluators/regex.js",
43
+ "dist/core/workflow/artifact-io.js",
44
+ "dist/core/workflow/capabilities.js",
45
+ "dist/core/workflow/default-workflows.js",
46
+ "dist/core/workflow/enforcement.js",
47
+ "dist/core/workflow/envelope.js",
48
+ "dist/core/workflow/index.js",
49
+ "dist/core/workflow/mcp-tools.js",
50
+ "dist/core/workflow/resolution.js",
51
+ "dist/core/workflow/run-lifecycle.js",
52
+ "dist/core/workflow/schemas.js",
53
+ "dist/core/workflow/synced-capability-registry.js",
54
+ "dist/core/workflow/synced-registry.js",
55
+ "dist/daemon/capability-sync-checker.js",
56
+ "dist/daemon/client.js",
57
+ "dist/daemon/egress-proxy.js",
58
+ "dist/daemon/global-host-events.js",
59
+ "dist/daemon/heartbeat-pusher.js",
60
+ "dist/daemon/heartbeat-tracker.js",
61
+ "dist/daemon/host-events-pusher.js",
62
+ "dist/daemon/main.js",
63
+ "dist/daemon/paths.js",
64
+ "dist/daemon/project-service-registry.js",
65
+ "dist/daemon/protocol.js",
66
+ "dist/daemon/server.js",
67
+ "dist/daemon/skill-sync-checker.js",
68
+ "dist/daemon/sync-checker.js",
69
+ "dist/daemon/ungoverned-scanner.js",
70
+ "dist/daemon/workflow-sync-checker.js",
71
+ "dist/defaults.js",
72
+ "dist/embed.js",
73
+ "dist/embedScheduler.js",
74
+ "dist/embeddings.js",
75
+ "dist/enterprise/audit/push.js",
76
+ "dist/enterprise/index.js",
77
+ "dist/enterprise/model/deploy.js",
78
+ "dist/enterprise/policy/sync.js",
79
+ "dist/enterprise/privacy/boundary.js",
80
+ "dist/enterprise/reviews/changed-files.js",
81
+ "dist/enterprise/reviews/pattern-context.js",
82
+ "dist/enterprise/reviews/policy-selection.js",
83
+ "dist/enterprise/reviews/push.js",
84
+ "dist/enterprise/reviews/trust-state.js",
85
+ "dist/enterprise/telemetry/sync.js",
86
+ "dist/enterprise/tools/enterprise.js",
87
+ "dist/enterprise/tools/harness.js",
88
+ "dist/enterprise/tools/walk.js",
89
+ "dist/enterprise/violations/push.js",
90
+ "dist/enterprise/workflow/push.js",
91
+ "dist/enterprise/workflow/state.js",
92
+ "dist/frontmatter.js",
93
+ "dist/graph.js",
94
+ "dist/graphCsv.js",
95
+ "dist/graphMetrics.js",
96
+ "dist/hooks/permission-request.js",
97
+ "dist/hooks/post-tool-use.js",
98
+ "dist/hooks/pre-compact.js",
99
+ "dist/hooks/pre-tool-use.js",
100
+ "dist/hooks/session-end.js",
101
+ "dist/hooks/session-start.js",
102
+ "dist/hooks/shared.js",
103
+ "dist/hooks/stop.js",
104
+ "dist/hooks/user-prompt-submit.js",
105
+ "dist/impactPresentation.js",
106
+ "dist/impactRanking.js",
107
+ "dist/impactResponse.js",
108
+ "dist/impactResults.js",
109
+ "dist/impactSeed.js",
110
+ "dist/impactTraversal.js",
111
+ "dist/jsonl.js",
112
+ "dist/loadGraph.js",
113
+ "dist/lruCache.js",
114
+ "dist/paths.js",
115
+ "dist/patternEvidence.js",
116
+ "dist/plugin.js",
117
+ "dist/presets.js",
118
+ "dist/relatedResponse.js",
119
+ "dist/relatedTraversal.js",
120
+ "dist/rules.js",
121
+ "dist/search.js",
122
+ "dist/searchCore.js",
123
+ "dist/searchResults.js",
124
+ "dist/server.js",
125
+ "dist/types.js",
126
+ "package-lock.json",
127
+ "package.json",
128
+ "src/cli/enterprise-setup.ts",
129
+ "src/cli/govern.ts",
130
+ "src/cli/query.ts",
131
+ "src/cli/run.ts",
132
+ "src/cli/stage.ts",
133
+ "src/cli/telemetry-test.ts",
134
+ "src/cli/ungoverned-detector.ts",
135
+ "src/contextEntities.ts",
136
+ "src/core/audit/query.ts",
137
+ "src/core/audit/writer.ts",
138
+ "src/core/config.ts",
139
+ "src/core/enterprise-host-identity.ts",
140
+ "src/core/enterprise-identity.ts",
141
+ "src/core/enterprise-rotation.ts",
142
+ "src/core/govern-paths.ts",
143
+ "src/core/index.ts",
144
+ "src/core/license.ts",
145
+ "src/core/policy/enforce.ts",
146
+ "src/core/policy/injection.ts",
147
+ "src/core/policy/store.ts",
148
+ "src/core/rbac/check.ts",
149
+ "src/core/secure-endpoint.ts",
150
+ "src/core/telemetry/collector.ts",
151
+ "src/core/telemetry/state-dir.ts",
152
+ "src/core/validators/builtins.ts",
153
+ "src/core/validators/config.ts",
154
+ "src/core/validators/engine.ts",
155
+ "src/core/validators/evaluators/code_comments.ts",
156
+ "src/core/validators/evaluators/regex.ts",
157
+ "src/core/workflow/artifact-io.ts",
158
+ "src/core/workflow/capabilities.ts",
159
+ "src/core/workflow/default-workflows.ts",
160
+ "src/core/workflow/enforcement.ts",
161
+ "src/core/workflow/envelope.ts",
162
+ "src/core/workflow/index.ts",
163
+ "src/core/workflow/mcp-tools.ts",
164
+ "src/core/workflow/resolution.ts",
165
+ "src/core/workflow/run-lifecycle.ts",
166
+ "src/core/workflow/schemas.ts",
167
+ "src/core/workflow/synced-capability-registry.ts",
168
+ "src/core/workflow/synced-registry.ts",
169
+ "src/daemon/capability-sync-checker.ts",
170
+ "src/daemon/client.ts",
171
+ "src/daemon/egress-proxy.ts",
172
+ "src/daemon/global-host-events.ts",
173
+ "src/daemon/heartbeat-pusher.ts",
174
+ "src/daemon/heartbeat-tracker.ts",
175
+ "src/daemon/host-events-pusher.ts",
176
+ "src/daemon/main.ts",
177
+ "src/daemon/paths.ts",
178
+ "src/daemon/project-service-registry.ts",
179
+ "src/daemon/protocol.ts",
180
+ "src/daemon/server.ts",
181
+ "src/daemon/skill-sync-checker.ts",
182
+ "src/daemon/sync-checker.ts",
183
+ "src/daemon/ungoverned-scanner.ts",
184
+ "src/daemon/workflow-sync-checker.ts",
185
+ "src/defaults.ts",
186
+ "src/embed.ts",
187
+ "src/embedScheduler.ts",
188
+ "src/embeddings.ts",
189
+ "src/enterprise/audit/push.ts",
190
+ "src/enterprise/index.ts",
191
+ "src/enterprise/model/deploy.ts",
192
+ "src/enterprise/policy/sync.ts",
193
+ "src/enterprise/privacy/boundary.ts",
194
+ "src/enterprise/reviews/changed-files.ts",
195
+ "src/enterprise/reviews/pattern-context.ts",
196
+ "src/enterprise/reviews/policy-selection.ts",
197
+ "src/enterprise/reviews/push.ts",
198
+ "src/enterprise/reviews/trust-state.ts",
199
+ "src/enterprise/telemetry/sync.ts",
200
+ "src/enterprise/tools/enterprise.ts",
201
+ "src/enterprise/tools/harness.ts",
202
+ "src/enterprise/tools/walk.ts",
203
+ "src/enterprise/violations/push.ts",
204
+ "src/enterprise/workflow/push.ts",
205
+ "src/enterprise/workflow/state.ts",
206
+ "src/frontmatter.ts",
207
+ "src/graph.ts",
208
+ "src/graphCsv.ts",
209
+ "src/graphMetrics.ts",
210
+ "src/hooks/permission-request.ts",
211
+ "src/hooks/post-tool-use.ts",
212
+ "src/hooks/pre-compact.ts",
213
+ "src/hooks/pre-tool-use.ts",
214
+ "src/hooks/session-end.ts",
215
+ "src/hooks/session-start.ts",
216
+ "src/hooks/shared.ts",
217
+ "src/hooks/stop.ts",
218
+ "src/hooks/user-prompt-submit.ts",
219
+ "src/impactPresentation.ts",
220
+ "src/impactRanking.ts",
221
+ "src/impactResponse.ts",
222
+ "src/impactResults.ts",
223
+ "src/impactSeed.ts",
224
+ "src/impactTraversal.ts",
225
+ "src/jsonl.ts",
226
+ "src/loadGraph.ts",
227
+ "src/lruCache.ts",
228
+ "src/paths.ts",
229
+ "src/patternEvidence.ts",
230
+ "src/plugin.ts",
231
+ "src/presets.ts",
232
+ "src/relatedResponse.ts",
233
+ "src/relatedTraversal.ts",
234
+ "src/rules.ts",
235
+ "src/search.ts",
236
+ "src/searchCore.ts",
237
+ "src/searchResults.ts",
238
+ "src/server.ts",
239
+ "src/types.ts",
240
+ "tests/changed-files.test.mjs",
241
+ "tests/copilot-shim.test.mjs",
242
+ "tests/daemon-client.test.mjs",
243
+ "tests/egress-proxy.test.mjs",
244
+ "tests/embed-entities.test.mjs",
245
+ "tests/embed-scheduler.test.mjs",
246
+ "tests/embedding-jsonl.test.mjs",
247
+ "tests/enterprise-config.test.mjs",
248
+ "tests/enterprise-identity-sync.test.mjs",
249
+ "tests/enterprise-pattern-context.test.mjs",
250
+ "tests/enterprise-review-trust.test.mjs",
251
+ "tests/enterprise-setup.test.mjs",
252
+ "tests/fixtures/org-skillz-contract.json",
253
+ "tests/fixtures/review-trust-contract.json",
254
+ "tests/global-host-events.test.mjs",
255
+ "tests/govern-install.test.mjs",
256
+ "tests/govern-repair.test.mjs",
257
+ "tests/govern-status.test.mjs",
258
+ "tests/govern.test.mjs",
259
+ "tests/graph-bulk-load.test.mjs",
260
+ "tests/graph-csv.test.mjs",
261
+ "tests/heartbeat-pusher.test.mjs",
262
+ "tests/heartbeat-tracker.test.mjs",
263
+ "tests/host-events-pusher.test.mjs",
264
+ "tests/license.test.mjs",
265
+ "tests/lru-cache.test.mjs",
266
+ "tests/paths.test.mjs",
267
+ "tests/pattern-evidence.test.mjs",
268
+ "tests/policy-check.test.mjs",
269
+ "tests/project-service-registry.test.mjs",
270
+ "tests/query-cli.test.mjs",
271
+ "tests/repo-name.test.mjs",
272
+ "tests/review-policy-selection.test.mjs",
273
+ "tests/review-trust-contract.test.mjs",
274
+ "tests/review-validator-source.test.mjs",
275
+ "tests/run.test.mjs",
276
+ "tests/search-graph-score.test.mjs",
277
+ "tests/secure-enterprise-endpoint.test.mjs",
278
+ "tests/server.test.mjs",
279
+ "tests/skill-sync-checker.test.mjs",
280
+ "tests/sync-checker.test.mjs",
281
+ "tests/telemetry-collector.test.mjs",
282
+ "tests/ungoverned-detector.test.mjs",
283
+ "tests/ungoverned-scanner.test.mjs",
284
+ "tests/vector-index.test.mjs",
285
+ "tests/workflow-cli.test.mjs",
286
+ "tests/workflow-enforcement.test.mjs",
287
+ "tests/workflow-envelope.test.mjs",
288
+ "tests/workflow-mcp-tools.test.mjs",
289
+ "tests/workflow-synced-capabilities.test.mjs",
290
+ "tests/workflow-synced-registry.test.mjs",
291
+ "tests/workflow-validators-override.test.mjs",
292
+ "tests/workflow.test.mjs",
293
+ "tsconfig.json"
294
+ ]
295
+ },
296
+ {
297
+ "source": "scripts",
298
+ "target": ".context/scripts",
299
+ "files": [
300
+ "bootstrap.sh",
301
+ "context.sh",
302
+ "dashboard.mjs",
303
+ "dashboard.sh",
304
+ "doctor.sh",
305
+ "embed.sh",
306
+ "ingest-parsers.mjs",
307
+ "ingest-worker.mjs",
308
+ "ingest.mjs",
309
+ "ingest.sh",
310
+ "install-git-hooks.sh",
311
+ "lib/enterprise-check.sh",
312
+ "lib/ingest/arguments.mjs",
313
+ "lib/ingest/chunks.mjs",
314
+ "lib/ingest/config.mjs",
315
+ "lib/ingest/constants.mjs",
316
+ "lib/ingest/files.mjs",
317
+ "lib/ingest/incremental-state.mjs",
318
+ "lib/ingest/io.mjs",
319
+ "lib/ingest/main.mjs",
320
+ "lib/ingest/parser-composition.mjs",
321
+ "lib/ingest/parser-registry.mjs",
322
+ "lib/ingest/pipeline-stages.mjs",
323
+ "lib/ingest/projects.mjs",
324
+ "lib/ingest/relations.mjs",
325
+ "lib/ingest/runtime-paths.mjs",
326
+ "lib/ingest/workers.mjs",
327
+ "load-kuzu.sh",
328
+ "load-ryu.sh",
329
+ "memory-compile.mjs",
330
+ "memory-compile.sh",
331
+ "memory-lint.mjs",
332
+ "memory-lint.sh",
333
+ "parsers/bash-treesitter.mjs",
334
+ "parsers/config.mjs",
335
+ "parsers/cpp-dispatch.mjs",
336
+ "parsers/cpp-treesitter.mjs",
337
+ "parsers/cpp.mjs",
338
+ "parsers/csharp.mjs",
339
+ "parsers/dotnet/CSharpParser/CSharpParser.csproj",
340
+ "parsers/dotnet/CSharpParser/Program.cs",
341
+ "parsers/dotnet/VbNetParser/Program.cs",
342
+ "parsers/dotnet/VbNetParser/VbNetParser.csproj",
343
+ "parsers/go-treesitter.mjs",
344
+ "parsers/java-treesitter.mjs",
345
+ "parsers/javascript.mjs",
346
+ "parsers/javascript/ast.mjs",
347
+ "parsers/javascript/calls.mjs",
348
+ "parsers/javascript/chunks.mjs",
349
+ "parsers/javascript/imports.mjs",
350
+ "parsers/javascript/patterns.mjs",
351
+ "parsers/javascript/scope-analysis.mjs",
352
+ "parsers/javascript/scope-builder.mjs",
353
+ "parsers/javascript/scope-resolver.mjs",
354
+ "parsers/markdown.mjs",
355
+ "parsers/package-lock.json",
356
+ "parsers/package.json",
357
+ "parsers/python-treesitter.mjs",
358
+ "parsers/resources.mjs",
359
+ "parsers/ruby-treesitter.mjs",
360
+ "parsers/rust-dispatch.mjs",
361
+ "parsers/rust-treesitter.mjs",
362
+ "parsers/rust.mjs",
363
+ "parsers/sql.mjs",
364
+ "parsers/tree-sitter/base.mjs",
365
+ "parsers/tree-sitter/queries/bash.calls.scm",
366
+ "parsers/tree-sitter/queries/bash.chunks.scm",
367
+ "parsers/tree-sitter/queries/bash.imports.scm",
368
+ "parsers/tree-sitter/queries/cpp.calls.scm",
369
+ "parsers/tree-sitter/queries/cpp.chunks.scm",
370
+ "parsers/tree-sitter/queries/cpp.imports.scm",
371
+ "parsers/tree-sitter/queries/go.calls.scm",
372
+ "parsers/tree-sitter/queries/go.chunks.scm",
373
+ "parsers/tree-sitter/queries/go.imports.scm",
374
+ "parsers/tree-sitter/queries/java.calls.scm",
375
+ "parsers/tree-sitter/queries/java.chunks.scm",
376
+ "parsers/tree-sitter/queries/java.imports.scm",
377
+ "parsers/tree-sitter/queries/python.calls.scm",
378
+ "parsers/tree-sitter/queries/python.chunks.scm",
379
+ "parsers/tree-sitter/queries/python.imports.scm",
380
+ "parsers/tree-sitter/queries/ruby.calls.scm",
381
+ "parsers/tree-sitter/queries/ruby.chunks.scm",
382
+ "parsers/tree-sitter/queries/ruby.imports.scm",
383
+ "parsers/tree-sitter/queries/rust.calls.scm",
384
+ "parsers/tree-sitter/queries/rust.chunks.scm",
385
+ "parsers/tree-sitter/queries/rust.imports.scm",
386
+ "parsers/vb6.mjs",
387
+ "parsers/vbnet.mjs",
388
+ "refresh.sh",
389
+ "status.sh",
390
+ "update-context.sh",
391
+ "watch.sh"
392
+ ]
393
+ },
394
+ {
395
+ "source": ".githooks",
396
+ "target": ".githooks",
397
+ "files": [
398
+ "_cortex-update-runner.sh",
399
+ "post-checkout",
400
+ "post-commit",
401
+ "post-merge",
402
+ "post-rewrite"
403
+ ]
404
+ },
405
+ {
406
+ "source": "docs",
407
+ "target": "docs",
408
+ "files": [
409
+ {
410
+ "source": "architecture.md",
411
+ "target": "cortex-architecture.md"
412
+ }
413
+ ]
414
+ }
415
+ ],
416
+ "legacyRoots": [
417
+ {
418
+ "sourceManagedRoot": ".context/scripts",
419
+ "target": "scripts"
420
+ }
421
+ ],
422
+ "preStateBaselines": [
423
+ "v2.4.1"
424
+ ],
425
+ "protectedFiles": [
426
+ ".context/config.yaml",
427
+ ".context/enterprise.yaml",
428
+ ".context/enterprise.yml",
429
+ ".context/ontology.cypher",
430
+ ".context/rules.yaml",
431
+ "AGENTS.md",
432
+ "CLAUDE.md"
433
+ ],
434
+ "preservedFiles": [
435
+ {
436
+ "source": ".context/config.yaml",
437
+ "target": ".context/config.yaml"
438
+ },
439
+ {
440
+ "source": ".context/ontology.cypher",
441
+ "target": ".context/ontology.cypher"
442
+ },
443
+ {
444
+ "source": ".context/rules.yaml",
445
+ "target": ".context/rules.yaml"
446
+ },
447
+ {
448
+ "source": "AGENTS.md",
449
+ "target": "AGENTS.md"
450
+ },
451
+ {
452
+ "source": "CLAUDE.md",
453
+ "target": "CLAUDE.md"
454
+ }
455
+ ]
456
+ }