@neurcode-ai/cli 0.9.66 → 0.10.1

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 (199) hide show
  1. package/.telemetry-bundle/dist/__tests__/harvest-verify.test.d.ts +1 -0
  2. package/.telemetry-bundle/dist/__tests__/harvest-verify.test.js +86 -0
  3. package/.telemetry-bundle/dist/contracts.d.ts +58 -0
  4. package/.telemetry-bundle/dist/contracts.js +8 -0
  5. package/.telemetry-bundle/dist/harvest-verify.d.ts +9 -0
  6. package/.telemetry-bundle/dist/harvest-verify.js +128 -0
  7. package/.telemetry-bundle/dist/index.d.ts +10 -0
  8. package/.telemetry-bundle/dist/index.js +22 -0
  9. package/.telemetry-bundle/dist/precision/leaderboards.d.ts +20 -0
  10. package/.telemetry-bundle/dist/precision/leaderboards.js +72 -0
  11. package/.telemetry-bundle/dist/reader.d.ts +5 -0
  12. package/.telemetry-bundle/dist/reader.js +46 -0
  13. package/.telemetry-bundle/dist/stable-json.d.ts +5 -0
  14. package/.telemetry-bundle/dist/stable-json.js +24 -0
  15. package/.telemetry-bundle/dist/store.d.ts +10 -0
  16. package/.telemetry-bundle/dist/store.js +52 -0
  17. package/.telemetry-bundle/dist/trust-scoring.d.ts +20 -0
  18. package/.telemetry-bundle/dist/trust-scoring.js +58 -0
  19. package/.telemetry-bundle/package.json +8 -0
  20. package/dist/commands/governance.d.ts +3 -0
  21. package/dist/commands/governance.d.ts.map +1 -0
  22. package/dist/commands/governance.js +390 -0
  23. package/dist/commands/governance.js.map +1 -0
  24. package/dist/commands/quickstart.js +3 -3
  25. package/dist/commands/quickstart.js.map +1 -1
  26. package/dist/commands/remediate-export.d.ts +5 -0
  27. package/dist/commands/remediate-export.d.ts.map +1 -1
  28. package/dist/commands/remediate-export.js +803 -14
  29. package/dist/commands/remediate-export.js.map +1 -1
  30. package/dist/commands/replay.d.ts.map +1 -1
  31. package/dist/commands/replay.js +14 -0
  32. package/dist/commands/replay.js.map +1 -1
  33. package/dist/commands/session.d.ts +7 -0
  34. package/dist/commands/session.d.ts.map +1 -1
  35. package/dist/commands/session.js +156 -0
  36. package/dist/commands/session.js.map +1 -1
  37. package/dist/commands/start-intent.d.ts.map +1 -1
  38. package/dist/commands/start-intent.js +61 -11
  39. package/dist/commands/start-intent.js.map +1 -1
  40. package/dist/commands/verify-guidance.d.ts +5 -0
  41. package/dist/commands/verify-guidance.d.ts.map +1 -0
  42. package/dist/commands/verify-guidance.js +49 -0
  43. package/dist/commands/verify-guidance.js.map +1 -0
  44. package/dist/commands/verify-output.d.ts +37 -0
  45. package/dist/commands/verify-output.d.ts.map +1 -0
  46. package/dist/commands/verify-output.js +572 -0
  47. package/dist/commands/verify-output.js.map +1 -0
  48. package/dist/commands/verify-render.d.ts +41 -0
  49. package/dist/commands/verify-render.d.ts.map +1 -0
  50. package/dist/commands/verify-render.js +457 -0
  51. package/dist/commands/verify-render.js.map +1 -0
  52. package/dist/commands/verify.d.ts.map +1 -1
  53. package/dist/commands/verify.js +278 -1081
  54. package/dist/commands/verify.js.map +1 -1
  55. package/dist/commands/workspace.d.ts.map +1 -1
  56. package/dist/commands/workspace.js +3 -14
  57. package/dist/commands/workspace.js.map +1 -1
  58. package/dist/context-engine/graph.d.ts.map +1 -1
  59. package/dist/context-engine/graph.js +69 -7
  60. package/dist/context-engine/graph.js.map +1 -1
  61. package/dist/context-engine/scanner.d.ts.map +1 -1
  62. package/dist/context-engine/scanner.js +9 -2
  63. package/dist/context-engine/scanner.js.map +1 -1
  64. package/dist/daemon/compatibility/execution.d.ts +42 -0
  65. package/dist/daemon/compatibility/execution.d.ts.map +1 -0
  66. package/dist/daemon/compatibility/execution.js +183 -0
  67. package/dist/daemon/compatibility/execution.js.map +1 -0
  68. package/dist/daemon/compatibility/mutation.d.ts +24 -0
  69. package/dist/daemon/compatibility/mutation.d.ts.map +1 -0
  70. package/dist/daemon/compatibility/mutation.js +724 -0
  71. package/dist/daemon/compatibility/mutation.js.map +1 -0
  72. package/dist/daemon/routes.d.ts +19 -0
  73. package/dist/daemon/routes.d.ts.map +1 -0
  74. package/dist/daemon/routes.js +123 -0
  75. package/dist/daemon/routes.js.map +1 -0
  76. package/dist/daemon/runtime/execution-bus.d.ts +217 -0
  77. package/dist/daemon/runtime/execution-bus.d.ts.map +1 -0
  78. package/dist/daemon/runtime/execution-bus.js +1420 -0
  79. package/dist/daemon/runtime/execution-bus.js.map +1 -0
  80. package/dist/daemon/runtime/workspace-runtime.d.ts +280 -0
  81. package/dist/daemon/runtime/workspace-runtime.d.ts.map +1 -0
  82. package/dist/daemon/runtime/workspace-runtime.js +1473 -0
  83. package/dist/daemon/runtime/workspace-runtime.js.map +1 -0
  84. package/dist/daemon/server.d.ts.map +1 -1
  85. package/dist/daemon/server.js +171 -874
  86. package/dist/daemon/server.js.map +1 -1
  87. package/dist/daemon/shaping.d.ts +11 -0
  88. package/dist/daemon/shaping.d.ts.map +1 -0
  89. package/dist/daemon/shaping.js +240 -0
  90. package/dist/daemon/shaping.js.map +1 -0
  91. package/dist/governance/canonical-pipeline.d.ts +2 -1
  92. package/dist/governance/canonical-pipeline.d.ts.map +1 -1
  93. package/dist/governance/canonical-pipeline.js +259 -84
  94. package/dist/governance/canonical-pipeline.js.map +1 -1
  95. package/dist/governance/structural-cache.d.ts.map +1 -1
  96. package/dist/governance/structural-cache.js +2 -7
  97. package/dist/governance/structural-cache.js.map +1 -1
  98. package/dist/index.js +230 -66
  99. package/dist/index.js.map +1 -1
  100. package/dist/utils/active-engineering-context.d.ts +12 -0
  101. package/dist/utils/active-engineering-context.d.ts.map +1 -0
  102. package/dist/utils/active-engineering-context.js +67 -0
  103. package/dist/utils/active-engineering-context.js.map +1 -0
  104. package/dist/utils/artifact-io.d.ts +33 -0
  105. package/dist/utils/artifact-io.d.ts.map +1 -0
  106. package/dist/utils/artifact-io.js +183 -0
  107. package/dist/utils/artifact-io.js.map +1 -0
  108. package/dist/utils/change-contract.d.ts +6 -2
  109. package/dist/utils/change-contract.d.ts.map +1 -1
  110. package/dist/utils/change-contract.js +175 -0
  111. package/dist/utils/change-contract.js.map +1 -1
  112. package/dist/utils/context-pack.d.ts +12 -0
  113. package/dist/utils/context-pack.d.ts.map +1 -0
  114. package/dist/utils/context-pack.js +147 -0
  115. package/dist/utils/context-pack.js.map +1 -0
  116. package/dist/utils/control-plane.d.ts +18 -0
  117. package/dist/utils/control-plane.d.ts.map +1 -1
  118. package/dist/utils/control-plane.js +31 -4
  119. package/dist/utils/control-plane.js.map +1 -1
  120. package/dist/utils/drift-intelligence.d.ts +47 -0
  121. package/dist/utils/drift-intelligence.d.ts.map +1 -0
  122. package/dist/utils/drift-intelligence.js +2099 -0
  123. package/dist/utils/drift-intelligence.js.map +1 -0
  124. package/dist/utils/execution-actions.d.ts +22 -0
  125. package/dist/utils/execution-actions.d.ts.map +1 -0
  126. package/dist/utils/execution-actions.js +103 -0
  127. package/dist/utils/execution-actions.js.map +1 -0
  128. package/dist/utils/execution-bus.d.ts +1 -214
  129. package/dist/utils/execution-bus.d.ts.map +1 -1
  130. package/dist/utils/execution-bus.js +15 -1359
  131. package/dist/utils/execution-bus.js.map +1 -1
  132. package/dist/utils/git.d.ts +1 -0
  133. package/dist/utils/git.d.ts.map +1 -1
  134. package/dist/utils/git.js +13 -3
  135. package/dist/utils/git.js.map +1 -1
  136. package/dist/utils/governance-decisions.d.ts +75 -0
  137. package/dist/utils/governance-decisions.d.ts.map +1 -0
  138. package/dist/utils/governance-decisions.js +412 -0
  139. package/dist/utils/governance-decisions.js.map +1 -0
  140. package/dist/utils/governance-provenance.d.ts +1 -1
  141. package/dist/utils/governance-provenance.d.ts.map +1 -1
  142. package/dist/utils/governance-provenance.js +5 -7
  143. package/dist/utils/governance-provenance.js.map +1 -1
  144. package/dist/utils/governance.d.ts +108 -0
  145. package/dist/utils/governance.d.ts.map +1 -1
  146. package/dist/utils/governance.js +209 -7
  147. package/dist/utils/governance.js.map +1 -1
  148. package/dist/utils/intelligence-runtime-common.d.ts +30 -0
  149. package/dist/utils/intelligence-runtime-common.d.ts.map +1 -0
  150. package/dist/utils/intelligence-runtime-common.js +156 -0
  151. package/dist/utils/intelligence-runtime-common.js.map +1 -0
  152. package/dist/utils/intent-contract-diagnostics.d.ts +9 -0
  153. package/dist/utils/intent-contract-diagnostics.d.ts.map +1 -0
  154. package/dist/utils/intent-contract-diagnostics.js +322 -0
  155. package/dist/utils/intent-contract-diagnostics.js.map +1 -0
  156. package/dist/utils/intent-pack.d.ts +15 -0
  157. package/dist/utils/intent-pack.d.ts.map +1 -0
  158. package/dist/utils/intent-pack.js +196 -0
  159. package/dist/utils/intent-pack.js.map +1 -0
  160. package/dist/utils/plan-sync.d.ts +1 -0
  161. package/dist/utils/plan-sync.d.ts.map +1 -1
  162. package/dist/utils/plan-sync.js +23 -0
  163. package/dist/utils/plan-sync.js.map +1 -1
  164. package/dist/utils/policy-decision.d.ts +5 -0
  165. package/dist/utils/policy-decision.d.ts.map +1 -0
  166. package/dist/utils/policy-decision.js +17 -0
  167. package/dist/utils/policy-decision.js.map +1 -0
  168. package/dist/utils/replay-custody.d.ts +43 -0
  169. package/dist/utils/replay-custody.d.ts.map +1 -0
  170. package/dist/utils/replay-custody.js +168 -0
  171. package/dist/utils/replay-custody.js.map +1 -0
  172. package/dist/utils/replay-runtime.d.ts +13 -0
  173. package/dist/utils/replay-runtime.d.ts.map +1 -1
  174. package/dist/utils/replay-runtime.js +96 -9
  175. package/dist/utils/replay-runtime.js.map +1 -1
  176. package/dist/utils/repository-intelligence.d.ts +9 -0
  177. package/dist/utils/repository-intelligence.d.ts.map +1 -0
  178. package/dist/utils/repository-intelligence.js +372 -0
  179. package/dist/utils/repository-intelligence.js.map +1 -0
  180. package/dist/utils/runtime-events.d.ts.map +1 -1
  181. package/dist/utils/runtime-events.js +25 -6
  182. package/dist/utils/runtime-events.js.map +1 -1
  183. package/dist/utils/semantic-contract-intelligence.d.ts +20 -0
  184. package/dist/utils/semantic-contract-intelligence.d.ts.map +1 -0
  185. package/dist/utils/semantic-contract-intelligence.js +825 -0
  186. package/dist/utils/semantic-contract-intelligence.js.map +1 -0
  187. package/dist/utils/session-continuity.d.ts +56 -0
  188. package/dist/utils/session-continuity.d.ts.map +1 -0
  189. package/dist/utils/session-continuity.js +318 -0
  190. package/dist/utils/session-continuity.js.map +1 -0
  191. package/dist/utils/verification-evidence.d.ts.map +1 -1
  192. package/dist/utils/verification-evidence.js +4 -1
  193. package/dist/utils/verification-evidence.js.map +1 -1
  194. package/dist/utils/workspace-runtime.d.ts +1 -266
  195. package/dist/utils/workspace-runtime.d.ts.map +1 -1
  196. package/dist/utils/workspace-runtime.js +15 -1412
  197. package/dist/utils/workspace-runtime.js.map +1 -1
  198. package/package.json +13 -11
  199. package/LICENSE +0 -201
