@ornexus/neocortex 4.60.66 → 4.60.68

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 (236) hide show
  1. package/dist/release-source.json +1 -1
  2. package/dist/sbom.cdx.json +1598 -1640
  3. package/install.ps1 +1 -1
  4. package/install.sh +2 -1
  5. package/package.json +10 -7
  6. package/packages/client/dist/adapters/adapter-registry.js +108 -1
  7. package/packages/client/dist/adapters/antigravity-adapter.js +77 -2
  8. package/packages/client/dist/adapters/claude-code-adapter.js +79 -3
  9. package/packages/client/dist/adapters/codex-adapter.js +80 -2
  10. package/packages/client/dist/adapters/cursor-adapter.js +115 -4
  11. package/packages/client/dist/adapters/gemini-adapter.js +71 -2
  12. package/packages/client/dist/adapters/grok-adapter.js +42 -2
  13. package/packages/client/dist/adapters/index.js +22 -1
  14. package/packages/client/dist/adapters/platform-detector.js +212 -1
  15. package/packages/client/dist/adapters/target-adapter.js +12 -0
  16. package/packages/client/dist/adapters/vscode-adapter.js +72 -2
  17. package/packages/client/dist/agent/refresh-stubs.js +417 -2
  18. package/packages/client/dist/agent/update-agent-yaml.js +102 -1
  19. package/packages/client/dist/agent/update-description.js +251 -1
  20. package/packages/client/dist/cache/crypto-utils.js +78 -1
  21. package/packages/client/dist/cache/encrypted-cache.js +108 -1
  22. package/packages/client/dist/cache/in-memory-asset-cache.js +73 -1
  23. package/packages/client/dist/cache/index.js +13 -1
  24. package/packages/client/dist/cache/protected-pi-boundary.js +44 -1
  25. package/packages/client/dist/checkpoint/checkpoint-client-reader.js +127 -2
  26. package/packages/client/dist/checkpoint/index.js +11 -1
  27. package/packages/client/dist/checkpoint/shared-checkpoint-types.js +32 -1
  28. package/packages/client/dist/cli.js +303 -3
  29. package/packages/client/dist/commands/activate.js +394 -8
  30. package/packages/client/dist/commands/architecture-answers.js +274 -7
  31. package/packages/client/dist/commands/architecture-memory-terminal.js +253 -4
  32. package/packages/client/dist/commands/architecture-non-ui-continuation.js +100 -1
  33. package/packages/client/dist/commands/architecture-root-binding.js +51 -1
  34. package/packages/client/dist/commands/cache-status.js +112 -2
  35. package/packages/client/dist/commands/config.js +88 -1
  36. package/packages/client/dist/commands/doctor.d.ts +135 -0
  37. package/packages/client/dist/commands/doctor.js +635 -0
  38. package/packages/client/dist/commands/invoke.d.ts +18 -0
  39. package/packages/client/dist/commands/invoke.js +7140 -142
  40. package/packages/client/dist/commands/legacy-epic-terminal.js +71 -1
  41. package/packages/client/dist/commands/legacy-story-branch.js +96 -1
  42. package/packages/client/dist/commands/legacy-story-pr.js +276 -1
  43. package/packages/client/dist/commands/mutation-qa-checkpoint.js +285 -5
  44. package/packages/client/dist/commands/mutation-qa-gate.js +54 -1
  45. package/packages/client/dist/commands/mutation-qa-git.js +41 -1
  46. package/packages/client/dist/commands/mutation-qa-policy.js +102 -1
  47. package/packages/client/dist/commands/mutation-qa-run.js +219 -3
  48. package/packages/client/dist/commands/mutation-qa-verdict.js +149 -1
  49. package/packages/client/dist/commands/mutation-qa.js +220 -1
  50. package/packages/client/dist/commands/native-agent.js +136 -2
  51. package/packages/client/dist/commands/planning-diagnosis.js +43 -1
  52. package/packages/client/dist/commands/planning-generation.js +53 -1
  53. package/packages/client/dist/commands/planning-memory.js +40 -1
  54. package/packages/client/dist/commands/planning-research.js +42 -1
  55. package/packages/client/dist/commands/private-session.js +75 -1
  56. package/packages/client/dist/commands/property-qa.js +139 -1
  57. package/packages/client/dist/commands/qa-control.js +16 -1
  58. package/packages/client/dist/commands/qa-scan-browser-launch.js +55 -1
  59. package/packages/client/dist/commands/qa-scan-browser-route.js +28 -1
  60. package/packages/client/dist/commands/qa-scan-capture.js +663 -5
  61. package/packages/client/dist/commands/qa-scan-discovery.js +376 -3
  62. package/packages/client/dist/commands/qa-scan-review.js +826 -5
  63. package/packages/client/dist/commands/qa-synthetic-backend-capture.js +266 -1
  64. package/packages/client/dist/commands/qa-synthetic-backend-review.js +297 -1
  65. package/packages/client/dist/commands/qa-synthetic-backend.js +340 -2
  66. package/packages/client/dist/commands/qa-synthetic-broker-port.js +85 -1
  67. package/packages/client/dist/commands/qa-synthetic-browser.js +39 -1
  68. package/packages/client/dist/commands/refactor-characterization.js +671 -21
  69. package/packages/client/dist/commands/refactor-commit.js +399 -13
  70. package/packages/client/dist/commands/refactor-control.js +142 -3
  71. package/packages/client/dist/commands/refactor-cpp-assertions.js +93 -3
  72. package/packages/client/dist/commands/refactor-review.js +283 -5
  73. package/packages/client/dist/commands/refactor-root.js +588 -7
  74. package/packages/client/dist/commands/refresh-memory.js +156 -3
  75. package/packages/client/dist/commands/shared-architecture-non-ui.js +24 -1
  76. package/packages/client/dist/commands/story-checkpoint.js +171 -1
  77. package/packages/client/dist/config/profile-directory.js +13 -1
  78. package/packages/client/dist/config/resolver-selection.js +278 -1
  79. package/packages/client/dist/config/secure-config.js +281 -12
  80. package/packages/client/dist/config.js +223 -2
  81. package/packages/client/dist/constants.js +25 -1
  82. package/packages/client/dist/context/context-collector.js +222 -2
  83. package/packages/client/dist/context/context-sanitizer.js +145 -1
  84. package/packages/client/dist/continuity/autonomous-governance.js +285 -1
  85. package/packages/client/dist/continuity/continuity-client-state-store.js +1587 -1
  86. package/packages/client/dist/continuity/invoke-hooks.js +129 -1
  87. package/packages/client/dist/continuity/migrations/001-initial-schema.js +12 -2
  88. package/packages/client/dist/continuity/migrations/002-processing-output-summary-indexes.js +12 -2
  89. package/packages/client/dist/continuity/migrations/003-headless-execution-attempts.js +12 -2
  90. package/packages/client/dist/continuity/migrations/004-outbox-delivery-state.js +12 -2
  91. package/packages/client/dist/continuity/migrations/005-bounded-headless-queue.js +12 -2
  92. package/packages/client/dist/continuity/migrations/006-native-agent-dispatches.js +10 -2
  93. package/packages/client/dist/continuity/native-agent-store.js +69 -1
  94. package/packages/client/dist/continuity/native-agent-types.js +90 -1
  95. package/packages/client/dist/continuity/outbox.js +117 -1
  96. package/packages/client/dist/continuity/runner-bootstrap-policy.js +172 -1
  97. package/packages/client/dist/continuity/sqlite-store.js +2536 -81
  98. package/packages/client/dist/effects/invoke-effect-gateways.js +62 -1
  99. package/packages/client/dist/errors/error-messages.js +228 -2
  100. package/packages/client/dist/errors/frontmatter-diagnostics.js +125 -1
  101. package/packages/client/dist/evidence/collector.js +347 -1
  102. package/packages/client/dist/evidence/index.js +1 -1
  103. package/packages/client/dist/evidence/types.js +2 -0
  104. package/packages/client/dist/fs/atomic-state-replace.js +152 -1
  105. package/packages/client/dist/generated/command-registry.generated.js +4076 -1
  106. package/packages/client/dist/generated/public-projections.generated.js +149 -1
  107. package/packages/client/dist/git/direct-yolo-c01-retry.js +138 -4
  108. package/packages/client/dist/git/direct-yolo-checkpoint.js +1234 -4
  109. package/packages/client/dist/git/git-lifecycle-step-ids.js +14 -1
  110. package/packages/client/dist/git/git-lifecycle-store.js +1938 -9
  111. package/packages/client/dist/git/legacy-story-branch-checkpoint.js +259 -9
  112. package/packages/client/dist/git/legacy-story-branch-setup.js +348 -4
  113. package/packages/client/dist/git/legacy-story-pr.js +3538 -70
  114. package/packages/client/dist/git/secure-filesystem-boundary.js +182 -5
  115. package/packages/client/dist/graph-retrieval/pre-command-hook.js +284 -1
  116. package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +237 -1
  117. package/packages/client/dist/i18n/first-run.js +60 -2
  118. package/packages/client/dist/index.js +47 -1
  119. package/packages/client/dist/invocation/invoke-input.js +24 -1
  120. package/packages/client/dist/license/index.js +5 -1
  121. package/packages/client/dist/license/license-client.js +304 -1
  122. package/packages/client/dist/machine/fingerprint.js +163 -2
  123. package/packages/client/dist/machine/index.js +5 -1
  124. package/packages/client/dist/memory/project-memory-path-scope.js +62 -1
  125. package/packages/client/dist/memory/project-memory-writer.js +1007 -40
  126. package/packages/client/dist/memory/shared-project-memory-types.js +253 -2
  127. package/packages/client/dist/migrations/project-identity-capability.js +50 -1
  128. package/packages/client/dist/migrations/project-identity.js +493 -7
  129. package/packages/client/dist/migrations/state-json.js +344 -4
  130. package/packages/client/dist/policy/architecture-policy.js +184 -2
  131. package/packages/client/dist/policy/index.js +7 -1
  132. package/packages/client/dist/policy/shared-policy-types.js +38 -0
  133. package/packages/client/dist/policy/subagent-approval-policy.js +55 -1
  134. package/packages/client/dist/private-execution/clean-baseline.js +279 -2
  135. package/packages/client/dist/private-execution/codex-executor.js +574 -4
  136. package/packages/client/dist/private-execution/codex-host-runtime.js +137 -1
  137. package/packages/client/dist/private-execution/codex-lifecycle-guard.js +97 -1
  138. package/packages/client/dist/private-execution/codex-scoped-permissions.js +128 -1
  139. package/packages/client/dist/private-execution/delivery.js +410 -13
  140. package/packages/client/dist/private-execution/diagnosis-root-review.js +294 -2
  141. package/packages/client/dist/private-execution/frozen-handoff.js +19 -6
  142. package/packages/client/dist/private-execution/implementation-validation.js +106 -2
  143. package/packages/client/dist/private-execution/isolated-admission.js +1432 -23
  144. package/packages/client/dist/private-execution/isolated-session.js +725 -5
  145. package/packages/client/dist/private-execution/isolated-workspace.js +122 -1
  146. package/packages/client/dist/private-execution/pact-consumer-runtime.js +409 -3
  147. package/packages/client/dist/private-execution/pact-test-source.js +258 -1
  148. package/packages/client/dist/private-execution/pact-toolchain.js +290 -3
  149. package/packages/client/dist/private-execution/pact-write-set.js +172 -1
  150. package/packages/client/dist/private-execution/planning-diagnosis-checkpoint.js +406 -5
  151. package/packages/client/dist/private-execution/planning-generation-checkpoint.js +462 -5
  152. package/packages/client/dist/private-execution/planning-memory-checkpoint.js +139 -3
  153. package/packages/client/dist/private-execution/planning-research-checkpoint.js +325 -4
  154. package/packages/client/dist/private-execution/private-report-store.js +42 -1
  155. package/packages/client/dist/private-execution/property-test-candidate.js +103 -1
  156. package/packages/client/dist/private-execution/property-test-choices.js +147 -3
  157. package/packages/client/dist/private-execution/property-test-plan.js +271 -7
  158. package/packages/client/dist/private-execution/property-test-review.js +258 -4
  159. package/packages/client/dist/private-execution/property-test-runtime.js +372 -9
  160. package/packages/client/dist/private-execution/property-test-source.js +139 -1
  161. package/packages/client/dist/private-execution/root-checkpoint.js +80 -1
  162. package/packages/client/dist/private-execution/root-memory-git-evidence.js +135 -3
  163. package/packages/client/dist/private-execution/root-memory-recovery.js +93 -1
  164. package/packages/client/dist/private-execution/root-memory-request.js +29 -1
  165. package/packages/client/dist/private-execution/root-memory-scope.js +178 -1
  166. package/packages/client/dist/private-execution/root-memory-writer.js +102 -1
  167. package/packages/client/dist/private-execution/session-lease.js +63 -1
  168. package/packages/client/dist/private-execution/shared-private-admission-types.js +50 -1
  169. package/packages/client/dist/private-execution/shared-project-validation.js +66 -1
  170. package/packages/client/dist/private-execution/shared-root-memory-types.js +61 -1
  171. package/packages/client/dist/private-execution/ux-source-validation.js +372 -1
  172. package/packages/client/dist/private-execution/ux-write-set.js +191 -2
  173. package/packages/client/dist/resilience/circuit-breaker.js +170 -1
  174. package/packages/client/dist/resilience/degradation-manager.js +164 -1
  175. package/packages/client/dist/resilience/freshness-indicator.js +100 -1
  176. package/packages/client/dist/resilience/index.js +8 -1
  177. package/packages/client/dist/resilience/recovery-detector.js +74 -1
  178. package/packages/client/dist/resolvers/asset-resolver.js +13 -0
  179. package/packages/client/dist/resolvers/local-resolver.js +255 -8
  180. package/packages/client/dist/resolvers/remote-resolver.js +233 -1
  181. package/packages/client/dist/runner/binary.js +404 -1
  182. package/packages/client/dist/runner/cli.js +1571 -17
  183. package/packages/client/dist/runner/headless/adapters.js +49 -1
  184. package/packages/client/dist/runner/headless/claude-code-adapter.js +79 -1
  185. package/packages/client/dist/runner/headless/continuous-story-workspace.js +1628 -11
  186. package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +69 -1
  187. package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +110 -2
  188. package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +1236 -8
  189. package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +318 -2
  190. package/packages/client/dist/runner/headless/fake-adapter.js +62 -1
  191. package/packages/client/dist/runner/headless/managed-profile.js +132 -1
  192. package/packages/client/dist/runner/headless/opencode-adapter.js +145 -2
  193. package/packages/client/dist/runner/headless/prepared-story-bundle.js +43 -1
  194. package/packages/client/dist/runner/headless/resolver.js +231 -1
  195. package/packages/client/dist/runner/headless/run-yolo.js +885 -1
  196. package/packages/client/dist/runner/headless/run-yoloop.d.ts +4 -1
  197. package/packages/client/dist/runner/headless/run-yoloop.js +2574 -2
  198. package/packages/client/dist/runner/headless/types.js +574 -2
  199. package/packages/client/dist/runner/local-console.js +396 -13
  200. package/packages/client/dist/runner/portal-sync-worker.js +1487 -1
  201. package/packages/client/dist/runner/project-identity.js +106 -1
  202. package/packages/client/dist/runner/scheduler.js +995 -7
  203. package/packages/client/dist/runner-cli.js +18 -2
  204. package/packages/client/dist/state/invocation-shape.js +13 -1
  205. package/packages/client/dist/state/project-state-snapshot.js +1677 -1
  206. package/packages/client/dist/state/state-json-repair.js +785 -3
  207. package/packages/client/dist/state/structural-dag-projection.js +118 -1
  208. package/packages/client/dist/telemetry/index.js +5 -1
  209. package/packages/client/dist/telemetry/offline-queue.js +131 -1
  210. package/packages/client/dist/tier/index.js +5 -1
  211. package/packages/client/dist/tier/tier-aware-client.js +405 -1
  212. package/packages/client/dist/types/index.js +38 -1
  213. package/packages/client/dist/version.js +27 -1
  214. package/packages/client/dist/yolo/change-evidence-collector.js +126 -1
  215. package/packages/client/dist/yolo/invoke-envelope-capability.js +62 -1
  216. package/packages/client/dist/yolo/spec-envelope-collector.js +185 -5
  217. package/packages/client/dist/yoloop/discovery-hook.js +300 -2
  218. package/packages/client/dist/yoloop/index.js +8 -1
  219. package/packages/client/dist/yoloop/invoke-hooks.js +669 -12
  220. package/packages/client/dist/yoloop/shared-discover-epics.js +1007 -1
  221. package/packages/client/dist/yoloop/shared-yoloop-types.js +33 -1
  222. package/packages/client/dist/yoloop/target-normalization.js +180 -1
  223. package/packages/client/dist/yoloop/yoloop-client-state-store.js +1723 -1
  224. package/packages/shared/dist/compatibility/index.js +476 -0
  225. package/packages/shared/dist/yoloop/release-blocked.js +653 -0
  226. package/targets-stubs/antigravity/gemini.md +1 -1
  227. package/targets-stubs/antigravity/skill/SKILL.md +3 -2
  228. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  229. package/targets-stubs/claude-code/neocortex-root.md +5 -5
  230. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  231. package/targets-stubs/claude-code/neocortex.md +8 -9
  232. package/targets-stubs/codex/AGENTS.md +3 -3
  233. package/targets-stubs/cursor/agent.md +4 -3
  234. package/targets-stubs/gemini-cli/agent.md +5 -4
  235. package/targets-stubs/opencode/neocortex-root.md +3 -3
  236. package/targets-stubs/vscode/neocortex.agent.md +5 -4
