@ornexus/neocortex 4.66.0 → 4.66.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 (94) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1206 -1193
  3. package/docs/install/linux-global-install.md +21 -1
  4. package/install.js +22 -28
  5. package/install.ps1 +19 -24
  6. package/install.sh +26 -30
  7. package/package.json +2 -2
  8. package/packages/client/dist/commands/doctor.d.ts +26 -1
  9. package/packages/client/dist/commands/doctor.js +2 -2
  10. package/packages/client/dist/commands/invoke.d.ts +149 -1
  11. package/packages/client/dist/commands/invoke.js +88 -83
  12. package/packages/client/dist/commands/planning-qa.d.ts +57 -0
  13. package/packages/client/dist/commands/planning-qa.js +1 -1
  14. package/packages/client/dist/commands/story-checkpoint.d.ts +2 -0
  15. package/packages/client/dist/commands/story-checkpoint.js +1 -1
  16. package/packages/client/dist/commands/story-worktree.d.ts +1 -1
  17. package/packages/client/dist/commands/story-worktree.js +1 -1
  18. package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +51 -0
  19. package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -3
  20. package/packages/client/dist/git/epic-lifecycle-evidence.d.ts +184 -0
  21. package/packages/client/dist/git/epic-lifecycle-evidence.js +6 -0
  22. package/packages/client/dist/git/git-lifecycle-store.d.ts +9 -0
  23. package/packages/client/dist/git/git-lifecycle-store.js +9 -8
  24. package/packages/client/dist/git/story-worktree-cleanup.js +1 -1
  25. package/packages/client/dist/git/story-worktree-integration.js +3 -3
  26. package/packages/client/dist/git/story-worktree-manager.d.ts +39 -0
  27. package/packages/client/dist/git/story-worktree-manager.js +3 -3
  28. package/packages/client/dist/git/story-write-set-extension.d.ts +62 -0
  29. package/packages/client/dist/git/story-write-set-extension.js +1 -1
  30. package/packages/client/dist/private-execution/codex-executor.d.ts +13 -0
  31. package/packages/client/dist/private-execution/codex-executor.js +4 -4
  32. package/packages/client/dist/private-execution/harness-adapters/antigravity.d.ts +9 -0
  33. package/packages/client/dist/private-execution/harness-adapters/antigravity.js +1 -0
  34. package/packages/client/dist/private-execution/harness-adapters/claude-code.d.ts +8 -0
  35. package/packages/client/dist/private-execution/harness-adapters/claude-code.js +1 -0
  36. package/packages/client/dist/private-execution/harness-adapters/codex.d.ts +7 -0
  37. package/packages/client/dist/private-execution/harness-adapters/codex.js +1 -0
  38. package/packages/client/dist/private-execution/harness-adapters/copilot-cli.d.ts +8 -0
  39. package/packages/client/dist/private-execution/harness-adapters/copilot-cli.js +1 -0
  40. package/packages/client/dist/private-execution/harness-adapters/cursor.d.ts +9 -0
  41. package/packages/client/dist/private-execution/harness-adapters/cursor.js +1 -0
  42. package/packages/client/dist/private-execution/harness-adapters/deepseek.d.ts +9 -0
  43. package/packages/client/dist/private-execution/harness-adapters/deepseek.js +1 -0
  44. package/packages/client/dist/private-execution/harness-adapters/gemini.d.ts +8 -0
  45. package/packages/client/dist/private-execution/harness-adapters/gemini.js +1 -0
  46. package/packages/client/dist/private-execution/harness-adapters/grok.d.ts +9 -0
  47. package/packages/client/dist/private-execution/harness-adapters/grok.js +1 -0
  48. package/packages/client/dist/private-execution/harness-adapters/index.d.ts +73 -0
  49. package/packages/client/dist/private-execution/harness-adapters/index.js +1 -0
  50. package/packages/client/dist/private-execution/harness-adapters/kimi.d.ts +9 -0
  51. package/packages/client/dist/private-execution/harness-adapters/kimi.js +1 -0
  52. package/packages/client/dist/private-execution/harness-adapters/openclaw.d.ts +9 -0
  53. package/packages/client/dist/private-execution/harness-adapters/openclaw.js +1 -0
  54. package/packages/client/dist/private-execution/harness-adapters/opencode.d.ts +7 -0
  55. package/packages/client/dist/private-execution/harness-adapters/opencode.js +1 -0
  56. package/packages/client/dist/private-execution/harness-ephemeral-home.d.ts +19 -0
  57. package/packages/client/dist/private-execution/harness-ephemeral-home.js +1 -0
  58. package/packages/client/dist/private-execution/harness-executor.d.ts +79 -0
  59. package/packages/client/dist/private-execution/harness-executor.js +1 -0
  60. package/packages/client/dist/private-execution/harness-process.d.ts +43 -0
  61. package/packages/client/dist/private-execution/harness-process.js +1 -0
  62. package/packages/client/dist/private-execution/isolated-admission.js +12 -12
  63. package/packages/client/dist/private-execution/isolated-workspace.d.ts +16 -1
  64. package/packages/client/dist/private-execution/isolated-workspace.js +1 -1
  65. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.d.ts +2 -3
  66. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +7 -4
  67. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +1 -22
  68. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +6 -10
  69. package/packages/client/dist/state/project-state-snapshot.d.ts +10 -0
  70. package/packages/client/dist/state/project-state-snapshot.js +1 -1
  71. package/packages/client/dist/state/structural-dag-projection.d.ts +26 -0
  72. package/packages/client/dist/state/structural-dag-projection.js +1 -1
  73. package/packages/client/dist/yoloop/yoloop-client-state-store.d.ts +67 -0
  74. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1
  75. package/packages/shared/dist/compatibility/index.js +28 -0
  76. package/targets-stubs/antigravity/gemini.md +1 -1
  77. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  78. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  79. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  80. package/targets-stubs/claude-code/neocortex-sentinel.md +1 -1
  81. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  82. package/targets-stubs/claude-code/neocortex.md +2 -2
  83. package/targets-stubs/codex/AGENTS.md +1 -1
  84. package/targets-stubs/cursor/agent.md +2 -2
  85. package/targets-stubs/gemini-cli/agent.md +2 -2
  86. package/targets-stubs/gemini-cli/agents/neocortex.md +2 -2
  87. package/targets-stubs/grok/SKILL.md +3 -3
  88. package/targets-stubs/grok/agents/{neocortex.md → neocortex-sentinel.md} +2 -2
  89. package/targets-stubs/grok/install-grok.sh +45 -8
  90. package/targets-stubs/lib/managed-config-merge.js +21 -1
  91. package/targets-stubs/lib/mcp-merge.js +18 -7
  92. package/targets-stubs/opencode/neocortex-root.md +1 -1
  93. package/targets-stubs/opencode/neocortex.md +1 -1
  94. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -1,6 +1,31 @@