package/dist/index.js CHANGED
@@ -64,7 +64,9 @@ const export_1 = require("./commands/export");
64
64
  const control_plane_1 = require("./commands/control-plane");
65
65
  const workspace_1 = require("./commands/workspace");
66
66
  const replay_1 = require("./commands/replay");
67
+ const governance_1 = require("./commands/governance");
67
68
  const execution_bus_1 = require("./utils/execution-bus");
69
+ const execution_actions_1 = require("./utils/execution-actions");
68
70
  // Read version from package.json
69
71
  let version = '0.1.2'; // fallback
70
72
  try {
@@ -79,38 +81,87 @@ const program = new commander_1.Command();
79
81
  const CORE_WORKFLOW_STEPS = [
80
82
  {
81
83
  command: 'neurcode start "<intent>"',
82
- description: 'Declare intent and initialize plan context',
84
+ description: 'Declare governance context and bounded implementation scope',
83
85
  },
84
86
  {
85
- command: 'neurcode verify',
86
- description: 'Check code against policies and plan',
87
+ command: 'neurcode verify --evidence',
88
+ description: 'Verify the current diff against intent, policy, and change contracts',
87
89
  },
88
90
  {
89
- command: 'neurcode fix',
90
- description: 'Get prioritized, file-level remediation guidance',
91
+ command: 'neurcode replay --json',
92
+ description: 'Inspect deterministic replay and provenance receipts from the last run',
91
93
  },
92
94
  {
93
- command: 'neurcode patch --file <path>',
94
- description: 'Apply a deterministic fix to a specific file',
95
+ command: 'neurcode remediate-export --finding-index 0',
96
+ description: 'Export bounded remediation context for an external remediation tool',
95
97
  },
96
98
  {
97
- command: 'neurcode verify',
98
- description: 'Confirm patches resolve all findings',
99
+ command: 'neurcode verify --ci',
100
+ description: 'Re-verify in CI with deterministic receipts and governance artifacts',
99
101
  },
100
102
  ];
101
- const PRIMARY_COMMAND_NAMES = new Set(['start', 'generate', 'export', 'verify', 'fix', 'patch', 'daemon']);
102
- const EXECUTION_ACTION_TYPES = [
103
+ const CANONICAL_OPERATOR_COMMAND_NAMES = new Set([
104
+ 'start',
105
+ 'quickstart',
103
106
  'verify',
104
- 'fix',
107
+ 'remediate-export',
108
+ 'replay',
109
+ ]);
110
+ const ENTERPRISE_OPERATIONS_COMMAND_NAMES = new Set([
111
+ 'policy',
112
+ 'governance',
113
+ 'workspace',
114
+ 'control-plane',
115
+ 'pilot-report',
116
+ 'daemon',
117
+ 'doctor',
118
+ 'compat',
119
+ 'login',
120
+ 'logout',
121
+ 'init',
122
+ 'whoami',
123
+ 'config',
124
+ 'repo',
125
+ 'approve',
126
+ 'bootstrap-policy',
127
+ ]);
128
+ const RUNTIME_ENGINEERING_COMMAND_NAMES = new Set([
129
+ 'audit',
130
+ 'contract',
131
+ 'feedback',
132
+ 'guard',
133
+ 'bootstrap',
134
+ 'map',
135
+ 'execute',
136
+ 'executions',
137
+ 'session',
138
+ 'brain',
139
+ ]);
140
+ const LEGACY_COMPATIBILITY_COMMAND_NAMES = new Set([
141
+ 'check',
142
+ 'refactor',
143
+ 'security',
144
+ 'ask',
145
+ 'plan',
146
+ 'plan-slo',
147
+ 'ship',
148
+ 'ship-resume',
149
+ 'ship-runs',
150
+ 'ship-attestation-verify',
151
+ 'apply',
152
+ 'allow',
153
+ 'simulate',
154
+ 'watch',
155
+ 'remediate',
156
+ 'remediate-validate',
157
+ 'remediate-status',
158
+ 'generate',
105
159
  'patch',
106
- 'apply-safe',
107
- 'reverify',
108
- 'policy-sync',
109
- 'intent-update',
110
- ];
111
- function isExecutionActionType(value) {
112
- return EXECUTION_ACTION_TYPES.includes(value);
113
- }
160
+ 'fix',
161
+ 'prompt',
162
+ 'revert',
163
+ 'export',
164
+ ]);
114
165
  function shouldRouteJsonLegacyCommandThroughExecutionBus(jsonEnabled) {
115
166
  if (!jsonEnabled)
116
167
  return false;
@@ -129,27 +180,31 @@ function emitJsonPayloadWithExitCode(payload, exitCode) {
129
180
  function formatCoreWorkflowStep(step) {
130
181
  return ` * ${step.command.padEnd(28)} ${step.description}`;
131
182
  }
132
- function buildAdvancedLegacyCommandsList(root) {
133
- const advancedCommands = [];
134
- for (const subcommand of root.commands) {
135
- const commandName = subcommand.name();
136
- if (commandName === 'help' || PRIMARY_COMMAND_NAMES.has(commandName)) {
137
- continue;
138
- }
139
- advancedCommands.push(commandName);
140
- }
141
- return advancedCommands.sort((left, right) => left.localeCompare(right));
183
+ function collectCommandLayer(root, commandNames, preferredOrder) {
184
+ const visible = new Set(root.commands
185
+ .map((subcommand) => subcommand.name())
186
+ .filter((commandName) => commandName !== 'help' && commandNames.has(commandName)));
187
+ const ordered = preferredOrder.filter((commandName) => visible.has(commandName));
188
+ const remainder = [...visible]
189
+ .filter((commandName) => !preferredOrder.includes(commandName))
190
+ .sort((left, right) => left.localeCompare(right));
191
+ return [...ordered, ...remainder];
142
192
  }
143
193
  function buildAdvancedLegacyHints(root) {
144
- return buildAdvancedLegacyCommandsList(root).map((commandName) => `neurcode ${commandName}`);
194
+ const fallbackCommands = root.commands
195
+ .map((subcommand) => subcommand.name())
196
+ .filter((commandName) => commandName !== 'help'
197
+ && !CANONICAL_OPERATOR_COMMAND_NAMES.has(commandName))
198
+ .sort((left, right) => left.localeCompare(right));
199
+ return fallbackCommands.map((commandName) => `neurcode ${commandName}`);
145
200
  }
146
201
  function configurePrimaryHelpView(root) {
147
- const primaryOrder = ['start', 'generate', 'verify', 'fix'];
202
+ const primaryOrder = ['start', 'quickstart', 'verify', 'remediate-export', 'replay'];
148
203
  root.configureHelp({
149
204
  visibleCommands: (command) => {
150
205
  const filtered = command.commands.filter((subcommand) => {
151
206
  const commandName = subcommand.name();
152
- return commandName === 'help' || PRIMARY_COMMAND_NAMES.has(commandName);
207
+ return commandName === 'help' || CANONICAL_OPERATOR_COMMAND_NAMES.has(commandName);
153
208
  });
154
209
  return filtered.sort((left, right) => {
155
210
  const leftIndex = primaryOrder.indexOf(left.name());
@@ -162,28 +217,93 @@ function configurePrimaryHelpView(root) {
162
217
  });
163
218
  }
164
219
  function printCoreWorkflowGuide() {
165
- console.log(chalk.bold.cyan('\n🚀 Neurcode Start\n'));
166
- console.log(chalk.bold.white('Core Workflow:'));
220
+ console.log(chalk.bold.cyan('\n🛡️ Neurcode Governance Workflow\n'));
221
+ console.log(chalk.bold.white('Canonical Workflow:'));
167
222
  CORE_WORKFLOW_STEPS.forEach((step) => console.log(chalk.dim(formatCoreWorkflowStep(step))));
168
223
  console.log('');
169
- console.log(chalk.dim('Run `neurcode --help` to see advanced and legacy commands.\n'));
224
+ console.log(chalk.dim('Run `neurcode --help` to see enterprise, runtime-engineering, and compatibility commands.\n'));
225
+ }
226
+ function formatCommandList(commandNames) {
227
+ return commandNames.length > 0
228
+ ? commandNames.map((commandName) => ` * neurcode ${commandName}`)
229
+ : [' * (none)'];
170
230
  }
171
- function renderHelpFooter(advancedCommands) {
172
- const advancedLines = advancedCommands.map((commandName) => ` * neurcode ${commandName}`);
231
+ function renderHelpFooter(root) {
232
+ const enterpriseOperations = collectCommandLayer(root, ENTERPRISE_OPERATIONS_COMMAND_NAMES, [
233
+ 'policy',
234
+ 'governance',
235
+ 'workspace',
236
+ 'control-plane',
237
+ 'pilot-report',
238
+ 'daemon',
239
+ 'doctor',
240
+ 'compat',
241
+ 'login',
242
+ 'logout',
243
+ 'init',
244
+ 'whoami',
245
+ 'config',
246
+ 'repo',
247
+ 'approve',
248
+ 'bootstrap-policy',
249
+ ]);
250
+ const runtimeEngineering = collectCommandLayer(root, RUNTIME_ENGINEERING_COMMAND_NAMES, [
251
+ 'audit',
252
+ 'contract',
253
+ 'feedback',
254
+ 'guard',
255
+ 'bootstrap',
256
+ 'map',
257
+ 'execute',
258
+ 'executions',
259
+ 'session',
260
+ 'brain',
261
+ ]);
262
+ const compatibilityCommands = collectCommandLayer(root, LEGACY_COMPATIBILITY_COMMAND_NAMES, [
263
+ 'fix',
264
+ 'patch',
265
+ 'generate',
266
+ 'prompt',
267
+ 'plan',
268
+ 'ask',
269
+ 'remediate',
270
+ 'remediate-validate',
271
+ 'remediate-status',
272
+ 'ship',
273
+ 'ship-resume',
274
+ 'ship-runs',
275
+ 'ship-attestation-verify',
276
+ 'apply',
277
+ 'export',
278
+ 'revert',
279
+ 'check',
280
+ 'refactor',
281
+ 'security',
282
+ 'simulate',
283
+ 'watch',
284
+ 'allow',
285
+ 'plan-slo',
286
+ ]);
173
287
  return [
174
288
  '',
175
289
  'Core Workflow',
176
290
  ...CORE_WORKFLOW_STEPS.map((step) => formatCoreWorkflowStep(step)),
177
291
  '',
178
- 'Advanced / Legacy Commands',
179
- ...(advancedLines.length > 0 ? advancedLines : [' * (none)']),
292
+ 'Enterprise Operations',
293
+ ...formatCommandList(enterpriseOperations),
294
+ '',
295
+ 'Runtime Engineering',
296
+ ...formatCommandList(runtimeEngineering),
297
+ '',
298
+ 'Compatibility / Legacy',
299
+ ...formatCommandList(compatibilityCommands),
180
300
  '',
181
301
  'Run `neurcode <command> --help` for command-specific details.',
182
302
  ].join('\n');
183
303
  }
184
304
  program
185
305
  .name('neurcode')
186
- .description('AI-powered code governance and diff analysis')
306
+ .description('Intent-aware deterministic governance infrastructure for AI-assisted engineering')
187
307
  .version(version);
188
308
  // Show welcome banner before parsing (for help or unauthenticated users)
189
309
  async function showWelcomeIfNeeded() {
@@ -202,7 +322,7 @@ showWelcomeIfNeeded().catch(() => {
202
322
  });
203
323
  program
204
324
  .command('start [intent...]')
205
- .description('Initialize what you are building')
325
+ .description('Declare governance intent and initialize bounded change context')
206
326
  .option('--run-init', 'Run `neurcode init` immediately after showing the guide')
207
327
  .option('--json', 'Output machine-readable onboarding metadata')
208
328
  .action(async (intentParts, options) => {
@@ -253,6 +373,7 @@ program
253
373
  (0, security_1.securityCommand)(program);
254
374
  (0, brain_1.brainCommand)(program);
255
375
  (0, policy_1.policyCommand)(program);
376
+ (0, governance_1.governanceCommand)(program);
256
377
  (0, control_plane_1.controlPlaneCommand)(program);
257
378
  (0, workspace_1.workspaceCommand)(program);
258
379
  (0, replay_1.replayCommand)(program);
@@ -438,7 +559,7 @@ program
438
559
  });
439
560
  program
440
561
  .command('ask')
441
- .description('Ask a repo question with grounded, citation-backed answers')
562
+ .description('Advanced: ask a repo question with grounded, citation-backed answers')
442
563
  .argument('<question...>', 'Question about the codebase')
443
564
  .option('--project-id <id>', 'Project ID')
444
565
  .option('--json', 'Output machine-readable JSON')
@@ -462,7 +583,7 @@ program
462
583
  });
463
584
  program
464
585
  .command('plan')
465
- .description('Generate an execution plan for a user intent')
586
+ .description('Legacy: generate an execution plan for a user intent')
466
587
  .argument('<intent...>', 'Description of what you want to accomplish')
467
588
  .option('--project-id <id>', 'Project ID')
468
589
  .option('--ticket <id>', 'Ticket ID from Linear or Jira (e.g., PROJ-123, ABC-123)')
@@ -527,7 +648,7 @@ planSloCmd
527
648
  });
528
649
  program
529
650
  .command('ship')
530
- .description('Plan, apply, verify, auto-remediate, and produce a merge confidence card')
651
+ .description('Legacy: run the older autonomous ship loop and produce a merge confidence card')
531
652
  .argument('<goal...>', 'Implementation goal to ship')
532
653
  .option('--project-id <id>', 'Project ID')
533
654
  .option('--max-fix-attempts <n>', 'Maximum auto-remediation attempts (default: 2)', (val) => parseInt(val, 10))
@@ -563,7 +684,7 @@ program
563
684
  });
564
685
  program
565
686
  .command('ship-resume')
566
- .description('Resume a previously started ship run from its checkpoint')
687
+ .description('Legacy: resume a previously started ship run from its checkpoint')
567
688
  .argument('<run-id>', 'Ship run ID (see neurcode ship-runs)')
568
689
  .option('--project-id <id>', 'Project ID override')
569
690
  .option('--max-fix-attempts <n>', 'Maximum auto-remediation attempts override', (val) => parseInt(val, 10))
@@ -593,7 +714,7 @@ program
593
714
  });
594
715
  program
595
716
  .command('ship-runs')
596
- .description('List persisted ship runs for this repository')
717
+ .description('Legacy: list persisted ship runs for this repository')
597
718
  .option('--limit <n>', 'Maximum runs to show (default: 20)', (val) => parseInt(val, 10))
598
719
  .option('--json', 'Output machine-readable JSON')
599
720
  .action((options) => {
@@ -604,7 +725,7 @@ program
604
725
  });
605
726
  program
606
727
  .command('ship-attestation-verify')
607
- .description('Verify a ship release attestation against the referenced merge card artifact')
728
+ .description('Legacy: verify a ship release attestation against the referenced merge card artifact')
608
729
  .argument('<path>', 'Path to release attestation JSON file')
609
730
  .option('--hmac-key <key>', 'HMAC key override for signature verification (defaults to NEURCODE_ATTEST_HMAC_KEY)')
610
731
  .option('--json', 'Output machine-readable JSON')
@@ -616,7 +737,7 @@ program
616
737
  });
