@ornexus/neocortex 4.60.73 → 4.60.74

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 (241) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1216 -1210
  3. package/install.ps1 +1 -1
  4. package/install.sh +1 -1
  5. package/package.json +2 -2
  6. package/packages/client/dist/adapters/adapter-registry.js +1 -108
  7. package/packages/client/dist/adapters/antigravity-adapter.js +2 -77
  8. package/packages/client/dist/adapters/claude-code-adapter.js +3 -79
  9. package/packages/client/dist/adapters/codex-adapter.js +2 -80
  10. package/packages/client/dist/adapters/cursor-adapter.js +4 -115
  11. package/packages/client/dist/adapters/gemini-adapter.js +2 -71
  12. package/packages/client/dist/adapters/grok-adapter.js +2 -42
  13. package/packages/client/dist/adapters/index.js +1 -22
  14. package/packages/client/dist/adapters/platform-detector.js +1 -212
  15. package/packages/client/dist/adapters/target-adapter.js +0 -12
  16. package/packages/client/dist/adapters/vscode-adapter.js +2 -72
  17. package/packages/client/dist/agent/refresh-stubs.js +2 -417
  18. package/packages/client/dist/agent/update-agent-yaml.js +1 -102
  19. package/packages/client/dist/agent/update-description.js +1 -251
  20. package/packages/client/dist/cache/crypto-utils.js +1 -78
  21. package/packages/client/dist/cache/encrypted-cache.js +1 -108
  22. package/packages/client/dist/cache/in-memory-asset-cache.js +1 -73
  23. package/packages/client/dist/cache/index.js +1 -13
  24. package/packages/client/dist/cache/protected-pi-boundary.js +1 -44
  25. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +2 -127
  26. package/packages/client/dist/checkpoint/index.js +1 -11
  27. package/packages/client/dist/checkpoint/shared-checkpoint-types.js +1 -32
  28. package/packages/client/dist/cli.js +5 -358
  29. package/packages/client/dist/commands/activate.js +8 -394
  30. package/packages/client/dist/commands/architecture-answers.js +7 -274
  31. package/packages/client/dist/commands/architecture-memory-terminal.js +4 -253
  32. package/packages/client/dist/commands/architecture-non-ui-continuation.js +1 -100
  33. package/packages/client/dist/commands/architecture-root-binding.js +1 -51
  34. package/packages/client/dist/commands/cache-status.js +2 -112
  35. package/packages/client/dist/commands/config.js +1 -88
  36. package/packages/client/dist/commands/doctor.js +2 -635
  37. package/packages/client/dist/commands/invoke.js +143 -7200
  38. package/packages/client/dist/commands/legacy-epic-terminal.js +1 -71
  39. package/packages/client/dist/commands/legacy-story-branch.js +1 -96
  40. package/packages/client/dist/commands/legacy-story-pr.js +1 -276
  41. package/packages/client/dist/commands/mutation-qa-checkpoint.js +5 -285
  42. package/packages/client/dist/commands/mutation-qa-gate.js +1 -54
  43. package/packages/client/dist/commands/mutation-qa-git.js +1 -41
  44. package/packages/client/dist/commands/mutation-qa-policy.js +1 -102
  45. package/packages/client/dist/commands/mutation-qa-run.js +3 -219
  46. package/packages/client/dist/commands/mutation-qa-verdict.js +1 -149
  47. package/packages/client/dist/commands/mutation-qa.js +1 -220
  48. package/packages/client/dist/commands/native-agent.js +2 -136
  49. package/packages/client/dist/commands/planning-diagnosis.js +1 -43
  50. package/packages/client/dist/commands/planning-generation.js +1 -53
  51. package/packages/client/dist/commands/planning-memory.js +1 -40
  52. package/packages/client/dist/commands/planning-research.js +1 -42
  53. package/packages/client/dist/commands/private-session.js +1 -75
  54. package/packages/client/dist/commands/property-qa.js +1 -139
  55. package/packages/client/dist/commands/qa-control.js +1 -16
  56. package/packages/client/dist/commands/qa-scan-browser-launch.js +1 -55
  57. package/packages/client/dist/commands/qa-scan-browser-route.js +1 -28
  58. package/packages/client/dist/commands/qa-scan-capture.js +5 -663
  59. package/packages/client/dist/commands/qa-scan-discovery.js +3 -376
  60. package/packages/client/dist/commands/qa-scan-review.js +5 -826
  61. package/packages/client/dist/commands/qa-synthetic-backend-capture.js +1 -266
  62. package/packages/client/dist/commands/qa-synthetic-backend-review.js +1 -297
  63. package/packages/client/dist/commands/qa-synthetic-backend.js +2 -340
  64. package/packages/client/dist/commands/qa-synthetic-broker-port.js +1 -85
  65. package/packages/client/dist/commands/qa-synthetic-browser.js +1 -39
  66. package/packages/client/dist/commands/refactor-characterization.js +21 -671
  67. package/packages/client/dist/commands/refactor-commit.js +13 -399
  68. package/packages/client/dist/commands/refactor-control.js +3 -142
  69. package/packages/client/dist/commands/refactor-cpp-assertions.js +3 -93
  70. package/packages/client/dist/commands/refactor-review.js +5 -283
  71. package/packages/client/dist/commands/refactor-root.js +7 -588
  72. package/packages/client/dist/commands/refresh-memory.js +3 -156
  73. package/packages/client/dist/commands/shared-architecture-non-ui.js +1 -24
  74. package/packages/client/dist/commands/story-checkpoint.js +1 -171
  75. package/packages/client/dist/config/profile-directory.js +1 -13
  76. package/packages/client/dist/config/resolver-selection.js +1 -278
  77. package/packages/client/dist/config/secure-config.js +12 -281
  78. package/packages/client/dist/config.js +2 -223
  79. package/packages/client/dist/constants.js +1 -25
  80. package/packages/client/dist/context/context-collector.js +2 -222
  81. package/packages/client/dist/context/context-sanitizer.js +1 -145
  82. package/packages/client/dist/continuity/autonomous-governance.js +1 -285
  83. package/packages/client/dist/continuity/continuity-client-state-store.js +1 -1587
  84. package/packages/client/dist/continuity/invoke-hooks.js +1 -129
  85. package/packages/client/dist/continuity/migrations/001-initial-schema.js +2 -12
  86. package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +2 -12
  87. package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +2 -12
  88. package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +2 -12
  89. package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +2 -12
  90. package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +2 -10
  91. package/packages/client/dist/continuity/native-agent-store.js +1 -69
  92. package/packages/client/dist/continuity/native-agent-types.js +1 -90
  93. package/packages/client/dist/continuity/outbox.js +1 -117
  94. package/packages/client/dist/continuity/runner-bootstrap-policy.js +1 -172
  95. package/packages/client/dist/continuity/sqlite-store.js +81 -2612
  96. package/packages/client/dist/effects/invoke-effect-gateways.js +1 -62
  97. package/packages/client/dist/errors/error-messages.js +2 -228
  98. package/packages/client/dist/errors/frontmatter-diagnostics.js +1 -125
  99. package/packages/client/dist/evidence/collector.js +1 -347
  100. package/packages/client/dist/evidence/index.js +1 -1
  101. package/packages/client/dist/evidence/types.js +0 -2
  102. package/packages/client/dist/fs/atomic-state-replace.js +1 -152
  103. package/packages/client/dist/generated/command-registry.generated.js +1 -4076
  104. package/packages/client/dist/generated/public-projections.generated.js +1 -149
  105. package/packages/client/dist/git/direct-yolo-c01-retry.js +4 -138
  106. package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -1234
  107. package/packages/client/dist/git/epic-operational-state.js +2 -672
  108. package/packages/client/dist/git/git-lifecycle-step-ids.js +1 -14
  109. package/packages/client/dist/git/git-lifecycle-store.d.ts +23 -0
  110. package/packages/client/dist/git/git-lifecycle-store.js +10 -1981
  111. package/packages/client/dist/git/legacy-story-branch-checkpoint.js +9 -259
  112. package/packages/client/dist/git/legacy-story-branch-setup.js +4 -348
  113. package/packages/client/dist/git/legacy-story-pr.js +70 -3538
  114. package/packages/client/dist/git/secure-filesystem-boundary.js +5 -182
  115. package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -284
  116. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -237
  117. package/packages/client/dist/i18n/first-run.js +2 -60
  118. package/packages/client/dist/index.js +1 -47
  119. package/packages/client/dist/invocation/invoke-input.js +1 -24
  120. package/packages/client/dist/license/index.js +1 -5
  121. package/packages/client/dist/license/license-client.js +1 -304
  122. package/packages/client/dist/machine/fingerprint.js +2 -163
  123. package/packages/client/dist/machine/index.js +1 -5
  124. package/packages/client/dist/memory/project-memory-path-scope.js +1 -62
  125. package/packages/client/dist/memory/project-memory-writer.js +40 -1007
  126. package/packages/client/dist/memory/shared-project-memory-types.js +2 -253
  127. package/packages/client/dist/migrations/epic-lifecycle-backfill.js +3 -1060
  128. package/packages/client/dist/migrations/project-identity-capability.js +1 -50
  129. package/packages/client/dist/migrations/project-identity.js +7 -493
  130. package/packages/client/dist/migrations/state-json.js +4 -393
  131. package/packages/client/dist/policy/architecture-policy.js +2 -184
  132. package/packages/client/dist/policy/index.js +1 -7
  133. package/packages/client/dist/policy/shared-policy-types.js +0 -38
  134. package/packages/client/dist/policy/subagent-approval-policy.js +1 -55
  135. package/packages/client/dist/private-execution/clean-baseline.js +2 -279
  136. package/packages/client/dist/private-execution/codex-executor.js +4 -574
  137. package/packages/client/dist/private-execution/codex-host-runtime.js +1 -137
  138. package/packages/client/dist/private-execution/codex-lifecycle-guard.js +1 -97
  139. package/packages/client/dist/private-execution/codex-scoped-permissions.js +1 -128
  140. package/packages/client/dist/private-execution/delivery.js +13 -410
  141. package/packages/client/dist/private-execution/diagnosis-root-review.js +2 -294
  142. package/packages/client/dist/private-execution/frozen-handoff.js +6 -19
  143. package/packages/client/dist/private-execution/implementation-validation.js +2 -106
  144. package/packages/client/dist/private-execution/isolated-admission.js +23 -1432
  145. package/packages/client/dist/private-execution/isolated-session.js +5 -725
  146. package/packages/client/dist/private-execution/isolated-workspace.js +1 -122
  147. package/packages/client/dist/private-execution/pact-consumer-runtime.js +3 -409
  148. package/packages/client/dist/private-execution/pact-test-source.js +1 -258
  149. package/packages/client/dist/private-execution/pact-toolchain.js +3 -290
  150. package/packages/client/dist/private-execution/pact-write-set.js +1 -172
  151. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +5 -406
  152. package/packages/client/dist/private-execution/planning-generation-checkpoint.js +5 -462
  153. package/packages/client/dist/private-execution/planning-memory-checkpoint.js +3 -139
  154. package/packages/client/dist/private-execution/planning-research-checkpoint.js +4 -325
  155. package/packages/client/dist/private-execution/private-report-store.js +1 -42
  156. package/packages/client/dist/private-execution/property-test-candidate.js +1 -103
  157. package/packages/client/dist/private-execution/property-test-choices.js +3 -147
  158. package/packages/client/dist/private-execution/property-test-plan.js +7 -271
  159. package/packages/client/dist/private-execution/property-test-review.js +4 -258
  160. package/packages/client/dist/private-execution/property-test-runtime.js +9 -372
  161. package/packages/client/dist/private-execution/property-test-source.js +1 -139
  162. package/packages/client/dist/private-execution/root-checkpoint.js +1 -80
  163. package/packages/client/dist/private-execution/root-memory-git-evidence.js +3 -135
  164. package/packages/client/dist/private-execution/root-memory-recovery.js +1 -93
  165. package/packages/client/dist/private-execution/root-memory-request.js +1 -29
  166. package/packages/client/dist/private-execution/root-memory-scope.js +1 -178
  167. package/packages/client/dist/private-execution/root-memory-writer.js +1 -102
  168. package/packages/client/dist/private-execution/session-lease.js +1 -63
  169. package/packages/client/dist/private-execution/shared-private-admission-types.js +1 -50
  170. package/packages/client/dist/private-execution/shared-project-validation.js +1 -66
  171. package/packages/client/dist/private-execution/shared-root-memory-types.js +1 -61
  172. package/packages/client/dist/private-execution/ux-source-validation.js +1 -372
  173. package/packages/client/dist/private-execution/ux-write-set.js +2 -191
  174. package/packages/client/dist/registry/registry-reconciliation.js +1 -234
  175. package/packages/client/dist/resilience/circuit-breaker.js +1 -170
  176. package/packages/client/dist/resilience/degradation-manager.js +1 -164
  177. package/packages/client/dist/resilience/freshness-indicator.js +1 -100
  178. package/packages/client/dist/resilience/index.js +1 -8
  179. package/packages/client/dist/resilience/recovery-detector.js +1 -74
  180. package/packages/client/dist/resolvers/asset-resolver.js +0 -13
  181. package/packages/client/dist/resolvers/local-resolver.js +8 -255
  182. package/packages/client/dist/resolvers/remote-resolver.js +1 -233
  183. package/packages/client/dist/runner/binary.js +1 -404
  184. package/packages/client/dist/runner/cli.js +17 -1571
  185. package/packages/client/dist/runner/headless/adapters.js +1 -49
  186. package/packages/client/dist/runner/headless/claude-code-adapter.js +1 -79
  187. package/packages/client/dist/runner/headless/continuous-story-workspace.js +11 -1628
  188. package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -69
  189. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.d.ts +1 -1
  190. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +2 -110
  191. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +2 -0
  192. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +10 -1236
  193. package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +18 -2
  194. package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -318
  195. package/packages/client/dist/runner/headless/fake-adapter.js +1 -62
  196. package/packages/client/dist/runner/headless/managed-profile.js +1 -132
  197. package/packages/client/dist/runner/headless/opencode-adapter.js +2 -145
  198. package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -43
  199. package/packages/client/dist/runner/headless/resolver.js +1 -231
  200. package/packages/client/dist/runner/headless/run-yolo.js +1 -885
  201. package/packages/client/dist/runner/headless/run-yoloop.d.ts +1 -0
  202. package/packages/client/dist/runner/headless/run-yoloop.js +2 -2574
  203. package/packages/client/dist/runner/headless/types.js +2 -574
  204. package/packages/client/dist/runner/local-console.js +13 -396
  205. package/packages/client/dist/runner/portal-sync-worker.js +1 -1487
  206. package/packages/client/dist/runner/project-identity.js +1 -106
  207. package/packages/client/dist/runner/scheduler.js +7 -995
  208. package/packages/client/dist/runner-cli.js +2 -18
  209. package/packages/client/dist/state/invocation-shape.js +1 -13
  210. package/packages/client/dist/state/project-state-snapshot.js +1 -1731
  211. package/packages/client/dist/state/state-json-repair.js +3 -785
  212. package/packages/client/dist/state/structural-dag-projection.js +1 -118
  213. package/packages/client/dist/telemetry/index.js +1 -5
  214. package/packages/client/dist/telemetry/offline-queue.js +1 -131
  215. package/packages/client/dist/tier/index.js +1 -5
  216. package/packages/client/dist/tier/tier-aware-client.js +1 -405
  217. package/packages/client/dist/types/index.js +1 -38
  218. package/packages/client/dist/version.js +1 -27
  219. package/packages/client/dist/yolo/change-evidence-collector.js +1 -126
  220. package/packages/client/dist/yolo/invoke-envelope-capability.js +1 -62
  221. package/packages/client/dist/yolo/spec-envelope-collector.js +5 -184
  222. package/packages/client/dist/yoloop/discovery-hook.js +2 -300
  223. package/packages/client/dist/yoloop/index.js +1 -8
  224. package/packages/client/dist/yoloop/invoke-hooks.js +12 -669
  225. package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1007
  226. package/packages/client/dist/yoloop/shared-yoloop-types.js +1 -33
  227. package/packages/client/dist/yoloop/target-normalization.js +1 -180
  228. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1 -1920
  229. package/packages/shared/dist/yolo/change-evidence.js +1 -1
  230. package/packages/shared/dist/yoloop/epic-terminal-git.js +144 -2
  231. package/targets-stubs/antigravity/gemini.md +1 -1
  232. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  233. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  234. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  235. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  236. package/targets-stubs/claude-code/neocortex.md +2 -2
  237. package/targets-stubs/codex/AGENTS.md +1 -1
  238. package/targets-stubs/cursor/agent.md +2 -2
  239. package/targets-stubs/gemini-cli/agent.md +2 -2
  240. package/targets-stubs/opencode/neocortex-root.md +1 -1
  241. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -1,7 +1,7 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { posix } from 'node:path';
