@ornexus/neocortex 4.60.79 → 4.60.81

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 (28) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1193 -1193
  3. package/install.ps1 +1 -1
  4. package/install.sh +1 -1
  5. package/package.json +2 -2
  6. package/packages/client/dist/commands/refresh-memory.d.ts +3 -1
  7. package/packages/client/dist/commands/refresh-memory.js +17 -2
  8. package/packages/client/dist/git/direct-yolo-checkpoint.js +144 -29
  9. package/packages/client/dist/git/git-lifecycle-store.js +22 -17
  10. package/packages/client/dist/git/neocortex-trailers.d.ts +26 -0
  11. package/packages/client/dist/git/neocortex-trailers.js +53 -0
  12. package/packages/client/dist/memory/project-memory-writer.d.ts +16 -1
  13. package/packages/client/dist/memory/project-memory-writer.js +55 -5
  14. package/packages/client/dist/runner/headless/run-yoloop.js +5 -1
  15. package/packages/client/dist/yolo/change-evidence-collector.d.ts +1 -1
  16. package/packages/client/dist/yolo/change-evidence-collector.js +26 -3
  17. package/packages/shared/dist/yoloop/epic-terminal-git.js +12 -0
  18. package/targets-stubs/antigravity/gemini.md +1 -1
  19. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  20. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  21. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  22. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  23. package/targets-stubs/claude-code/neocortex.md +2 -2
  24. package/targets-stubs/codex/AGENTS.md +1 -1
  25. package/targets-stubs/cursor/agent.md +2 -2
  26. package/targets-stubs/gemini-cli/agent.md +2 -2
  27. package/targets-stubs/opencode/neocortex-root.md +1 -1
  28. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -4,12 +4,14 @@
4
4
  * The writer owns only the NEOCORTEX-MEMORY block. Everything outside that
5
5
  * block is preserved byte-for-byte so users can keep local instructions.
6
6
  */
7
+ import { execFileSync } from 'node:child_process';
7
8
  import { randomUUID } from 'node:crypto';
8
9
  import { constants as fsConstants, existsSync, lstatSync, mkdirSync, copyFileSync, readdirSync, readFileSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, symlinkSync, unlinkSync, writeFileSync, } from 'node:fs';
9
10
  import { platform } from 'node:os';
10
11
  import { basename, dirname, join, relative, resolve } from 'node:path';
11
12
  import { CANONICAL_PROJECT_MEMORY_SOURCE, getProjectMemoryTarget, renderArchitectureReferenceTable, } from './shared-project-memory-types.js';
12
13
  import { assertProjectMemoryPaths, invalidProjectMemoryPath, isValidScopedRelativePath } from './project-memory-path-scope.js';