617
738
  program
618
739
  .command('apply')
619
- .description('Apply a saved architect plan by generating and writing code files')
740
+ .description('Legacy: apply a saved architect plan by generating and writing code files')
620
741
  .argument('<planId>', 'Plan ID (UUID) to apply')
621
742
  .option('--force', 'Overwrite existing files without confirmation')
622
743
  .option('--json', 'Output machine-readable JSON')
@@ -654,7 +775,7 @@ program
654
775
  });
655
776
  program
656
777
  .command('simulate')
657
- .description('Predict blast radius and likely regressions before merge ("what would have broken?")')
778
+ .description('Advanced: predict blast radius and likely regressions before merge ("what would have broken?")')
658
779
  .option('--staged', 'Analyze staged changes only')
659
780
  .option('--head', 'Analyze changes against HEAD')
660
781
  .option('--base <ref>', 'Analyze changes against a specific base ref')
@@ -673,14 +794,14 @@ program
673
794
  });
674
795
  program
675
796
  .command('watch')
676
- .description('Start Neurcode Watch - A local background service that records file changes for Time Machine feature')
797
+ .description('Legacy: start the local file-change recorder used by Time Machine workflows')
677
798
  .action(() => {
678
799
  (0, watch_1.watchCommand)();
679
800
  });
