@ornexus/neocortex 4.60.22 → 4.60.24
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.
- package/dist/sbom.cdx.json +24 -24
- package/install.js +67 -10
- package/install.ps1 +39 -8
- package/install.sh +18 -6
- package/package.json +9 -3
- package/packages/client/dist/adapters/adapter-registry.d.ts +2 -2
- package/packages/client/dist/adapters/adapter-registry.js +1 -1
- package/packages/client/dist/adapters/grok-adapter.d.ts +11 -0
- package/packages/client/dist/adapters/grok-adapter.js +2 -0
- package/packages/client/dist/adapters/index.d.ts +1 -0
- package/packages/client/dist/adapters/index.js +1 -1
- package/packages/client/dist/adapters/platform-detector.d.ts +1 -1
- package/packages/client/dist/adapters/platform-detector.js +1 -1
- package/packages/client/dist/agent/refresh-stubs.js +2 -2
- package/packages/client/dist/cli.js +21 -2
- package/packages/client/dist/commands/invoke.d.ts +39 -26
- package/packages/client/dist/commands/invoke.js +56 -50
- package/packages/client/dist/commands/story-checkpoint.d.ts +15 -0
- package/packages/client/dist/commands/story-checkpoint.js +1 -0
- package/packages/client/dist/config.js +1 -1
- package/packages/client/dist/continuity/invoke-hooks.js +1 -1
- package/packages/client/dist/fs/atomic-state-replace.d.ts +16 -0
- package/packages/client/dist/fs/atomic-state-replace.js +1 -0
- package/packages/client/dist/generated/command-registry.generated.d.ts +51 -51
- package/packages/client/dist/generated/command-registry.generated.js +1 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +67 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.js +3 -0
- package/packages/client/dist/git/git-lifecycle-store.d.ts +198 -0
- package/packages/client/dist/git/git-lifecycle-store.js +4 -0
- package/packages/client/dist/git/secure-filesystem-boundary.d.ts +26 -0
- package/packages/client/dist/git/secure-filesystem-boundary.js +123 -0
- package/packages/client/dist/graph-retrieval/pre-command-hook.d.ts +11 -0
- package/packages/client/dist/graph-retrieval/pre-command-hook.js +1 -1
- package/packages/client/dist/graph-retrieval/shared-graph-retrieval-contract.js +1 -1
- package/packages/client/dist/index.d.ts +2 -0
- package/packages/client/dist/index.js +1 -1
- package/packages/client/dist/invocation/invoke-input.d.ts +9 -0
- package/packages/client/dist/invocation/invoke-input.js +1 -0
- package/packages/client/dist/memory/shared-project-memory-types.d.ts +29 -2
- package/packages/client/dist/memory/shared-project-memory-types.js +2 -2
- package/packages/client/dist/migrations/project-identity-capability.d.ts +13 -0
- package/packages/client/dist/migrations/project-identity-capability.js +1 -0
- package/packages/client/dist/migrations/project-identity.d.ts +41 -0
- package/packages/client/dist/migrations/project-identity.js +7 -0
- package/packages/client/dist/policy/subagent-approval-policy.js +1 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.d.ts +131 -0
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +58 -0
- package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.d.ts +23 -0
- package/packages/client/dist/runner/headless/epic-git-reconciliation-inventory.js +1 -0
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.d.ts +15 -0
- package/packages/client/dist/runner/headless/epic-merge-candidate-qa.js +28 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.d.ts +12 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-cli-adapter.js +8 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +134 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -0
- package/packages/client/dist/runner/headless/prepared-story-bundle.js +1 -1
- package/packages/client/dist/runner/headless/run-yolo.js +1 -1
- package/packages/client/dist/runner/headless/run-yoloop.d.ts +7 -2
- package/packages/client/dist/runner/headless/run-yoloop.js +8 -1
- package/packages/client/dist/runner/headless/types.d.ts +1 -1
- package/packages/client/dist/runner/headless/types.js +2 -2
- package/packages/client/dist/state/invocation-shape.d.ts +9 -0
- package/packages/client/dist/state/invocation-shape.js +1 -0
- package/packages/client/dist/state/project-state-snapshot.d.ts +9 -3
- package/packages/client/dist/state/project-state-snapshot.js +1 -1
- package/packages/client/dist/state/state-json-repair.d.ts +9 -0
- package/packages/client/dist/state/state-json-repair.js +3 -3
- package/packages/client/dist/state/structural-dag-projection.d.ts +24 -0
- package/packages/client/dist/state/structural-dag-projection.js +1 -0
- package/packages/client/dist/tier/tier-aware-client.js +1 -1
- package/packages/client/dist/yoloop/invoke-hooks.d.ts +13 -10
- package/packages/client/dist/yoloop/invoke-hooks.js +8 -5
- package/packages/client/dist/yoloop/shared-discover-epics.js +1 -1
- package/packages/shared/dist/generated/command-registry.generated.js +64 -65
- package/packages/shared/dist/generated/invocation-schema.generated.js +16 -24
- package/packages/shared/dist/invocation/index.d.ts +6 -2
- package/packages/shared/dist/invocation/index.js +5 -0
- package/packages/shared/dist/invocation/input-envelope.d.ts +37 -0
- package/packages/shared/dist/invocation/input-envelope.js +98 -0
- package/packages/shared/dist/invocation/project-identity-migration.d.ts +28 -0
- package/packages/shared/dist/invocation/project-identity-migration.js +83 -0
- package/packages/shared/dist/invocation/public-diagnostics.d.ts +87 -0
- package/packages/shared/dist/invocation/public-diagnostics.js +181 -0
- package/packages/shared/dist/invocation/state-projection.d.ts +21 -0
- package/packages/shared/dist/invocation/state-projection.js +1 -0
- package/packages/shared/dist/invocation/strict-effect-receipt.d.ts +12 -0
- package/packages/shared/dist/invocation/strict-effect-receipt.js +43 -0
- package/packages/shared/dist/yoloop/epic-terminal-git.js +227 -0
- package/packages/shared/dist/yoloop/planning-graph.js +119 -0
- package/packages/shared/dist/yoloop/public-story-write-set.js +27 -0
- package/packages/shared/dist/yoloop/wave-decision-receipt.js +19 -0
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/neocortex.md +18 -0
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +21 -2
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +2 -2
- package/targets-stubs/codex/AGENTS.md +20 -1
- package/targets-stubs/cursor/agent.md +20 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/gemini-cli/gemini.md +18 -0
- package/targets-stubs/grok/README.md +13 -0
- package/targets-stubs/grok/SKILL.md +50 -0
- package/targets-stubs/grok/config-mcp.toml +22 -0
- package/targets-stubs/grok/install-grok.sh +31 -0
- package/targets-stubs/kimi/neocortex.md +18 -0
- package/targets-stubs/openclaw/SKILL.md +18 -0
- package/targets-stubs/opencode/neocortex-root.md +20 -1
- package/targets-stubs/vscode/neocortex.agent.md +20 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const L=1,O="client-pre-command-v1",N=["utility","planning","architecture","diagnostic","research","story-execution","review","qa","security","continuity","recovery"],P={maxItems:24,maxEdges:64,maxPayloadBytes:12288,maxSnippetChars:480,maxLabelChars:160,maxTotalCost:100},i=e=>Object.freeze({...e}),v=Object.freeze({utility:i({maxItems:4,maxEdges:8,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:40}),planning:i({maxItems:12,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:70}),architecture:i({maxItems:10,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:65}),diagnostic:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),research:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),"story-execution":i({maxItems:6,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),review:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),qa:i({maxItems:6,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),security:i({maxItems:8,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),continuity:i({maxItems:6,maxEdges:16,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:45}),recovery:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55})}),u=e=>Object.freeze({commandId:e.commandId,...e.number===void 0?{}:{number:e.number},aliases:Object.freeze([...e.aliases??[]]),retrievalProfile:e.retrievalProfile,retrievalBudget:v[e.retrievalProfile]}),C=[{commandId:"status",number:1,aliases:["st"],retrievalProfile:"utility"},{commandId:"init",number:2,aliases:["inicializar"],retrievalProfile:"utility"},{commandId:"arch-plan",number:3,aliases:["arquitetura","architecture","arch"],retrievalProfile:"architecture"},{commandId:"arch-prd",number:4,aliases:["prd","product-requirements"],retrievalProfile:"architecture"},{commandId:"arch-architecture",number:5,aliases:["arch-doc","tech-architecture"],retrievalProfile:"architecture"},{commandId:"arch-api-contracts",number:6,aliases:["api-contracts","api-contract"],retrievalProfile:"architecture"},{commandId:"arch-api-integrations",number:7,aliases:["api-integrations","api-int"],retrievalProfile:"architecture"},{commandId:"arch-database",number:8,aliases:["database-schema","db-schema","db"],retrievalProfile:"architecture"},{commandId:"arch-security",number:9,aliases:["cyber-security","security","sec"],retrievalProfile:"architecture"},{commandId:"arch-design-system",number:10,aliases:["design-system","ds","atomic-design"],retrievalProfile:"architecture"},{commandId:"arch-ux-design",number:11,aliases:["ux-design","ux","wireframes","wireframe","user-flows"],retrievalProfile:"architecture"},{commandId:"arch-performance",number:12,aliases:["performance","perf","capacity-planning","capacity","arch-perf","performance-strategy"],retrievalProfile:"architecture"},{commandId:"arch-testing",number:13,aliases:["testing-strategy","test-plan","test-strategy","arch-test"],retrievalProfile:"architecture"},{commandId:"arch-infrastructure",number:14,aliases:["infrastructure","infra","deploy-plan","deployment","arch-infra","arch-deploy"],retrievalProfile:"architecture"},{commandId:"arch-review",number:15,aliases:["review-consolidation","consolidation","architecture-review","arch-consolidation"],retrievalProfile:"architecture"},{commandId:"arch-fitness-functions",number:16,aliases:["fitness","fitness-functions","archfit","arch-fit","fit-funcs"],retrievalProfile:"architecture"},{commandId:"create-epic",number:17,aliases:["criar-epic","planejamento"],retrievalProfile:"planning"},{commandId:"idea-diagnose",number:18,aliases:["idea-diag"],retrievalProfile:"planning"},{commandId:"idea-research",number:19,aliases:["idea-pesq"],retrievalProfile:"planning"},{commandId:"generate-epic",number:20,aliases:["gerar-epic"],retrievalProfile:"planning"},{commandId:"exec",number:21,aliases:["executar","pipeline"],retrievalProfile:"story-execution"},{commandId:"yolo",number:22,retrievalProfile:"story-execution"},{commandId:"epic",number:23,aliases:["parallel-epic"],retrievalProfile:"story-execution"},{commandId:"setup-branch",number:24,aliases:["setup","branch"],retrievalProfile:"story-execution"},{commandId:"diagnose",number:25,aliases:["diag","diagnostico","c02"],retrievalProfile:"diagnostic"},{commandId:"research",number:26,aliases:["pesquisar","pesq","research-fix","c03"],retrievalProfile:"research"},{commandId:"write-spec",number:27,aliases:["spec","especificacao","c04"],retrievalProfile:"story-execution"},{commandId:"create-tasks",number:28,aliases:["tasks","tarefas","c05"],retrievalProfile:"story-execution"},{commandId:"implement",number:29,aliases:["impl","implementar","c06"],retrievalProfile:"story-execution"},{commandId:"commit",number:30,aliases:["push","commit-push","commit_push","cp","c07"],retrievalProfile:"story-execution"},{commandId:"sync",number:31,aliases:["sincronizar","c08"],retrievalProfile:"story-execution"},{commandId:"create-pr",number:32,aliases:["pr","c09"],retrievalProfile:"story-execution"},{commandId:"review",number:33,aliases:["revisar","c11"],retrievalProfile:"review"},{commandId:"merge",number:34,aliases:["mesclar","c12"],retrievalProfile:"story-execution"},{commandId:"fix-blocked",number:35,aliases:["fix","corrigir"],retrievalProfile:"recovery"},{commandId:"finalize-epic",number:36,aliases:["finalizar"],retrievalProfile:"recovery"},{commandId:"resolve-conflicts",number:37,aliases:["conflitos"],retrievalProfile:"recovery"},{commandId:"update-memory",number:38,aliases:["memoria"],retrievalProfile:"recovery"},{commandId:"refactor",number:39,aliases:["refactoring","refact","refac","rf","cleanup-code","code-cleanup","code-quality","improve-code","modernize","modernization","legacy","legacy-code","debt-pay","pay-debt","debt-reduction","smell-fix","fix-smells","code-smells","strangler","strangler-fig"],retrievalProfile:"recovery"},{commandId:"cleanup",number:40,aliases:["limpar","limpeza"],retrievalProfile:"utility"},{commandId:"audit",number:41,aliases:["auditar","auditoria"],retrievalProfile:"utility"},{commandId:"tech-debt",number:42,aliases:["debt","debts","debt-list","tech-debts","td"],retrievalProfile:"utility"},{commandId:"menu",number:43,aliases:["help","ajuda","?","commands","cmds"],retrievalProfile:"utility"},{commandId:"plans",number:44,aliases:["planos","pricing"],retrievalProfile:"utility"},{commandId:"billing",number:45,aliases:["bill","subscription","sub"],retrievalProfile:"utility"},{commandId:"subscribe",number:46,aliases:["upgrade","checkout"],retrievalProfile:"utility"},{commandId:"qa-scan",number:47,aliases:["qa","qa-test","visual-qa","e2e-scan","troubleshoot","debug-ui","scan","a11y","accessibility","wcag"],retrievalProfile:"qa"},{commandId:"yoloop",number:48,aliases:["auto-yolo","epic-runner","story-runner","loop-yolo","auto-epic"],retrievalProfile:"utility"},{commandId:"migrate-state",number:49,aliases:["migrate","state-migrate","schema-migrate"],retrievalProfile:"utility"},{commandId:"policy-audit",number:50,aliases:["policy","audit-policy","policy-history","policies"],retrievalProfile:"utility"},{commandId:"mutation-test",number:51,aliases:["mutation","stryker","kill-mutants"],retrievalProfile:"qa"},{commandId:"sync-openapi",number:52,aliases:["openapi-sync","api-sync","spec-sync","regen-openapi"],retrievalProfile:"utility"},{commandId:"generate-pacts",number:53,aliases:["pacts","gen-pacts","regen-pacts","create-pacts"],retrievalProfile:"utility"},{commandId:"verify-pacts",number:54,aliases:["verify-pact","pact-verify","check-pacts","pact-check"],retrievalProfile:"utility"},{commandId:"property-test",number:55,aliases:["property","pbt","proptest","property-tests","invariant-test"],retrievalProfile:"qa"},{commandId:"chaos-plan",number:56,aliases:["chaos","gameday","resilience-test"],retrievalProfile:"utility"},{commandId:"ui-ux-review",number:57,aliases:["ux-review","design-review","visual-review","product-polish"],retrievalProfile:"utility"},{commandId:"solyd-system",number:58,aliases:["security-system","authorized-security","sec-system"],retrievalProfile:"security"},{commandId:"goal",number:59,aliases:["goals","durable-goal","continuity-goal"],retrievalProfile:"continuity"},{commandId:"loop",number:60,aliases:["loops","durable-loop","continuity-loop"],retrievalProfile:"continuity"},{commandId:"jobs",number:61,aliases:["job","continuity-jobs"],retrievalProfile:"continuity"},{commandId:"runner",number:62,aliases:["neocortex-runner","continuity-runner"],retrievalProfile:"continuity"}],g=[{commandId:"diagnose-inline",retrievalProfile:"diagnostic"},{commandId:"research-inline",retrievalProfile:"research"},{commandId:"yolo-inline",retrievalProfile:"story-execution"},{commandId:"goal-tick",retrievalProfile:"continuity"},{commandId:"loop-tick",retrievalProfile:"continuity"}],l=Object.freeze(C.map(u)),p=Object.freeze(g.map(u)),f=Object.freeze([...l,...p]),m=Object.freeze(Object.fromEntries(f.map(e=>[e.commandId,e]))),E=Object.freeze(Object.fromEntries(l.filter(e=>e.number!==void 0).map(e=>[e.number,e]))),_=Object.freeze(Object.fromEntries(l.flatMap(e=>e.aliases.map(a=>[y(a),e.commandId]))));function y(e){return e.trim().toLowerCase().replace(/^\*/,"")}function T(e){return e.trim().split(/\s+/,1)[0]??""}function R(){return l}function S(){return p}function A(){return f}function M(e){const a=T(e);if(!a)return m.menu??null;const t=y(a);return/^\d+$/.test(t)?E[Number.parseInt(t,10)]??null:m[t]??m[_[t]??""]??null}const b={CanonicalMemory:0,Guardrail:1,Debt:2,State:3,Story:4,Epic:5,Command:6,Doc:7,Package:8,Api:9,Route:10,DbSchema:11,Flag:12,BusinessRule:13,Risk:14,PlatformMemory:15};function d(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\.\//,"")}function I(e){return[e.nodeType,`${e.source.kind}:${d(e.source.path).toLowerCase()}`,e.stableId.toLowerCase()].join("|")}function x(e){return e.score??0}function h(e,a){const t=x(a)-x(e);if(t!==0)return t;const o=a.confidence-e.confidence;if(o!==0)return o;const s=e.budgetCost-a.budgetCost;if(s!==0)return s;const n=b[e.nodeType]-b[a.nodeType];if(n!==0)return n;const r=d(e.source.path).localeCompare(d(a.source.path),"en-US");return r!==0?r:e.stableId.localeCompare(a.stableId,"en-US")}function D(e){const a={...P,...e.budgets},t=new Map;for(const r of e.items){const c=t.get(I(r));(!c||h(r,c)<0)&&t.set(I(r),r)}const o=[],s=[];let n=0;for(const r of[...t.values()].sort(h)){const c=n+Math.max(1,r.budgetCost);if(o.length>=a.maxItems||c>a.maxTotalCost){s.push({stableId:r.stableId,source:r.source,reasonCode:"budget_exceeded"});continue}o.push(r),n=c}return{schemaVersion:1,retrievalId:e.retrievalId,query:e.query,budget:{...a,totalCost:n},items:o,skipped:s,warnings:e.warnings??[],generatedAt:e.generatedAt}}export{f as CLIENT_COMMAND_CONTEXT_POLICIES,_ as CLIENT_COMMAND_CONTEXT_POLICY_ALIAS_MAP,m as CLIENT_COMMAND_CONTEXT_POLICY_BY_ID,E as CLIENT_COMMAND_CONTEXT_POLICY_BY_NUMBER,v as CLIENT_GRAPH_RETRIEVAL_PROFILE_BUDGETS,p as CLIENT_INTERNAL_COMMAND_CONTEXT_POLICIES,l as CLIENT_PUBLIC_COMMAND_CONTEXT_POLICIES,N as COMMAND_CONTEXT_RETRIEVAL_PROFILES,P as DEFAULT_GRAPH_RETRIEVAL_BUDGETS,O as GRAPH_RETRIEVAL_CLIENT_CONTRACT_VERSION,L as GRAPH_RETRIEVAL_SCHEMA_VERSION,h as compareGraphRetrievalItems,D as createGraphRetrievalMetadata,A as listClientCommandContextPolicies,S as listClientInternalCommandContextPolicies,R as listClientPublicCommandContextPolicies,y as normalizeCommandToken,d as normalizeGraphRetrievalPath,M as resolveClientCommandContextPolicy};
|
|
1
|
+
const L=1,O="client-pre-command-v1",N=["utility","planning","architecture","diagnostic","research","story-execution","review","qa","security","continuity","recovery"],P={maxItems:24,maxEdges:64,maxPayloadBytes:12288,maxSnippetChars:480,maxLabelChars:160,maxTotalCost:100},i=e=>Object.freeze({...e}),v=Object.freeze({utility:i({maxItems:4,maxEdges:8,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:40}),planning:i({maxItems:12,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:70}),architecture:i({maxItems:10,maxEdges:48,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:65}),diagnostic:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),research:i({maxItems:10,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:360,maxLabelChars:128,maxTotalCost:60}),"story-execution":i({maxItems:6,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),review:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),qa:i({maxItems:6,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:50}),security:i({maxItems:8,maxEdges:24,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55}),continuity:i({maxItems:6,maxEdges:16,maxPayloadBytes:4*1024,maxSnippetChars:280,maxLabelChars:96,maxTotalCost:45}),recovery:i({maxItems:8,maxEdges:32,maxPayloadBytes:8*1024,maxSnippetChars:320,maxLabelChars:128,maxTotalCost:55})}),u=e=>Object.freeze({commandId:e.commandId,...e.number===void 0?{}:{number:e.number},aliases:Object.freeze([...e.aliases??[]]),retrievalProfile:e.retrievalProfile,retrievalBudget:v[e.retrievalProfile]}),C=[{commandId:"status",number:1,aliases:["st"],retrievalProfile:"utility"},{commandId:"arch-plan",number:3,aliases:["arquitetura","architecture","arch"],retrievalProfile:"architecture"},{commandId:"arch-prd",number:4,aliases:["prd","product-requirements"],retrievalProfile:"architecture"},{commandId:"arch-architecture",number:5,aliases:["arch-doc","tech-architecture"],retrievalProfile:"architecture"},{commandId:"arch-api-contracts",number:6,aliases:["api-contracts","api-contract"],retrievalProfile:"architecture"},{commandId:"arch-api-integrations",number:7,aliases:["api-integrations","api-int"],retrievalProfile:"architecture"},{commandId:"arch-database",number:8,aliases:["database-schema","db-schema","db"],retrievalProfile:"architecture"},{commandId:"arch-security",number:9,aliases:["cyber-security","security","sec"],retrievalProfile:"architecture"},{commandId:"arch-design-system",number:10,aliases:["design-system","ds","atomic-design"],retrievalProfile:"architecture"},{commandId:"arch-ux-design",number:11,aliases:["ux-design","ux","wireframes","wireframe","user-flows"],retrievalProfile:"architecture"},{commandId:"arch-performance",number:12,aliases:["performance","perf","capacity-planning","capacity","arch-perf","performance-strategy"],retrievalProfile:"architecture"},{commandId:"arch-testing",number:13,aliases:["testing-strategy","test-plan","test-strategy","arch-test"],retrievalProfile:"architecture"},{commandId:"arch-infrastructure",number:14,aliases:["infrastructure","infra","deploy-plan","deployment","arch-infra","arch-deploy"],retrievalProfile:"architecture"},{commandId:"arch-review",number:15,aliases:["review-consolidation","consolidation","architecture-review","arch-consolidation"],retrievalProfile:"architecture"},{commandId:"arch-fitness-functions",number:16,aliases:["fitness","fitness-functions","archfit","arch-fit","fit-funcs"],retrievalProfile:"architecture"},{commandId:"create-epic",number:17,aliases:["criar-epic","planejamento"],retrievalProfile:"planning"},{commandId:"idea-diagnose",number:18,aliases:["idea-diag"],retrievalProfile:"planning"},{commandId:"idea-research",number:19,aliases:["idea-pesq"],retrievalProfile:"planning"},{commandId:"generate-epic",number:20,aliases:["gerar-epic"],retrievalProfile:"planning"},{commandId:"exec",number:21,aliases:["executar","pipeline"],retrievalProfile:"story-execution"},{commandId:"yolo",number:22,retrievalProfile:"story-execution"},{commandId:"epic",number:23,aliases:["parallel-epic"],retrievalProfile:"story-execution"},{commandId:"setup-branch",number:24,aliases:["setup","branch"],retrievalProfile:"story-execution"},{commandId:"diagnose",number:25,aliases:["diag","diagnostico","c02"],retrievalProfile:"diagnostic"},{commandId:"research",number:26,aliases:["pesquisar","pesq","research-fix","c03"],retrievalProfile:"research"},{commandId:"write-spec",number:27,aliases:["spec","especificacao","c04"],retrievalProfile:"story-execution"},{commandId:"create-tasks",number:28,aliases:["tasks","tarefas","c05"],retrievalProfile:"story-execution"},{commandId:"implement",number:29,aliases:["impl","implementar","c06"],retrievalProfile:"story-execution"},{commandId:"commit",number:30,aliases:["push","commit-push","commit_push","cp","c07"],retrievalProfile:"story-execution"},{commandId:"sync",number:31,aliases:["sincronizar","c08"],retrievalProfile:"story-execution"},{commandId:"create-pr",number:32,aliases:["pr","c09"],retrievalProfile:"story-execution"},{commandId:"review",number:33,aliases:["revisar","c11"],retrievalProfile:"review"},{commandId:"merge",number:34,aliases:["mesclar","c12"],retrievalProfile:"story-execution"},{commandId:"fix-blocked",number:35,aliases:["fix","corrigir"],retrievalProfile:"recovery"},{commandId:"finalize-epic",number:36,aliases:["finalizar"],retrievalProfile:"recovery"},{commandId:"resolve-conflicts",number:37,aliases:["conflitos"],retrievalProfile:"recovery"},{commandId:"update-memory",number:38,aliases:["memoria"],retrievalProfile:"recovery"},{commandId:"refactor",number:39,aliases:["refactoring","refact","refac","rf","cleanup-code","code-cleanup","code-quality","improve-code","modernize","modernization","legacy","legacy-code","debt-pay","pay-debt","debt-reduction","smell-fix","fix-smells","code-smells","strangler","strangler-fig"],retrievalProfile:"recovery"},{commandId:"cleanup",number:40,aliases:["limpar","limpeza"],retrievalProfile:"utility"},{commandId:"audit",number:41,aliases:["auditar","auditoria"],retrievalProfile:"utility"},{commandId:"tech-debt",number:42,aliases:["debt","debts","debt-list","tech-debts","td"],retrievalProfile:"utility"},{commandId:"menu",number:43,aliases:["help","ajuda","?","commands","cmds"],retrievalProfile:"utility"},{commandId:"plans",number:44,aliases:["planos","pricing"],retrievalProfile:"utility"},{commandId:"billing",number:45,aliases:["bill","subscription","sub"],retrievalProfile:"utility"},{commandId:"subscribe",number:46,aliases:["upgrade","checkout"],retrievalProfile:"utility"},{commandId:"qa-scan",number:47,aliases:["qa","qa-test","visual-qa","e2e-scan","troubleshoot","debug-ui","scan","a11y","accessibility","wcag"],retrievalProfile:"qa"},{commandId:"yoloop",number:48,aliases:["auto-yolo","epic-runner","story-runner","loop-yolo","auto-epic"],retrievalProfile:"utility"},{commandId:"migrate-state",number:49,aliases:["migrate","state-migrate","schema-migrate"],retrievalProfile:"utility"},{commandId:"policy-audit",number:50,aliases:["policy","audit-policy","policy-history","policies"],retrievalProfile:"utility"},{commandId:"mutation-test",number:51,aliases:["mutation","stryker","kill-mutants"],retrievalProfile:"qa"},{commandId:"sync-openapi",number:52,aliases:["openapi-sync","api-sync","spec-sync","regen-openapi"],retrievalProfile:"utility"},{commandId:"generate-pacts",number:53,aliases:["pacts","gen-pacts","regen-pacts","create-pacts"],retrievalProfile:"utility"},{commandId:"verify-pacts",number:54,aliases:["verify-pact","pact-verify","check-pacts","pact-check"],retrievalProfile:"utility"},{commandId:"property-test",number:55,aliases:["property","pbt","proptest","property-tests","invariant-test"],retrievalProfile:"qa"},{commandId:"chaos-plan",number:56,aliases:["chaos","gameday","resilience-test"],retrievalProfile:"utility"},{commandId:"ui-ux-review",number:57,aliases:["ux-review","design-review","visual-review","product-polish"],retrievalProfile:"utility"},{commandId:"solyd-system",number:58,aliases:["security-system","authorized-security","sec-system"],retrievalProfile:"security"},{commandId:"goal",number:59,aliases:["goals","durable-goal","continuity-goal"],retrievalProfile:"continuity"},{commandId:"loop",number:60,aliases:["loops","durable-loop","continuity-loop"],retrievalProfile:"continuity"},{commandId:"jobs",number:61,aliases:["job","continuity-jobs"],retrievalProfile:"continuity"},{commandId:"runner",number:62,aliases:["neocortex-runner","continuity-runner"],retrievalProfile:"continuity"},{commandId:"migrate-project-id",number:63,retrievalProfile:"recovery"}],g=[{commandId:"diagnose-inline",retrievalProfile:"diagnostic"},{commandId:"research-inline",retrievalProfile:"research"},{commandId:"yolo-inline",retrievalProfile:"story-execution"},{commandId:"goal-tick",retrievalProfile:"continuity"},{commandId:"loop-tick",retrievalProfile:"continuity"}],l=Object.freeze(C.map(u)),p=Object.freeze(g.map(u)),f=Object.freeze([...l,...p]),m=Object.freeze(Object.fromEntries(f.map(e=>[e.commandId,e]))),E=Object.freeze(Object.fromEntries(l.filter(e=>e.number!==void 0).map(e=>[e.number,e]))),_=Object.freeze(Object.fromEntries(l.flatMap(e=>e.aliases.map(a=>[y(a),e.commandId]))));function y(e){return e.trim().toLowerCase().replace(/^\*/,"")}function T(e){return e.trim().split(/\s+/,1)[0]??""}function R(){return l}function S(){return p}function A(){return f}function M(e){const a=T(e);if(!a)return m.menu??null;const t=y(a);return/^\d+$/.test(t)?E[Number.parseInt(t,10)]??null:m[t]??m[_[t]??""]??null}const b={CanonicalMemory:0,Guardrail:1,Debt:2,State:3,Story:4,Epic:5,Command:6,Doc:7,Package:8,Api:9,Route:10,DbSchema:11,Flag:12,BusinessRule:13,Risk:14,PlatformMemory:15};function d(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\.\//,"")}function I(e){return[e.nodeType,`${e.source.kind}:${d(e.source.path).toLowerCase()}`,e.stableId.toLowerCase()].join("|")}function x(e){return e.score??0}function h(e,a){const t=x(a)-x(e);if(t!==0)return t;const o=a.confidence-e.confidence;if(o!==0)return o;const s=e.budgetCost-a.budgetCost;if(s!==0)return s;const n=b[e.nodeType]-b[a.nodeType];if(n!==0)return n;const r=d(e.source.path).localeCompare(d(a.source.path),"en-US");return r!==0?r:e.stableId.localeCompare(a.stableId,"en-US")}function D(e){const a={...P,...e.budgets},t=new Map;for(const r of e.items){const c=t.get(I(r));(!c||h(r,c)<0)&&t.set(I(r),r)}const o=[],s=[];let n=0;for(const r of[...t.values()].sort(h)){const c=n+Math.max(1,r.budgetCost);if(o.length>=a.maxItems||c>a.maxTotalCost){s.push({stableId:r.stableId,source:r.source,reasonCode:"budget_exceeded"});continue}o.push(r),n=c}return{schemaVersion:1,retrievalId:e.retrievalId,query:e.query,budget:{...a,totalCost:n},items:o,skipped:s,warnings:e.warnings??[],generatedAt:e.generatedAt}}export{f as CLIENT_COMMAND_CONTEXT_POLICIES,_ as CLIENT_COMMAND_CONTEXT_POLICY_ALIAS_MAP,m as CLIENT_COMMAND_CONTEXT_POLICY_BY_ID,E as CLIENT_COMMAND_CONTEXT_POLICY_BY_NUMBER,v as CLIENT_GRAPH_RETRIEVAL_PROFILE_BUDGETS,p as CLIENT_INTERNAL_COMMAND_CONTEXT_POLICIES,l as CLIENT_PUBLIC_COMMAND_CONTEXT_POLICIES,N as COMMAND_CONTEXT_RETRIEVAL_PROFILES,P as DEFAULT_GRAPH_RETRIEVAL_BUDGETS,O as GRAPH_RETRIEVAL_CLIENT_CONTRACT_VERSION,L as GRAPH_RETRIEVAL_SCHEMA_VERSION,h as compareGraphRetrievalItems,D as createGraphRetrievalMetadata,A as listClientCommandContextPolicies,S as listClientInternalCommandContextPolicies,R as listClientPublicCommandContextPolicies,y as normalizeCommandToken,d as normalizeGraphRetrievalPath,M as resolveClientCommandContextPolicy};
|
|
@@ -53,6 +53,8 @@ export { OfflineTelemetryQueue, type TelemetryEvent, type QueueConfig, type Queu
|
|
|
53
53
|
export { getCacheStatus, formatCacheStatus, type CacheStatusInfo, type CacheStatusOptions, } from './commands/cache-status.js';
|
|
54
54
|
export { getSubagentApprovalPolicy, ensureManagedSubagentApprovalPolicy, setSubagentApprovalMode, resetSubagentApprovalMode, ApprovalPolicyConfigError, type ApprovalPolicyConfigOptions, type ApprovalPolicyConfigResult, } from './config.js';
|
|
55
55
|
export { configCliHandler, type ConfigCliDependencies, } from './commands/config.js';
|
|
56
|
+
export { storyCheckpointCliHandler, parseStoryCheckpointArgs, } from './commands/story-checkpoint.js';
|
|
57
|
+
export { beginDirectYoloStoryCommit, finalizeDirectYoloStoryCheckpoint, issueDirectYoloSetupLeaseHandoff, recoverLegacyDirectYoloStoryCheckpoint, type DirectYoloCheckpointOptions, type DirectYoloCheckpointResult, type DirectYoloCommitPlan, type DirectYoloSetupHandoffReceipt, } from './git/direct-yolo-checkpoint.js';
|
|
56
58
|
export { FRONTMATTER_DIAGNOSTIC_CATEGORIES, FRONTMATTER_DIAGNOSTIC_REASON_CODES, getFrontmatterDiagnostic, formatFrontmatterDiagnostic, type FrontmatterDiagnosticCategory, type FrontmatterDiagnosticReasonCode, type PublicFrontmatterDiagnostic, } from './errors/frontmatter-diagnostics.js';
|
|
57
59
|
export { invoke, invokeCliHandler, collectStateSnapshot, type InvokeOptions, type InvokeResult, } from './commands/invoke.js';
|
|
58
60
|
export { TierAwareClient, type TierAwareClientOptions, type PreFlightResult, type QuotaSnapshot, } from './tier/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ResolverMode as o,NoOpCache as t}from"./types/index.js";import{LocalResolver as i}from"./resolvers/local-resolver.js";import{RemoteResolver as p,RemoteResolverError as l}from"./resolvers/remote-resolver.js";import{EncryptedCache as m}from"./cache/index.js";import{createResolver as
|
|
1
|
+
import{ResolverMode as o,NoOpCache as t}from"./types/index.js";import{LocalResolver as i}from"./resolvers/local-resolver.js";import{RemoteResolver as p,RemoteResolverError as l}from"./resolvers/remote-resolver.js";import{EncryptedCache as m}from"./cache/index.js";import{createResolver as f,selectResolver as d}from"./config/resolver-selection.js";import{collectContext as g}from"./context/context-collector.js";import{sanitizeValue as A,sanitizeRecord as y,sanitizeObject as S}from"./context/context-sanitizer.js";import{getMachineFingerprint as u}from"./machine/index.js";import{LicenseClient as T}from"./license/index.js";import{ClaudeCodeAdapter as M,CursorAdapter as h,VSCodeAdapter as E,GeminiAdapter as O,CodexAdapter as k,AntigravityAdapter as F,AdapterRegistry as P,UnknownTargetError as b,createDefaultRegistry as I,detectPlatform as N,isValidTargetId as j}from"./adapters/index.js";import{ClientCircuitBreaker as _,DegradationManager as w,DegradationLevel as z,FreshnessIndicator as G,RecoveryDetector as H}from"./resilience/index.js";import{OfflineTelemetryQueue as V}from"./telemetry/index.js";import{getCacheStatus as Q,formatCacheStatus as U}from"./commands/cache-status.js";import{getSubagentApprovalPolicy as J,ensureManagedSubagentApprovalPolicy as K,setSubagentApprovalMode as W,resetSubagentApprovalMode as X,ApprovalPolicyConfigError as Z}from"./config.js";import{configCliHandler as ee}from"./commands/config.js";import{storyCheckpointCliHandler as oe,parseStoryCheckpointArgs as te}from"./commands/story-checkpoint.js";import{beginDirectYoloStoryCommit as ie,finalizeDirectYoloStoryCheckpoint as ne,issueDirectYoloSetupLeaseHandoff as pe,recoverLegacyDirectYoloStoryCheckpoint as le}from"./git/direct-yolo-checkpoint.js";import{FRONTMATTER_DIAGNOSTIC_CATEGORIES as me,FRONTMATTER_DIAGNOSTIC_REASON_CODES as se,getFrontmatterDiagnostic as fe,formatFrontmatterDiagnostic as de}from"./errors/frontmatter-diagnostics.js";import{invoke as ge,invokeCliHandler as xe,collectStateSnapshot as Ae}from"./commands/invoke.js";import{TierAwareClient as Se}from"./tier/index.js";import{buildProjectMemoryContent as ue,createNodeProjectMemoryFs as ve,writeProjectMemory as Te,writeProjectMemoryTargetFiles as De}from"./memory/project-memory-writer.js";export{P as AdapterRegistry,F as AntigravityAdapter,Z as ApprovalPolicyConfigError,M as ClaudeCodeAdapter,_ as ClientCircuitBreaker,k as CodexAdapter,h as CursorAdapter,z as DegradationLevel,w as DegradationManager,m as EncryptedCache,me as FRONTMATTER_DIAGNOSTIC_CATEGORIES,se as FRONTMATTER_DIAGNOSTIC_REASON_CODES,G as FreshnessIndicator,O as GeminiAdapter,T as LicenseClient,i as LocalResolver,t as NoOpCache,V as OfflineTelemetryQueue,H as RecoveryDetector,p as RemoteResolver,l as RemoteResolverError,o as ResolverMode,Se as TierAwareClient,b as UnknownTargetError,E as VSCodeAdapter,ie as beginDirectYoloStoryCommit,ue as buildProjectMemoryContent,g as collectContext,Ae as collectStateSnapshot,ee as configCliHandler,I as createDefaultRegistry,ve as createNodeProjectMemoryFs,f as createResolver,N as detectPlatform,K as ensureManagedSubagentApprovalPolicy,ne as finalizeDirectYoloStoryCheckpoint,U as formatCacheStatus,de as formatFrontmatterDiagnostic,Q as getCacheStatus,fe as getFrontmatterDiagnostic,u as getMachineFingerprint,J as getSubagentApprovalPolicy,ge as invoke,xe as invokeCliHandler,j as isValidTargetId,pe as issueDirectYoloSetupLeaseHandoff,te as parseStoryCheckpointArgs,le as recoverLegacyDirectYoloStoryCheckpoint,X as resetSubagentApprovalMode,S as sanitizeObject,y as sanitizeRecord,A as sanitizeValue,d as selectResolver,W as setSubagentApprovalMode,oe as storyCheckpointCliHandler,Te as writeProjectMemory,De as writeProjectMemoryTargetFiles};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type InvokeInputEnvelopeV2, type InvokeInputSourceV2 } from '../../../shared/dist/invocation/index.js';
|
|
2
|
+
export declare class InvokeInputDecodeError extends Error {
|
|
3
|
+
readonly source: InvokeInputSourceV2;
|
|
4
|
+
readonly code = "INVOCATION_MALFORMED_INPUT";
|
|
5
|
+
readonly reason = "invalid-utf8";
|
|
6
|
+
constructor(source: InvokeInputSourceV2);
|
|
7
|
+
}
|
|
8
|
+
export declare function decodeExplicitInvokeInput(source: InvokeInputSourceV2, value: string | Uint8Array): string;
|
|
9
|
+
export declare function buildInvokeInputEnvelope(source: InvokeInputSourceV2, value: string | Uint8Array): InvokeInputEnvelopeV2;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createInvokeInputEnvelopeV2 as n}from"../../../shared/dist/invocation/index.js";class o extends Error{source;code="INVOCATION_MALFORMED_INPUT";reason="invalid-utf8";constructor(e){super(`${e} must contain valid UTF-8 text. Use --args-file or --stdin with an unmodified UTF-8 document.`),this.source=e,this.name="InvokeInputDecodeError"}}function r(t,e){if(typeof e=="string")return e;try{return new TextDecoder("utf-8",{fatal:!0}).decode(e)}catch{throw new o(t)}}function c(t,e){return n(t,r(t,e))}export{o as InvokeInputDecodeError,c as buildInvokeInputEnvelope,r as decodeExplicitInvokeInput};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* at runtime. Keep this file in sync with `packages/shared/src/project-memory-*`
|
|
6
6
|
* and enforce drift through the P130.06 release tests.
|
|
7
7
|
*/
|
|
8
|
-
export type ProjectMemoryTargetId = 'canonical' | 'claude-code' | 'codex' | 'gemini-cli' | 'antigravity' | 'vscode' | 'cursor' | 'opencode' | 'openclaw' | 'kimi' | 'github-copilot-cli';
|
|
8
|
+
export type ProjectMemoryTargetId = 'canonical' | 'claude-code' | 'codex' | 'grok' | 'gemini-cli' | 'antigravity' | 'vscode' | 'cursor' | 'opencode' | 'openclaw' | 'kimi' | 'github-copilot-cli';
|
|
9
9
|
export type ProjectMemoryTemplateKind = 'neocortex-md' | 'claude-md' | 'agents-md' | 'gemini-md' | 'copilot-instructions' | 'cursor-rule';
|
|
10
10
|
export interface ProjectMemoryBudget {
|
|
11
11
|
readonly maxLines: number;
|
|
@@ -64,7 +64,7 @@ export interface BootstrapArchitectureMemory {
|
|
|
64
64
|
readonly heuristics?: readonly string[];
|
|
65
65
|
}
|
|
66
66
|
export declare const CANONICAL_PROJECT_MEMORY_SOURCE: "NEOCORTEX.md";
|
|
67
|
-
export declare const PROJECT_MEMORY_TARGET_IDS: readonly ["claude-code", "codex", "gemini-cli", "antigravity", "vscode", "cursor", "opencode", "openclaw", "kimi", "github-copilot-cli"];
|
|
67
|
+
export declare const PROJECT_MEMORY_TARGET_IDS: readonly ["claude-code", "codex", "grok", "gemini-cli", "antigravity", "vscode", "cursor", "opencode", "openclaw", "kimi", "github-copilot-cli"];
|
|
68
68
|
export declare const PROJECT_MEMORY_TARGETS: {
|
|
69
69
|
readonly canonical: {
|
|
70
70
|
readonly targetId: "canonical";
|
|
@@ -147,6 +147,33 @@ export declare const PROJECT_MEMORY_TARGETS: {
|
|
|
147
147
|
readonly requiresWrapperPreservation: true;
|
|
148
148
|
readonly notes: "Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems.";
|
|
149
149
|
};
|
|
150
|
+
readonly grok: {
|
|
151
|
+
readonly targetId: "grok";
|
|
152
|
+
readonly platformName: "Grok Build";
|
|
153
|
+
readonly canonicalSource: "NEOCORTEX.md";
|
|
154
|
+
readonly primaryFile: "AGENTS.md";
|
|
155
|
+
readonly secondaryFiles: readonly [".grok/skills/neocortex/SKILL.md"];
|
|
156
|
+
readonly ownedBlockName: "NEOCORTEX-MEMORY";
|
|
157
|
+
readonly templateKind: "agents-md";
|
|
158
|
+
readonly budget: {
|
|
159
|
+
readonly maxLines: 220;
|
|
160
|
+
readonly maxBytes: 18000;
|
|
161
|
+
};
|
|
162
|
+
readonly linkRequirement: {
|
|
163
|
+
readonly canonicalSource: "NEOCORTEX.md";
|
|
164
|
+
readonly semanticFileRequired: true;
|
|
165
|
+
readonly symlinkBacked: true;
|
|
166
|
+
readonly wrapperAllowed: false;
|
|
167
|
+
readonly includeFallbackAllowed: false;
|
|
168
|
+
readonly requiresWrapperPreservation: false;
|
|
169
|
+
readonly fallbackIsCompatibilityRemediation: true;
|
|
170
|
+
readonly policy: "mandatory-semantic-symlink";
|
|
171
|
+
readonly notes: "Semantic platform memory file must resolve to NEOCORTEX.md through a symlink; do not replace it with an unrelated wrapper or copied frontmatter.";
|
|
172
|
+
};
|
|
173
|
+
readonly bidirectionalReference: ProjectMemoryBidirectionalReference;
|
|
174
|
+
readonly requiresWrapperPreservation: true;
|
|
175
|
+
readonly notes: "Grok Build reads AGENTS.md and the project-local Neocortex Skill; both resolve to canonical NEOCORTEX.md context.";
|
|
176
|
+
};
|
|
150
177
|
readonly 'gemini-cli': {
|
|
151
178
|
readonly targetId: "gemini-cli";
|
|
152
179
|
readonly platformName: "Gemini CLI";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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."},c={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."},a={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 t(o){return{canonicalSource:e,resolvesVia:o.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 l=["claude-code","codex","gemini-cli","antigravity","vscode","cursor","opencode","openclaw","kimi","github-copilot-cli"],s={canonical:{targetId:"canonical",platformName:"Neocortex Canonical Memory",canonicalSource:e,primaryFile:e,secondaryFiles:["AGENTS.md","CLAUDE.md","GEMINI.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"neocortex-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(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:[".claude/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"claude-md",budget:{maxLines:320,maxBytes:28e3},linkRequirement:r,bidirectionalReference:t(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:[".codex/agents/neocortex.toml"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(r),requiresWrapperPreservation:!0,notes:"Codex root instructions. Uppercase AGENTS.md is required on case-sensitive filesystems."},"gemini-cli":{targetId:"gemini-cli",platformName:"Gemini CLI",canonicalSource:e,primaryFile:"GEMINI.md",secondaryFiles:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(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:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(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:[".github/instructions/neocortex.instructions.md",".github/agents/neocortex.agent.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),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:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"cursor-rule",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),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:[".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:t(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:["~/.openclaw/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),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:["AGENTS.md",".kimi/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),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:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies."}};function d(o){return s[o]}function
|
|
2
|
-
`)}export{e as CANONICAL_PROJECT_MEMORY_SOURCE,s as PROJECT_MEMORY_TARGETS,l as PROJECT_MEMORY_TARGET_IDS,d as getProjectMemoryTarget,
|
|
1
|
+
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."},c={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."},a={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 t(o){return{canonicalSource:e,resolvesVia:o.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 l=["claude-code","codex","grok","gemini-cli","antigravity","vscode","cursor","opencode","openclaw","kimi","github-copilot-cli"],s={canonical:{targetId:"canonical",platformName:"Neocortex Canonical Memory",canonicalSource:e,primaryFile:e,secondaryFiles:["AGENTS.md","CLAUDE.md","GEMINI.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"neocortex-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(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:[".claude/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"claude-md",budget:{maxLines:320,maxBytes:28e3},linkRequirement:r,bidirectionalReference:t(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:[".codex/agents/neocortex.toml"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(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:[".grok/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:r,bidirectionalReference:t(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:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(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:[".gemini/agents/neocortex.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"gemini-md",budget:{maxLines:260,maxBytes:22e3},linkRequirement:r,bidirectionalReference:t(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:[".github/instructions/neocortex.instructions.md",".github/agents/neocortex.agent.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),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:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"cursor-rule",budget:{maxLines:180,maxBytes:14e3},linkRequirement:c,bidirectionalReference:t(c),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:[".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:t(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:["~/.openclaw/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),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:["AGENTS.md",".kimi/skills/neocortex/SKILL.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"agents-md",budget:{maxLines:220,maxBytes:18e3},linkRequirement:a,bidirectionalReference:t(a),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:["AGENTS.md"],ownedBlockName:"NEOCORTEX-MEMORY",templateKind:"copilot-instructions",budget:{maxLines:180,maxBytes:14e3},linkRequirement:a,bidirectionalReference:t(a),requiresWrapperPreservation:!0,notes:"GitHub Copilot CLI or gh alias instructions. Resolve compact memory back to NEOCORTEX.md without copying private prompt bodies."}};function d(o){return s[o]}function u(o){return o==="canonical"||l.includes(o)}function p(){return l.map(o=>s[o])}function y(o){const n=i=>i.replace(/\|/g,"\\|").replace(/\n/g," ");return["| Path | Title | Purpose | Suggested Usage |","| --- | --- | --- | --- |",...o.map(i=>`| ${n(i.path)} | ${n(i.title)} | ${n(i.purpose)} | ${n(i.suggestedUsage)} |`)].join(`
|
|
2
|
+
`)}export{e as CANONICAL_PROJECT_MEMORY_SOURCE,s as PROJECT_MEMORY_TARGETS,l as PROJECT_MEMORY_TARGET_IDS,d as getProjectMemoryTarget,u as isProjectMemoryTargetId,p as listProjectMemoryTargets,y as renderArchitectureReferenceTable};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ProjectIdentityCapabilityReason = 'supported' | 'fetch-unavailable' | 'request-failed' | 'http-rejected' | 'response-too-large' | 'response-invalid' | 'capability-missing';
|
|
2
|
+
export interface ProjectIdentityCapabilityProbe {
|
|
3
|
+
readonly supported: boolean;
|
|
4
|
+
readonly reason: ProjectIdentityCapabilityReason;
|
|
5
|
+
readonly publicSafe: true;
|
|
6
|
+
}
|
|
7
|
+
type FetchLike = (input: string, init?: RequestInit) => Promise<Pick<Response, 'ok' | 'text'>>;
|
|
8
|
+
/**
|
|
9
|
+
* Fail-closed, non-mutating rollout probe. An older server cannot cause the
|
|
10
|
+
* client to persist a local project ID that has no remote floor authority.
|
|
11
|
+
*/
|
|
12
|
+
export declare function probeProjectIdentityMigrationCapability(serverUrl: string, fetcher?: FetchLike | undefined): Promise<ProjectIdentityCapabilityProbe>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type ProjectIdentityMigrationReceiptV1, type ProjectIdentityMigrationRequestV1 } from '../../../shared/dist/invocation/index.js';
|
|
2
|
+
declare const MIGRATION_SCHEMA_VERSION: 1;
|
|
3
|
+
export type ProjectIdentityMigrationPhase = 'prepared' | 'remote-acknowledged' | 'finalized';
|
|
4
|
+
export interface ProjectIdentityMigrationDocumentV1 {
|
|
5
|
+
readonly schemaVersion: typeof MIGRATION_SCHEMA_VERSION;
|
|
6
|
+
readonly operationId: string;
|
|
7
|
+
readonly projectId: string;
|
|
8
|
+
readonly phase: ProjectIdentityMigrationPhase;
|
|
9
|
+
readonly legacyEpicFloor: number;
|
|
10
|
+
readonly originalStateExists: boolean;
|
|
11
|
+
readonly originalStateDigest: string;
|
|
12
|
+
readonly preparedStateDigest: string;
|
|
13
|
+
readonly backupPath: string | null;
|
|
14
|
+
readonly createdAt: string;
|
|
15
|
+
readonly updatedAt: string;
|
|
16
|
+
readonly receipt?: ProjectIdentityMigrationReceiptV1;
|
|
17
|
+
}
|
|
18
|
+
export interface PreparedProjectIdentityMigration {
|
|
19
|
+
readonly changed: boolean;
|
|
20
|
+
readonly document: ProjectIdentityMigrationDocumentV1;
|
|
21
|
+
readonly request: ProjectIdentityMigrationRequestV1;
|
|
22
|
+
}
|
|
23
|
+
export declare class ProjectIdentityMigrationError extends Error {
|
|
24
|
+
readonly code: string;
|
|
25
|
+
constructor(code: string, message?: string);
|
|
26
|
+
}
|
|
27
|
+
export declare function prepareProjectIdentityMigration(projectRoot: string): PreparedProjectIdentityMigration;
|
|
28
|
+
export declare function finalizeProjectIdentityMigration(projectRoot: string, receipt: ProjectIdentityMigrationReceiptV1): ProjectIdentityMigrationDocumentV1;
|
|
29
|
+
/** Persist the authenticated ACK before local finalization so a crash is reconcilable. */
|
|
30
|
+
export declare function acknowledgeProjectIdentityMigration(projectRoot: string, receipt: ProjectIdentityMigrationReceiptV1): ProjectIdentityMigrationDocumentV1;
|
|
31
|
+
export declare function rollbackPreparedProjectIdentityMigration(projectRoot: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Read-only admission check used to prevent create-epic from observing the
|
|
34
|
+
* locally prepared project ID before its remote floor has been acknowledged.
|
|
35
|
+
*/
|
|
36
|
+
export declare function readProjectIdentityMigrationPhase(projectRoot: string): ProjectIdentityMigrationPhase | null;
|
|
37
|
+
export declare function projectIdentityMigrationRelativePaths(projectRoot: string): {
|
|
38
|
+
readonly state: string;
|
|
39
|
+
readonly migration: string;
|
|
40
|
+
};
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{createHash as z,randomUUID as m}from"node:crypto";import{existsSync as I,linkSync as q,lstatSync as R,mkdirSync as Q,readFileSync as T,realpathSync as W,statSync as X,unlinkSync as O}from"node:fs";import{dirname as E,join as a,relative as F,resolve as Z}from"node:path";import{assertProjectIdentityMigrationReceiptV1 as j,PROJECT_ID_PATTERN as K}from"../../../shared/dist/invocation/index.js";import{atomicReplaceUtf8 as l,durableCreateUtf8 as U,fsyncDirectoryBestEffort as u,recoverAtomicReplaceUtf8 as $}from"../fs/atomic-state-replace.js";const Et=1,_=a(".neocortex","state.json"),f=a(".neocortex","project-identity-migration.json"),tt=a(".neocortex","project-identity-migration.lock"),et=/^\.neocortex[\\/]state\.json\.project-identity-backup-(?:\d{8}T\d{9}Z-)?mig_[a-f0-9]{32}$/;class n extends Error{code;constructor(r,t=r){super(t),this.code=r,this.name="ProjectIdentityMigrationError"}}const p=o=>z("sha256").update(o).digest("hex");function rt(){return`prj_${m().replaceAll("-","")}`}function ot(){return`mig_${m().replaceAll("-","")}`}function nt(o){return o.toISOString().replace(/[-:.]/g,"")}function g(o){const r=Z(o);let t;try{t=W(r)}catch{throw new n("PROJECT_IDENTITY_ROOT_INVALID")}if(!X(t).isDirectory())throw new n("PROJECT_IDENTITY_ROOT_INVALID");const e=a(t,".neocortex");if(I(e)&&R(e).isSymbolicLink())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED");const i=a(t,_);if(I(i)){const s=R(i);if(s.isSymbolicLink()||!s.isFile())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED")}const c=a(t,f);if(I(c)){const s=R(c);if(s.isSymbolicLink()||!s.isFile())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED")}return t}function A(o,r){const t=a(o,tt);Q(E(t),{recursive:!0,mode:448});const e=()=>{const i=`${t}.${process.pid}.${m()}.owner`;U(i,`${process.pid}
|
|
2
|
+
`);try{q(i,t),u(E(t))}finally{try{O(i)}catch{}u(E(t))}};try{e()}catch(i){if(i.code!=="EEXIST")throw new n("PROJECT_IDENTITY_MIGRATION_LOCKED");const c=R(t);if(c.isSymbolicLink()||!c.isFile())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED");const s=T(t,"utf8");if(!/^[1-9][0-9]*\n$/.test(s)||s.length>24)throw new n("PROJECT_IDENTITY_MIGRATION_LOCK_CORRUPT");const d=Number(s.trim());let N=!0;try{process.kill(d,0)}catch(h){N=h.code!=="ESRCH"}if(N)throw new n("PROJECT_IDENTITY_MIGRATION_LOCKED");try{O(t),u(E(t)),e()}catch{throw new n("PROJECT_IDENTITY_MIGRATION_LOCKED")}}try{return r()}finally{try{O(t),u(E(t))}catch{}}}function v(o){let r;try{r=JSON.parse(o)}catch{throw new n("PROJECT_IDENTITY_STATE_CORRUPT")}if(!r||typeof r!="object"||Array.isArray(r))throw new n("PROJECT_IDENTITY_STATE_CORRUPT");return r}function y(o){const r=a(o,f);try{$(r),$(a(o,_))}catch{throw new n("PROJECT_IDENTITY_ATOMIC_RECOVERY_FAILED")}if(!I(r))return null;let t;try{t=JSON.parse(T(r,"utf8"))}catch{throw new n("PROJECT_IDENTITY_MIGRATION_STATE_CORRUPT")}if(!t||typeof t!="object"||Array.isArray(t))throw new n("PROJECT_IDENTITY_MIGRATION_STATE_CORRUPT");const e=t;if(e.schemaVersion!==1||typeof e.operationId!="string"||!/^mig_[a-f0-9]{32}$/.test(e.operationId)||typeof e.projectId!="string"||!K.test(e.projectId)||!["prepared","remote-acknowledged","finalized"].includes(String(e.phase))||!Number.isSafeInteger(e.legacyEpicFloor)||(e.legacyEpicFloor??-1)<0||typeof e.originalStateExists!="boolean"||typeof e.originalStateDigest!="string"||!/^[a-f0-9]{64}$/.test(e.originalStateDigest)||typeof e.preparedStateDigest!="string"||!/^[a-f0-9]{64}$/.test(e.preparedStateDigest)||e.backupPath!==null&&(typeof e.backupPath!="string"||!et.test(e.backupPath))||typeof e.createdAt!="string"||typeof e.updatedAt!="string")throw new n("PROJECT_IDENTITY_MIGRATION_STATE_CORRUPT");e.receipt!==void 0&&j(e.receipt);const i=e.phase==="remote-acknowledged"||e.phase==="finalized";if(e.phase==="prepared"&&e.receipt!==void 0||i&&e.receipt===void 0||e.receipt!==void 0&&(e.receipt.operationId!==e.operationId||e.receipt.projectId!==e.projectId||e.receipt.acceptedLegacyFloor<e.legacyEpicFloor))throw new n("PROJECT_IDENTITY_MIGRATION_STATE_CORRUPT");return e}function it(o){const r=[];o.epics&&typeof o.epics=="object"&&!Array.isArray(o.epics)&&r.push(...Object.keys(o.epics));const t=o.epic_id_ledger;if(t&&typeof t=="object"&&!Array.isArray(t)){const e=t.reserved_ids;Array.isArray(e)&&r.push(...e.filter(i=>typeof i=="string"))}return r.reduce((e,i)=>{const c=i.match(/^P?(\d+)$/i);if(!c)return e;const s=Number(c[1]);return Number.isSafeInteger(s)?Math.max(e,s):e},0)}function J(o){return{version:1,operationId:o.operationId,projectId:o.projectId,localStateDigest:o.preparedStateDigest,legacyEpicFloor:o.legacyEpicFloor,phase:"seed"}}function B(o,r){const t=v(o),e=t.config&&typeof t.config=="object"&&!Array.isArray(t.config)?"config":t.project&&typeof t.project=="object"&&!Array.isArray(t.project)?"project":"config",i=t[e]??{};return t[e]={...i,project_id:r},t.schema_version===void 0&&(t.schema_version=1),(!t.stories||typeof t.stories!="object"||Array.isArray(t.stories))&&(t.stories={}),(!t.epics||typeof t.epics!="object"||Array.isArray(t.epics))&&(t.epics={}),{raw:`${JSON.stringify(t,null,2)}
|
|
3
|
+
`,state:t}}function V(){return`${JSON.stringify({schema_version:1,config:{project_name:"neocortex-project",default_branch:"main",language:"pt-BR"},stories:{},epics:{}},null,2)}
|
|
4
|
+
`}function ct(o,r){if(!r.originalStateExists)return;if(!r.backupPath)throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_MISSING");const t=a(o,r.backupPath);if(!I(t))throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_MISSING");const e=R(t);if(e.isSymbolicLink()||!e.isFile())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED");if(p(T(t))!==r.originalStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_CORRUPT")}function ft(o){const r=g(o);return A(r,()=>{const t=y(r);if(t){const P=a(r,_);ct(r,t);const w=I(P),L=w?p(T(P)):null;if(L===t.preparedStateDigest)return{changed:!1,document:t,request:J(t)};if(!(t.phase==="prepared"&&(w&&L===t.originalStateDigest||!w&&!t.originalStateExists)))throw new n("PROJECT_IDENTITY_MIGRATION_STATE_DRIFT");const H=w?T(P,"utf8"):V(),x=B(H,t.projectId).raw;if(p(x)!==t.preparedStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_STATE_DRIFT");return l(P,x),{changed:!0,document:t,request:J(t)}}const e=a(r,_),i=I(e),c=i?T(e,"utf8"):V(),s=v(c),d=s.config&&typeof s.config=="object"&&!Array.isArray(s.config)?"config":s.project&&typeof s.project=="object"&&!Array.isArray(s.project)?"project":"config",h=(s[d]??{}).project_id,M=typeof h=="string"&&K.test(h)?h:rt(),Y=B(c,M),S=Y.raw,b=ot(),k=new Date,D=i?a(".neocortex",`state.json.project-identity-backup-${nt(k)}-${b}`):null;D&&U(a(r,D),c);const G=k.toISOString(),C={schemaVersion:1,operationId:b,projectId:M,phase:"prepared",legacyEpicFloor:it(Y.state),originalStateExists:i,originalStateDigest:p(c),preparedStateDigest:p(S),backupPath:D,createdAt:G,updatedAt:G};return l(a(r,f),`${JSON.stringify(C,null,2)}
|
|
5
|
+
`),l(e,S),{changed:S!==c,document:C,request:J(C)}})}function dt(o,r){j(r);const t=g(o);return A(t,()=>{const e=y(t);if(!e)throw new n("PROJECT_IDENTITY_MIGRATION_NOT_PREPARED");if(e.operationId!==r.operationId||e.projectId!==r.projectId)throw new n("PROJECT_IDENTITY_MIGRATION_RECEIPT_CONFLICT");const i=a(t,_);if(!I(i)||p(T(i))!==e.preparedStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_STATE_DRIFT");if(e.phase==="prepared"||!e.receipt||e.receipt.receiptDigest!==r.receiptDigest)throw new n("PROJECT_IDENTITY_MIGRATION_ACK_REQUIRED");if(e.phase==="finalized")return e;const c={...e,phase:"finalized",updatedAt:new Date().toISOString(),receipt:r};return l(a(t,f),`${JSON.stringify(c,null,2)}
|
|
6
|
+
`),c})}function Rt(o,r){j(r);const t=g(o);return A(t,()=>{const e=y(t);if(!e)throw new n("PROJECT_IDENTITY_MIGRATION_NOT_PREPARED");if(e.operationId!==r.operationId||e.projectId!==r.projectId)throw new n("PROJECT_IDENTITY_MIGRATION_RECEIPT_CONFLICT");const i=a(t,_);if(!I(i)||p(T(i))!==e.preparedStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_STATE_DRIFT");if(e.receipt&&e.receipt.receiptDigest!==r.receiptDigest)throw new n("PROJECT_IDENTITY_MIGRATION_RECEIPT_CONFLICT");if(e.phase==="remote-acknowledged"||e.phase==="finalized")return e;const c={...e,phase:"remote-acknowledged",updatedAt:new Date().toISOString(),receipt:r};return l(a(t,f),`${JSON.stringify(c,null,2)}
|
|
7
|
+
`),c})}function lt(o){const r=g(o);A(r,()=>{const t=y(r);if(!t)return;if(t.phase!=="prepared"||t.receipt)throw new n("PROJECT_IDENTITY_MIGRATION_ROLLBACK_AFTER_ACK_DENIED");const e=a(r,_);if(!I(e)||p(T(e))!==t.preparedStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_STATE_DRIFT");if(t.originalStateExists){if(!t.backupPath)throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_MISSING");const c=a(r,t.backupPath);if(!I(c))throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_MISSING");const s=R(c);if(s.isSymbolicLink()||!s.isFile())throw new n("PROJECT_IDENTITY_SYMLINK_REJECTED");const d=T(c,"utf8");if(p(d)!==t.originalStateDigest)throw new n("PROJECT_IDENTITY_MIGRATION_BACKUP_CORRUPT");l(e,d)}else O(e),u(E(e));const i=a(r,f);O(i),u(E(i))})}function ut(o){const r=g(o);return y(r)?.phase??null}function gt(o){const r=g(o);return{state:F(r,a(r,_)),migration:F(r,a(r,f))}}export{n as ProjectIdentityMigrationError,Rt as acknowledgeProjectIdentityMigration,dt as finalizeProjectIdentityMigration,ft as prepareProjectIdentityMigration,gt as projectIdentityMigrationRelativePaths,ut as readProjectIdentityMigrationPhase,lt as rollbackPreparedProjectIdentityMigration};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const u=1,p="max",s="[P201-EV-MAX-POLICY]",c=new Set(["claude-code","cursor","vscode","gemini","codex","opencode","github-copilot-cli","kimi","antigravity","openclaw","runner","unknown"]),r=e=>c.has(e)?e:"unknown",d=Object.freeze({"claude-code":{status:"validated",scope:"child",fallbackMode:"none",fallbackReasonCode:null},opencode:{status:"unvalidated",scope:"child",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},codex:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},gemini:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},vscode:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},"github-copilot-cli":{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},kimi:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},cursor:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},antigravity:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},openclaw:{status:"unsupported",scope:"none",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unsupported"},runner:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unsupported"},unknown:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-target-unknown"}}),n=Object.freeze({disabled:0,standard:1,max:2});function f(e){return e==="max"||e==="standard"||e==="disabled"}function i(e){const a=r(e),o=d[a];return a==="unknown"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"platform-target-unknown"}):o.status==="unsupported"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"host-capability-unsupported"}):o.status==="unvalidated"?Object.freeze({platformTarget:a,maximumMode:"standard",scope:o.scope,reductionReason:"host-capability-unvalidated"}):Object.freeze({platformTarget:a,maximumMode:"max",scope:o.scope,reductionReason:"host-policy-reduced"})}function b(e={}){const a=e.userOverride??"max",o=e.hostPolicy??i(e.platformTarget),t=d[o.platformTarget],l=n[a]>n[o.maximumMode];return Object.freeze({schemaVersion:1,requestedMode:a,effectiveMode:l?o.maximumMode:a,source:e.userOverride?"user-override":"managed-default",platformTarget:o.platformTarget,scope:o.scope,effectiveReason:l?o.reductionReason:"requested-mode-honored",fallbackMode:t.fallbackMode,fallbackReasonCode:t.fallbackReasonCode})}function m(e,a,o){return Object.freeze({evidence:s,event:e,occurredAt:o,...a})}export{s as SUBAGENT_APPROVAL_EVIDENCE,p as SUBAGENT_APPROVAL_MANAGED_DEFAULT,u as SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION,m as createSubagentApprovalAuditEvent,i as deriveSubagentHostApprovalPolicy,f as isSubagentApprovalMode,b as resolveSubagentApprovalPolicy};
|
|
1
|
+
const u=1,p="max",s="[P201-EV-MAX-POLICY]",c=new Set(["claude-code","cursor","vscode","gemini","codex","opencode","github-copilot-cli","kimi","antigravity","openclaw","grok","runner","unknown"]),r=e=>c.has(e)?e:"unknown",d=Object.freeze({"claude-code":{status:"validated",scope:"child",fallbackMode:"none",fallbackReasonCode:null},opencode:{status:"unvalidated",scope:"child",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},codex:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},gemini:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},vscode:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},"github-copilot-cli":{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},kimi:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},cursor:{status:"unvalidated",scope:"session",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unvalidated"},antigravity:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},grok:{status:"unvalidated",scope:"inherited",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unvalidated"},openclaw:{status:"unsupported",scope:"none",fallbackMode:"root-inline",fallbackReasonCode:"platform-child-unsupported"},runner:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-child-unsupported"},unknown:{status:"unsupported",scope:"none",fallbackMode:"shell-loop",fallbackReasonCode:"platform-target-unknown"}}),n=Object.freeze({disabled:0,standard:1,max:2});function f(e){return e==="max"||e==="standard"||e==="disabled"}function i(e){const a=r(e),o=d[a];return a==="unknown"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"platform-target-unknown"}):o.status==="unsupported"?Object.freeze({platformTarget:a,maximumMode:"disabled",scope:o.scope,reductionReason:"host-capability-unsupported"}):o.status==="unvalidated"?Object.freeze({platformTarget:a,maximumMode:"standard",scope:o.scope,reductionReason:"host-capability-unvalidated"}):Object.freeze({platformTarget:a,maximumMode:"max",scope:o.scope,reductionReason:"host-policy-reduced"})}function b(e={}){const a=e.userOverride??"max",o=e.hostPolicy??i(e.platformTarget),t=d[o.platformTarget],l=n[a]>n[o.maximumMode];return Object.freeze({schemaVersion:1,requestedMode:a,effectiveMode:l?o.maximumMode:a,source:e.userOverride?"user-override":"managed-default",platformTarget:o.platformTarget,scope:o.scope,effectiveReason:l?o.reductionReason:"requested-mode-honored",fallbackMode:t.fallbackMode,fallbackReasonCode:t.fallbackReasonCode})}function m(e,a,o){return Object.freeze({evidence:s,event:e,occurredAt:o,...a})}export{s as SUBAGENT_APPROVAL_EVIDENCE,p as SUBAGENT_APPROVAL_MANAGED_DEFAULT,u as SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION,m as createSubagentApprovalAuditEvent,i as deriveSubagentHostApprovalPolicy,f as isSubagentApprovalMode,b as resolveSubagentApprovalPolicy};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Branchless preparation sandboxes for continuous yoloop children.
|
|
3
|
+
*
|
|
4
|
+
* A child receives an independent Git index at a detached HEAD, but no branch
|
|
5
|
+
* and no Git worktree are created. Only the root applies the validated result
|
|
6
|
+
* and creates the single logical story commit on the epic branch.
|
|
7
|
+
*/
|
|
8
|
+
import type { StoryCommitCheckpoint } from '../../../../shared/dist/yoloop/branch-unit.js';
|
|
9
|
+
import type { YoloopPreparationBundleAdmission } from '../../../../shared/dist/yoloop/execution-plan.js';
|
|
10
|
+
import { type AnchoredDirectoryIdentity } from '../../git/secure-filesystem-boundary.js';
|
|
11
|
+
import type { HeadlessCommandRunner } from './types.js';
|
|
12
|
+
export interface ContinuousStoryWorkspaceRequest {
|
|
13
|
+
readonly projectRoot: string;
|
|
14
|
+
readonly epicId: string;
|
|
15
|
+
readonly storyId: string;
|
|
16
|
+
readonly targetRef: string;
|
|
17
|
+
readonly dispatchId: string;
|
|
18
|
+
readonly executionBranch: string;
|
|
19
|
+
readonly graphRevision: string;
|
|
20
|
+
readonly authorizedWriteSet: readonly string[];
|
|
21
|
+
}
|
|
22
|
+
interface ContinuousContextSnapshot {
|
|
23
|
+
readonly path: string;
|
|
24
|
+
readonly content?: Buffer;
|
|
25
|
+
}
|
|
26
|
+
export interface ContinuousStoryWorkspaceLease {
|
|
27
|
+
readonly projectRoot: string;
|
|
28
|
+
readonly workspacePath: string;
|
|
29
|
+
readonly workspaceStrategy: 'branchless_sandbox';
|
|
30
|
+
readonly storyId: string;
|
|
31
|
+
readonly targetRef: string;
|
|
32
|
+
readonly epicId: string;
|
|
33
|
+
readonly executionBranch: string;
|
|
34
|
+
readonly graphRevision: string;
|
|
35
|
+
/** Root-observed graph authority snapshot; distinct from the server epoch id. */
|
|
36
|
+
readonly graphAuthorityRevision: string;
|
|
37
|
+
/** Physical epic epoch observed with the authority snapshot. */
|
|
38
|
+
readonly graphAuthorityEpoch: string | null;
|
|
39
|
+
/** Effective target-story status observed with the authority snapshot. */
|
|
40
|
+
readonly graphAuthorityStoryStatus: string | null;
|
|
41
|
+
readonly authorizedWriteSet: readonly string[];
|
|
42
|
+
readonly claimRevision: string;
|
|
43
|
+
readonly baseSha: string;
|
|
44
|
+
readonly preparedAt: string;
|
|
45
|
+
readonly dispatchId: string;
|
|
46
|
+
readonly leasePath: string;
|
|
47
|
+
readonly leaseOwnerNonce: string;
|
|
48
|
+
readonly workspaceOwnerNonce: string;
|
|
49
|
+
readonly workspaceIdentity: AnchoredDirectoryIdentity;
|
|
50
|
+
readonly contextSnapshots: readonly ContinuousContextSnapshot[];
|
|
51
|
+
}
|
|
52
|
+
export type ContinuousStoryWorkspaceResult<T> = {
|
|
53
|
+
readonly ok: true;
|
|
54
|
+
readonly value: T;
|
|
55
|
+
} | {
|
|
56
|
+
readonly ok: false;
|
|
57
|
+
readonly reasonCode: string;
|
|
58
|
+
};
|
|
59
|
+
export interface ContinuousStoryWorkspaceManager {
|
|
60
|
+
prepare(input: ContinuousStoryWorkspaceRequest): Promise<ContinuousStoryWorkspaceResult<ContinuousStoryWorkspaceLease>>;
|
|
61
|
+
integrate(lease: ContinuousStoryWorkspaceLease, authority?: {
|
|
62
|
+
readonly receiptRefs?: readonly string[];
|
|
63
|
+
readonly nowIso?: string;
|
|
64
|
+
}): Promise<ContinuousStoryWorkspaceResult<{
|
|
65
|
+
readonly headSha: string;
|
|
66
|
+
readonly alreadyIntegrated: boolean;
|
|
67
|
+
readonly bundle: YoloopPreparationBundleAdmission;
|
|
68
|
+
readonly checkpoint: StoryCommitCheckpoint;
|
|
69
|
+
}>>;
|
|
70
|
+
release(lease: ContinuousStoryWorkspaceLease, preserveForRecovery: boolean): Promise<void>;
|
|
71
|
+
}
|
|
72
|
+
export interface ContinuousStoryWorkspaceManagerOptions {
|
|
73
|
+
/** Test-only platform seam; production always uses process.platform. */
|
|
74
|
+
readonly platform?: NodeJS.Platform;
|
|
75
|
+
/** Test observer after canonical P205; its return value never authorizes QA. */
|
|
76
|
+
readonly storyQaRunner?: (input: {
|
|
77
|
+
readonly projectRoot: string;
|
|
78
|
+
readonly storyId: string;
|
|
79
|
+
readonly headSha: string;
|
|
80
|
+
}) => Promise<unknown>;
|
|
81
|
+
/** Deterministic adversarial seam used only to prove QA-to-checkpoint races. */
|
|
82
|
+
readonly beforeCheckpointPersist?: (input: {
|
|
83
|
+
readonly projectRoot: string;
|
|
84
|
+
readonly storyId: string;
|
|
85
|
+
readonly headSha: string;
|
|
86
|
+
}) => Promise<void>;
|
|
87
|
+
/** Fault seam at the exact commit-return -> checkpoint-authority boundary. */
|
|
88
|
+
readonly afterRootCommit?: (input: {
|
|
89
|
+
readonly projectRoot: string;
|
|
90
|
+
readonly storyId: string;
|
|
91
|
+
readonly headSha: string;
|
|
92
|
+
}) => Promise<void>;
|
|
93
|
+
/** Test-only clock proving that lease expiry is checked again inside checkpoint CAS. */
|
|
94
|
+
readonly checkpointNow?: (phase: 'before-mutation' | 'pre-commit') => number;
|
|
95
|
+
/** Fault seam inside the serialized checkpoint preCommit, before its final authority read. */
|
|
96
|
+
readonly insideCheckpointPreCommit?: (input: {
|
|
97
|
+
readonly projectRoot: string;
|
|
98
|
+
readonly storyId: string;
|
|
99
|
+
readonly headSha: string;
|
|
100
|
+
}) => Promise<void>;
|
|
101
|
+
/** Fault seam after durable checkpoint persistence and before post-persist verification/cleanup. */
|
|
102
|
+
readonly afterCheckpointPersist?: (input: {
|
|
103
|
+
readonly projectRoot: string;
|
|
104
|
+
readonly storyId: string;
|
|
105
|
+
readonly headSha: string;
|
|
106
|
+
}) => Promise<void>;
|
|
107
|
+
/** Adversarial seam after writer acquisition and before the serialized root Git guard. */
|
|
108
|
+
readonly beforeRootCommit?: (input: {
|
|
109
|
+
readonly projectRoot: string;
|
|
110
|
+
readonly storyId: string;
|
|
111
|
+
readonly headSha: string;
|
|
112
|
+
}) => Promise<void>;
|
|
113
|
+
/** Deterministic adversarial seam immediately before a sandbox write commit. */
|
|
114
|
+
readonly beforeSandboxWriteCommit?: (input: {
|
|
115
|
+
readonly boundaryRoot: string;
|
|
116
|
+
readonly relativePath: string;
|
|
117
|
+
readonly destinationPath: string;
|
|
118
|
+
}) => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Create the only command runner authorized for a continuous child. The helper
|
|
122
|
+
* owns and revalidates the sandbox cwd before launching the runtime, so the
|
|
123
|
+
* mutable public pathname is never reused as the runtime's cwd.
|
|
124
|
+
*/
|
|
125
|
+
export declare function createAnchoredContinuousStoryCommandRunner(lease: Pick<ContinuousStoryWorkspaceLease, 'workspacePath' | 'workspaceIdentity'>, hooks?: {
|
|
126
|
+
readonly beforeHandoff?: () => Promise<void> | void;
|
|
127
|
+
readonly afterHandoff?: () => Promise<void> | void;
|
|
128
|
+
}): HeadlessCommandRunner;
|
|
129
|
+
/** Default continuous-DAG workspace policy. It never creates a Git worktree. */
|
|
130
|
+
export declare function createBranchlessContinuousStoryWorkspaceManager(options?: ContinuousStoryWorkspaceManagerOptions): ContinuousStoryWorkspaceManager;
|
|
131
|
+
export {};
|