14
+ export const LEGACY_AGENT_PATH_WRAPPER_TRACKED_REASON = 'legacy-agent-path-wrapper-tracked';
13
15
  function hasCanonicalUpdateInput(options) {
14
16
  return (options.memoryNotes?.length ?? 0) > 0 ||
15
17
  (options.architectureReferences?.length ?? 0) > 0 ||
@@ -941,8 +943,42 @@ const LEGACY_AGENT_PATH_WRAPPERS = {
941
943
  antigravity: ['.gemini/agents/neocortex.md'],
942
944
  };
943
945
  const LEGACY_WRAPPER_HEADER = /^# [^\n]* Neocortex Memory Wrapper\s*$/;
946
+ /**
947
+ * True only when Git positively reports the path as tracked in the index.
948
+ * Git unavailable, not a repository, or any error is treated as untracked.
949
+ * Ambient GIT_* variables are stripped so hooks cannot redirect the lookup.
950
+ */
951
+ function isGitTrackedPath(projectRoot, relativeFile) {
952
+ try {
953
+ execFileSync('git', [
954
+ '-c', 'core.fsmonitor=false',
955
+ 'ls-files', '--error-unmatch', '--', relativeFile,
956
+ ], {
957
+ cwd: projectRoot,
958
+ stdio: ['ignore', 'ignore', 'ignore'],
959
+ env: {
960
+ ...Object.fromEntries(Object.entries(process.env).filter(([key]) => !key.startsWith('GIT_'))),
961
+ GIT_TERMINAL_PROMPT: '0',
962
+ GIT_OPTIONAL_LOCKS: '0',
963
+ },
964
+ timeout: 10_000,
965
+ windowsHide: true,
966
+ });
967
+ return true;
968
+ }
969
+ catch {
970
+ return false;
971
+ }
972
+ }
944
973
  function retireLegacyAgentPathWrappers(projectRoot, target, dryRun, backupDirectory) {
945
- const retired = [];
974
+ const results = [];
975
+ const retiredStatus = dryRun ? 'would-retire' : 'retired';
976
+ const trackedBlocked = (relativeFile) => ({
977
+ relativeFile,
978
+ status: 'tracked-blocked',
979
+ reasonCode: LEGACY_AGENT_PATH_WRAPPER_TRACKED_REASON,
980
+ remediation: `git rm ${relativeFile}`,
981
+ });
946
982
  for (const relativeFile of LEGACY_AGENT_PATH_WRAPPERS[target.targetId] ?? []) {
947
983
  assertProjectMemoryPaths(projectRoot, [relativeFile]);
948
984
  const filePath = join(projectRoot, relativeFile);
@@ -962,9 +998,14 @@ function retireLegacyAgentPathWrappers(projectRoot, target, dryRun, backupDirect
962
998
  pointsToCanonical = false;
963
999
  }
964
1000
  if (pointsToCanonical) {
1001
+ // A tracked wrapper is repository content: never delete it behind Git's back.
1002
+ if (isGitTrackedPath(projectRoot, relativeFile)) {
1003
+ results.push(trackedBlocked(relativeFile));
1004
+ continue;
1005
+ }
965
1006
  if (!dryRun)
966
1007
  unlinkSync(filePath);
967
- retired.push(relativeFile);
1008
+ results.push({ relativeFile, status: retiredStatus });
968
1009
  }
969
1010
  continue;
970
1011
  }
@@ -975,6 +1016,10 @@ function retireLegacyAgentPathWrappers(projectRoot, target, dryRun, backupDirect
975
1016
  const end = content.indexOf(markerEnd(target));
976
1017
  if (start < 0 || end < start)
977
1018
  continue;
1019
+ if (isGitTrackedPath(projectRoot, relativeFile)) {
1020
+ results.push(trackedBlocked(relativeFile));
1021
+ continue;
1022
+ }
978
1023
  const remainder = content.slice(0, start) + content.slice(end + markerEnd(target).length);
979
1024
  const trimmed = remainder.trim();
980
1025
  if (trimmed.length === 0 || LEGACY_WRAPPER_HEADER.test(trimmed)) {
@@ -986,9 +1031,9 @@ function retireLegacyAgentPathWrappers(projectRoot, target, dryRun, backupDirect
986
1031
  if (!dryRun)
987
1032
  writeFileWithBackup(filePath, `${remainder.replace(/\s+$/, '')}\n`, backupDirectory);
988
1033
  }
989
- retired.push(relativeFile);
1034
+ results.push({ relativeFile, status: retiredStatus });
990
1035
  }
991
- return retired;
1036
+ return results;
992
1037
  }
993
1038
  export function writeProjectMemoryTargetFiles(options) {
994
1039
  if (options.fs !== undefined) {
@@ -1056,12 +1101,17 @@ export function writeProjectMemoryTargetFiles(options) {
1056
1101
  reasonCodes: reasonCodesForNotes(options.memoryNotes ?? []),
1057
1102
  };
1058
1103
  });
1059
- const retiredFiles = retireLegacyAgentPathWrappers(options.projectRoot, target, options.dryRun, options.backupDirectory);
1104
+ const legacyAgentPathWrappers = retireLegacyAgentPathWrappers(options.projectRoot, target, options.dryRun, options.backupDirectory);
1105
+ // A tracked-blocked wrapper is reported, never acted on, so it does not mark the target changed.
1106
+ const retiredFiles = legacyAgentPathWrappers
1107
+ .filter((entry) => entry.status !== 'tracked-blocked')
1108
+ .map((entry) => entry.relativeFile);
1060
1109
  return {
1061
1110
  targetId: target.targetId,
1062
1111
  canonicalFilePath,
1063
1112
  files,
1064
1113
  changed: canonicalChanged || files.some((file) => file.changed) || retiredFiles.length > 0,
1065
1114
  ...(retiredFiles.length > 0 ? { retiredFiles } : {}),
1115
+ ...(legacyAgentPathWrappers.length > 0 ? { legacyAgentPathWrappers } : {}),
1066
1116
  };
1067
1117
  }
@@ -696,8 +696,12 @@ async function executeRootOwnedYoloop(input) {
696
696
  && epicIntegration.ready === false
697
697
  && integrationReasonCodes.length > 0
698
698
  && integrationReasonCodes.every((reasonCode) => reasonCode === 'epic-aggregate-qa-receipt-required'
699
+ || reasonCode === 'epic-aggregate-qa-graph-stale'
700
+ || reasonCode === 'epic-aggregate-qa-expired'
701
+ || reasonCode === 'epic-head-reconciliation-bindings-incomplete'
699
702
  || reasonCode === 'epic-origin-binding-required'
700
- || /^missing-story-checkpoint:[A-Za-z0-9._-]+$/.test(reasonCode));
703
+ || /^missing-story-checkpoint:[A-Za-z0-9._-]+$/.test(reasonCode)
704
+ || /^scheduling-checkpoint-evidence-missing:[A-Za-z0-9._-]+$/.test(reasonCode));
701
705
  // P223 release admission has already completed for this root invocation.
702
706
  // Only now may the client produce the physical aggregate/origin evidence
703
707
  // needed for the server to emit the terminal Git directive. This avoids a
@@ -1,5 +1,5 @@
1
1
  import { type YoloChangeEvidence } from '../../../shared/dist/yolo/change-evidence.js';
2
- export type YoloChangeEvidenceReason = 'invalid-default-branch' | 'repository-root-mismatch' | 'runtime-state-unavailable' | 'lease-owner-mismatch' | 'lease-invalid-or-nonsetup' | 'execution-branch-mismatch' | 'base-ref-missing' | 'base-observation-unavailable' | 'base-object-missing' | 'base-not-ancestor' | 'diff-read-unavailable' | `direct-yolo-${string}`;
2
+ export type YoloChangeEvidenceReason = 'invalid-default-branch' | 'repository-root-mismatch' | 'runtime-state-unavailable' | 'lease-owner-mismatch' | 'lease-invalid-or-nonsetup' | 'execution-branch-mismatch' | 'base-ref-missing' | 'base-observation-unavailable' | 'base-observation-timeout' | 'base-object-missing' | 'base-not-ancestor' | 'diff-read-unavailable' | `direct-yolo-${string}`;
3
3
  export type YoloChangeEvidenceBaseSource = 'active-story-lease' | 'published-execution-branch' | 'local-default-branch' | 'remote-default-branch' | 'none';
4
4
  export interface YoloChangeEvidenceDiagnostic {
5
5
  readonly reason: YoloChangeEvidenceReason;
@@ -21,7 +21,7 @@ function fallbackAction(reason) {
21
21
  || reason === 'direct-yolo-writer-active')
22
22
  return 'resolve-lease-conflict';
23
23
  if (reason === 'base-ref-missing' || reason === 'base-observation-unavailable'
24
- || reason === 'base-object-missing' || reason === 'base-not-ancestor'
24
+ || reason === 'base-observation-timeout' || reason === 'base-object-missing' || reason === 'base-not-ancestor'
25
25
  || reason === 'diff-read-unavailable')
26
26
  return 'restore-verified-base-evidence';
27
27
  if (reason === 'execution-branch-mismatch'
@@ -104,6 +104,29 @@ function git(root, args, reason, baseSource, reconciliation) {
104
104
  unavailable(reason, baseSource, reconciliation);
105
105
  }
106
106
  }
107
+ // Remote observation crosses the network: local Git reads keep the 3 s bound,
108
+ // but `ls-remote` gets a longer bound and one retry, and a timeout is reported
109
+ // distinctly so a slow network is never mistaken for missing base evidence.
110
+ const REMOTE_OBSERVATION_TIMEOUT_MS = 15_000;
111
+ const REMOTE_OBSERVATION_ATTEMPTS = 2;
112
+ function gitRemote(root, args, baseSource, reconciliation) {
113
+ let timedOut = false;
114
+ for (let attempt = 0; attempt < REMOTE_OBSERVATION_ATTEMPTS; attempt += 1) {
115
+ try {
116
+ return execFileSync('git', ['-C', root, ...args], {
117
+ encoding: 'utf8', timeout: REMOTE_OBSERVATION_TIMEOUT_MS, maxBuffer: 1024 * 1024,
118
+ stdio: ['ignore', 'pipe', 'ignore'],
119
+ env: { ...process.env, GIT_TERMINAL_PROMPT: '0' },
120
+ });
121
+ }
122
+ catch (error) {
123
+ const code = error.code;
124
+ const signal = error.signal;
125
+ timedOut = code === 'ETIMEDOUT' || signal === 'SIGTERM';
126
+ }
127
+ }
128
+ unavailable(timedOut ? 'base-observation-timeout' : 'base-observation-unavailable', baseSource, reconciliation);
129
+ }
107
130
  function gitRefExists(root, ref, reconciliation) {
108
131
  const result = spawnSync('git', ['-C', root, 'show-ref', '--verify', '--quiet', ref], {
109
132
  timeout: 3_000, stdio: 'ignore',
@@ -182,9 +205,9 @@ export function collectYoloChangeEvidence(options) {
182
205
  baseSource = 'active-story-lease';
183
206
  }
184
207
  else {
185
- const remoteLine = executionBranch === null ? '' : git(options.projectRoot, [
208
+ const remoteLine = executionBranch === null ? '' : gitRemote(options.projectRoot, [
186
209
  'ls-remote', '--heads', 'origin', `refs/heads/${executionBranch}`,
187
- ], 'base-observation-unavailable', 'published-execution-branch', reconciliation).trim();
210
+ ], 'published-execution-branch', reconciliation).trim();
188
211
  if (remoteLine) {
189
212
  baseSource = 'published-execution-branch';
190
213
  const match = /^([a-f0-9]{40})\trefs\/heads\/([^\n]+)$/.exec(remoteLine);
@@ -38,6 +38,12 @@ export const EPIC_TERMINAL_GIT_REASON_CODES = Object.freeze({
38
38
  ALREADY_RECONCILED: 'git-resource-already-reconciled',
39
39
  AGGREGATE_QA_REQUIRED: 'epic-aggregate-qa-receipt-required',
40
40
  AGGREGATE_QA_STALE: 'epic-aggregate-qa-receipt-stale',
41
+ /** Head-bound aggregate receipt exists but was produced for an older epic graph epoch. */
42
+ AGGREGATE_QA_GRAPH_STALE: 'epic-aggregate-qa-graph-stale',
43
+ /** Head-bound aggregate receipt on the current epoch is older than the P205 validity window. */
44
+ AGGREGATE_QA_EXPIRED: 'epic-aggregate-qa-expired',
45
+ /** Scheduling evidence exists, but the head reconciliation receipt does not bind every story. */
46
+ HEAD_RECONCILIATION_BINDINGS_INCOMPLETE: 'epic-head-reconciliation-bindings-incomplete',
41
47
  ORIGIN_BINDING_REQUIRED: 'epic-origin-binding-required',
42
48
  PROVIDER_TRUTH_UNKNOWN: 'git-resource-provider-truth-unknown',
43
49
  WORKTREE_ACTIVE: 'git-resource-worktree-active',
@@ -51,6 +57,12 @@ export const EPIC_TERMINAL_GIT_REASON_CODES = Object.freeze({
51
57
  PR_BASE_GUARD_UNVERIFIABLE: 'epic-terminal-pr-base-guard-unverifiable',
52
58
  PR_MERGE_QUEUE_LOCAL_GATE_REQUIRED: 'epic-terminal-pr-merge-queue-local-gate-required',
53
59
  });
60
+ /**
61
+ * Per-story reason prefix (`scheduling-checkpoint-evidence-missing:<storyId>`)
62
+ * for the yoloop scheduling-evidence lane, where the integration checkpoint is
63
+ * deliberately withheld and `missing-story-checkpoint` would be misleading.
64
+ */
65
+ export const EPIC_SCHEDULING_EVIDENCE_MISSING_PREFIX = 'scheduling-checkpoint-evidence-missing:';
54
66
  export function epicHeadReconciliationRangeDigest(lastAcceptedCheckpointHeadSha, executionHeadSha, reconciliationCommitShas) {
55
67
  return createHash('sha256').update([
56
68
  'epic-head-reconciliation-range-v1',
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v4.60.79 | OrNexus Team
1
+ # 🧠 Neocortex v4.60.81 | OrNexus Team
2
2
 
3
3
  This project uses Neocortex, a Development Orchestrator.
4
4
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.79 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.81 | OrNexus Team"
4
4
  ---
5
5
 
6
6
  <!--
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex Root Agent'
5
5
  title: 'Development Orchestrator (Root)'
6
6
  icon: '>'
7
- version: '4.60.79'
7
+ version: '4.60.81'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex Root Agent v4.60.79 | OrNexus Team"
3
+ description: "🧠 Neocortex Root Agent v4.60.81 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  tools:
@@ -109,7 +109,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
109
109
  ┌────────────────────────────────────────────────────────────┐
110
110
  │ │
111
111
  │ ####### N E O C O R T E X │
112
- │ ### ######## v4.60.79 │
112
+ │ ### ######## v4.60.81 │
113
113
  │ ######### ##### │
114
114
  │ ## ############## Development Orchestrator │
115
115
  │ ## ### ###### ## OrNexus Team │
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex'
5
5
  title: 'Development Orchestrator'
6
6
  icon: '>'
7
- version: '4.60.79'
7
+ version: '4.60.81'
8
8
  architecture: 'thin-client'
9
9
  module: stand-alone
10
10
  hasSidecar: false
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.79 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.81 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  permissionMode: bypassPermissions
@@ -107,7 +107,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
107
107
  ┌────────────────────────────────────────────────────────────┐
108
108
  │ │
109
109
  │ ####### N E O C O R T E X │
110
- │ ### ######## v4.60.79 │
110
+ │ ### ######## v4.60.81 │
111
111
  │ ######### ##### │
112
112
  │ ## ############## Development Orchestrator │
113
113
  │ ## ### ###### ## OrNexus Team │
@@ -32,7 +32,7 @@ Codex built-in commands or actions.
32
32
 
33
33
  <!-- END: Plugin Conflict Prevention -->
34
34
 
35
- # Neocortex v4.60.79 | OrNexus Team
35
+ # Neocortex v4.60.81 | OrNexus Team
36
36
 
37
37
  You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
38
38
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.79 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.81 | OrNexus Team"
4
4
  model: inherit
5
5
  readonly: false
6
6
  is_background: false
@@ -93,7 +93,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
93
93
  ┌────────────────────────────────────────────────────────────┐
94
94
  │ │
95
95
  │ ####### N E O C O R T E X │
96
- │ ### ######## v4.60.79 │
96
+ │ ### ######## v4.60.81 │
97
97
  │ ######### ##### │
98
98
  │ ## ############## Development Orchestrator │
99
99
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex v4.60.79 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.81 | OrNexus Team"
4
4
  kind: local
5
5
  tools:
6
6
  # File operations (Gemini CLI built-ins)
@@ -62,7 +62,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
62
62
  ┌────────────────────────────────────────────────────────────┐
63
63
  │ │
64
64
  │ ####### N E O C O R T E X │
65
- │ ### ######## v4.60.79 │
65
+ │ ### ######## v4.60.81 │
66
66
  │ ######### ##### │
67
67
  │ ## ############## Development Orchestrator │
68
68
  │ ## ### ###### ## OrNexus Team │
@@ -64,7 +64,7 @@ task directive, I keep root-owned inline/shell-loop execution.
64
64
  ┌────────────────────────────────────────────────────────────┐
65
65
  │ │
66
66
  │ ####### N E O C O R T E X │
67
- │ ### ######## v4.60.79 │
67
+ │ ### ######## v4.60.81 │
68
68
  │ ######### ##### │
69
69
  │ ## ############## Development Orchestrator │
70
70
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "neocortex"
3
- description: "Neocortex v4.60.79 | OrNexus Team"
3
+ description: "Neocortex v4.60.81 | OrNexus Team"
4
4
  tools:
5
5
  # Read / Edit (built-in tool sets)
6
6
  - read
@@ -72,7 +72,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
72
72
  ┌────────────────────────────────────────────────────────────┐
73
73
  │ │
74
74
  │ ####### N E O C O R T E X │
75
- │ ### ######## v4.60.79 │
75
+ │ ### ######## v4.60.81 │
76
76
  │ ######### ##### │
77
77
  │ ## ############## Development Orchestrator │
78
78
  │ ## ### ###### ## OrNexus Team │