680
801
  // Session management commands
681
802
  const sessionCmd = program
682
803
  .command('session')
683
- .description('Manage AI coding sessions');
804
+ .description('Manage cloud sessions and local intent-runtime continuity');
684
805
  sessionCmd
685
806
  .command('list')
686
807
  .description('List all sessions for the current project')
@@ -714,9 +835,51 @@ sessionCmd
714
835
  projectId: options.projectId,
715
836
  });
716
837
  });
838
+ sessionCmd
839
+ .command('list-local')
840
+ .description('List local intent-runtime session snapshots for this repository')
841
+ .option('--json', 'Output machine-readable JSON')
842
+ .action((options) => {
843
+ (0, session_1.listLocalSessionsCommand)({
844
+ json: options.json === true,
845
+ });
846
+ });
847
+ sessionCmd
848
+ .command('current-local')
849
+ .description('Show the active local intent-runtime session')
850
+ .option('--json', 'Output machine-readable JSON')
851
+ .action((options) => {
852
+ (0, session_1.currentLocalSessionCommand)({
853
+ json: options.json === true,
854
+ });
855
+ });
856
+ sessionCmd
857
+ .command('resume-local')
858
+ .description('Restore a stored local intent-runtime session snapshot')
859
+ .option('--session-id <id>', 'Local session ID to restore (defaults to the active or latest snapshot)')
860
+ .option('--json', 'Output machine-readable JSON')
861
+ .action((options) => {
862
+ (0, session_1.resumeLocalSessionCommand)({
863
+ sessionId: options.sessionId,
864
+ json: options.json === true,
865
+ });
866
+ });
867
+ sessionCmd
868
+ .command('compare-local')
869
+ .description('Compare the approved scope and boundary expectations of two local intent sessions')
870
+ .requiredOption('--left <id>', 'Left local session ID')
871
+ .requiredOption('--right <id>', 'Right local session ID')
872
+ .option('--json', 'Output machine-readable JSON')
873
+ .action((options) => {
874
+ (0, session_1.compareLocalSessionsCommand)({
875
+ left: options.left,
876
+ right: options.right,
877
+ json: options.json === true,
878
+ });
879
+ });
717
880
  program