@@ -1,2 +1,253 @@
1
- function i(...t){return t.map(a=>({scope:"project",path:a}))}const e="NEOCORTEX.md",r={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!1,includeFallbackAllowed:!1,requiresWrapperPreservation:!1,fallbackIsCompatibilityRemediation:!0,policy:"mandatory-semantic-symlink",notes:"Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter."},l={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!1,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"symlink-backed-wrapper",notes:"Platform wrapper/frontmatter is allowed only when the semantic memory payload remains symlink-backed by NEOCORTEX.md."},c={canonicalSource:e,semanticFileRequired:!0,symlinkBacked:!0,wrapperAllowed:!0,includeFallbackAllowed:!0,requiresWrapperPreservation:!0,fallbackIsCompatibilityRemediation:!0,policy:"safe-include-fallback",notes:"Use a safe include/import only for platforms that cannot consume symlinks directly; the include must resolve back to NEOCORTEX.md."};function o(t){return{canonicalSource:e,resolvesVia:t.policy,feedbackTrigger:"*update-memory",guidance:"Treat NEOCORTEX.md as canonical project memory; consult it before platform-specific memory, and run *update-memory when durable project context changes should flow back to the canonical source."}}const s=["claude-code","codex","grok","gemini-cli","antigravity","vscode","cursor","opencode","openclaw","kimi","github-copilot-cli"],m={canonical:{targetId:"canonical",platformName:"Neocortex Canonical Memory",canonicalSource:e,primaryFile:e,secondaryFiles:i("AGENTS.md","CLAUDE.md","GEMINI.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"neocortex-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!1,notes:"Canonical compact project memory source for platform symlinks and wrappers. Store only summaries, indexes, and links to architecture docs here."},"claude-code":{targetId:"claude-code",platformName:"Claude Code",canonicalSource:e,primaryFile:"CLAUDE.md",secondaryFiles:i(".claude/agents/neocortex.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"claude-md",budget:{maxLines:320,maxBytes:28e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!1,notes:"Claude Code project memory. Resolve to NEOCORTEX.md; keep root content concise and link deeper docs with @path references."},codex:{targetId:"codex",platformName:"Codex CLI",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:i(".codex/agents/neocortex.toml"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!0,notes:"Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems."},grok:{targetId:"grok",platformName:"Grok Build",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:i(".grok/skills/neocortex/SKILL.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!0,notes:"Grok Build reads AGENTS.md and the project-local Neocortex Skill; both resolve to canonical NEOCORTEX.md context."},"gemini-cli":{targetId:"gemini-cli",platformName:"Gemini CLI",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:i(".gemini/agents/neocortex.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!1,notes:"Gemini CLI context file. Prefer shallow @file.md imports for detailed architecture docs."},antigravity:{targetId:"antigravity",platformName:"Antigravity",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:i(".gemini/agents/neocortex.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!1,notes:"Antigravity currently shares GEMINI.md behavior with the Gemini target stubs."},vscode:{targetId:"vscode",platformName:"VS Code / GitHub Copilot",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:i(".github/instructions/neocortex.instructions.md",".github/agents/neocortex.agent.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:l,bidirectionalReference:o(l),requiresWrapperPreservation:!0,notes:"VS Code and GitHub Copilot always-on repository instructions."},cursor:{targetId:"cursor",platformName:"Cursor",canonicalSource:e,primaryFile:".cursor/rules/neocortex.mdc",secondaryFiles:i("AGENTS.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"cursor-rule",budget:{maxLines:180,maxBytes:14e3},linkRequirement:l,bidirectionalReference:o(l),requiresWrapperPreservation:!0,notes:"Cursor rule memory. Use AGENTS.md as compatibility fallback when Cursor rules are absent."},opencode:{targetId:"opencode",platformName:"OpenCode",canonicalSource:e,primaryFile:"AGENTS.md",secondaryFiles:i(".opencode/AGENTS.md",".opencode/agents/neocortex-root.md",".opencode/agents/neocortex.md",".agent/skills/neocortex/SKILL.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:o(r),requiresWrapperPreservation:!0,notes:"OpenCode agent memory. It consumes AGENTS.md-compatible instructions and must resolve to canonical NEOCORTEX.md."},openclaw:{targetId:"openclaw",platformName:"OpenClaw",canonicalSource:e,primaryFile:".openclaw/skills/neocortex/SKILL.md",secondaryFiles:[{scope:"user",path:".openclaw/skills/neocortex/SKILL.md"}],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:c,bidirectionalReference:o(c),requiresWrapperPreservation:!0,notes:"OpenClaw Skill thin-client memory entrypoint. Use the project Skill path when --create-project is requested; do not mutate ~/.openclaw/openclaw.json, and keep memory content public-safe."},kimi:{targetId:"kimi",platformName:"Kimi",canonicalSource:e,primaryFile:"KIMI.md",secondaryFiles:i("AGENTS.md",".kimi/skills/neocortex/SKILL.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:c,bidirectionalReference:o(c),requiresWrapperPreservation:!0,notes:"Kimi memory entrypoint. Prefer a symlink to NEOCORTEX.md; use a compact include only if the host cannot follow symlinks."},"github-copilot-cli":{targetId:"github-copilot-cli",platformName:"GitHub Copilot CLI / gh alias",canonicalSource:e,primaryFile:".github/copilot-instructions.md",secondaryFiles:i("AGENTS.md"),ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:o(c),requiresWrapperPreservation:!0,notes:"GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies."}};function p(t){return m[t]}function u(t){return t==="canonical"||s.includes(t)}function y(){return s.map(t=>m[t])}function E(t){const a=n=>n.replace(/\|/g,"\\|").replace(/\n/g," ");return["| Path | Title | Purpose | Suggested Usage |","| --- | --- | --- | --- |",...t.map(n=>`| ${a(n.path)} | ${a(n.title)} | ${a(n.purpose)} | ${a(n.suggestedUsage)} |`)].join(`
2
- `)}export{e as CANONICAL_PROJECT_MEMORY_SOURCE,m as PROJECT_MEMORY_TARGETS,s as PROJECT_MEMORY_TARGET_IDS,p as getProjectMemoryTarget,u as isProjectMemoryTargetId,y as listProjectMemoryTargets,E as renderArchitectureReferenceTable};
1
+ /**
2
+ * P130.06: Client-side SSoT-Shadow mirror for project memory targets.
3
+ *
4
+ * The published client tarball must not import the workspace-only shared package
5
+ * at runtime. Keep this file in sync with `packages/shared/src/project-memory-*`
6
+ * and enforce drift through the P130.06 release tests.
7
+ */
8
+ function projectFileRefs(...paths) {
9
+ return paths.map((path) => ({ scope: 'project', path }));
10
+ }
11
+ export const CANONICAL_PROJECT_MEMORY_SOURCE = 'NEOCORTEX.md';
12
+ const MANDATORY_SEMANTIC_SYMLINK = {
13
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
14
+ semanticFileRequired: true,
15
+ symlinkBacked: true,
16
+ wrapperAllowed: false,
17
+ includeFallbackAllowed: false,
18
+ requiresWrapperPreservation: false,
19
+ fallbackIsCompatibilityRemediation: true,
20
+ policy: 'mandatory-semantic-symlink',
21
+ notes: 'Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter.',
22
+ };
23
+ const SYMLINK_BACKED_WRAPPER = {
24
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
25
+ semanticFileRequired: true,
26
+ symlinkBacked: true,
27
+ wrapperAllowed: true,
28
+ includeFallbackAllowed: false,
29
+ requiresWrapperPreservation: true,
30
+ fallbackIsCompatibilityRemediation: true,
31
+ policy: 'symlink-backed-wrapper',
32
+ notes: 'Platform wrapper/frontmatter is allowed only when the semantic memory payload remains symlink-backed by NEOCORTEX.md.',
33
+ };
34
+ const SAFE_INCLUDE_FALLBACK = {
35
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
36
+ semanticFileRequired: true,
37
+ symlinkBacked: true,
38
+ wrapperAllowed: true,
39
+ includeFallbackAllowed: true,
40
+ requiresWrapperPreservation: true,
41
+ fallbackIsCompatibilityRemediation: true,
42
+ policy: 'safe-include-fallback',
43
+ notes: 'Use a safe include/import only for platforms that cannot consume symlinks directly; the include must resolve back to NEOCORTEX.md.',
44
+ };
45
+ function bidirectionalReference(requirement) {
46
+ return {
47
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
48
+ resolvesVia: requirement.policy,
49
+ feedbackTrigger: '*update-memory',
50
+ guidance: 'Treat NEOCORTEX.md as canonical project memory; consult it before platform-specific memory, and run *update-memory when durable project context changes should flow back to the canonical source.',
51
+ };
52
+ }
53
+ export const PROJECT_MEMORY_TARGET_IDS = [
54
+ 'claude-code',
55
+ 'codex',
56
+ 'grok',
57
+ 'gemini-cli',
58
+ 'antigravity',
59
+ 'vscode',
60
+ 'cursor',
61
+ 'opencode',
62
+ 'openclaw',
63
+ 'kimi',
64
+ 'github-copilot-cli',
65
+ ];
66
+ export const PROJECT_MEMORY_TARGETS = {
67
+ canonical: {
68
+ targetId: 'canonical',
69
+ platformName: 'Neocortex Canonical Memory',
70
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
71
+ primaryFile: CANONICAL_PROJECT_MEMORY_SOURCE,
72
+ secondaryFiles: projectFileRefs('AGENTS.md', 'CLAUDE.md', 'GEMINI.md'),
73
+ ownedBlockName: 'NEOCORTEX-MEMORY',
74
+ templateKind: 'neocortex-md',
75
+ budget: { maxLines: 220, maxBytes: 18_000 },
76
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
77
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
78
+ requiresWrapperPreservation: false,
79
+ notes: 'Canonical compact project memory source for platform symlinks and wrappers. Store only summaries, indexes, and links to architecture docs here.',
80
+ },
81
+ 'claude-code': {
82
+ targetId: 'claude-code',
83
+ platformName: 'Claude Code',
84
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
85
+ primaryFile: 'CLAUDE.md',
86
+ secondaryFiles: projectFileRefs('.claude/agents/neocortex.md'),
87
+ ownedBlockName: 'NEOCORTEX-MEMORY',
88
+ templateKind: 'claude-md',
89
+ budget: { maxLines: 320, maxBytes: 28_000 },
90
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
91
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
92
+ requiresWrapperPreservation: false,
93
+ notes: 'Claude Code project memory. Resolve to NEOCORTEX.md; keep root content concise and link deeper docs with @path references.',
94
+ },
95
+ codex: {
96
+ targetId: 'codex',
97
+ platformName: 'Codex CLI',
98
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
99
+ primaryFile: 'AGENTS.md',
100
+ secondaryFiles: projectFileRefs('.codex/agents/neocortex.toml'),
101
+ ownedBlockName: 'NEOCORTEX-MEMORY',
102
+ templateKind: 'agents-md',
103
+ budget: { maxLines: 220, maxBytes: 18_000 },
104
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
105
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
106
+ requiresWrapperPreservation: true,
107
+ notes: 'Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems.',
108
+ },
109
+ grok: {
110
+ targetId: 'grok',
111
+ platformName: 'Grok Build',
112
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
113
+ primaryFile: 'AGENTS.md',
114
+ secondaryFiles: projectFileRefs('.grok/skills/neocortex/SKILL.md'),
115
+ ownedBlockName: 'NEOCORTEX-MEMORY',
116
+ templateKind: 'agents-md',
117
+ budget: { maxLines: 220, maxBytes: 18_000 },
118
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
119
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
120
+ requiresWrapperPreservation: true,
121
+ notes: 'Grok Build reads AGENTS.md and the project-local Neocortex Skill; both resolve to canonical NEOCORTEX.md context.',
122
+ },
123
+ 'gemini-cli': {
124
+ targetId: 'gemini-cli',
125
+ platformName: 'Gemini CLI',
126
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
127
+ primaryFile: 'GEMINI.md',
128
+ secondaryFiles: projectFileRefs('.gemini/agents/neocortex.md'),
129
+ ownedBlockName: 'NEOCORTEX-MEMORY',
130
+ templateKind: 'gemini-md',
131
+ budget: { maxLines: 260, maxBytes: 22_000 },
132
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
133
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
134
+ requiresWrapperPreservation: false,
135
+ notes: 'Gemini CLI context file. Prefer shallow @file.md imports for detailed architecture docs.',
136
+ },
137
+ antigravity: {
138
+ targetId: 'antigravity',
139
+ platformName: 'Antigravity',
140
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
141
+ primaryFile: 'GEMINI.md',
142
+ secondaryFiles: projectFileRefs('.gemini/agents/neocortex.md'),
143
+ ownedBlockName: 'NEOCORTEX-MEMORY',
144
+ templateKind: 'gemini-md',
145
+ budget: { maxLines: 260, maxBytes: 22_000 },
146
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
147
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
148
+ requiresWrapperPreservation: false,
149
+ notes: 'Antigravity currently shares GEMINI.md behavior with the Gemini target stubs.',
150
+ },
151
+ vscode: {
152
+ targetId: 'vscode',
153
+ platformName: 'VS Code / GitHub Copilot',
154
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
155
+ primaryFile: '.github/copilot-instructions.md',
156
+ secondaryFiles: projectFileRefs('.github/instructions/neocortex.instructions.md', '.github/agents/neocortex.agent.md'),
157
+ ownedBlockName: 'NEOCORTEX-MEMORY',
158
+ templateKind: 'copilot-instructions',
159
+ budget: { maxLines: 180, maxBytes: 14_000 },
160
+ linkRequirement: SYMLINK_BACKED_WRAPPER,
161
+ bidirectionalReference: bidirectionalReference(SYMLINK_BACKED_WRAPPER),
162
+ requiresWrapperPreservation: true,
163
+ notes: 'VS Code and GitHub Copilot always-on repository instructions.',
164
+ },
165
+ cursor: {
166
+ targetId: 'cursor',
167
+ platformName: 'Cursor',
168
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
169
+ primaryFile: '.cursor/rules/neocortex.mdc',
170
+ secondaryFiles: projectFileRefs('AGENTS.md'),
171
+ ownedBlockName: 'NEOCORTEX-MEMORY',
172
+ templateKind: 'cursor-rule',
173
+ budget: { maxLines: 180, maxBytes: 14_000 },
174
+ linkRequirement: SYMLINK_BACKED_WRAPPER,
175
+ bidirectionalReference: bidirectionalReference(SYMLINK_BACKED_WRAPPER),
176
+ requiresWrapperPreservation: true,
177
+ notes: 'Cursor rule memory. Use AGENTS.md as compatibility fallback when Cursor rules are absent.',
178
+ },
179
+ opencode: {
180
+ targetId: 'opencode',
181
+ platformName: 'OpenCode',
182
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
183
+ primaryFile: 'AGENTS.md',
184
+ secondaryFiles: projectFileRefs('.opencode/AGENTS.md', '.opencode/agents/neocortex-root.md', '.opencode/agents/neocortex.md', '.agent/skills/neocortex/SKILL.md'),
185
+ ownedBlockName: 'NEOCORTEX-MEMORY',
186
+ templateKind: 'agents-md',
187
+ budget: { maxLines: 220, maxBytes: 18_000 },
188
+ linkRequirement: MANDATORY_SEMANTIC_SYMLINK,
189
+ bidirectionalReference: bidirectionalReference(MANDATORY_SEMANTIC_SYMLINK),
190
+ requiresWrapperPreservation: true,
191
+ notes: 'OpenCode agent memory. It consumes AGENTS.md-compatible instructions and must resolve to canonical NEOCORTEX.md.',
192
+ },
193
+ openclaw: {
194
+ targetId: 'openclaw',
195
+ platformName: 'OpenClaw',
196
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
197
+ primaryFile: '.openclaw/skills/neocortex/SKILL.md',
198
+ secondaryFiles: [{ scope: 'user', path: '.openclaw/skills/neocortex/SKILL.md' }],
199
+ ownedBlockName: 'NEOCORTEX-MEMORY',
200
+ templateKind: 'agents-md',
201
+ budget: { maxLines: 220, maxBytes: 18_000 },
202
+ linkRequirement: SAFE_INCLUDE_FALLBACK,
203
+ bidirectionalReference: bidirectionalReference(SAFE_INCLUDE_FALLBACK),
204
+ requiresWrapperPreservation: true,
205
+ notes: 'OpenClaw Skill thin-client memory entrypoint. Use the project Skill path when --create-project is requested; do not mutate ~/.openclaw/openclaw.json, and keep memory content public-safe.',
206
+ },
207
+ kimi: {
208
+ targetId: 'kimi',
209
+ platformName: 'Kimi',
210
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
211
+ primaryFile: 'KIMI.md',
212
+ secondaryFiles: projectFileRefs('AGENTS.md', '.kimi/skills/neocortex/SKILL.md'),
213
+ ownedBlockName: 'NEOCORTEX-MEMORY',
214
+ templateKind: 'agents-md',
215
+ budget: { maxLines: 220, maxBytes: 18_000 },
216
+ linkRequirement: SAFE_INCLUDE_FALLBACK,
217
+ bidirectionalReference: bidirectionalReference(SAFE_INCLUDE_FALLBACK),
218
+ requiresWrapperPreservation: true,
219
+ notes: 'Kimi memory entrypoint. Prefer a symlink to NEOCORTEX.md; use a compact include only if the host cannot follow symlinks.',
220
+ },
221
+ 'github-copilot-cli': {
222
+ targetId: 'github-copilot-cli',
223
+ platformName: 'GitHub Copilot CLI / gh alias',
224
+ canonicalSource: CANONICAL_PROJECT_MEMORY_SOURCE,
225
+ primaryFile: '.github/copilot-instructions.md',
226
+ secondaryFiles: projectFileRefs('AGENTS.md'),
227
+ ownedBlockName: 'NEOCORTEX-MEMORY',
228
+ templateKind: 'copilot-instructions',
229
+ budget: { maxLines: 180, maxBytes: 14_000 },
230
+ linkRequirement: SAFE_INCLUDE_FALLBACK,
231
+ bidirectionalReference: bidirectionalReference(SAFE_INCLUDE_FALLBACK),
232
+ requiresWrapperPreservation: true,
233
+ notes: 'GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies.',
234
+ },
235
+ };
236
+ export function getProjectMemoryTarget(targetId) {
237
+ return PROJECT_MEMORY_TARGETS[targetId];
238
+ }
239
+ export function isProjectMemoryTargetId(value) {
240
+ return value === 'canonical' || PROJECT_MEMORY_TARGET_IDS.includes(value);
241
+ }
242
+ export function listProjectMemoryTargets() {
243
+ return PROJECT_MEMORY_TARGET_IDS.map((targetId) => PROJECT_MEMORY_TARGETS[targetId]);
244
+ }
245
+ export function renderArchitectureReferenceTable(references) {
246
+ const escapeCell = (value) => value.replace(/\|/g, '\\|').replace(/\n/g, ' ');
247
+ const rows = references.map((reference) => `| ${escapeCell(reference.path)} | ${escapeCell(reference.title)} | ${escapeCell(reference.purpose)} | ${escapeCell(reference.suggestedUsage)} |`);
248
+ return [
249
+ '| Path | Title | Purpose | Suggested Usage |',
250
+ '| --- | --- | --- | --- |',
251
+ ...rows,
252
+ ].join('\n');
253
+ }
@@ -1 +1,50 @@
1
- import{PROJECT_IDENTITY_MIGRATION_CAPABILITY as u}from"../../../shared/dist/invocation/index.js";const l=16*1024;async function f(p,t=globalThis.fetch){if(!t)return{supported:!1,reason:"fetch-unavailable",publicSafe:!0};const a=new AbortController,s=setTimeout(()=>a.abort(),5e3);s.unref?.();try{const o=await t(`${p.replace(/\/+$/,"")}/api/v1/config`,{method:"GET",headers:{accept:"application/json"},signal:a.signal});if(!o.ok)return{supported:!1,reason:"http-rejected",publicSafe:!0};const i=await o.text();if(Buffer.byteLength(i,"utf8")>l)return{supported:!1,reason:"response-too-large",publicSafe:!0};let e;try{e=JSON.parse(i)}catch{return{supported:!1,reason:"response-invalid",publicSafe:!0}}if(!e||typeof e!="object"||Array.isArray(e))return{supported:!1,reason:"response-invalid",publicSafe:!0};const r=e.capabilities;return!Array.isArray(r)||r.some(n=>typeof n!="string"||n.length>80)?{supported:!1,reason:"response-invalid",publicSafe:!0}:r.includes(u)?{supported:!0,reason:"supported",publicSafe:!0}:{supported:!1,reason:"capability-missing",publicSafe:!0}}catch{return{supported:!1,reason:"request-failed",publicSafe:!0}}finally{clearTimeout(s)}}export{f as probeProjectIdentityMigrationCapability};
1
+ import { PROJECT_IDENTITY_MIGRATION_CAPABILITY } from '../../../shared/dist/invocation/index.js';
2
+ const MAX_CAPABILITY_RESPONSE_BYTES = 16 * 1024;
3
+ /**
4
+ * Fail-closed, non-mutating rollout probe. An older server cannot cause the
5
+ * client to persist a local project ID that has no remote floor authority.
6
+ */
7
+ export async function probeProjectIdentityMigrationCapability(serverUrl, fetcher = globalThis.fetch) {
8
+ if (!fetcher)
9
+ return { supported: false, reason: 'fetch-unavailable', publicSafe: true };
10
+ const controller = new AbortController();
11
+ const timeout = setTimeout(() => controller.abort(), 5_000);
12
+ timeout.unref?.();
13
+ try {
14
+ const response = await fetcher(`${serverUrl.replace(/\/+$/, '')}/api/v1/config`, {
15
+ method: 'GET',
16
+ headers: { accept: 'application/json' },
17
+ signal: controller.signal,
18
+ });
19
+ if (!response.ok)
20
+ return { supported: false, reason: 'http-rejected', publicSafe: true };
21
+ const raw = await response.text();
22
+ if (Buffer.byteLength(raw, 'utf8') > MAX_CAPABILITY_RESPONSE_BYTES) {
23
+ return { supported: false, reason: 'response-too-large', publicSafe: true };
24
+ }
25
+ let parsed;
26
+ try {
27
+ parsed = JSON.parse(raw);
28
+ }
29
+ catch {
30
+ return { supported: false, reason: 'response-invalid', publicSafe: true };
31
+ }
32
+ if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
33
+ return { supported: false, reason: 'response-invalid', publicSafe: true };
34
+ }
35
+ const capabilities = parsed.capabilities;
36
+ if (!Array.isArray(capabilities)
37
+ || capabilities.some((value) => typeof value !== 'string' || value.length > 80)) {
38
+ return { supported: false, reason: 'response-invalid', publicSafe: true };
39
+ }
40
+ return capabilities.includes(PROJECT_IDENTITY_MIGRATION_CAPABILITY)
41
+ ? { supported: true, reason: 'supported', publicSafe: true }
42
+ : { supported: false, reason: 'capability-missing', publicSafe: true };
43
+ }
44
+ catch {
45
+ return { supported: false, reason: 'request-failed', publicSafe: true };
46
+ }
47
+ finally {
48
+ clearTimeout(timeout);
49
+ }
50
+ }