1
1
  #!/bin/sh
2
2
  # Neocortex - xAI Grok Build Install Adapter (thin-client)
3
3
 
4
+ # P229.09 (R4): retire the legacy child profile renamed to neocortex-sentinel.
5
+ # Runs only after the sentinel install succeeded with a real write or noop; a
6
+ # preserved/skipped sentinel leaves the legacy file untouched.
7
+ grok_retire_legacy_child() {
8
+ local source_dir="$1" legacy="$2" base_dir="$3" managed_id="$4"
9
+ case "$NEOCORTEX_MANAGED_ACTION" in
10
+ created|updated|legacy-migrated|restored|noop|planned-created|planned-updated|planned-noop) ;;
11
+ *) return 0 ;;
12
+ esac
13
+ [ -e "$legacy" ] || return 0
14
+ command -v node >/dev/null 2>&1 || return 0
15
+ local output dry=""
16
+ [ "${DRY_RUN:-false}" = true ] && dry="--dry-run"
17
+ output="$(node "$source_dir/targets-stubs/lib/managed-config-merge.js" retire-legacy "$legacy" "$base_dir/.neocortex/managed-config-manifest.json" "$base_dir" "$managed_id" $dry 2>&1)"
18
+ neocortex_managed_parse "$output"
19
+ case "$NEOCORTEX_MANAGED_ACTION" in
20
+ removed|planned-removed)
21
+ echo "[GROK] Retired legacy child agent: ${legacy##*/} ($NEOCORTEX_MANAGED_REASON)" ;;
22
+ none) ;;
23
+ *)
24
+ echo "[GROK] WARN: legacy child agent ${legacy##*/} preserved ($NEOCORTEX_MANAGED_REASON); move it aside to finish the rename to neocortex-sentinel." >&2 ;;
25
+ esac
26
+ return 0
27
+ }
28
+
4
29
  install_grok() {
5
30
  local source_dir="${1:?SOURCE_DIR required}"
6
31
  local dest_dir="${2:?DEST_DIR required}"
@@ -25,16 +50,28 @@ install_grok() {
25
50
  neocortex_managed_report "[GROK]" ".grok/skills/neocortex/SKILL.md (project skill)"
26
51
  fi
27
52
 
28
- # P228.04: published per-story child agent type (`spawn_subagent` with
29
- # subagent_type "neocortex"); managed, non-overwriting, drift preserved.
30
- if [ -f "$grok_target/agents/neocortex.md" ]; then
53
+ # P228.04 / P229.09: published per-story child agent type (`spawn_subagent`
54
+ # with subagent_type "neocortex-sentinel"); managed, non-overwriting, drift
55
+ # preserved. The legacy child `agents/neocortex.md` is retired only after
56
+ # the sentinel is in place and only when its hash matches the manifest.
57
+ if [ -f "$grok_target/agents/neocortex-sentinel.md" ]; then
31
58
  mkdir -p "$grok_home/agents"
32
- neocortex_managed_profile "$source_dir" "$grok_target/agents/neocortex.md" "$grok_home/agents/neocortex.md" "$grok_base" "profile-grok-agent-neocortex" || failures=$((failures + 1))
33
- neocortex_managed_report "[GROK]" "$grok_home/agents/neocortex.md (global child agent)"
34
- if ! neocortex_is_user_home "$dest_dir" && [ -d "$dest_dir" ] && [ "$dest_dir/.grok/agents/neocortex.md" != "$grok_home/agents/neocortex.md" ]; then
59
+ if neocortex_managed_profile "$source_dir" "$grok_target/agents/neocortex-sentinel.md" "$grok_home/agents/neocortex-sentinel.md" "$grok_base" "profile-grok-agent-neocortex-sentinel"; then
60
+ neocortex_managed_report "[GROK]" "$grok_home/agents/neocortex-sentinel.md (global child agent)"
61
+ grok_retire_legacy_child "$source_dir" "$grok_home/agents/neocortex.md" "$grok_base" "profile-grok-agent-neocortex"
62
+ else
63
+ failures=$((failures + 1))
64
+ neocortex_managed_report "[GROK]" "$grok_home/agents/neocortex-sentinel.md (global child agent)"
65
+ fi
66
+ if ! neocortex_is_user_home "$dest_dir" && [ -d "$dest_dir" ] && [ "$dest_dir/.grok/agents/neocortex-sentinel.md" != "$grok_home/agents/neocortex-sentinel.md" ]; then
35
67
  mkdir -p "$dest_dir/.grok/agents"
36
- neocortex_managed_profile "$source_dir" "$grok_target/agents/neocortex.md" "$dest_dir/.grok/agents/neocortex.md" "$dest_dir" "project-grok-agent-neocortex" || failures=$((failures + 1))
37
- neocortex_managed_report "[GROK]" ".grok/agents/neocortex.md (project child agent)"
68
+ if neocortex_managed_profile "$source_dir" "$grok_target/agents/neocortex-sentinel.md" "$dest_dir/.grok/agents/neocortex-sentinel.md" "$dest_dir" "project-grok-agent-neocortex-sentinel"; then
69
+ neocortex_managed_report "[GROK]" ".grok/agents/neocortex-sentinel.md (project child agent)"
70
+ grok_retire_legacy_child "$source_dir" "$dest_dir/.grok/agents/neocortex.md" "$dest_dir" "project-grok-agent-neocortex"
71
+ else
72
+ failures=$((failures + 1))
73
+ neocortex_managed_report "[GROK]" ".grok/agents/neocortex-sentinel.md (project child agent)"
74
+ fi
38
75
  fi
39
76
  fi
40
77
 
@@ -325,6 +325,21 @@ function settleLegacyCopy(input, manifest, allowedHashes) {
325
325
  };
326
326
  }
327
327
 
328
+ /**
329
+ * P229.09 (R4): retire a renamed managed profile (for example the Grok child
330
+ * `agents/neocortex.md`, now `neocortex-sentinel.md`). The file and its
331
+ * manifest owners are removed only when the bytes match a recorded
332
+ * `installedHash`; anything else is preserved.
333
+ */
334
+ function retireLegacy({ destination, manifestFile, baseDir, id, dryRun }) {
335
+ const manifest = loadManifest(manifestFile, baseDir);
336
+ const settled = settleLegacyCopy({ legacyCopyPath: destination, baseDir, manifestFile, dryRun }, manifest, []);
337
+ if (!settled || settled.action === 'none') {
338
+ return resultFor(id, null, 'none', 'agent-profile-legacy-absent', { dryRun: dryRun === true });
339
+ }
340
+ return resultFor(id, settled.relativePath || null, settled.action, settled.reasonCode, { dryRun: dryRun === true });
341
+ }
342
+
328
343
  /**
329
344
  * P228.19 AM-09: true when the destination still holds the legacy child and
330
345
  * would be rewritten as orchestrator. Writers use it to avoid carrying the
@@ -1185,7 +1200,7 @@ function reconcile(options) {
1185
1200
  }
1186
1201
 
1187
1202
  function usage() {
1188
- console.error('Usage: managed-config-merge.js profile <source> <dest> <manifest> <base> <id> [--dry-run] [--adopt-legacy] [--tier=<Free|Pro|Enterprise>] [--legacy-base=<dir>] [--legacy-copy=<path>] | resolve-base <platform-home> <default-base> | policy <config> <manifest> <base> [--dry-run] | rollback <manifest> <base> <id> [--dry-run] | reconcile <dest> <manifest> <base> [--dry-run]');
1203
+ console.error('Usage: managed-config-merge.js profile <source> <dest> <manifest> <base> <id> [--dry-run] [--adopt-legacy] [--tier=<Free|Pro|Enterprise>] [--legacy-base=<dir>] [--legacy-copy=<path>] | resolve-base <platform-home> <default-base> | policy <config> <manifest> <base> [--dry-run] | rollback <manifest> <base> <id> [--dry-run] | reconcile <dest> <manifest> <base> [--dry-run] | retire-legacy <dest> <manifest> <base> <id> [--dry-run]');
1189
1204
  process.exitCode = 64;
1190
1205
  }
1191
1206
 
@@ -1234,6 +1249,10 @@ function runCli(argv = process.argv.slice(2)) {
1234
1249
  const [destination, manifestFile, baseDir] = args;
1235
1250
  if (!destination || !manifestFile || !baseDir) return usage();
1236
1251
  result = reconcile({ destination, manifestFile, baseDir, dryRun });
1252
+ } else if (command === 'retire-legacy') {
1253
+ const [destination, manifestFile, baseDir, id] = args;
1254
+ if (!destination || !manifestFile || !baseDir || !id) return usage();
1255
+ result = retireLegacy({ destination, manifestFile, baseDir, id, dryRun });
1237
1256
  } else {
1238
1257
  return usage();
1239
1258
  }
@@ -1270,6 +1289,7 @@ module.exports = {
1270
1289
  applyTierLabel,
1271
1290
  reconcile,
1272
1291
  resolveManagedBase,
1292
+ retireLegacy,
1273
1293
  rollback,
1274
1294
  runCli,
1275
1295
  sha256,
@@ -353,11 +353,20 @@ function mergeJson(stubFile, destFile, rootKey, target, managedTopLevelCsv = '')
353
353
  return 0;
354
354
  }
355
355
 
356
+ // P229.09 (R5): `[table]` and `[[array.of.tables]]` are both section headers
357
+ // (TOML v1.0.0). Array tables are never managed; they only end a section.
358
+ const TABLE_HEADER = /^\[[^[\]][^\]]*\]$/;
359
+ const ARRAY_TABLE_HEADER = /^\[\[[^[\]]+\]\]$/;
360
+
361
+ function isTomlSectionHeader(line) {
362
+ return TABLE_HEADER.test(line) || ARRAY_TABLE_HEADER.test(line);
363
+ }
364
+
356
365
  function looksInvalidToml(text) {
357
366
  for (const line of text.split(/\r?\n/)) {
358
367
  const trimmed = line.trim();
359
368
  if (!trimmed || trimmed.startsWith('#')) continue;
360
- if (trimmed.startsWith('[') && !/^\[[^\]]+\]$/.test(trimmed)) return `invalid table header: ${trimmed}`;
369
+ if (trimmed.startsWith('[') && !isTomlSectionHeader(trimmed)) return `invalid table header: ${trimmed}`;
361
370
  const quotes = (trimmed.match(/(?<!\\)"/g) || []).length;
362
371
  if (quotes % 2 !== 0) return `unbalanced quote: ${trimmed}`;
363
372
  }
@@ -379,7 +388,7 @@ function splitManagedTomlSections(text) {
379
388
  flush();
380
389
  currentName = match[1];
381
390
  current = [line];
382
- } else if (/^\[[^\]]+\]$/.test(line)) {
391
+ } else if (isTomlSectionHeader(line)) {
383
392
  flush();
384
393
  currentName = null;
385
394
  current = [];
@@ -404,9 +413,10 @@ function removeManagedTomlSections(text, managed) {
404
413
  const out = [];
405
414
  let skipping = false;
406
415
  for (const line of lines) {
407
- const match = line.match(/^\[mcp_servers\.([^\]]+)\]$/);
408
- if (match) skipping = managed.includes(match[1]);
409
- else if (/^\[[^\]]+\]$/.test(line)) skipping = false;
416
+ const match = line.match(/^\[\[?mcp_servers\.([^\]]+)\]\]?$/);
417
+ if (match) {
418
+ skipping = managed.some((name) => match[1] === name || match[1].startsWith(`${name}.`));
419
+ } else if (isTomlSectionHeader(line)) skipping = false;
410
420
  if (!skipping) out.push(line);
411
421
  }
412
422
  return out.join('\n').replace(/[ \t\n]*$/, '\n');
@@ -463,9 +473,10 @@ function mergeToml(stubFile, destFile, target) {
463
473
  const namesToAppend = managed.filter((name) => Object.prototype.hasOwnProperty.call(plan.entries, name));
464
474
  const preserved = removeManagedTomlSections(existing, namesToRemove).replace(/\n*# Neocortex MCP Servers\s*\n*$/, '\n');
465
475
  const managedBlock = namesToAppend.map((name) => stubSections.get(name).trimEnd()).join('\n\n');
476
+ const preservedBody = preserved.trimEnd();
466
477
  const next = managedBlock
467
- ? `${preserved.trimEnd()}\n\n# Neocortex MCP Servers\n${managedBlock}\n`
468
- : `${preserved.trimEnd()}\n`;
478
+ ? `${preservedBody ? `${preservedBody}\n\n` : ''}# Neocortex MCP Servers\n${managedBlock}\n`
479
+ : (preservedBody ? `${preservedBody}\n` : '');
469
480
  const nextOwnership = stableJson({ ...ownership.value, entries: plan.entries });
470
481
  if (next !== existing) {
471
482
  if (retirement.remove.length > 0) backupRetired(destFile, target);
@@ -74,7 +74,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
74
74
  ┌────────────────────────────────────────────────────────────┐
75
75
  │ │
76
76
  │ ####### N E O C O R T E X │
77
- │ ### ######## v4.66.0 │
77
+ │ ### ######## v4.66.2 │
78
78
  │ ######### ##### │
79
79
  │ ## ############## Development Orchestrator │
80
80
  │ ## ### ###### ## OrNexus Team │
@@ -73,7 +73,7 @@ user's own `*yolo @docs/stories/<id>.story.md` is never refused.
73
73
  ┌────────────────────────────────────────────────────────────┐
74
74
  │ │
75
75
  │ ####### N E O C O R T E X │
76
- │ ### ######## v4.66.0 │
76
+ │ ### ######## v4.66.2 │
77
77
  │ ######### ##### │
78
78
  │ ## ############## Development Orchestrator │
79
79
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "neocortex"
3
- description: "Neocortex v4.66.0 | OrNexus Team"
3
+ description: "Neocortex v4.66.2 | OrNexus Team"
4
4
  tools:
5
5
  # Read / Edit (built-in tool sets)
6
6
  - read
@@ -82,7 +82,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
82
82
  ┌────────────────────────────────────────────────────────────┐
83
83
  │ │
84
84
  │ ####### N E O C O R T E X │
85
- │ ### ######## v4.66.0 │
85
+ │ ### ######## v4.66.2 │
86
86
  │ ######### ##### │
87
87
  │ ## ############## Development Orchestrator │
88
88
  │ ## ### ###### ## OrNexus Team │