718
881
  .command('remediate')
719
- .description('Run verify, auto-remediate using ship loop, then re-verify')
882
+ .description('Legacy: run verify, auto-remediate using the older ship loop, then re-verify')
720
883
  .option('--goal <text>', 'Goal text for remediation ship loop')
721
884
  .option('--plan-id <id>', 'Plan ID for verify scope checks')
722
885
  .option('--project-id <id>', 'Project ID override')
@@ -776,8 +939,8 @@ program
776
939
  program
777
940
  .command('remediate-export')
778
941
  .description('Export a structured deterministic remediation payload for a governance finding.\n' +
779
- 'Pass the output to Cursor, Claude, Codex, or any AI coding assistant.\n' +
780
- 'This command NEVER modifies any file. Neurcode detects. Your AI assistant remediates.')
942
+ 'Pass the output to an external remediation tool or coding workflow.\n' +
943
+ 'This command NEVER modifies any file. Neurcode verifies. External remediation owns the code change.')
781
944
  .option('--finding <id>', 'Export payload for a specific finding ID')
782
945
  .option('--finding-id <id>', 'Alias for --finding (backward compatible)')
783
946
  .option('--finding-index <n>', 'Export payload for finding at 0-based index')
@@ -798,6 +961,8 @@ program
798
961
  out: options.out,
