@ornexus/neocortex 4.60.26 → 4.60.27
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 +23 -23
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +2 -2
- package/packages/client/dist/cli.js +1 -0
- package/packages/client/dist/commands/story-checkpoint.d.ts +1 -1
- package/packages/client/dist/commands/story-checkpoint.js +1 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +18 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -3
- package/packages/client/dist/index.d.ts +1 -1
- package/packages/client/dist/index.js +1 -1
- package/packages/client/dist/runner-cli.js +0 -0
- package/targets-stubs/antigravity/gemini.md +1 -1
- 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 +2 -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 +1 -1
- package/targets-stubs/cursor/agent.md +2 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/opencode/neocortex-root.md +1 -1
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
package/dist/sbom.cdx.json
CHANGED
|
@@ -984,7 +984,7 @@
|
|
|
984
984
|
"version": "1.26.0"
|
|
985
985
|
},
|
|
986
986
|
{
|
|
987
|
-
"bom-ref": "@neocortex/client@4.60.
|
|
987
|
+
"bom-ref": "@neocortex/client@4.60.27",
|
|
988
988
|
"group": "@neocortex",
|
|
989
989
|
"name": "client",
|
|
990
990
|
"properties": [
|
|
@@ -993,9 +993,9 @@
|
|
|
993
993
|
"value": "node_modules/@neocortex/client"
|
|
994
994
|
}
|
|
995
995
|
],
|
|
996
|
-
"purl": "pkg:npm/%40neocortex/client@4.60.
|
|
996
|
+
"purl": "pkg:npm/%40neocortex/client@4.60.27",
|
|
997
997
|
"type": "library",
|
|
998
|
-
"version": "4.60.
|
|
998
|
+
"version": "4.60.27"
|
|
999
999
|
},
|
|
1000
1000
|
{
|
|
1001
1001
|
"bom-ref": "@neocortex/core@0.1.0",
|
|
@@ -1012,7 +1012,7 @@
|
|
|
1012
1012
|
"version": "0.1.0"
|
|
1013
1013
|
},
|
|
1014
1014
|
{
|
|
1015
|
-
"bom-ref": "@neocortex/server@4.60.
|
|
1015
|
+
"bom-ref": "@neocortex/server@4.60.27",
|
|
1016
1016
|
"group": "@neocortex",
|
|
1017
1017
|
"name": "server",
|
|
1018
1018
|
"properties": [
|
|
@@ -1021,12 +1021,12 @@
|
|
|
1021
1021
|
"value": "node_modules/@neocortex/server"
|
|
1022
1022
|
}
|
|
1023
1023
|
],
|
|
1024
|
-
"purl": "pkg:npm/%40neocortex/server@4.60.
|
|
1024
|
+
"purl": "pkg:npm/%40neocortex/server@4.60.27",
|
|
1025
1025
|
"type": "library",
|
|
1026
|
-
"version": "4.60.
|
|
1026
|
+
"version": "4.60.27"
|
|
1027
1027
|
},
|
|
1028
1028
|
{
|
|
1029
|
-
"bom-ref": "@neocortex/shared@4.60.
|
|
1029
|
+
"bom-ref": "@neocortex/shared@4.60.27",
|
|
1030
1030
|
"group": "@neocortex",
|
|
1031
1031
|
"name": "shared",
|
|
1032
1032
|
"properties": [
|
|
@@ -1035,9 +1035,9 @@
|
|
|
1035
1035
|
"value": "node_modules/@neocortex/shared"
|
|
1036
1036
|
}
|
|
1037
1037
|
],
|
|
1038
|
-
"purl": "pkg:npm/%40neocortex/shared@4.60.
|
|
1038
|
+
"purl": "pkg:npm/%40neocortex/shared@4.60.27",
|
|
1039
1039
|
"type": "library",
|
|
1040
|
-
"version": "4.60.
|
|
1040
|
+
"version": "4.60.27"
|
|
1041
1041
|
},
|
|
1042
1042
|
{
|
|
1043
1043
|
"bom-ref": "@opentelemetry/api-logs@0.214.0",
|
|
@@ -9405,17 +9405,17 @@
|
|
|
9405
9405
|
"dependsOn": [
|
|
9406
9406
|
"@clack/prompts@1.0.1",
|
|
9407
9407
|
"@modelcontextprotocol/sdk@1.26.0",
|
|
9408
|
-
"@neocortex/client@4.60.
|
|
9408
|
+
"@neocortex/client@4.60.27",
|
|
9409
9409
|
"@neocortex/core@0.1.0",
|
|
9410
|
-
"@neocortex/server@4.60.
|
|
9411
|
-
"@neocortex/shared@4.60.
|
|
9410
|
+
"@neocortex/server@4.60.27",
|
|
9411
|
+
"@neocortex/shared@4.60.27",
|
|
9412
9412
|
"better-sqlite3@12.11.1",
|
|
9413
9413
|
"execa@9.6.1",
|
|
9414
9414
|
"node-cache@5.1.2",
|
|
9415
9415
|
"picocolors@1.1.1",
|
|
9416
9416
|
"zod@4.4.3"
|
|
9417
9417
|
],
|
|
9418
|
-
"ref": "@ornexus/neocortex@4.60.
|
|
9418
|
+
"ref": "@ornexus/neocortex@4.60.27"
|
|
9419
9419
|
},
|
|
9420
9420
|
{
|
|
9421
9421
|
"dependsOn": [
|
|
@@ -9456,7 +9456,7 @@
|
|
|
9456
9456
|
"@fastify/jwt@10.2.2",
|
|
9457
9457
|
"@fastify/rate-limit@10.3.0",
|
|
9458
9458
|
"@fastify/static@10.1.3",
|
|
9459
|
-
"@neocortex/shared@4.60.
|
|
9459
|
+
"@neocortex/shared@4.60.27",
|
|
9460
9460
|
"@sentry/node@10.62.0",
|
|
9461
9461
|
"bcryptjs@3.0.3",
|
|
9462
9462
|
"drizzle-orm@0.45.2",
|
|
@@ -9469,7 +9469,7 @@
|
|
|
9469
9469
|
"stripe@20.4.1",
|
|
9470
9470
|
"yaml@2.9.0"
|
|
9471
9471
|
],
|
|
9472
|
-
"ref": "@neocortex/server@4.60.
|
|
9472
|
+
"ref": "@neocortex/server@4.60.27"
|
|
9473
9473
|
},
|
|
9474
9474
|
{
|
|
9475
9475
|
"dependsOn": [
|
|
@@ -9590,16 +9590,16 @@
|
|
|
9590
9590
|
},
|
|
9591
9591
|
{
|
|
9592
9592
|
"dependsOn": [
|
|
9593
|
-
"@neocortex/shared@4.60.
|
|
9593
|
+
"@neocortex/shared@4.60.27",
|
|
9594
9594
|
"better-sqlite3@12.11.1",
|
|
9595
9595
|
"jose@6.2.2",
|
|
9596
9596
|
"keytar@7.9.0"
|
|
9597
9597
|
],
|
|
9598
|
-
"ref": "@neocortex/client@4.60.
|
|
9598
|
+
"ref": "@neocortex/client@4.60.27"
|
|
9599
9599
|
},
|
|
9600
9600
|
{
|
|
9601
9601
|
"dependsOn": [
|
|
9602
|
-
"@neocortex/shared@4.60.
|
|
9602
|
+
"@neocortex/shared@4.60.27"
|
|
9603
9603
|
],
|
|
9604
9604
|
"ref": "@neocortex/core@0.1.0"
|
|
9605
9605
|
},
|
|
@@ -10653,7 +10653,7 @@
|
|
|
10653
10653
|
"ref": "@lukeed/ms@2.0.2"
|
|
10654
10654
|
},
|
|
10655
10655
|
{
|
|
10656
|
-
"ref": "@neocortex/shared@4.60.
|
|
10656
|
+
"ref": "@neocortex/shared@4.60.27"
|
|
10657
10657
|
},
|
|
10658
10658
|
{
|
|
10659
10659
|
"ref": "@opentelemetry/api@1.9.1"
|
|
@@ -11136,8 +11136,8 @@
|
|
|
11136
11136
|
"metadata": {
|
|
11137
11137
|
"component": {
|
|
11138
11138
|
"author": "OrNexus Team",
|
|
11139
|
-
"bom-ref": "@ornexus/neocortex@4.60.
|
|
11140
|
-
"description": "Neocortex v4.60.
|
|
11139
|
+
"bom-ref": "@ornexus/neocortex@4.60.27",
|
|
11140
|
+
"description": "Neocortex v4.60.27 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
|
|
11141
11141
|
"externalReferences": [
|
|
11142
11142
|
{
|
|
11143
11143
|
"comment": "as detected from PackageJson property \"bugs.url\"",
|
|
@@ -11170,9 +11170,9 @@
|
|
|
11170
11170
|
"value": ""
|
|
11171
11171
|
}
|
|
11172
11172
|
],
|
|
11173
|
-
"purl": "pkg:npm/%40ornexus/neocortex@4.60.
|
|
11173
|
+
"purl": "pkg:npm/%40ornexus/neocortex@4.60.27?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FOrNexus-AI%2Fneocortex.git",
|
|
11174
11174
|
"type": "application",
|
|
11175
|
-
"version": "4.60.
|
|
11175
|
+
"version": "4.60.27"
|
|
11176
11176
|
},
|
|
11177
11177
|
"tools": {
|
|
11178
11178
|
"components": [
|
package/install.ps1
CHANGED
package/install.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ornexus/neocortex",
|
|
3
|
-
"version": "4.60.
|
|
4
|
-
"description": "Neocortex v4.60.
|
|
3
|
+
"version": "4.60.27",
|
|
4
|
+
"description": "Neocortex v4.60.27 - Orquestrador de Desenvolvimento de Epics & Stories para Claude Code",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
|
7
7
|
"claude-code",
|
|
@@ -79,6 +79,7 @@ Examples:
|
|
|
79
79
|
neocortex-client cache-status
|
|
80
80
|
neocortex-client config status
|
|
81
81
|
neocortex-client config standard --platform-target claude-code
|
|
82
|
+
neocortex-client story-checkpoint setup --story P174.03.913359 --format json
|
|
82
83
|
neocortex-client story-checkpoint handoff --story P174.03.913359 --format json
|
|
83
84
|
neocortex-client story-checkpoint begin --story P174.03.913359 --format json
|
|
84
85
|
neocortex-client story-checkpoint finalize --story P174.03.913359 --push --format json
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFile as m}from"node:fs/promises";import{resolve as u}from"node:path";import{beginDirectYoloStoryCommit as
|
|
1
|
+
import{readFile as m}from"node:fs/promises";import{resolve as u}from"node:path";import{beginDirectYoloStoryCommit as w,finalizeDirectYoloStoryCheckpoint as k,issueDirectYoloSetupLeaseHandoff as y,prepareDirectYoloSetup as g,recoverLegacyDirectYoloStoryCheckpoint as v}from"../git/direct-yolo-checkpoint.js";function S(a){const e=a[0];if(e!=="setup"&&e!=="handoff"&&e!=="begin"&&e!=="finalize"&&e!=="recover")throw new Error("story-checkpoint-action-invalid");let i="",t=process.cwd(),r,h="origin",c=!1,d="plain",f,l;for(let p=1;p<a.length;p++){const o=a[p],n=()=>a[++p]??"";if(o==="--story")i=n();else if(o.startsWith("--story="))i=o.slice(8);else if(o==="--project-root")t=n()||t;else if(o.startsWith("--project-root="))t=o.slice(15);else if(o==="--commit")r=n();else if(o.startsWith("--commit="))r=o.slice(9);else if(o==="--remote")h=n();else if(o.startsWith("--remote="))h=o.slice(9);else if(o==="--push"||o==="--require-remote")c=!0;else if(o==="--setup-handoff-session")f=n();else if(o.startsWith("--setup-handoff-session="))f=o.slice(24);else if(o==="--setup-handoff-token-file")l=n();else if(o.startsWith("--setup-handoff-token-file="))l=o.slice(27);else if(o==="--format"){const s=n();if(s!=="json"&&s!=="plain")throw new Error("story-checkpoint-format-invalid");d=s}else if(o.startsWith("--format=")){const s=o.slice(9);if(s!=="json"&&s!=="plain")throw new Error("story-checkpoint-format-invalid");d=s}else throw new Error("story-checkpoint-argument-invalid")}if(!i)throw new Error("story-checkpoint-story-required");if(e==="recover"&&!r)throw new Error("story-checkpoint-commit-required");if(e==="recover"&&!c)throw new Error("story-checkpoint-remote-proof-required");if(e==="finalize"&&!c)throw new Error("story-checkpoint-push-required");if(e==="begin"&&(r||c||h!=="origin"))throw new Error("story-checkpoint-option-invalid");if((e==="setup"||e==="handoff")&&(r||c||h!=="origin"))throw new Error("story-checkpoint-option-invalid");if(e==="finalize"&&r)throw new Error("story-checkpoint-option-invalid");if(f===void 0!=(l===void 0))throw new Error("story-checkpoint-setup-handoff-incomplete");if(e!=="begin"&&(f||l))throw new Error("story-checkpoint-option-invalid");return{action:e,storyId:i,projectRoot:u(t),commitSha:r,remote:h,push:c,format:d,...f?{setupHandoffSessionId:f}:{},...l?{setupHandoffTokenFile:u(l)}:{}}}async function C(a){let e;try{e=S(a)}catch(r){return console.error(r instanceof Error?r.message:"story-checkpoint-arguments-invalid"),1}let i;if(e.setupHandoffSessionId&&e.setupHandoffTokenFile)try{i={sessionId:e.setupHandoffSessionId,token:(await m(e.setupHandoffTokenFile,"utf8")).trim()}}catch{return console.error("story-checkpoint-setup-handoff-read-failed"),1}const t=e.action==="setup"?await g(e):e.action==="handoff"?await y(e):e.action==="begin"?await w({...e,...i?{setupLeaseHandoff:i}:{}}):e.action==="finalize"?await k(e):await v({...e,commitSha:e.commitSha});if(e.format==="json")console.log(JSON.stringify({action:e.action,...t},null,2));else if(t.ok)if(console.log(`story-checkpoint ${e.action}: ok`),e.action==="begin"&&"trailers"in t.value)for(const r of t.value.trailers)console.log(r);else"headSha"in t.value&&console.log(`head=${t.value.headSha}`);else console.error(`story-checkpoint ${e.action}: ${t.reasonCode}`);return t.ok?0:1}export{S as parseStoryCheckpointArgs,C as storyCheckpointCliHandler};
|
|
@@ -31,6 +31,18 @@ export interface DirectYoloSetupHandoffReceipt {
|
|
|
31
31
|
readonly reused: boolean;
|
|
32
32
|
readonly publicSafe: true;
|
|
33
33
|
}
|
|
34
|
+
export interface DirectYoloSetupReceipt {
|
|
35
|
+
readonly schemaVersion: 1;
|
|
36
|
+
readonly kind: 'direct-yolo-setup-receipt';
|
|
37
|
+
readonly storyId: string;
|
|
38
|
+
readonly epicId: string;
|
|
39
|
+
readonly executionBranch: string;
|
|
40
|
+
readonly originBranch: string;
|
|
41
|
+
readonly originHeadSha: string;
|
|
42
|
+
readonly leaseExpiresAt: string;
|
|
43
|
+
readonly reused: boolean;
|
|
44
|
+
readonly publicSafe: true;
|
|
45
|
+
}
|
|
34
46
|
export interface DirectYoloCheckpointOptions {
|
|
35
47
|
readonly projectRoot: string;
|
|
36
48
|
readonly storyId: string;
|
|
@@ -55,6 +67,12 @@ export interface DirectYoloCheckpointOptions {
|
|
|
55
67
|
/** Test seam for crash-window reproduction after durable CAS and before release. */
|
|
56
68
|
readonly afterCheckpointPersist?: () => Promise<void>;
|
|
57
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Productive P207 setup boundary. It owns only the current checkout and the
|
|
72
|
+
* epic branch; it never creates, removes or repositions a worktree. Existing
|
|
73
|
+
* staged and unstaged bytes must remain identical across the branch switch.
|
|
74
|
+
*/
|
|
75
|
+
export declare function prepareDirectYoloSetup(options: Pick<DirectYoloCheckpointOptions, 'projectRoot' | 'storyId' | 'nowIso'>): Promise<DirectYoloCheckpointResult<DirectYoloSetupReceipt>>;
|
|
58
76
|
/**
|
|
59
77
|
* Productive setup-owner handoff emitter used immediately before C08. The
|
|
60
78
|
* one-time token never crosses stdout; only a public receipt is returned.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import{execFile as we}from"node:child_process";import{createHash as Ie,randomBytes as Re,timingSafeEqual as ve}from"node:crypto";import{readFile as re}from"node:fs/promises";import{join as oe,resolve as Se}from"node:path";import{promisify as ke}from"node:util";import{acquireGitLifecyclePhysicalIntegrationLock as H,applyGitLifecycleRuntimeOverlay as De,computeImmutableStoryQaEvidenceDigest as xe,computeGitLifecyclePhysicalIntegrationLockOwnerDigest as ie,computeP205StoryQaEvidenceDigest as be,computeLegacyDirectYoloRecoveryReceiptRef as Ae,ensureRuntimeEpic as C,ensureRuntimeStory as je,ensureGitLifecyclePrivateChildDirectory as Ee,executeP205TransientAuthority as Le,projectP205TransientExecutionEvidence as _e,LEGACY_DIRECT_YOLO_RECOVERY_COMMITS as Be,mutateGitLifecycleRuntime as O,P205_COMPLETE_COMMAND as $e,readGitLifecycleRuntime as q,gitLifecycleRuntimeDirectory as qe,assertGitLifecyclePrivateFile as ne,releaseGitLifecyclePhysicalIntegrationLock as N,releaseGitLifecyclePhysicalIntegrationLockForCheckpoint as ze,verifyGitLifecyclePhysicalIntegrationLock as F,verifyAcceptedGitLifecycleStoryCheckpoint as se}from"./git-lifecycle-store.js";import{anchoredAtomicWriteFile as Ce}from"./secure-filesystem-boundary.js";import{GIT_LIFECYCLE_COMMIT_PUSH_STEP_ID as Oe,GIT_LIFECYCLE_REVIEW_PR_STEP_ID as ae}from"./git-lifecycle-step-ids.js";const Y=ke(we);async function Xe(e){try{const t=await K(e.projectRoot,e.storyId),i=$(await E(t.projectRoot,["diff","--cached","--name-only","-z"])),r=G(i,t.authorizedWriteSet,e.storyId);if(!r.ok)return y(r.reasonCode);if($(await E(t.projectRoot,["diff","--name-only","-z"])).some(w=>i.includes(w)))return y("direct-yolo-user-overlap");const s=await E(t.projectRoot,["diff","--cached","--binary","--full-index"]);if(!s)return y("direct-yolo-staged-diff-empty");const f=v(s),a=v([...t.authorizedWriteSet].sort().join("\0")),c=W(e.nowIso),n=await q(t.projectRoot,{required:!0}),d=I(n.epics[t.epicId]?.branch_lease);if(!ye(d,e.storyId,c))return y("direct-yolo-setup-handoff-owner-invalid");const h=String(d.sessionId),R=String(d.expiresAt),m=new Date(Math.min(Date.parse(R),Date.parse(c)+300*1e3)).toISOString(),l=await P(t.projectRoot,e.storyId),S=l?.state==="issued"&&l.fromSessionId===h&&l.bundleDigest===f&&l.claimRevision===a&&Date.parse(l.expiresAt)>Date.parse(c),A=S?l.expiresAt:m,j=S?l.token:Re(32).toString("base64url"),x=v(j),u=Object.freeze({schemaVersion:1,kind:"direct-yolo-setup-handoff",storyId:e.storyId,fromSessionId:h,tokenDigest:x,bundleDigest:f,claimRevision:a,expiresAt:A}),k=v(JSON.stringify(u)),p=await H(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:h,idempotencyKey:h,expiresAt:A,persistent:!1,createdAt:c});if(!p.ok)return y(p.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");try{await M(t.projectRoot,{schemaVersion:1,kind:"direct-yolo-setup-handoff-token",state:"issued",storyId:e.storyId,fromSessionId:h,token:j,tokenDigest:x,bundleDigest:f,claimRevision:a,grantDigest:k,expiresAt:A}),await O(t.projectRoot,w=>{const g=I(C(w,t.epicId).branch_lease);if(!ye(g,e.storyId,c)||g?.sessionId!==h||g.idempotencyKey!==h)throw new Error("direct-yolo-setup-handoff-owner-raced");g.handoffGrant=u},{expectedRevision:n.revision,preCommit:async()=>{if(!await F(p.path,p.owner))throw new Error("direct-yolo-integration-lock-raced");const w=await P(t.projectRoot,e.storyId);if(!w||w.state!=="issued"||w.grantDigest!==k||w.tokenDigest!==x)throw new Error("direct-yolo-setup-handoff-token-raced")}})}finally{await N(p.path,p.owner).catch(()=>{})}return{ok:!0,value:Object.freeze({schemaVersion:1,kind:"direct-yolo-setup-handoff-receipt",storyId:e.storyId,sessionId:h,bundleDigest:f,claimRevision:a,grantDigest:k,expiresAt:A,reused:S,publicSafe:!0})}}catch(t){return y(t instanceof Error&&/^direct-yolo-/.test(t.message)?t.message:"direct-yolo-setup-handoff-failed")}}async function et(e){try{const t=await K(e.projectRoot,e.storyId),i=await b(t.projectRoot,["rev-parse","HEAD"]),r=$(await E(t.projectRoot,["diff","--cached","--name-only","-z"])),o=G(r,t.authorizedWriteSet,e.storyId);if(!o.ok)return y(o.reasonCode);if($(await E(t.projectRoot,["diff","--name-only","-z"])).some(u=>r.includes(u)))return y("direct-yolo-user-overlap");const f=await E(t.projectRoot,["diff","--cached","--binary","--full-index"]);if(!f)return y("direct-yolo-staged-diff-empty");const a=v(f),c=v([...t.authorizedWriteSet].sort().join("\0")),n=v(["direct-yolo-commit-v1",e.storyId,t.epicId,t.executionBranch,i,a,t.graphRevision,c].join("\0")),d=W(e.nowIso);let h=e.setupLeaseHandoff??await Pe(t.projectRoot,e.storyId,a,c,d);const R=await q(t.projectRoot,{required:!0}),m=I(R.epics[t.epicId]?.branch_lease),l=m?.ownerStoryId===e.storyId&&m.sessionId===n&&m.idempotencyKey===n&&typeof m.expiresAt=="string"&&Date.parse(m.expiresAt)>Date.parse(d)?m:void 0;if(l&&e.setupLeaseHandoff)return y("direct-yolo-setup-handoff-replayed");const S=I(l?.handoffConsumption);if(S){const u=await P(t.projectRoot,e.storyId);if(!u||!["consuming","consumed"].includes(u.state)||u.fromSessionId!==S.fromSessionId||u.tokenDigest!==S.tokenDigest||u.bundleDigest!==a||u.claimRevision!==c||S.bundleDigest!==a||S.claimRevision!==c||u.consumedBySessionId!==n||S.consumedBySessionId!==n)return y("direct-yolo-setup-handoff-consume-invalid");if(u.state==="consuming"){if(!u.token||v(u.token)!==u.tokenDigest)return y("direct-yolo-setup-handoff-consume-invalid");h={sessionId:u.fromSessionId,token:u.token}}}const A=l?String(l.expiresAt):new Date(Date.parse(d)+1800*1e3).toISOString(),j=await H(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:n,idempotencyKey:n,expiresAt:A,persistent:!0,createdAt:l&&typeof l.acquiredAt=="string"?l.acquiredAt:d});if(!j.ok)return y(j.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");try{h&&e.setupLeaseHandoff===void 0&&(await He(t.projectRoot,e.storyId,h.sessionId,h.token,n,d),await e.setupHandoffFault?.("after-consuming-persisted")),await O(t.projectRoot,u=>{const k=C(u,t.epicId),p=I(k.branch_lease),w=p&&Date.parse(String(p.expiresAt))>Date.parse(d),g=p?.ownerStoryId===e.storyId&&p.sessionId===n&&p.idempotencyKey===n,D=p?.ownerStoryId===e.storyId&&p.sessionId===p.idempotencyKey&&typeof p.idempotencyKey=="string"&&/^setup-[a-f0-9]{64}$/.test(p.idempotencyKey),L=w&&D&&Ge({current:p,handoff:h,storyId:e.storyId,bundleDigest:a,claimRevision:c,nowIso:d});if(h&&w&&!g&&!L)throw new Error("direct-yolo-setup-handoff-invalid");if(w&&!g&&!L)throw new Error("direct-yolo-writer-active");const _=L?I(p?.handoffGrant):void 0,B=_?{schemaVersion:1,kind:"direct-yolo-setup-handoff-consumption",state:"consumed",storyId:e.storyId,fromSessionId:String(p?.sessionId),tokenDigest:String(_.tokenDigest),bundleDigest:a,claimRevision:c,consumedBySessionId:n,consumedAt:d}:void 0;k.branch_mode="epic",k.execution_branch=t.executionBranch,k.origin_branch=t.originBranch,k.graph_revision=t.graphRevision,k.branch_lease=w&&g?p:{schemaVersion:1,ownerStoryId:e.storyId,sessionId:n,idempotencyKey:n,acquiredAt:d,expiresAt:A,...B?{handoffConsumption:B}:{}}},{expectedRevision:R.revision,preCommit:async()=>{if(!await F(j.path,j.owner))throw new Error("direct-yolo-integration-lock-raced")}})}catch(u){throw await N(j.path,j.owner).catch(()=>{}),u}h&&e.setupLeaseHandoff===void 0&&(await e.setupHandoffFault?.("before-consumed-persist"),await Ne(t.projectRoot,t.epicId,e.storyId,h.sessionId,h.token,a,c,n,d));const x=Object.freeze([`Neocortex-Story: ${e.storyId}`,`Neocortex-Epic: ${t.epicId}`,`Neocortex-Execution-Branch: ${t.executionBranch}`,`Neocortex-Prepared-Base: ${i}`,`Neocortex-Bundle-Digest: ${a}`,`Neocortex-Graph-Revision: ${t.graphRevision}`,`Neocortex-Claim-Revision: ${c}`]);return{ok:!0,value:Object.freeze({schemaVersion:1,storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:i,bundleDigest:a,graphRevision:t.graphRevision,claimRevision:c,idempotencyKey:n,changedPaths:Object.freeze(r),trailers:x})}}catch(t){return y(X(t,"direct-yolo-begin-failed"))}}async function tt(e){let t,i,r;try{const o=await K(e.projectRoot,e.storyId);t=o;const s=await b(o.projectRoot,["rev-parse","HEAD"]);let f=await q(o.projectRoot,{required:!0});const a=I(f.stories[e.storyId]?.checkpoint);if(a){const D=typeof a.headSha=="string"?a.headSha:"",L=typeof a.graphRevision=="string"?a.graphRevision:"",_=/^[a-f0-9]{40,64}$/.test(D)?$(await E(o.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",D])):[],B=G(_,o.authorizedWriteSet,e.storyId);if(!(/^[a-f0-9]{40,64}$/.test(D)&&await z(o.projectRoot,["merge-base","--is-ancestor",D,s]))||!/^[a-f0-9]{64}$/.test(L)||!B.ok)return y("direct-yolo-replay-invalid");const ge=await Q(e,o.projectRoot,s,L);if(!await se(o.projectRoot,a,e.storyId,o.epicId,o.executionBranch,ge.transientAuthority,o.authorizedWriteSet))return y("direct-yolo-replay-invalid");if(!await U(o.projectRoot,o.executionBranch,s,_))return y("direct-yolo-replay-head-raced");if(e.push&&!await fe(o.projectRoot,e.remote??"origin",o.executionBranch,D))return y("direct-yolo-remote-head-mismatch");const ee=Array.isArray(a.receiptRefs)?a.receiptRefs.find(te=>typeof te=="string"&&/^physical-lock-owner:[a-f0-9]{64}$/.test(te)):void 0;return ee&&typeof a.idempotencyKey=="string"&&await ze(o.projectRoot,{storyId:e.storyId,idempotencyKey:a.idempotencyKey,ownerDigest:ee.slice(20)}),{ok:!0,value:a}}const c=s,n=await b(o.projectRoot,["rev-parse",`${c}^`]),d=await E(o.projectRoot,["show","--no-patch","--format=%B",c]),h=$(await E(o.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",c])),R=G(h,o.authorizedWriteSet,e.storyId);if(!R.ok)return y(R.reasonCode);const m=T(d,"Neocortex-Bundle-Digest"),l=T(d,"Neocortex-Graph-Revision"),S=T(d,"Neocortex-Claim-Revision"),A=new Map([["Neocortex-Story",e.storyId],["Neocortex-Epic",o.epicId],["Neocortex-Execution-Branch",o.executionBranch],["Neocortex-Prepared-Base",n],["Neocortex-Graph-Revision",o.graphRevision],["Neocortex-Claim-Revision",v([...o.authorizedWriteSet].sort().join("\0"))]]);if(!m||!/^[a-f0-9]{64}$/.test(m)||!l||!S||[...A].some(([D,L])=>T(d,D)!==L))return y("direct-yolo-trailers-invalid");const j=v(await E(o.projectRoot,["diff","--binary","--full-index",`${n}..${c}`]));if(m!==j)return y("direct-yolo-bundle-digest-mismatch");const x=v(["direct-yolo-commit-v1",e.storyId,o.epicId,o.executionBranch,n,m,l,S].join("\0")),u=I(f.epics[o.epicId]?.branch_lease),k=W(e.nowIso),p=u?.ownerStoryId===e.storyId&&u.idempotencyKey===x&&u.sessionId===x&&Date.parse(String(u.expiresAt))>Date.now()?u:void 0;if(u&&Date.parse(String(u.expiresAt))>Date.now()&&!p)return y("direct-yolo-writer-active");const w=p??{schemaVersion:1,ownerStoryId:e.storyId,sessionId:x,idempotencyKey:x,acquiredAt:k,expiresAt:new Date(Date.parse(k)+1800*1e3).toISOString()},g=await H(o.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:x,idempotencyKey:x,expiresAt:String(w.expiresAt),persistent:!0,createdAt:String(w.acquiredAt)});if(!g.ok)return y(g.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");r=g,p||(f=(await O(o.projectRoot,L=>{const _=C(L,o.epicId),B=I(_.branch_lease);if(B&&Date.parse(String(B.expiresAt))>Date.parse(k))throw new Error("direct-yolo-writer-active");if(_.graph_revision!==o.graphRevision)throw new Error("direct-yolo-graph-revision-raced");_.branch_lease=w},{expectedRevision:f.revision})).document),i=w;{const D=await Q(e,o.projectRoot,c,o.graphRevision);if(!await U(o.projectRoot,o.executionBranch,c,h))return y("direct-yolo-head-raced");if(e.push){const B=V(e.remote??"origin");if(await b(o.projectRoot,["push",B,o.executionBranch]),!await ue(o.projectRoot,B,o.executionBranch,c))return y("direct-yolo-remote-head-mismatch")}const L=await ce({projectRoot:o.projectRoot,storyId:e.storyId,epicId:o.epicId,executionBranch:o.executionBranch,baseSha:n,headSha:c,bundleDigest:m,graphRevision:l,claimRevision:S,idempotencyKey:x,qaExecution:D,physicalLockOwnerDigest:ie(g.owner),nowIso:W(e.nowIso),legacyReceiptRef:void 0});return await e.beforeCheckpointPersist?.(),await de({projectRoot:o.projectRoot,checkpoint:L,remote:e.push?e.remote??"origin":void 0,expectedRevision:f.revision,expectedLease:w,expectedGraphRevision:o.graphRevision,physicalLockPath:g.path,physicalLockOwner:g.owner,transientAuthority:D.transientAuthority,authorizedWriteSet:o.authorizedWriteSet})?(await e.afterCheckpointPersist?.(),{ok:!0,value:L}):y("direct-yolo-checkpoint-persist-failed")}}catch(o){return y(X(o,"direct-yolo-finalize-failed"))}finally{r&&await N(r.path,r.owner).catch(()=>{}),t&&i?await J(t.projectRoot,t.epicId,i).catch(()=>{}):t&&await Ke(t,e.storyId).catch(()=>{})}}async function rt(e){try{const t=await K(e.projectRoot,e.storyId);if(!/^[a-f0-9]{40,64}$/.test(e.commitSha))return y("direct-yolo-recovery-commit-invalid");const i=await b(t.projectRoot,["rev-parse",e.commitSha]);if(Be[e.storyId]!==i)return y("direct-yolo-recovery-not-allowlisted");if(await b(t.projectRoot,["rev-parse","HEAD"])!==i)return y("direct-yolo-recovery-head-mismatch");await b(t.projectRoot,["merge-base","--is-ancestor",i,`refs/heads/${t.executionBranch}`]);const r=await b(t.projectRoot,["rev-parse",`${i}^`]),o=await E(t.projectRoot,["diff","--binary","--full-index",`${r}..${i}`]),s=$(await E(t.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",i]));if(!G(s,t.authorizedWriteSet.length>0?t.authorizedWriteSet:s,e.storyId).ok)return y("direct-yolo-recovery-write-set-invalid");const a=v(o),c=v([...s].sort().join("\0")),n=v(["legacy-direct-yolo-recovery-v1",e.storyId,i].join("\0")),d=W(e.nowIso),h=new Date(Date.parse(d)+1800*1e3).toISOString(),R=await q(t.projectRoot,{required:!0}),m=await H(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:n,idempotencyKey:n,expiresAt:h,persistent:!0,createdAt:d});if(!m.ok)return y(m.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-recovery-integration-backpressure":"direct-yolo-recovery-integration-lock-failed");const l={schemaVersion:1,ownerStoryId:e.storyId,sessionId:n,idempotencyKey:n,acquiredAt:d,expiresAt:h};let S=!1;try{const A=await O(t.projectRoot,w=>{const g=C(w,t.epicId),D=I(g.branch_lease);if(D&&Date.parse(String(D.expiresAt))>Date.parse(d)&&!Z(D,l))throw new Error("direct-yolo-recovery-writer-active");if(g.graph_revision!==t.graphRevision)throw new Error("direct-yolo-recovery-graph-raced");g.branch_mode="epic",g.execution_branch=t.executionBranch,g.origin_branch=t.originBranch,g.branch_lease=l},{expectedRevision:R.revision});S=!0;const j=await Q(e,t.projectRoot,i,t.graphRevision);if(!await U(t.projectRoot,t.executionBranch,i,s))return y("direct-yolo-recovery-head-raced");if(e.push){const w=V(e.remote??"origin"),g=(await b(t.projectRoot,["ls-remote","--heads",w,`refs/heads/${t.executionBranch}`])).split(/\s+/)[0];if(!g||!await z(t.projectRoot,["merge-base","--is-ancestor",i,g]))return y("direct-yolo-recovery-remote-proof-missing")}const x=await ce({projectRoot:t.projectRoot,storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:r,headSha:i,bundleDigest:a,graphRevision:t.graphRevision,claimRevision:c,idempotencyKey:n,qaExecution:j,physicalLockOwnerDigest:ie(m.owner),nowIso:d,legacyReceiptRef:void 0}),u=await Ae(t.projectRoot,{storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:r,headSha:i,bundleDigest:a,graphRevision:t.graphRevision});if(!u)return y("direct-yolo-recovery-evidence-invalid");const k=Object.freeze({...x,receiptRefs:Object.freeze([...x.receiptRefs,u])});return await de({projectRoot:t.projectRoot,checkpoint:k,remote:e.push?e.remote??"origin":void 0,remotePolicy:"ancestor-recovery",expectedRevision:A.document.revision,expectedLease:l,expectedGraphRevision:t.graphRevision,physicalLockPath:m.path,physicalLockOwner:m.owner,transientAuthority:j.transientAuthority,authorizedWriteSet:t.authorizedWriteSet})?{ok:!0,value:k}:y("direct-yolo-recovery-persist-failed")}finally{await N(m.path,m.owner).catch(()=>{}),S&&await J(t.projectRoot,t.epicId,l).catch(()=>{})}}catch(t){return y(X(t,"direct-yolo-recovery-failed"))}}async function K(e,t){if(!/^[A-Za-z][A-Za-z0-9_-]*\.[A-Za-z0-9._-]+$/.test(t))throw new Error("direct-yolo-story-id-invalid");const i=Se(e),r=I(JSON.parse(await re(oe(i,".neocortex/state.json"),"utf8"))),o=await q(i,{required:!0}),s=De(r,o),f=I(s.stories),a=I(s.epics),c=I(f?.[t]),n=String(c?.epic_id??t.split(".")[0]),d=I(a?.[n]),h=String(d?.execution_branch??""),R=String(d?.origin_branch??""),m=String(d?.graph_revision??""),l=Array.isArray(c?.files_to_modify)?[...new Set(c.files_to_modify.filter(A=>typeof A=="string"&&le(A)))].sort():[],S=await b(i,["symbolic-ref","--quiet","--short","HEAD"]);if(!c||d?.branch_mode!=="epic"||!me(h)||!me(R)||!await z(i,["check-ref-format","--branch",h])||!await z(i,["check-ref-format","--branch",R])||!/^[a-f0-9]{64}$/.test(m)||S!==h)throw new Error("direct-yolo-epic-authority-invalid");return{projectRoot:i,story:c,epicId:n,executionBranch:h,originBranch:R,graphRevision:m,authorizedWriteSet:l}}async function ce(e){const t=e.nowIso,i=await E(e.projectRoot,["show","--no-patch","--format=%H%n%P%n%B",e.headSha]),r=$(await E(e.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",e.headSha])),o=xe({storyId:e.storyId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,commitBody:i,changedPaths:r}),s=be({gitEvidenceDigest:o,headSha:e.headSha,graphRevision:e.graphRevision,manifestDigest:e.qaExecution.manifestDigest,gateIds:e.qaExecution.gateIds,resultDigest:e.qaExecution.resultDigest}),f=`story-qa:${s}`,a=Object.freeze({schemaVersion:1,kind:"story_qa_evidence",producer:"local-yolo-tdd",evidenceVersion:"p205-execution-v2",storyId:e.storyId,epicId:e.epicId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,contract:e.qaExecution.contract,command:e.qaExecution.command,manifestDigest:e.qaExecution.manifestDigest,gateIds:e.qaExecution.gateIds,resultDigest:e.qaExecution.resultDigest,sourceEvidenceDigest:s,verdict:"passed",checkedAt:t,receiptRef:f}),c=v(["root-commit-range-review-v1",e.storyId,e.baseSha,e.headSha,e.bundleDigest,e.graphRevision,f,v(i),[...r].sort().join(",")].join("\0")),n=`story-review:${c}`,d=Object.freeze({schemaVersion:1,kind:"story_review_evidence",producer:"root-commit-range-review",storyId:e.storyId,epicId:e.epicId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,sourceEvidenceDigest:c,qaReceiptRef:f,verdict:"approved",reviewedAt:t,receiptRef:n}),h=[`.neocortex/stories/${e.storyId}/qa-gate-result.json`,`.neocortex/stories/${e.storyId}/validation-evidence.md`,f,n,...e.physicalLockOwnerDigest?[`physical-lock-owner:${e.physicalLockOwnerDigest}`]:[],...e.legacyReceiptRef?[e.legacyReceiptRef]:[]];return Object.freeze({schemaVersion:1,storyId:e.storyId,epicId:e.epicId,branch:e.executionBranch,baseSha:e.baseSha,headSha:e.headSha,commits:Object.freeze([e.headSha]),idempotencyKey:e.idempotencyKey,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,claimRevision:e.claimRevision,receiptRefs:Object.freeze(h),qaVerdict:"passed",reviewVerdict:"approved",qaReceipt:a,reviewReceipt:d,recordedAt:t})}async function de(e){const{projectRoot:t,checkpoint:i,remote:r}=e;let o=!1;return await O(t,s=>{const f=C(s,i.epicId);if(e.expectedLease){const d=I(f.branch_lease);if(!Z(d,e.expectedLease))throw new Error("direct-yolo-runtime-revision-conflict");if(Date.parse(String(d?.expiresAt))<=Date.now())throw new Error("direct-yolo-writer-lease-expired");if(f.graph_revision!==e.expectedGraphRevision||i.graphRevision!==e.expectedGraphRevision)throw new Error("direct-yolo-graph-revision-raced")}const a=je(s,i.storyId),c=I(a.checkpoint);if(c&&c.headSha!==i.headSha){o=!0;return}a.checkpoint=i,a.status="done",a.last_step=ae;const n=Array.isArray(a.steps_completed)?a.steps_completed.filter(d=>typeof d=="string"):[];a.steps_completed=[...new Set([...n,Oe,ae])],f.branch_lease=null},{expectedRevision:e.expectedRevision,preCommit:async()=>{if(o)throw new Error("direct-yolo-checkpoint-conflict");if(await b(t,["symbolic-ref","--quiet","--short","HEAD"])!==i.branch||await b(t,["rev-parse","HEAD"])!==i.headSha)throw new Error("direct-yolo-checkpoint-head-raced");if(!await se(t,i,i.storyId,i.epicId,i.branch,e.transientAuthority,e.authorizedWriteSet))throw new Error("direct-yolo-checkpoint-physical-invalid");if(e.physicalLockPath&&e.physicalLockOwner&&!await F(e.physicalLockPath,e.physicalLockOwner))throw new Error("direct-yolo-integration-lock-raced");if(r&&!(e.remotePolicy==="ancestor-recovery"?await fe(t,r,i.branch,i.headSha):await ue(t,r,i.branch,i.headSha)))throw new Error("direct-yolo-checkpoint-remote-raced")}}),!o}async function fe(e,t,i,r){const o=V(t),s=(await b(e,["ls-remote","--heads",o,`refs/heads/${i}`])).split(/\s+/)[0];return!!(s&&await z(e,["merge-base","--is-ancestor",r,s]))}function ye(e,t,i){return!!(e?.ownerStoryId===t&&e.sessionId===e.idempotencyKey&&typeof e.idempotencyKey=="string"&&/^setup-[a-f0-9]{64}$/.test(e.idempotencyKey)&&typeof e.expiresAt=="string"&&Date.parse(e.expiresAt)>Date.parse(i))}async function he(e,t){const i=await qe(e),r=await Ee(i,"handoffs"),o=`direct-${v(t)}.json`;return{parent:r,name:o,path:oe(r,o)}}async function M(e,t){const i=await he(e,t.storyId);await Ce(i.parent,i.name,`${JSON.stringify(t,null,2)}
|
|
2
|
-
`),await
|
|
3
|
-
`).map(
|
|
1
|
+
import{execFile as xe}from"node:child_process";import{createHash as De,randomBytes as oe,timingSafeEqual as be}from"node:crypto";import{readFile as ie}from"node:fs/promises";import{join as ne,resolve as ae}from"node:path";import{promisify as Ae}from"node:util";import{acquireGitLifecyclePhysicalIntegrationLock as N,applyGitLifecycleRuntimeOverlay as je,computeImmutableStoryQaEvidenceDigest as Ee,computeGitLifecyclePhysicalIntegrationLockOwnerDigest as se,computeP205StoryQaEvidenceDigest as Be,computeLegacyDirectYoloRecoveryReceiptRef as _e,ensureRuntimeEpic as z,ensureRuntimeStory as Le,ensureGitLifecyclePrivateChildDirectory as qe,executeP205TransientAuthority as $e,projectP205TransientExecutionEvidence as Ce,LEGACY_DIRECT_YOLO_RECOVERY_COMMITS as ze,mutateGitLifecycleRuntime as H,P205_COMPLETE_COMMAND as He,readGitLifecycleRuntime as q,gitLifecycleRuntimeDirectory as Oe,assertGitLifecyclePrivateFile as ce,releaseGitLifecyclePhysicalIntegrationLock as V,releaseGitLifecyclePhysicalIntegrationLockForCheckpoint as Pe,verifyGitLifecyclePhysicalIntegrationLock as Y,verifyAcceptedGitLifecycleStoryCheckpoint as de}from"./git-lifecycle-store.js";import{anchoredAtomicWriteFile as Ne}from"./secure-filesystem-boundary.js";import{GIT_LIFECYCLE_COMMIT_PUSH_STEP_ID as Ve,GIT_LIFECYCLE_REVIEW_PR_STEP_ID as fe}from"./git-lifecycle-step-ids.js";const M=Ae(xe);async function it(e){try{const t=await he(e.projectRoot,e.storyId),o=P(e.nowIso),r=Date.parse(o),i=await w(t.projectRoot,["symbolic-ref","--quiet","--short","HEAD"]),n=await w(t.projectRoot,["rev-parse","HEAD"]),u=await q(t.projectRoot,{required:!0}),s=R(u.epics[t.epicId]),d=R(s?.branch_lease),a=d&&Number.isFinite(Date.parse(String(d.expiresAt)))&&Date.parse(String(d.expiresAt))>r;if(a&&d?.ownerStoryId!==e.storyId)return f("direct-yolo-writer-active");let c=Re(s?.origin_binding,t.executionBranch,t.originBranch);if(i===t.executionBranch){if(!c)return f("direct-yolo-origin-binding-invalid")}else{if(i!==t.originBranch)return f("direct-yolo-current-branch-mismatch");if(c&&c.originHeadSha!==n)return f("direct-yolo-origin-binding-conflict");if(c??={schemaVersion:1,originBranch:t.originBranch,originHeadSha:n,executionBranch:t.executionBranch,capturedFromCurrentCheckout:!0,capturedAt:o},(await Me(t.projectRoot)).some(g=>g.branch===t.executionBranch&&ae(g.path)!==t.projectRoot))return f("direct-yolo-execution-branch-checked-out-elsewhere");const p=await Se(t.projectRoot),h=`refs/heads/${t.executionBranch}`;if(await C(t.projectRoot,["show-ref","--verify","--quiet",h])){const g=await w(t.projectRoot,["rev-parse",h]);if(g!==n){if(!await C(t.projectRoot,["merge-base","--is-ancestor",g,n]))return f("direct-yolo-execution-branch-diverged");await w(t.projectRoot,["update-ref",h,n,g])}await w(t.projectRoot,["switch",t.executionBranch])}else await w(t.projectRoot,["switch","-c",t.executionBranch]);if(await Se(t.projectRoot)!==p)return f("direct-yolo-checkout-payload-raced")}const l=await w(t.projectRoot,["symbolic-ref","--quiet","--short","HEAD"]),S=await w(t.projectRoot,["rev-parse","HEAD"]);if(l!==t.executionBranch)return f("direct-yolo-current-branch-mismatch");if(a&&d?.ownerStoryId===e.storyId)return{ok:!0,value:ve(t,c,String(d.expiresAt),!0)};const m=o,y=new Date(r+3600*1e3).toISOString(),k=`setup-${oe(32).toString("hex")}`,E=await q(t.projectRoot,{required:!0});return await H(t.projectRoot,A=>{const p=z(A,t.epicId),h=R(p.branch_lease);if(h&&Date.parse(String(h.expiresAt))>r&&h.ownerStoryId!==e.storyId)throw new Error("direct-yolo-writer-active");const g=Re(p.origin_binding,t.executionBranch,t.originBranch);if(p.origin_binding&&!g)throw new Error("direct-yolo-origin-binding-conflict");if(g&&JSON.stringify(g)!==JSON.stringify(c))throw new Error("direct-yolo-origin-binding-conflict");p.branch_mode="epic",p.execution_branch=t.executionBranch,p.origin_branch=t.originBranch,p.graph_revision=t.graphRevision,p.origin_binding=c,p.branch_lease={schemaVersion:1,ownerStoryId:e.storyId,sessionId:k,idempotencyKey:k,acquiredAt:m,expiresAt:y}},{expectedRevision:E.revision,preCommit:async()=>{if(await w(t.projectRoot,["symbolic-ref","--quiet","--short","HEAD"])!==t.executionBranch||await w(t.projectRoot,["rev-parse","HEAD"])!==S)throw new Error("direct-yolo-setup-physical-state-raced")}}),{ok:!0,value:ve(t,c,y,!1)}}catch(t){return f(T(t,"direct-yolo-setup-failed"))}}async function nt(e){try{const t=await G(e.projectRoot,e.storyId),o=$(await b(t.projectRoot,["diff","--cached","--name-only","-z"])),r=W(o,t.authorizedWriteSet,e.storyId);if(!r.ok)return f(r.reasonCode);if($(await b(t.projectRoot,["diff","--name-only","-z"])).some(x=>o.includes(x)))return f("direct-yolo-user-overlap");const n=await b(t.projectRoot,["diff","--cached","--binary","--full-index"]);if(!n)return f("direct-yolo-staged-diff-empty");const u=D(n),s=D([...t.authorizedWriteSet].sort().join("\0")),d=P(e.nowIso),a=await q(t.projectRoot,{required:!0}),c=R(a.epics[t.epicId]?.branch_lease);if(!pe(c,e.storyId,d))return f("direct-yolo-setup-handoff-owner-invalid");const l=String(c.sessionId),S=String(c.expiresAt),m=new Date(Math.min(Date.parse(S),Date.parse(d)+300*1e3)).toISOString(),y=await O(t.projectRoot,e.storyId),k=y?.state==="issued"&&y.fromSessionId===l&&y.bundleDigest===u&&y.claimRevision===s&&Date.parse(y.expiresAt)>Date.parse(d),E=k?y.expiresAt:m,A=k?y.token:oe(32).toString("base64url"),p=D(A),h=Object.freeze({schemaVersion:1,kind:"direct-yolo-setup-handoff",storyId:e.storyId,fromSessionId:l,tokenDigest:p,bundleDigest:u,claimRevision:s,expiresAt:E}),g=D(JSON.stringify(h)),I=await N(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:l,idempotencyKey:l,expiresAt:E,persistent:!1,createdAt:d});if(!I.ok)return f(I.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");try{await Z(t.projectRoot,{schemaVersion:1,kind:"direct-yolo-setup-handoff-token",state:"issued",storyId:e.storyId,fromSessionId:l,token:A,tokenDigest:p,bundleDigest:u,claimRevision:s,grantDigest:g,expiresAt:E}),await H(t.projectRoot,x=>{const v=R(z(x,t.epicId).branch_lease);if(!pe(v,e.storyId,d)||v?.sessionId!==l||v.idempotencyKey!==l)throw new Error("direct-yolo-setup-handoff-owner-raced");v.handoffGrant=h},{expectedRevision:a.revision,preCommit:async()=>{if(!await Y(I.path,I.owner))throw new Error("direct-yolo-integration-lock-raced");const x=await O(t.projectRoot,e.storyId);if(!x||x.state!=="issued"||x.grantDigest!==g||x.tokenDigest!==p)throw new Error("direct-yolo-setup-handoff-token-raced")}})}finally{await V(I.path,I.owner).catch(()=>{})}return{ok:!0,value:Object.freeze({schemaVersion:1,kind:"direct-yolo-setup-handoff-receipt",storyId:e.storyId,sessionId:l,bundleDigest:u,claimRevision:s,grantDigest:g,expiresAt:E,reused:k,publicSafe:!0})}}catch(t){return f(t instanceof Error&&/^direct-yolo-/.test(t.message)?t.message:"direct-yolo-setup-handoff-failed")}}async function at(e){try{const t=await G(e.projectRoot,e.storyId),o=await w(t.projectRoot,["rev-parse","HEAD"]),r=$(await b(t.projectRoot,["diff","--cached","--name-only","-z"])),i=W(r,t.authorizedWriteSet,e.storyId);if(!i.ok)return f(i.reasonCode);if($(await b(t.projectRoot,["diff","--name-only","-z"])).some(h=>r.includes(h)))return f("direct-yolo-user-overlap");const u=await b(t.projectRoot,["diff","--cached","--binary","--full-index"]);if(!u)return f("direct-yolo-staged-diff-empty");const s=D(u),d=D([...t.authorizedWriteSet].sort().join("\0")),a=D(["direct-yolo-commit-v1",e.storyId,t.epicId,t.executionBranch,o,s,t.graphRevision,d].join("\0")),c=P(e.nowIso);let l=e.setupLeaseHandoff??await We(t.projectRoot,e.storyId,s,d,c);const S=await q(t.projectRoot,{required:!0}),m=R(S.epics[t.epicId]?.branch_lease),y=m?.ownerStoryId===e.storyId&&m.sessionId===a&&m.idempotencyKey===a&&typeof m.expiresAt=="string"&&Date.parse(m.expiresAt)>Date.parse(c)?m:void 0;if(y&&e.setupLeaseHandoff)return f("direct-yolo-setup-handoff-replayed");const k=R(y?.handoffConsumption);if(k){const h=await O(t.projectRoot,e.storyId);if(!h||!["consuming","consumed"].includes(h.state)||h.fromSessionId!==k.fromSessionId||h.tokenDigest!==k.tokenDigest||h.bundleDigest!==s||h.claimRevision!==d||k.bundleDigest!==s||k.claimRevision!==d||h.consumedBySessionId!==a||k.consumedBySessionId!==a)return f("direct-yolo-setup-handoff-consume-invalid");if(h.state==="consuming"){if(!h.token||D(h.token)!==h.tokenDigest)return f("direct-yolo-setup-handoff-consume-invalid");l={sessionId:h.fromSessionId,token:h.token}}}const E=y?String(y.expiresAt):new Date(Date.parse(c)+1800*1e3).toISOString(),A=await N(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:a,idempotencyKey:a,expiresAt:E,persistent:!0,createdAt:y&&typeof y.acquiredAt=="string"?y.acquiredAt:c});if(!A.ok)return f(A.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");try{l&&e.setupLeaseHandoff===void 0&&(await Ge(t.projectRoot,e.storyId,l.sessionId,l.token,a,c),await e.setupHandoffFault?.("after-consuming-persisted")),await H(t.projectRoot,h=>{const g=z(h,t.epicId),I=R(g.branch_lease),x=I&&Date.parse(String(I.expiresAt))>Date.parse(c),v=I?.ownerStoryId===e.storyId&&I.sessionId===a&&I.idempotencyKey===a,j=I?.ownerStoryId===e.storyId&&I.sessionId===I.idempotencyKey&&typeof I.idempotencyKey=="string"&&/^setup-[a-f0-9]{64}$/.test(I.idempotencyKey),B=x&&j&&Fe({current:I,handoff:l,storyId:e.storyId,bundleDigest:s,claimRevision:d,nowIso:c});if(l&&x&&!v&&!B)throw new Error("direct-yolo-setup-handoff-invalid");if(x&&!v&&!B)throw new Error("direct-yolo-writer-active");const _=B?R(I?.handoffGrant):void 0,L=_?{schemaVersion:1,kind:"direct-yolo-setup-handoff-consumption",state:"consumed",storyId:e.storyId,fromSessionId:String(I?.sessionId),tokenDigest:String(_.tokenDigest),bundleDigest:s,claimRevision:d,consumedBySessionId:a,consumedAt:c}:void 0;g.branch_mode="epic",g.execution_branch=t.executionBranch,g.origin_branch=t.originBranch,g.graph_revision=t.graphRevision,g.branch_lease=x&&v?I:{schemaVersion:1,ownerStoryId:e.storyId,sessionId:a,idempotencyKey:a,acquiredAt:c,expiresAt:E,...L?{handoffConsumption:L}:{}}},{expectedRevision:S.revision,preCommit:async()=>{if(!await Y(A.path,A.owner))throw new Error("direct-yolo-integration-lock-raced")}})}catch(h){throw await V(A.path,A.owner).catch(()=>{}),h}l&&e.setupLeaseHandoff===void 0&&(await e.setupHandoffFault?.("before-consumed-persist"),await Ke(t.projectRoot,t.epicId,e.storyId,l.sessionId,l.token,s,d,a,c));const p=Object.freeze([`Neocortex-Story: ${e.storyId}`,`Neocortex-Epic: ${t.epicId}`,`Neocortex-Execution-Branch: ${t.executionBranch}`,`Neocortex-Prepared-Base: ${o}`,`Neocortex-Bundle-Digest: ${s}`,`Neocortex-Graph-Revision: ${t.graphRevision}`,`Neocortex-Claim-Revision: ${d}`]);return{ok:!0,value:Object.freeze({schemaVersion:1,storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:o,bundleDigest:s,graphRevision:t.graphRevision,claimRevision:d,idempotencyKey:a,changedPaths:Object.freeze(r),trailers:p})}}catch(t){return f(T(t,"direct-yolo-begin-failed"))}}async function st(e){let t,o,r;try{const i=await G(e.projectRoot,e.storyId);t=i;const n=await w(i.projectRoot,["rev-parse","HEAD"]);let u=await q(i.projectRoot,{required:!0});const s=R(u.stories[e.storyId]?.checkpoint);if(s){const j=typeof s.headSha=="string"?s.headSha:"",B=typeof s.graphRevision=="string"?s.graphRevision:"",_=/^[a-f0-9]{40,64}$/.test(j)?$(await b(i.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",j])):[],L=W(_,i.authorizedWriteSet,e.storyId);if(!(/^[a-f0-9]{40,64}$/.test(j)&&await C(i.projectRoot,["merge-base","--is-ancestor",j,n]))||!/^[a-f0-9]{64}$/.test(B)||!L.ok)return f("direct-yolo-replay-invalid");const ke=await U(e,i.projectRoot,n,B);if(!await de(i.projectRoot,s,e.storyId,i.epicId,i.executionBranch,ke.transientAuthority,i.authorizedWriteSet))return f("direct-yolo-replay-invalid");if(!await X(i.projectRoot,i.executionBranch,n,_))return f("direct-yolo-replay-head-raced");if(e.push&&!await ye(i.projectRoot,e.remote??"origin",i.executionBranch,j))return f("direct-yolo-remote-head-mismatch");const te=Array.isArray(s.receiptRefs)?s.receiptRefs.find(re=>typeof re=="string"&&/^physical-lock-owner:[a-f0-9]{64}$/.test(re)):void 0;return te&&typeof s.idempotencyKey=="string"&&await Pe(i.projectRoot,{storyId:e.storyId,idempotencyKey:s.idempotencyKey,ownerDigest:te.slice(20)}),{ok:!0,value:s}}const d=n,a=await w(i.projectRoot,["rev-parse",`${d}^`]),c=await b(i.projectRoot,["show","--no-patch","--format=%B",d]),l=$(await b(i.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",d])),S=W(l,i.authorizedWriteSet,e.storyId);if(!S.ok)return f(S.reasonCode);const m=F(c,"Neocortex-Bundle-Digest"),y=F(c,"Neocortex-Graph-Revision"),k=F(c,"Neocortex-Claim-Revision"),E=new Map([["Neocortex-Story",e.storyId],["Neocortex-Epic",i.epicId],["Neocortex-Execution-Branch",i.executionBranch],["Neocortex-Prepared-Base",a],["Neocortex-Graph-Revision",i.graphRevision],["Neocortex-Claim-Revision",D([...i.authorizedWriteSet].sort().join("\0"))]]);if(!m||!/^[a-f0-9]{64}$/.test(m)||!y||!k||[...E].some(([j,B])=>F(c,j)!==B))return f("direct-yolo-trailers-invalid");const A=D(await b(i.projectRoot,["diff","--binary","--full-index",`${a}..${d}`]));if(m!==A)return f("direct-yolo-bundle-digest-mismatch");const p=D(["direct-yolo-commit-v1",e.storyId,i.epicId,i.executionBranch,a,m,y,k].join("\0")),h=R(u.epics[i.epicId]?.branch_lease),g=P(e.nowIso),I=h?.ownerStoryId===e.storyId&&h.idempotencyKey===p&&h.sessionId===p&&Date.parse(String(h.expiresAt))>Date.now()?h:void 0;if(h&&Date.parse(String(h.expiresAt))>Date.now()&&!I)return f("direct-yolo-writer-active");const x=I??{schemaVersion:1,ownerStoryId:e.storyId,sessionId:p,idempotencyKey:p,acquiredAt:g,expiresAt:new Date(Date.parse(g)+1800*1e3).toISOString()},v=await N(i.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:p,idempotencyKey:p,expiresAt:String(x.expiresAt),persistent:!0,createdAt:String(x.acquiredAt)});if(!v.ok)return f(v.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-integration-backpressure":"direct-yolo-integration-lock-failed");r=v,I||(u=(await H(i.projectRoot,B=>{const _=z(B,i.epicId),L=R(_.branch_lease);if(L&&Date.parse(String(L.expiresAt))>Date.parse(g))throw new Error("direct-yolo-writer-active");if(_.graph_revision!==i.graphRevision)throw new Error("direct-yolo-graph-revision-raced");_.branch_lease=x},{expectedRevision:u.revision})).document),o=x;{const j=await U(e,i.projectRoot,d,i.graphRevision);if(!await X(i.projectRoot,i.executionBranch,d,l))return f("direct-yolo-head-raced");if(e.push){const L=K(e.remote??"origin");if(await w(i.projectRoot,["push",L,i.executionBranch]),!await me(i.projectRoot,L,i.executionBranch,d))return f("direct-yolo-remote-head-mismatch")}const B=await ue({projectRoot:i.projectRoot,storyId:e.storyId,epicId:i.epicId,executionBranch:i.executionBranch,baseSha:a,headSha:d,bundleDigest:m,graphRevision:y,claimRevision:k,idempotencyKey:p,qaExecution:j,physicalLockOwnerDigest:se(v.owner),nowIso:P(e.nowIso),legacyReceiptRef:void 0});return await e.beforeCheckpointPersist?.(),await le({projectRoot:i.projectRoot,checkpoint:B,remote:e.push?e.remote??"origin":void 0,expectedRevision:u.revision,expectedLease:x,expectedGraphRevision:i.graphRevision,physicalLockPath:v.path,physicalLockOwner:v.owner,transientAuthority:j.transientAuthority,authorizedWriteSet:i.authorizedWriteSet})?(await e.afterCheckpointPersist?.(),{ok:!0,value:B}):f("direct-yolo-checkpoint-persist-failed")}}catch(i){return f(T(i,"direct-yolo-finalize-failed"))}finally{r&&await V(r.path,r.owner).catch(()=>{}),t&&o?await Q(t.projectRoot,t.epicId,o).catch(()=>{}):t&&await Ye(t,e.storyId).catch(()=>{})}}async function ct(e){try{const t=await G(e.projectRoot,e.storyId);if(!/^[a-f0-9]{40,64}$/.test(e.commitSha))return f("direct-yolo-recovery-commit-invalid");const o=await w(t.projectRoot,["rev-parse",e.commitSha]);if(ze[e.storyId]!==o)return f("direct-yolo-recovery-not-allowlisted");if(await w(t.projectRoot,["rev-parse","HEAD"])!==o)return f("direct-yolo-recovery-head-mismatch");await w(t.projectRoot,["merge-base","--is-ancestor",o,`refs/heads/${t.executionBranch}`]);const r=await w(t.projectRoot,["rev-parse",`${o}^`]),i=await b(t.projectRoot,["diff","--binary","--full-index",`${r}..${o}`]),n=$(await b(t.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",o]));if(!W(n,t.authorizedWriteSet.length>0?t.authorizedWriteSet:n,e.storyId).ok)return f("direct-yolo-recovery-write-set-invalid");const s=D(i),d=D([...n].sort().join("\0")),a=D(["legacy-direct-yolo-recovery-v1",e.storyId,o].join("\0")),c=P(e.nowIso),l=new Date(Date.parse(c)+1800*1e3).toISOString(),S=await q(t.projectRoot,{required:!0}),m=await N(t.projectRoot,{kind:"direct",storyId:e.storyId,sessionId:a,idempotencyKey:a,expiresAt:l,persistent:!0,createdAt:c});if(!m.ok)return f(m.reasonCode==="git-lifecycle-integration-backpressure"?"direct-yolo-recovery-integration-backpressure":"direct-yolo-recovery-integration-lock-failed");const y={schemaVersion:1,ownerStoryId:e.storyId,sessionId:a,idempotencyKey:a,acquiredAt:c,expiresAt:l};let k=!1;try{const E=await H(t.projectRoot,x=>{const v=z(x,t.epicId),j=R(v.branch_lease);if(j&&Date.parse(String(j.expiresAt))>Date.parse(c)&&!J(j,y))throw new Error("direct-yolo-recovery-writer-active");if(v.graph_revision!==t.graphRevision)throw new Error("direct-yolo-recovery-graph-raced");v.branch_mode="epic",v.execution_branch=t.executionBranch,v.origin_branch=t.originBranch,v.branch_lease=y},{expectedRevision:S.revision});k=!0;const A=await U(e,t.projectRoot,o,t.graphRevision);if(!await X(t.projectRoot,t.executionBranch,o,n))return f("direct-yolo-recovery-head-raced");if(e.push){const x=K(e.remote??"origin"),v=(await w(t.projectRoot,["ls-remote","--heads",x,`refs/heads/${t.executionBranch}`])).split(/\s+/)[0];if(!v||!await C(t.projectRoot,["merge-base","--is-ancestor",o,v]))return f("direct-yolo-recovery-remote-proof-missing")}const p=await ue({projectRoot:t.projectRoot,storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:r,headSha:o,bundleDigest:s,graphRevision:t.graphRevision,claimRevision:d,idempotencyKey:a,qaExecution:A,physicalLockOwnerDigest:se(m.owner),nowIso:c,legacyReceiptRef:void 0}),h=await _e(t.projectRoot,{storyId:e.storyId,epicId:t.epicId,executionBranch:t.executionBranch,baseSha:r,headSha:o,bundleDigest:s,graphRevision:t.graphRevision});if(!h)return f("direct-yolo-recovery-evidence-invalid");const g=Object.freeze({...p,receiptRefs:Object.freeze([...p.receiptRefs,h])});return await le({projectRoot:t.projectRoot,checkpoint:g,remote:e.push?e.remote??"origin":void 0,remotePolicy:"ancestor-recovery",expectedRevision:E.document.revision,expectedLease:y,expectedGraphRevision:t.graphRevision,physicalLockPath:m.path,physicalLockOwner:m.owner,transientAuthority:A.transientAuthority,authorizedWriteSet:t.authorizedWriteSet})?{ok:!0,value:g}:f("direct-yolo-recovery-persist-failed")}finally{await V(m.path,m.owner).catch(()=>{}),k&&await Q(t.projectRoot,t.epicId,y).catch(()=>{})}}catch(t){return f(T(t,"direct-yolo-recovery-failed"))}}async function he(e,t){if(!/^[A-Za-z][A-Za-z0-9_-]*\.[A-Za-z0-9._-]+$/.test(t))throw new Error("direct-yolo-story-id-invalid");const o=ae(e),r=R(JSON.parse(await ie(ne(o,".neocortex/state.json"),"utf8"))),i=await q(o,{required:!0}),n=je(r,i),u=R(n.stories),s=R(n.epics),d=R(u?.[t]),a=String(d?.epic_id??t.split(".")[0]),c=R(s?.[a]),l=String(c?.execution_branch??""),S=String(c?.origin_branch??""),m=String(c?.graph_revision??""),y=Array.isArray(d?.files_to_modify)?[...new Set(d.files_to_modify.filter(k=>typeof k=="string"&&ee(k)))].sort():[];if(!d)throw new Error("direct-yolo-story-state-missing");if(c?.branch_mode!=="epic")throw new Error("direct-yolo-branch-mode-invalid");if(!Ie(l)||!await C(o,["check-ref-format","--branch",l]))throw new Error("direct-yolo-execution-branch-invalid");if(!Ie(S)||!await C(o,["check-ref-format","--branch",S]))throw new Error("direct-yolo-origin-branch-invalid");if(!/^[a-f0-9]{64}$/.test(m))throw new Error("direct-yolo-graph-revision-invalid");return{projectRoot:o,storyId:t,story:d,epicId:a,executionBranch:l,originBranch:S,graphRevision:m,authorizedWriteSet:y}}async function G(e,t){const o=await he(e,t);if(await w(o.projectRoot,["symbolic-ref","--quiet","--short","HEAD"])!==o.executionBranch)throw new Error("direct-yolo-current-branch-mismatch");return o}async function ue(e){const t=e.nowIso,o=await b(e.projectRoot,["show","--no-patch","--format=%H%n%P%n%B",e.headSha]),r=$(await b(e.projectRoot,["diff-tree","--no-commit-id","--name-only","-r","-z",e.headSha])),i=Ee({storyId:e.storyId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,commitBody:o,changedPaths:r}),n=Be({gitEvidenceDigest:i,headSha:e.headSha,graphRevision:e.graphRevision,manifestDigest:e.qaExecution.manifestDigest,gateIds:e.qaExecution.gateIds,resultDigest:e.qaExecution.resultDigest}),u=`story-qa:${n}`,s=Object.freeze({schemaVersion:1,kind:"story_qa_evidence",producer:"local-yolo-tdd",evidenceVersion:"p205-execution-v2",storyId:e.storyId,epicId:e.epicId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,contract:e.qaExecution.contract,command:e.qaExecution.command,manifestDigest:e.qaExecution.manifestDigest,gateIds:e.qaExecution.gateIds,resultDigest:e.qaExecution.resultDigest,sourceEvidenceDigest:n,verdict:"passed",checkedAt:t,receiptRef:u}),d=D(["root-commit-range-review-v1",e.storyId,e.baseSha,e.headSha,e.bundleDigest,e.graphRevision,u,D(o),[...r].sort().join(",")].join("\0")),a=`story-review:${d}`,c=Object.freeze({schemaVersion:1,kind:"story_review_evidence",producer:"root-commit-range-review",storyId:e.storyId,epicId:e.epicId,baseSha:e.baseSha,headSha:e.headSha,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,sourceEvidenceDigest:d,qaReceiptRef:u,verdict:"approved",reviewedAt:t,receiptRef:a}),l=[`.neocortex/stories/${e.storyId}/qa-gate-result.json`,`.neocortex/stories/${e.storyId}/validation-evidence.md`,u,a,...e.physicalLockOwnerDigest?[`physical-lock-owner:${e.physicalLockOwnerDigest}`]:[],...e.legacyReceiptRef?[e.legacyReceiptRef]:[]];return Object.freeze({schemaVersion:1,storyId:e.storyId,epicId:e.epicId,branch:e.executionBranch,baseSha:e.baseSha,headSha:e.headSha,commits:Object.freeze([e.headSha]),idempotencyKey:e.idempotencyKey,bundleDigest:e.bundleDigest,graphRevision:e.graphRevision,claimRevision:e.claimRevision,receiptRefs:Object.freeze(l),qaVerdict:"passed",reviewVerdict:"approved",qaReceipt:s,reviewReceipt:c,recordedAt:t})}async function le(e){const{projectRoot:t,checkpoint:o,remote:r}=e;let i=!1;return await H(t,n=>{const u=z(n,o.epicId);if(e.expectedLease){const c=R(u.branch_lease);if(!J(c,e.expectedLease))throw new Error("direct-yolo-runtime-revision-conflict");if(Date.parse(String(c?.expiresAt))<=Date.now())throw new Error("direct-yolo-writer-lease-expired");if(u.graph_revision!==e.expectedGraphRevision||o.graphRevision!==e.expectedGraphRevision)throw new Error("direct-yolo-graph-revision-raced")}const s=Le(n,o.storyId),d=R(s.checkpoint);if(d&&d.headSha!==o.headSha){i=!0;return}s.checkpoint=o,s.status="done",s.last_step=fe;const a=Array.isArray(s.steps_completed)?s.steps_completed.filter(c=>typeof c=="string"):[];s.steps_completed=[...new Set([...a,Ve,fe])],u.branch_lease=null},{expectedRevision:e.expectedRevision,preCommit:async()=>{if(i)throw new Error("direct-yolo-checkpoint-conflict");if(await w(t,["symbolic-ref","--quiet","--short","HEAD"])!==o.branch||await w(t,["rev-parse","HEAD"])!==o.headSha)throw new Error("direct-yolo-checkpoint-head-raced");if(!await de(t,o,o.storyId,o.epicId,o.branch,e.transientAuthority,e.authorizedWriteSet))throw new Error("direct-yolo-checkpoint-physical-invalid");if(e.physicalLockPath&&e.physicalLockOwner&&!await Y(e.physicalLockPath,e.physicalLockOwner))throw new Error("direct-yolo-integration-lock-raced");if(r&&!(e.remotePolicy==="ancestor-recovery"?await ye(t,r,o.branch,o.headSha):await me(t,r,o.branch,o.headSha)))throw new Error("direct-yolo-checkpoint-remote-raced")}}),!i}async function ye(e,t,o,r){const i=K(t),n=(await w(e,["ls-remote","--heads",i,`refs/heads/${o}`])).split(/\s+/)[0];return!!(n&&await C(e,["merge-base","--is-ancestor",r,n]))}function pe(e,t,o){return!!(e?.ownerStoryId===t&&e.sessionId===e.idempotencyKey&&typeof e.idempotencyKey=="string"&&/^setup-[a-f0-9]{64}$/.test(e.idempotencyKey)&&typeof e.expiresAt=="string"&&Date.parse(e.expiresAt)>Date.parse(o))}async function ge(e,t){const o=await Oe(e),r=await qe(o,"handoffs"),i=`direct-${D(t)}.json`;return{parent:r,name:i,path:ne(r,i)}}async function Z(e,t){const o=await ge(e,t.storyId);await Ne(o.parent,o.name,`${JSON.stringify(t,null,2)}
|
|
2
|
+
`),await ce(o.path,o.parent)}async function O(e,t){try{const o=await ge(e,t);await ce(o.path,o.parent);const r=JSON.parse(await ie(o.path,"utf8")),i=r.state==="issued"?["schemaVersion","kind","state","storyId","fromSessionId","token","tokenDigest","bundleDigest","claimRevision","grantDigest","expiresAt"]:r.state==="consuming"?["schemaVersion","kind","state","storyId","fromSessionId","token","tokenDigest","bundleDigest","claimRevision","grantDigest","expiresAt","consumedBySessionId","consumeStartedAt"]:["schemaVersion","kind","state","storyId","fromSessionId","tokenDigest","bundleDigest","claimRevision","grantDigest","expiresAt","consumedBySessionId","consumedAt"];return Object.keys(r).sort().join("\0")!==[...i].sort().join("\0")||r.schemaVersion!==1||r.kind!=="direct-yolo-setup-handoff-token"||r.state!=="issued"&&r.state!=="consuming"&&r.state!=="consumed"||r.storyId!==t||typeof r.fromSessionId!="string"||!/^setup-[a-f0-9]{64}$/.test(r.fromSessionId)||![r.tokenDigest,r.bundleDigest,r.claimRevision,r.grantDigest].every(n=>typeof n=="string"&&/^[a-f0-9]{64}$/.test(n))||typeof r.expiresAt!="string"||!Number.isFinite(Date.parse(r.expiresAt))||(r.state==="issued"||r.state==="consuming")&&(typeof r.token!="string"||!/^[A-Za-z0-9_-]{32,256}$/.test(r.token))||r.state==="consuming"&&(typeof r.consumedBySessionId!="string"||!/^[a-f0-9]{64}$/.test(r.consumedBySessionId)||typeof r.consumeStartedAt!="string"||!Number.isFinite(Date.parse(r.consumeStartedAt)))||r.state==="consumed"&&(typeof r.consumedBySessionId!="string"||!/^[a-f0-9]{64}$/.test(r.consumedBySessionId)||typeof r.consumedAt!="string"||!Number.isFinite(Date.parse(r.consumedAt)))?void 0:r}catch{return}}async function We(e,t,o,r,i){const n=await O(e,t);if(!(!n||n.state==="consumed"||!n.token||n.bundleDigest!==o||n.claimRevision!==r||Date.parse(n.expiresAt)<=Date.parse(i)||D(n.token)!==n.tokenDigest))return{sessionId:n.fromSessionId,token:n.token}}async function Ge(e,t,o,r,i,n){const u=await O(e,t);if(!u||u.state==="consumed"||u.fromSessionId!==o||u.token!==r||u.tokenDigest!==D(r))throw new Error("direct-yolo-setup-handoff-consume-invalid");if(u.state==="consuming"){if(u.consumedBySessionId!==i)throw new Error("direct-yolo-setup-handoff-consume-raced");return}await Z(e,{...u,state:"consuming",consumedBySessionId:i,consumeStartedAt:n})}async function Ke(e,t,o,r,i,n,u,s,d){const a=await O(e,o);if(a?.state==="consumed"&&a.fromSessionId===r&&a.consumedBySessionId===s)return;const c=await q(e,{required:!0}),l=R(c.epics[t]?.branch_lease),S=R(l?.handoffConsumption);if(!a||a.state!=="consuming"||a.fromSessionId!==r||a.token!==i||a.tokenDigest!==D(i)||a.bundleDigest!==n||a.claimRevision!==u||a.consumedBySessionId!==s||l?.ownerStoryId!==o||l.sessionId!==s||S?.kind!=="direct-yolo-setup-handoff-consumption"||S.state!=="consumed"||S.fromSessionId!==r||S.tokenDigest!==a.tokenDigest||S.bundleDigest!==n||S.claimRevision!==u||S.consumedBySessionId!==s)throw new Error("direct-yolo-setup-handoff-consume-invalid");try{await Z(e,{schemaVersion:1,kind:a.kind,state:"consumed",storyId:o,fromSessionId:r,tokenDigest:a.tokenDigest,bundleDigest:a.bundleDigest,claimRevision:a.claimRevision,grantDigest:a.grantDigest,expiresAt:a.expiresAt,consumedBySessionId:s,consumedAt:d})}catch{throw new Error("direct-yolo-setup-handoff-consume-persist-failed")}}function Fe(e){const t=R(e.current?.handoffGrant),o=e.handoff?.token,r=typeof o=="string"&&/^[A-Za-z0-9_-]{32,256}$/.test(o)?D(o):void 0;return!!(t&&r&&e.handoff&&e.handoff.sessionId===e.current?.sessionId&&t.schemaVersion===1&&t.kind==="direct-yolo-setup-handoff"&&t.storyId===e.storyId&&t.fromSessionId===e.current?.sessionId&&t.bundleDigest===e.bundleDigest&&t.claimRevision===e.claimRevision&&typeof t.expiresAt=="string"&&Date.parse(t.expiresAt)>Date.parse(e.nowIso)&&typeof t.tokenDigest=="string"&&/^[a-f0-9]{64}$/.test(t.tokenDigest)&&Te(t.tokenDigest,r))}function Te(e,t){const o=Buffer.from(e,"hex"),r=Buffer.from(t,"hex");return o.length===32&&r.length===32&&be(o,r)}function J(e,t){return!!(e&&["schemaVersion","ownerStoryId","sessionId","idempotencyKey","acquiredAt","expiresAt"].every(o=>e[o]===t[o]))}async function Q(e,t,o){await H(e,r=>{const i=z(r,t),n=R(i.branch_lease);J(n,o)&&(i.branch_lease=null)})}async function Ye(e,t){const o=await q(e.projectRoot,{required:!0}),r=R(o.epics[e.epicId]?.branch_lease);if(!r||r.ownerStoryId!==t||!we(r.sessionId)||!we(r.idempotencyKey)||!Number.isFinite(Date.parse(String(r.acquiredAt)))||!Number.isFinite(Date.parse(String(r.expiresAt))))return;const i=await N(e.projectRoot,{kind:"direct",storyId:t,sessionId:String(r.sessionId),idempotencyKey:String(r.idempotencyKey),createdAt:String(r.acquiredAt),expiresAt:String(r.expiresAt),persistent:!0});if(!i.ok)return;await V(i.path,i.owner)&&await Q(e.projectRoot,e.epicId,r)}async function U(e,t,o,r){const i=await $e(t,{headSha:o,graphRevision:r,nowIso:e.nowIso});await e.qaRunner?.({projectRoot:t,storyId:e.storyId,headSha:o});const n=Ce(i);if(!n)throw new Error("p205-transient-authority-invalid");return{contract:"P205-CI-02",command:He,manifestDigest:n.manifestDigest,gateIds:n.gateIds,resultDigest:n.resultDigest,transientAuthority:i}}async function X(e,t,o,r){return await w(e,["rev-parse","HEAD"])!==o||await w(e,["symbolic-ref","--quiet","--short","HEAD"])!==t||!await C(e,["diff","--cached","--quiet"])?!1:C(e,["diff","--quiet","HEAD","--",...r])}async function me(e,t,o,r){const i=K(t);return(await w(e,["ls-remote","--heads",i,`refs/heads/${o}`])).split(/\s+/)[0]===r}function W(e,t,o){if(e.length===0||e.some(i=>!ee(i)))return{ok:!1,reasonCode:"direct-yolo-write-set-invalid"};const r=[".neocortex/state.json",`docs/stories/${o}.story.md`,`.neocortex/stories/${o}/qa-gate-result.json`,`.neocortex/stories/${o}/validation-evidence.md`,`.neocortex/stories/${o}/review.md`];return!r.every(i=>e.includes(i))||!r.every(i=>t.includes(i))?{ok:!1,reasonCode:"direct-yolo-write-set-invalid"}:e.some(i=>!t.includes(i))?{ok:!1,reasonCode:"direct-yolo-write-set-unauthorized"}:{ok:!0}}function ee(e){return e.length>0&&e.length<=1024&&!e.startsWith("/")&&!e.includes("\\")&&!e.split("/").includes("..")&&!e.startsWith(".git/")&&!e.includes("\0")}function we(e){return typeof e=="string"&&e.length>0&&e.length<=512&&/^[A-Za-z0-9._:@/+\-=]+$/.test(e)}function Ie(e){return e.length>0&&e.length<=240&&!e.startsWith("-")&&!/[\s~^:?*[\\]/.test(e)&&!e.includes("..")}function K(e){if(!/^[A-Za-z0-9._-]{1,128}$/.test(e))throw new Error("direct-yolo-remote-invalid");return e}function F(e,t){const o=`${t}: `,r=e.split(`
|
|
3
|
+
`).map(i=>i.trim()).filter(i=>i.startsWith(o)).map(i=>i.slice(o.length));return r.length===1?r[0]:void 0}function D(e){return De("sha256").update(e).digest("hex")}function $(e){return e.split("\0").filter(Boolean)}function P(e){return e&&Number.isFinite(Date.parse(e))?new Date(Date.parse(e)).toISOString():new Date().toISOString()}function R(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Re(e,t,o){const r=R(e);if(!(!r||r.schemaVersion!==1||r.originBranch!==o||r.executionBranch!==t||r.capturedFromCurrentCheckout!==!0||typeof r.originHeadSha!="string"||!/^[a-f0-9]{40,64}$/.test(r.originHeadSha)||typeof r.capturedAt!="string"||!Number.isFinite(Date.parse(r.capturedAt))))return r}function ve(e,t,o,r){return Object.freeze({schemaVersion:1,kind:"direct-yolo-setup-receipt",storyId:e.storyId,epicId:e.epicId,executionBranch:e.executionBranch,originBranch:e.originBranch,originHeadSha:t.originHeadSha,leaseExpiresAt:o,reused:r,publicSafe:!0})}async function Se(e){const t=$(await b(e,["ls-files","--others","--exclude-standard","-z"])).sort(),o=await Promise.all(t.map(async r=>{if(!ee(r))throw new Error("direct-yolo-checkout-payload-invalid");return`${r}\0${await w(e,["hash-object","--no-filters","--",r])}`}));return D([await b(e,["diff","--cached","--binary","--full-index"]),await b(e,["diff","--binary","--full-index"]),await b(e,["status","--porcelain=v1","-z","--untracked-files=all"]),...o].join("\0"))}async function Me(e){const t=[];let o;for(const r of(await b(e,["worktree","list","--porcelain"])).split(`
|
|
4
|
+
`))r.startsWith("worktree ")?(o={path:r.slice(9)},t.push(o)):o&&r.startsWith("branch refs/heads/")&&(o.branch=r.slice(18));return t}function T(e,t){return e instanceof Error&&e.message==="git-lifecycle-runtime-revision-conflict"?"direct-yolo-runtime-revision-conflict":e instanceof Error&&/^direct-yolo-[a-z0-9-]+$/.test(e.message)?e.message:t}function f(e){return{ok:!1,reasonCode:e}}async function w(e,t){return String((await M("git",[...t],{cwd:e,encoding:"utf8",maxBuffer:32*1024*1024})).stdout).trim()}async function b(e,t){return String((await M("git",[...t],{cwd:e,encoding:"utf8",maxBuffer:32*1024*1024})).stdout)}async function C(e,t){try{return await M("git",[...t],{cwd:e,maxBuffer:8*1024*1024}),!0}catch{return!1}}export{at as beginDirectYoloStoryCommit,st as finalizeDirectYoloStoryCheckpoint,nt as issueDirectYoloSetupLeaseHandoff,it as prepareDirectYoloSetup,ct as recoverLegacyDirectYoloStoryCheckpoint};
|
|
@@ -54,7 +54,7 @@ export { getCacheStatus, formatCacheStatus, type CacheStatusInfo, type CacheStat
|
|
|
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
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';
|
|
57
|
+
export { beginDirectYoloStoryCommit, finalizeDirectYoloStoryCheckpoint, issueDirectYoloSetupLeaseHandoff, prepareDirectYoloSetup, recoverLegacyDirectYoloStoryCheckpoint, type DirectYoloCheckpointOptions, type DirectYoloCheckpointResult, type DirectYoloCommitPlan, type DirectYoloSetupReceipt, type DirectYoloSetupHandoffReceipt, } from './git/direct-yolo-checkpoint.js';
|
|
58
58
|
export { FRONTMATTER_DIAGNOSTIC_CATEGORIES, FRONTMATTER_DIAGNOSTIC_REASON_CODES, getFrontmatterDiagnostic, formatFrontmatterDiagnostic, type FrontmatterDiagnosticCategory, type FrontmatterDiagnosticReasonCode, type PublicFrontmatterDiagnostic, } from './errors/frontmatter-diagnostics.js';
|
|
59
59
|
export { invoke, invokeCliHandler, collectStateSnapshot, type InvokeOptions, type InvokeResult, } from './commands/invoke.js';
|
|
60
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
|
|
1
|
+
import{ResolverMode as o,NoOpCache as t}from"./types/index.js";import{LocalResolver as i}from"./resolvers/local-resolver.js";import{RemoteResolver as n,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 S,sanitizeObject as y}from"./context/context-sanitizer.js";import{getMachineFingerprint as R}from"./machine/index.js";import{LicenseClient as D}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 Y,DegradationManager as _,DegradationLevel as w,FreshnessIndicator as z,RecoveryDetector as G}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 pe,issueDirectYoloSetupLeaseHandoff as ne,prepareDirectYoloSetup as le,recoverLegacyDirectYoloStoryCheckpoint as ce}from"./git/direct-yolo-checkpoint.js";import{FRONTMATTER_DIAGNOSTIC_CATEGORIES as se,FRONTMATTER_DIAGNOSTIC_REASON_CODES as fe,getFrontmatterDiagnostic as de,formatFrontmatterDiagnostic as Ce}from"./errors/frontmatter-diagnostics.js";import{invoke as xe,invokeCliHandler as Ae,collectStateSnapshot as Se}from"./commands/invoke.js";import{TierAwareClient as ue}from"./tier/index.js";import{buildProjectMemoryContent as ve,createNodeProjectMemoryFs as De,writeProjectMemory as Te,writeProjectMemoryTargetFiles as Me}from"./memory/project-memory-writer.js";export{P as AdapterRegistry,F as AntigravityAdapter,Z as ApprovalPolicyConfigError,M as ClaudeCodeAdapter,Y as ClientCircuitBreaker,k as CodexAdapter,h as CursorAdapter,w as DegradationLevel,_ as DegradationManager,m as EncryptedCache,se as FRONTMATTER_DIAGNOSTIC_CATEGORIES,fe as FRONTMATTER_DIAGNOSTIC_REASON_CODES,z as FreshnessIndicator,O as GeminiAdapter,D as LicenseClient,i as LocalResolver,t as NoOpCache,V as OfflineTelemetryQueue,G as RecoveryDetector,n as RemoteResolver,l as RemoteResolverError,o as ResolverMode,ue as TierAwareClient,b as UnknownTargetError,E as VSCodeAdapter,ie as beginDirectYoloStoryCommit,ve as buildProjectMemoryContent,g as collectContext,Se as collectStateSnapshot,ee as configCliHandler,I as createDefaultRegistry,De as createNodeProjectMemoryFs,f as createResolver,N as detectPlatform,K as ensureManagedSubagentApprovalPolicy,pe as finalizeDirectYoloStoryCheckpoint,U as formatCacheStatus,Ce as formatFrontmatterDiagnostic,Q as getCacheStatus,de as getFrontmatterDiagnostic,R as getMachineFingerprint,J as getSubagentApprovalPolicy,xe as invoke,Ae as invokeCliHandler,j as isValidTargetId,ne as issueDirectYoloSetupLeaseHandoff,te as parseStoryCheckpointArgs,le as prepareDirectYoloSetup,ce as recoverLegacyDirectYoloStoryCheckpoint,X as resetSubagentApprovalMode,y as sanitizeObject,S as sanitizeRecord,A as sanitizeValue,d as selectResolver,W as setSubagentApprovalMode,oe as storyCheckpointCliHandler,Te as writeProjectMemory,Me as writeProjectMemoryTargetFiles};
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex-root
|
|
3
|
-
description: "🧠 Neocortex Root Agent v4.60.
|
|
3
|
+
description: "🧠 Neocortex Root Agent v4.60.27 | OrNexus Team"
|
|
4
4
|
model: opus
|
|
5
5
|
color: blue
|
|
6
6
|
tools:
|
|
@@ -108,7 +108,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
108
108
|
┌────────────────────────────────────────────────────────────┐
|
|
109
109
|
│ │
|
|
110
110
|
│ ####### N E O C O R T E X │
|
|
111
|
-
│ ### ######## v4.60.
|
|
111
|
+
│ ### ######## v4.60.27 │
|
|
112
112
|
│ ######### ##### │
|
|
113
113
|
│ ## ############## Development Orchestrator │
|
|
114
114
|
│ ## ### ###### ## OrNexus Team │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "🧠 Neocortex v4.60.
|
|
3
|
+
description: "🧠 Neocortex v4.60.27 | OrNexus Team"
|
|
4
4
|
model: opus
|
|
5
5
|
color: blue
|
|
6
6
|
permissionMode: bypassPermissions
|
|
@@ -104,7 +104,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
104
104
|
┌────────────────────────────────────────────────────────────┐
|
|
105
105
|
│ │
|
|
106
106
|
│ ####### N E O C O R T E X │
|
|
107
|
-
│ ### ######## v4.60.
|
|
107
|
+
│ ### ######## v4.60.27 │
|
|
108
108
|
│ ######### ##### │
|
|
109
109
|
│ ## ############## Development Orchestrator │
|
|
110
110
|
│ ## ### ###### ## OrNexus Team │
|
|
@@ -28,7 +28,7 @@ Codex built-in commands or actions.
|
|
|
28
28
|
|
|
29
29
|
<!-- END: Plugin Conflict Prevention -->
|
|
30
30
|
|
|
31
|
-
# Neocortex v4.60.
|
|
31
|
+
# Neocortex v4.60.27 | OrNexus Team
|
|
32
32
|
|
|
33
33
|
You are a Development Orchestrator. All orchestration logic is delivered by the remote Neocortex server.
|
|
34
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex
|
|
3
|
-
description: "🧠 Neocortex v4.60.
|
|
3
|
+
description: "🧠 Neocortex v4.60.27 | OrNexus Team"
|
|
4
4
|
model: inherit
|
|
5
5
|
readonly: false
|
|
6
6
|
is_background: false
|
|
@@ -64,7 +64,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
64
64
|
┌────────────────────────────────────────────────────────────┐
|
|
65
65
|
│ │
|
|
66
66
|
│ ####### N E O C O R T E X │
|
|
67
|
-
│ ### ######## v4.60.
|
|
67
|
+
│ ### ######## v4.60.27 │
|
|
68
68
|
│ ######### ##### │
|
|
69
69
|
│ ## ############## Development Orchestrator │
|
|
70
70
|
│ ## ### ###### ## OrNexus Team │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: neocortex-root
|
|
3
|
-
description: "🧠 Neocortex v4.60.
|
|
3
|
+
description: "🧠 Neocortex v4.60.27 | OrNexus Team"
|
|
4
4
|
kind: local
|
|
5
5
|
tools:
|
|
6
6
|
# File operations (Gemini CLI built-ins)
|
|
@@ -62,7 +62,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
62
62
|
┌────────────────────────────────────────────────────────────┐
|
|
63
63
|
│ │
|
|
64
64
|
│ ####### N E O C O R T E X │
|
|
65
|
-
│ ### ######## v4.60.
|
|
65
|
+
│ ### ######## v4.60.27 │
|
|
66
66
|
│ ######### ##### │
|
|
67
67
|
│ ## ############## Development Orchestrator │
|
|
68
68
|
│ ## ### ###### ## OrNexus Team │
|
|
@@ -58,7 +58,7 @@ explicit server opt-in rather than a local assumption.
|
|
|
58
58
|
┌────────────────────────────────────────────────────────────┐
|
|
59
59
|
│ │
|
|
60
60
|
│ ####### N E O C O R T E X │
|
|
61
|
-
│ ### ######## v4.60.
|
|
61
|
+
│ ### ######## v4.60.27 │
|
|
62
62
|
│ ######### ##### │
|
|
63
63
|
│ ## ############## Development Orchestrator │
|
|
64
64
|
│ ## ### ###### ## OrNexus Team │
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "neocortex"
|
|
3
|
-
description: "Neocortex v4.60.
|
|
3
|
+
description: "Neocortex v4.60.27 | OrNexus Team"
|
|
4
4
|
tools:
|
|
5
5
|
# Read / Edit (built-in tool sets)
|
|
6
6
|
- read
|
|
@@ -68,7 +68,7 @@ SEMPRE que este agente for invocado, imprima o banner abaixo como PRIMEIRO outpu
|
|
|
68
68
|
┌────────────────────────────────────────────────────────────┐
|
|
69
69
|
│ │
|
|
70
70
|
│ ####### N E O C O R T E X │
|
|
71
|
-
│ ### ######## v4.60.
|
|
71
|
+
│ ### ######## v4.60.27 │
|
|
72
72
|
│ ######### ##### │
|
|
73
73
|
│ ## ############## Development Orchestrator │
|
|
74
74
|
│ ## ### ###### ## OrNexus Team │
|