3
3
  const SHA = /^[a-f0-9]{40}(?:[a-f0-9]{24})?$/;
4
- const PATH = /^[A-Za-z0-9_.-][A-Za-z0-9_./ -]{0,239}$/;
4
+ const PATH = /^[A-Za-z0-9_.\[\]-][A-Za-z0-9_./ \[\]-]{0,239}$/;
5
5
  const UNSAFE = /(^|\/)(?:\.env(?:\.|$)|secrets?|credentials?|private-prompts?|customer-data)(?:\/|$)|(?:token|password|license[_-]?key|secret)[=:]/i;
6
6
  function digest(paths) {
7
7
  return createHash('sha256').update(JSON.stringify(paths)).digest('hex');
@@ -1,4 +1,17 @@
1
1
  /** Public contracts and pure safety decisions for epic-owned terminal Git. */
2
+ import { createHash } from 'node:crypto';
3
+ /**
4
+ * P205 complete-gate budgets are declared in config/release-gates.v2.json and
5
+ * mirrored here so installed clients keep the same closed runtime bounds.
6
+ * release-gates.test.mjs prevents either side from drifting independently.
7
+ */
8
+ export const P205_RELEASE_GATE_BUDGETS = Object.freeze({
9
+ completeGateWorstCaseMs: 45 * 60 * 1000,
10
+ cancellationGraceMs: 5 * 60 * 1000,
11
+ aggregateValidityMs: 2 * 60 * 60 * 1000,
12
+ terminalWorkflowMaxDurationMs: 2 * 60 * 60 * 1000,
13
+ });
14
+ export const P205_ROOT_INVOKE_TIMEOUT_MS = P205_RELEASE_GATE_BUDGETS.completeGateWorstCaseMs + P205_RELEASE_GATE_BUDGETS.cancellationGraceMs;
2
15
  export const EPIC_TERMINAL_GIT_REASON_CODES = Object.freeze({
3
16
  READY: 'epic-terminal-git-ready',
4
17
  ALREADY_COMPLETE: 'epic-terminal-git-already-complete',
@@ -38,6 +51,96 @@ export const EPIC_TERMINAL_GIT_REASON_CODES = Object.freeze({
38
51
  PR_BASE_GUARD_UNVERIFIABLE: 'epic-terminal-pr-base-guard-unverifiable',
39
52
  PR_MERGE_QUEUE_LOCAL_GATE_REQUIRED: 'epic-terminal-pr-merge-queue-local-gate-required',
40
53
  });
54
+ export function epicHeadReconciliationRangeDigest(lastAcceptedCheckpointHeadSha, executionHeadSha, reconciliationCommitShas) {
55
+ return createHash('sha256').update([
56
+ 'epic-head-reconciliation-range-v1',
57
+ lastAcceptedCheckpointHeadSha,
58
+ executionHeadSha,
59
+ ...reconciliationCommitShas,
60
+ ].join('\0')).digest('hex');
61
+ }
62
+ export function epicHeadReconciliationPathsDigest(paths) {
63
+ return createHash('sha256').update(paths.join('\0')).digest('hex');
64
+ }
65
+ export function epicHeadReconciliationInputDigest(value) {
66
+ return createHash('sha256').update(JSON.stringify({
67
+ schemaVersion: value.schemaVersion,
68
+ kind: value.kind,
69
+ producer: value.producer,
70
+ epicId: value.epicId,
71
+ executionBranch: value.executionBranch,
72
+ originBranch: value.originBranch,
73
+ graphRevision: value.graphRevision,
74
+ originHeadSha: value.originHeadSha,
75
+ lastAcceptedCheckpointHeadSha: value.lastAcceptedCheckpointHeadSha,
76
+ executionHeadSha: value.executionHeadSha,
77
+ acceptedCheckpointIds: value.acceptedCheckpointIds,
78
+ acceptedCheckpointHeads: value.acceptedCheckpointHeads,
79
+ reconciliationCommitShas: value.reconciliationCommitShas,
80
+ commitRangeDigest: value.commitRangeDigest,
81
+ changedPaths: value.changedPaths,
82
+ changedPathsDigest: value.changedPathsDigest,
83
+ allowedWriteSet: value.allowedWriteSet,
84
+ allowedWriteSetDigest: value.allowedWriteSetDigest,
85
+ aggregateReceiptRef: value.aggregateReceiptRef,
86
+ aggregateManifestDigest: value.aggregateManifestDigest,
87
+ aggregateResultDigest: value.aggregateResultDigest,
88
+ producedAt: value.producedAt,
89
+ revalidatedAt: value.revalidatedAt,
90
+ publicSafe: value.publicSafe,
91
+ })).digest('hex');
92
+ }
93
+ export function validateEpicHeadReconciliationReceipt(value, expected) {
94
+ if (!value || value.schemaVersion !== 1 || value.kind !== 'epic_head_reconciliation'
95
+ || value.producer !== 'client-p205-head-reconciliation-v1' || value.publicSafe !== true
96
+ || !nonEmpty(value.epicId) || !nonEmpty(value.executionBranch) || !nonEmpty(value.originBranch)
97
+ || !Array.isArray(value.acceptedCheckpointIds) || !Array.isArray(value.acceptedCheckpointHeads)
98
+ || !Array.isArray(value.reconciliationCommitShas) || !Array.isArray(value.changedPaths)
99
+ || !Array.isArray(value.allowedWriteSet)
100
+ || value.epicId !== expected.epicId || value.executionBranch !== expected.executionBranch
101
+ || value.originBranch !== expected.originBranch || value.graphRevision !== expected.graphRevision
102
+ || value.originHeadSha !== expected.originHeadSha || value.executionHeadSha !== expected.executionHeadSha
103
+ || value.lastAcceptedCheckpointHeadSha !== expected.acceptedCheckpointHeads.at(-1)
104
+ || !sameOrdered(value.acceptedCheckpointIds, expected.acceptedCheckpointIds)
105
+ || !sameOrdered(value.acceptedCheckpointHeads, expected.acceptedCheckpointHeads)
106
+ || value.aggregateReceiptRef !== expected.aggregateQaReceipt.receiptRef
107
+ || value.aggregateManifestDigest !== expected.aggregateQaReceipt.manifestDigest
108
+ || value.aggregateResultDigest !== expected.aggregateQaReceipt.resultDigest
109
+ || !nonEmpty(value.aggregateReceiptRef) || !isHash(value.aggregateManifestDigest)
110
+ || !isHash(value.aggregateResultDigest) || !nonEmpty(value.producedAt) || !nonEmpty(value.revalidatedAt)
111
+ || value.acceptedCheckpointIds.length === 0 || value.acceptedCheckpointIds.length > 2_048
112
+ || value.acceptedCheckpointIds.some((id) => !nonEmpty(id) || id.length > 240)
113
+ || value.reconciliationCommitShas.length > 2_048
114
+ || value.changedPaths.length > 2_048
115
+ || value.allowedWriteSet.length === 0 || value.allowedWriteSet.length > 2_048
116
+ || (value.lastAcceptedCheckpointHeadSha !== value.executionHeadSha
117
+ && (value.reconciliationCommitShas.length === 0 || value.changedPaths.length === 0))
118
+ || (value.lastAcceptedCheckpointHeadSha === value.executionHeadSha
119
+ && (value.reconciliationCommitShas.length !== 0 || value.changedPaths.length !== 0))
120
+ || !isFullSha(value.originHeadSha) || !isFullSha(value.lastAcceptedCheckpointHeadSha)
121
+ || !isFullSha(value.executionHeadSha) || !isHash(value.graphRevision)
122
+ || value.acceptedCheckpointHeads.some((sha) => !isFullSha(sha))
123
+ || value.reconciliationCommitShas.some((sha) => !isFullSha(sha))
124
+ || !sameOrdered(value.changedPaths, [...new Set(value.changedPaths)].sort())
125
+ || !sameOrdered(value.allowedWriteSet, [...new Set(value.allowedWriteSet)].sort())
126
+ || value.changedPaths.some((path) => !safeRepositoryPath(path))
127
+ || value.allowedWriteSet.some((path) => !safeWriteScope(path))
128
+ || value.changedPaths.some((path) => !value.allowedWriteSet.some((scope) => writeScopeCovers(scope, path)))
129
+ || value.commitRangeDigest !== epicHeadReconciliationRangeDigest(value.lastAcceptedCheckpointHeadSha, value.executionHeadSha, value.reconciliationCommitShas)
130
+ || value.changedPathsDigest !== epicHeadReconciliationPathsDigest(value.changedPaths)
131
+ || value.allowedWriteSetDigest !== epicHeadReconciliationPathsDigest(value.allowedWriteSet)
132
+ || value.inputDigest !== epicHeadReconciliationInputDigest(value)
133
+ || !isHash(value.commitRangeDigest) || !isHash(value.changedPathsDigest)
134
+ || !isHash(value.allowedWriteSetDigest) || !isHash(value.inputDigest))
135
+ return false;
136
+ const producedAt = Date.parse(value.producedAt);
137
+ const revalidatedAt = Date.parse(value.revalidatedAt);
138
+ const now = Date.parse(expected.nowIso);
139
+ return Number.isFinite(producedAt) && Number.isFinite(revalidatedAt) && Number.isFinite(now)
140
+ && revalidatedAt >= producedAt
141
+ && now - revalidatedAt <= P205_RELEASE_GATE_BUDGETS.aggregateValidityMs
142
+ && revalidatedAt - now <= P205_RELEASE_GATE_BUDGETS.cancellationGraceMs;
143
+ }
41
144
  export function validateEpicTerminalGitDirective(directive, actual) {
42
145
  const reasons = [];
43
146
  if (!nonEmpty(directive.originBranch))
@@ -76,8 +179,8 @@ export function validateEpicTerminalGitDirective(directive, actual) {
76
179
  || !directive.localGates.receiptRefs.includes(aggregate.receiptRef)) {
77
180
  reasons.push(EPIC_TERMINAL_GIT_REASON_CODES.AGGREGATE_QA_REQUIRED);
78
181
  }
79
- else if (!Number.isFinite(Date.parse(aggregate.checkedAt)) || actual.nowIso && (Date.parse(actual.nowIso) - Date.parse(aggregate.checkedAt) > 30 * 60 * 1000
80
- || Date.parse(aggregate.checkedAt) - Date.parse(actual.nowIso) > 5 * 60 * 1000)) {
182
+ else if (!Number.isFinite(Date.parse(aggregate.checkedAt)) || actual.nowIso && (Date.parse(actual.nowIso) - Date.parse(aggregate.checkedAt) > P205_RELEASE_GATE_BUDGETS.aggregateValidityMs
183
+ || Date.parse(aggregate.checkedAt) - Date.parse(actual.nowIso) > P205_RELEASE_GATE_BUDGETS.cancellationGraceMs)) {
81
184
  reasons.push(EPIC_TERMINAL_GIT_REASON_CODES.AGGREGATE_QA_STALE);
82
185
  }
83
186
  const originBinding = actual.originBinding;
@@ -90,6 +193,24 @@ export function validateEpicTerminalGitDirective(directive, actual) {
90
193
  || !Number.isFinite(Date.parse(originBinding.capturedAt))) {
91
194
  reasons.push(EPIC_TERMINAL_GIT_REASON_CODES.ORIGIN_BINDING_REQUIRED);
92
195
  }
196
+ const directedReconciliation = directive.localGates?.headReconciliationReceipt;
197
+ const actualReconciliation = actual.headReconciliationReceipt;
198
+ if (directedReconciliation && (!actualReconciliation || !originBinding || !aggregate
199
+ || directedReconciliation.inputDigest !== actualReconciliation.inputDigest
200
+ || !validateEpicHeadReconciliationReceipt(actualReconciliation, {
201
+ epicId: directive.epicId,
202
+ executionBranch: directive.executionBranch,
203
+ originBranch: directive.originBranch,
204
+ graphRevision: directive.graphRevision,
205
+ originHeadSha: originBinding.originHeadSha,
206
+ executionHeadSha: actual.executionHeadSha,
207
+ acceptedCheckpointIds: actual.acceptedCheckpointIds,
208
+ acceptedCheckpointHeads: actualReconciliation.acceptedCheckpointHeads,
209
+ aggregateQaReceipt: aggregate,
210
+ nowIso: actual.nowIso ?? new Date(0).toISOString(),
211
+ }))) {
212
+ reasons.push(EPIC_TERMINAL_GIT_REASON_CODES.AGGREGATE_QA_REQUIRED);
213
+ }
93
214
  if (actual.writerLeaseActive)
94
215
  reasons.push(EPIC_TERMINAL_GIT_REASON_CODES.LEASE_ACTIVE);
95
216
  if (!sameSet(directive.storyCheckpointIds, actual.acceptedCheckpointIds)) {
@@ -220,6 +341,9 @@ function nonEmpty(value) {
220
341
  function isSha(value) {
221
342
  return /^[a-f0-9]{7,64}$/i.test(value);
222
343
  }
344
+ function isFullSha(value) {
345
+ return /^[a-f0-9]{40,64}$/i.test(value);
346
+ }
223
347
  function isHash(value) {
224
348
  return typeof value === 'string' && /^[a-f0-9]{64}$/i.test(value);
225
349
  }
@@ -229,3 +353,21 @@ function unique(values) {
229
353
  function sameSet(left, right) {
230
354
  return left.length === right.length && [...left].sort().every((item, index) => item === [...right].sort()[index]);
231
355
  }
356
+ function sameOrdered(left, right) {
357
+ return left.length === right.length && left.every((item, index) => item === right[index]);
358
+ }
359
+ function safeRepositoryPath(value) {
360
+ return safeWriteScope(value) && !value.endsWith('/');
361
+ }
362
+ function safeWriteScope(value) {
363
+ if (typeof value !== 'string' || value.length === 0 || value.length > 512
364
+ || value.startsWith('/') || value.startsWith('-') || value.includes('\\')
365
+ || value.includes('\0') || value.includes('//'))
366
+ return false;
367
+ const parts = value.replace(/\/$/, '').split('/');
368
+ return parts.length > 0 && parts.every((part) => part.length > 0 && part !== '.' && part !== '..')
369
+ && parts[0] !== '.git';
370
+ }
371
+ function writeScopeCovers(scope, path) {
372
+ return scope === path || scope.endsWith('/') && path.startsWith(scope);
373
+ }
@@ -1,4 +1,4 @@
1
- # 🧠 Neocortex v4.60.73 | OrNexus Team
1
+ # 🧠 Neocortex v4.60.74 | 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.73 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.74 | 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.73'
7
+ version: '4.60.74'
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.73 | OrNexus Team"
3
+ description: "🧠 Neocortex Root Agent v4.60.74 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  tools:
@@ -108,7 +108,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
108
108
  ┌────────────────────────────────────────────────────────────┐
109
109
  │ │
110
110
  │ ####### N E O C O R T E X │
111
- │ ### ######## v4.60.73 │
111
+ │ ### ######## v4.60.74 │
112
112
  │ ######### ##### │
113
113
  │ ## ############## Development Orchestrator │
114
114
  │ ## ### ###### ## OrNexus Team │
@@ -4,7 +4,7 @@ agent:
4
4
  name: 'Neocortex'
5
5
  title: 'Development Orchestrator'
6
6
  icon: '>'
7
- version: '4.60.73'
7
+ version: '4.60.74'
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.73 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.74 | OrNexus Team"
4
4
  model: opus
5
5
  color: blue
6
6
  permissionMode: bypassPermissions
@@ -104,7 +104,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
104
104
  ┌────────────────────────────────────────────────────────────┐
105
105
  │ │
106
106
  │ ####### N E O C O R T E X │
107
- │ ### ######## v4.60.73 │
107
+ │ ### ######## v4.60.74 │
108
108
  │ ######### ##### │
109
109
  │ ## ############## Development Orchestrator │
110
110
  │ ## ### ###### ## OrNexus Team │
@@ -28,7 +28,7 @@ Codex built-in commands or actions.
28
28
 
29
29
  <!-- END: Plugin Conflict Prevention -->
30
30
 
31
- # Neocortex v4.60.73 | OrNexus Team
31
+ # Neocortex v4.60.74 | OrNexus Team
32
32
 
33
33
  You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
34
34
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex
3
- description: "🧠 Neocortex v4.60.73 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.74 | OrNexus Team"
4
4
  model: inherit
5
5
  readonly: false
6
6
  is_background: false
@@ -64,7 +64,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
64
64
  ┌────────────────────────────────────────────────────────────┐
65
65
  │ │
66
66
  │ ####### N E O C O R T E X │
67
- │ ### ######## v4.60.73 │
67
+ │ ### ######## v4.60.74 │
68
68
  │ ######### ##### │
69
69
  │ ## ############## Development Orchestrator │
70
70
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: neocortex-root
3
- description: "🧠 Neocortex v4.60.73 | OrNexus Team"
3
+ description: "🧠 Neocortex v4.60.74 | 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.73 │
65
+ │ ### ######## v4.60.74 │
66
66
  │ ######### ##### │
67
67
  │ ## ############## Development Orchestrator │
68
68
  │ ## ### ###### ## OrNexus Team │
@@ -58,7 +58,7 @@ explicit server opt-in rather than a local assumption.
58
58
  ┌────────────────────────────────────────────────────────────┐
59
59
  │ │
60
60
  │ ####### N E O C O R T E X │
61
- │ ### ######## v4.60.73 │
61
+ │ ### ######## v4.60.74 │
62
62
  │ ######### ##### │
63
63
  │ ## ############## Development Orchestrator │
64
64
  │ ## ### ###### ## OrNexus Team │
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: "neocortex"
3
- description: "Neocortex v4.60.73 | OrNexus Team"
3
+ description: "Neocortex v4.60.74 | OrNexus Team"
4
4
  tools:
5
5
  # Read / Edit (built-in tool sets)
6
6
  - read
@@ -68,7 +68,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
68
68
  ┌────────────────────────────────────────────────────────────┐
69
69
  │ │
70
70
  │ ####### N E O C O R T E X │
71
- │ ### ######## v4.60.73 │
71
+ │ ### ######## v4.60.74 │
72
72
  │ ######### ##### │
73
73
  │ ## ############## Development Orchestrator │
74
74
  │ ## ### ###### ## OrNexus Team │