799
962
  copy: options.copy === true,
800
963
  json: options.json === true,
964
+ verifyOutputFile: options.verifyOutputFile,
965
+ projectRoot: options.projectRoot,
801
966
  });
802
967
  });
803
968
  // ── neurcode remediate validate ────────────────────────────────────────────────
@@ -833,7 +998,7 @@ program
833
998
  });
834
999
  program
835
1000
  .command('generate')
836
- .description('Generate a governed plan context (reads intent from plan.json if no prompt given)')
1001
+ .description('Legacy: generate governed plan context (reads intent from plan.json if no prompt given)')
837
1002
  .argument('[prompt...]', 'Implementation prompt — omit to use intent from plan.json')
838
1003
  .option('--plan-id <id>', 'Plan ID override for scope context')
839
1004
  .option('--json', 'Output machine-readable JSON')
@@ -848,7 +1013,7 @@ program
848
1013
  });
849
1014
  program
850
1015
  .command('patch')
851
- .description('Apply a deterministic fix patch to a file (from neurcode fix suggestions)')
1016
+ .description('Legacy: apply a deterministic fix patch to a file (from neurcode fix suggestions)')
852
1017
  .requiredOption('--file <path>', 'Path to the file to patch')
853
1018
  .option('--preview-token <token>', 'Preview token generated by deterministic patch preview')
854
1019
  .option('--rollback-receipt <id>', 'Rollback a previously applied deterministic patch receipt')
@@ -886,7 +1051,7 @@ program
886
1051
  });
887
1052
  program
888
1053
  .command('fix')
889
- .description('Get actionable fixes')
1054
+ .description('Review prioritized governance findings and optional legacy patch suggestions')
890
1055
  .option('--plan-id <id>', 'Plan ID for verify scope checks')
891
1056
  .option('--project-id <id>', 'Project ID override')
892
1057
  .option('--ci', 'CI mode: deterministic verification-only flow, no local interactive/runtime assumptions')
@@ -956,7 +1121,7 @@ program
956
1121
  });
957
1122
  program
958
1123
  .command('verify')
959
- .description('Check code against policies and plan')
1124
+ .description('Run intent-aware deterministic verification against policy and bounded change scope')
960
1125
  .option('--plan-id <id>', 'Plan ID to verify against (required unless --policy-only)')
961
1126
  .option('--project-id <id>', 'Project ID')
962
1127
  .option('--ci', 'CI mode: deterministic verification-only flow, no daemon/interactive/local-state assumptions')
@@ -1101,7 +1266,7 @@ program
1101
1266
  });
1102
1267
  program
1103
1268
  .command('prompt [plan-id]')
1104
- .description('Generate a Cursor/Claude prompt from an Architect Plan (uses last plan if ID not provided)')
1269
+ .description('Legacy: generate an external prompt from an Architect Plan (uses last plan if ID not provided)')
1105
1270
  .option('--json', 'Output machine-readable JSON')
1106
1271
  .option('--output <path>', 'Write prompt output to a file')
1107
1272
  .option('--no-copy', 'Do not copy prompt to clipboard')
@@ -1152,7 +1317,7 @@ revertCmd
1152
1317
  // ── Export ────────────────────────────────────────────────────────────────────
1153
1318
  program
1154
1319
  .command('export')
1155
- .description('Export current plan as structured JSON for agent consumption')
1320
+ .description('Legacy: export current plan as structured JSON for external workflow consumption')
1156
1321
  .option('--json', 'Output machine-readable JSON to stdout')
1157
1322
  .option('--file <path>', 'Write exported plan to a file (e.g. plan.json)')
1158
1323
  .action((options) => {
@@ -1164,7 +1329,7 @@ program
1164
1329
  // ── Daemon ────────────────────────────────────────────────────────────────────
1165
1330
  program
1166
1331
  .command('daemon')
1167
- .description('Start local dashboard bridge for verify/fix/patch actions (http://localhost:4321)')
1332
+ .description('Start the local governance bridge for verify, findings, replay, and remediation export (http://localhost:4321)')
1168
1333
  .action(() => {
1169
1334
  (0, server_1.startDaemon)();
1170
1335
  });
@@ -1182,9 +1347,9 @@ program
1182
1347
  .option('--no-reverify', 'Skip post-action deterministic reverify stage')
1183
1348
  .option('--json', 'Output full execution record as JSON')
1184
1349
  .action(async (type, options) => {
1185
- if (!isExecutionActionType(type)) {
1350
+ if (!(0, execution_actions_1.isExecutionActionType)(type)) {
1186
1351
  console.error(`❌ Unsupported execution type: ${type}`);
1187
- console.error(` Supported: ${EXECUTION_ACTION_TYPES.join(', ')}`);
1352
+ console.error(` Supported: ${execution_actions_1.EXECUTION_ACTION_TYPES.join(', ')}`);
1188
1353
  process.exit(1);
1189
1354
  }
1190
1355
  const run = await (0, execution_bus_1.runExecution)({
@@ -1270,7 +1435,6 @@ program
1270
1435
  console.log('');
1271
1436
  });
1272
1437
  configurePrimaryHelpView(program);
1273
- const advancedLegacyCommands = buildAdvancedLegacyCommandsList(program);
1274
- program.addHelpText('after', renderHelpFooter(advancedLegacyCommands));
1438
+ program.addHelpText('after', renderHelpFooter(program));
1275
1439
  program.parse();
1276
1440
  //# sourceMappingURL=index.js.map