@ornexus/neocortex 4.60.74 → 4.60.75
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/release-source.json +1 -1
- package/install.ps1 +1 -1
- package/install.sh +1 -1
- package/package.json +2 -2
- package/packages/client/dist/cache/encrypted-cache.d.ts +27 -0
- package/packages/client/dist/cache/encrypted-cache.js +1 -1
- package/packages/client/dist/commands/invoke.d.ts +38 -1
- package/packages/client/dist/commands/invoke.js +79 -79
- package/packages/client/dist/config/host-auth-broker.d.ts +31 -0
- package/packages/client/dist/config/host-auth-broker.js +1 -0
- package/packages/client/dist/config/host-auth-reference.d.ts +32 -0
- package/packages/client/dist/config/host-auth-reference.js +1 -0
- package/packages/client/dist/config/secure-config.js +1 -1
- package/packages/client/dist/continuity/native-agent-types.d.ts +11 -0
- package/packages/client/dist/continuity/native-agent-types.js +1 -1
- package/packages/client/dist/errors/error-messages.d.ts +3 -0
- package/packages/client/dist/errors/error-messages.js +2 -2
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +11 -1
- package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -4
- package/packages/client/dist/index.d.ts +2 -0
- package/packages/client/dist/index.js +1 -1
- package/packages/client/dist/license/host-auth-recovery.d.ts +158 -0
- package/packages/client/dist/license/host-auth-recovery.js +1 -0
- package/packages/client/dist/license/license-client.d.ts +10 -1
- package/packages/client/dist/license/license-client.js +1 -1
- package/packages/client/dist/runner/epic-background-dispatcher.d.ts +61 -0
- package/packages/client/dist/runner/epic-background-dispatcher.js +1 -0
- package/packages/client/dist/runner/headless/background-root.d.ts +65 -0
- package/packages/client/dist/runner/headless/background-root.js +1 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +9 -0
- package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -2
- package/packages/client/dist/runner/headless/managed-environment-cleanup.d.ts +95 -0
- package/packages/client/dist/runner/headless/managed-environment-cleanup.js +1 -0
- package/packages/client/dist/state/project-state-snapshot.d.ts +7 -0
- package/packages/client/dist/state/project-state-snapshot.js +1 -1
- package/packages/client/dist/yolo/change-evidence-collector.d.ts +21 -1
- package/packages/client/dist/yolo/change-evidence-collector.js +1 -1
- package/packages/shared/dist/invocation/explicit-intent-recovery.d.ts +83 -0
- package/packages/shared/dist/invocation/explicit-intent-recovery.js +187 -0
- package/packages/shared/dist/invocation/index.d.ts +7 -0
- package/packages/shared/dist/invocation/index.js +22 -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 +24 -21
- package/targets-stubs/codex/README.md +6 -1
- package/targets-stubs/codex/neocortex.toml +7 -2
- package/targets-stubs/cursor/agent.md +2 -2
- package/targets-stubs/gemini-cli/agent.md +2 -2
- package/targets-stubs/opencode/neocortex-root.md +16 -1
- package/targets-stubs/opencode/neocortex.md +6 -0
- package/targets-stubs/vscode/neocortex.agent.md +2 -2
package/dist/release-source.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"sourceRevision":"
|
|
1
|
+
{"schemaVersion":1,"sourceRevision":"9f33eb8a7a523b63cc8f48f4737610df5cb294f9","version":"4.60.75"}
|
package/install.ps1
CHANGED
package/install.sh
CHANGED
package/package.json
CHANGED
|
@@ -18,16 +18,43 @@ export interface EncryptedCacheOptions {
|
|
|
18
18
|
passphrase: string;
|
|
19
19
|
/** Read entries without cleanup, creation, overwrite or deletion. */
|
|
20
20
|
strictReadOnly?: boolean;
|
|
21
|
+
/** Bounded test seam for authoritative crash/fault matrices. */
|
|
22
|
+
authoritativeFaultInjector?: (phase: AuthoritativeWritePhase) => void | Promise<void>;
|
|
23
|
+
/** Clock used only by the finite authoritative lock. */
|
|
24
|
+
authoritativeNow?: () => number;
|
|
25
|
+
/** Owner liveness probe used only after an authoritative lock expires. */
|
|
26
|
+
authoritativeOwnerAlive?: (pid: number) => boolean;
|
|
21
27
|
}
|
|
28
|
+
export type AuthoritativeWritePhase = 'lock-synced' | 'temp-synced' | 'backup-synced' | 'renamed' | 'directory-synced' | 'readback-verified';
|
|
22
29
|
export declare class EncryptedCache implements CacheProvider {
|
|
23
30
|
private readonly cacheDir;
|
|
24
31
|
private readonly passphrase;
|
|
25
32
|
private readonly strictReadOnly;
|
|
33
|
+
private readonly authoritativeFaultInjector?;
|
|
34
|
+
private readonly authoritativeNow;
|
|
35
|
+
private readonly authoritativeOwnerAlive;
|
|
26
36
|
private initPromise;
|
|
27
37
|
constructor(options: EncryptedCacheOptions);
|
|
28
38
|
get(key: string): Promise<string | null>;
|
|
29
39
|
set(key: string, value: string, ttlMs?: number): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* Required private-state read. Unlike ordinary cache reads, corruption and
|
|
42
|
+
* access failures are explicit and expired content is never cleaned up.
|
|
43
|
+
*/
|
|
44
|
+
getAuthoritative(key: string): Promise<string | null>;
|
|
45
|
+
/**
|
|
46
|
+
* Durable compare-bound replace for private auth generations. This method is
|
|
47
|
+
* intentionally separate from best-effort cache set(): callers must observe
|
|
48
|
+
* every lock, persistence, readback and preimage failure.
|
|
49
|
+
*/
|
|
50
|
+
setAuthoritative(key: string, value: string, options?: {
|
|
51
|
+
readonly expectedPlaintextSha256?: string | null;
|
|
52
|
+
}): Promise<void>;
|
|
30
53
|
clear(): Promise<void>;
|
|
31
54
|
private keyToPath;
|
|
32
55
|
private ensureDir;
|
|
56
|
+
private acquireAuthoritativeLock;
|
|
57
|
+
private quarantineExpiredAuthoritativeLock;
|
|
58
|
+
private readAuthoritativePreimage;
|
|
59
|
+
private injectAuthoritativeFault;
|
|
33
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mkdir as
|
|
1
|
+
import{mkdir as I,writeFile as L,readFile as c,rm as m,readdir as N,open as v,rename as b,lstat as E}from"node:fs/promises";import{basename as R,join as D}from"node:path";import{createHash as l,randomUUID as F}from"node:crypto";import{hostname as O}from"node:os";import{encrypt as S,decrypt as g}from"./crypto-utils.js";import{setSecureFilePermissions as T}from"../config/secure-config.js";import{hasProtectedCachePayloadMarker as H}from"./protected-pi-boundary.js";const $=".enc";class z{cacheDir;passphrase;strictReadOnly;authoritativeFaultInjector;authoritativeNow;authoritativeOwnerAlive;initPromise=null;constructor(t){this.cacheDir=t.cacheDir,this.passphrase=t.passphrase,this.strictReadOnly=t.strictReadOnly??!1,this.authoritativeFaultInjector=t.authoritativeFaultInjector,this.authoritativeNow=t.authoritativeNow??Date.now,this.authoritativeOwnerAlive=t.authoritativeOwnerAlive??q}async get(t){try{const r=this.keyToPath(t),a=await c(r,"utf8"),i=g(a,this.passphrase);return i.expired?(this.strictReadOnly||await m(r,{force:!0}).catch(()=>{}),null):i.plaintext}catch{return null}}async set(t,r,a){if(!this.strictReadOnly)try{if(H(r))return;await this.ensureDir();const i=this.keyToPath(t),e=S(r,this.passphrase,a);await L(i,e,"utf8"),T(i)}catch{}}async getAuthoritative(t){const r=this.keyToPath(t);try{const a=await E(r);if(!a.isFile()||a.isSymbolicLink())throw new Error("auth-generation-path-unsafe");const i=await c(r,"utf8"),e=g(i,this.passphrase);if(e.expired)throw new Error("auth-generation-corrupt");return e.plaintext}catch(a){if(a?.code==="ENOENT")return null;throw C(a)?a:new Error("auth-generation-unavailable",{cause:a})}}async setAuthoritative(t,r,a={}){if(this.strictReadOnly)throw new Error("auth-generation-unavailable");if(Buffer.byteLength(r,"utf8")>256*1024)throw new Error("auth-generation-capacity");await this.ensureDir();const i=await E(this.cacheDir);if(!i.isDirectory()||i.isSymbolicLink())throw new Error("auth-generation-path-unsafe");const e=this.keyToPath(t),h=`${e}.lock`,u=`${e}.${process.pid}.${F()}.tmp`,f=F();let n,s;try{n=await this.acquireAuthoritativeLock(h,f,l("sha256").update(t).digest("hex"));const x=this.authoritativeNow();if(await n.writeFile(JSON.stringify({schemaVersion:1,ownerPid:process.pid,ownerHost:O(),nonce:f,keyDigest:l("sha256").update(t).digest("hex"),createdAt:new Date(x).toISOString(),expiresAt:new Date(x+6e4).toISOString()})),await n.sync(),await this.injectAuthoritativeFault("lock-synced"),(await N(this.cacheDir)).filter(o=>o.startsWith(`${R(e)}.`)&&o.endsWith(".tmp")).length>0)throw new Error("auth-generation-path-unsafe");try{const o=await E(e);if(!o.isFile()||o.isSymbolicLink())throw new Error("auth-generation-path-unsafe")}catch(o){if(o?.code!=="ENOENT")throw o}const d=await this.readAuthoritativePreimage(e),y=d===null?null:l("sha256").update(d.plaintext).digest("hex");if(a.expectedPlaintextSha256!==void 0&&y!==a.expectedPlaintextSha256)throw new Error("auth-generation-revision-conflict");const j=S(r,this.passphrase);if(s=await v(u,"wx",384),await s.writeFile(j,"utf8"),await s.sync(),await this.injectAuthoritativeFault("temp-synced"),await s.close(),s=void 0,d!==null&&y!==null){const o=`${e}.${y}.bak`;try{const w=await v(o,"wx",384);try{await w.writeFile(d.raw,"utf8"),await w.sync()}finally{await w.close()}}catch(w){if(w?.code!=="EEXIST")throw w;if(await c(o,"utf8")!==d.raw)throw new Error("auth-generation-path-unsafe")}await this.injectAuthoritativeFault("backup-synced")}const k=await this.readAuthoritativePreimage(e);if((k===null?null:l("sha256").update(k.plaintext).digest("hex"))!==y)throw new Error("auth-generation-revision-conflict");await b(u,e),await this.injectAuthoritativeFault("renamed"),T(e);const A=await v(this.cacheDir,"r");try{await A.sync()}finally{await A.close()}await this.injectAuthoritativeFault("directory-synced");const P=g(await c(e,"utf8"),this.passphrase);if(P.expired||P.plaintext!==r)throw new Error("auth-generation-corrupt");await this.injectAuthoritativeFault("readback-verified")}finally{if(s&&await s.close().catch(()=>{}),await m(u,{force:!0}).catch(()=>{}),n){await n.close().catch(()=>{});try{JSON.parse(await c(h,"utf8")).nonce===f&&await m(h,{force:!0})}catch{}}}}async clear(){if(!this.strictReadOnly)try{const r=(await N(this.cacheDir).catch(()=>[])).filter(a=>a.endsWith($)).map(a=>m(D(this.cacheDir,a),{force:!0}).catch(()=>{}));await Promise.all(r)}catch{}}keyToPath(t){const r=l("sha256").update(t).digest("hex");return D(this.cacheDir,`${r}${$}`)}ensureDir(){return this.initPromise||(this.initPromise=I(this.cacheDir,{recursive:!0}).then(()=>{}).catch(t=>{throw this.initPromise=null,t})),this.initPromise}async acquireAuthoritativeLock(t,r,a){for(let i=0;i<2;i+=1)try{return await v(t,"wx",384)}catch(e){if(e?.code!=="EEXIST")throw e;if(i>0)throw new Error("auth-recovery-backpressure");await this.quarantineExpiredAuthoritativeLock(t,r,a)}throw new Error("auth-recovery-backpressure")}async quarantineExpiredAuthoritativeLock(t,r,a){let i;try{i=await c(t,"utf8")}catch(n){if(n?.code==="ENOENT")return;throw new Error("auth-recovery-backpressure",{cause:n})}let e;try{e=JSON.parse(i)}catch(n){throw new Error("auth-generation-path-unsafe",{cause:n})}const h=typeof e.expiresAt=="string"?Date.parse(e.expiresAt):Number.NaN,u=e.ownerPid;if(e.schemaVersion!==1||e.keyDigest!==a||!Number.isSafeInteger(u)||typeof e.ownerHost!="string"||typeof e.nonce!="string"||!Number.isFinite(h))throw new Error("auth-generation-path-unsafe");if(h>this.authoritativeNow()||e.ownerHost!==O()||this.authoritativeOwnerAlive(u))throw new Error("auth-recovery-backpressure");const f=`${t}.stale-${l("sha256").update(i).digest("hex").slice(0,16)}-${r}.bak`;try{await b(t,f)}catch(n){if(n?.code==="ENOENT")return;throw new Error("auth-recovery-backpressure",{cause:n})}}async readAuthoritativePreimage(t){try{const r=await E(t);if(!r.isFile()||r.isSymbolicLink())throw new Error("auth-generation-path-unsafe");const a=await c(t,"utf8"),i=g(a,this.passphrase);if(i.expired)throw new Error("auth-generation-corrupt");return{raw:a,plaintext:i.plaintext}}catch(r){if(r?.code==="ENOENT")return null;throw r}}async injectAuthoritativeFault(t){await this.authoritativeFaultInjector?.(t)}}function q(p){try{return process.kill(p,0),!0}catch(t){return t?.code==="EPERM"}}function C(p){return p instanceof Error&&/^auth-generation-(?:corrupt|path-unsafe|capacity|revision-conflict|unavailable)$/.test(p.message)}export{z as EncryptedCache};
|
|
@@ -10,7 +10,7 @@ import { type YoloSpecEnvelopeV1 } from '../../../shared/dist/yolo/spec-envelope
|
|
|
10
10
|
import type { YoloChangeEvidence } from '../../../shared/dist/yolo/change-evidence.js';
|
|
11
11
|
import { type ReleaseGateRequestV1 } from '../../../shared/dist/yoloop/release-blocked.js';
|
|
12
12
|
import { type InvokeEffectContext, type StrictReadOnlyInvokeEnvelope } from '../../../shared/dist/strict-readonly.js';
|
|
13
|
-
import { type InvokeInputEvidenceV1, type InvokeInputEnvelopeV2, type InvokeInputSourceV2, type InvocationMalformedInputReasonV1, type InvocationAdmissionResultV1, type ProjectIdentityMigrationRequestV1 } from '../../../shared/dist/invocation/index.js';
|
|
13
|
+
import { type ExplicitIntentRecoveryBindingV1, type ExplicitIntentRecoveryResultV1, type InvokeInputEvidenceV1, type InvokeInputEnvelopeV2, type InvokeInputSourceV2, type InvocationMalformedInputReasonV1, type InvocationAdmissionResultV1, type ProjectIdentityMigrationRequestV1 } from '../../../shared/dist/invocation/index.js';
|
|
14
14
|
import { type CompatibilityOfferV1, type CompatibilityResultV1 } from '../../../shared/dist/compatibility/index.js';
|
|
15
15
|
import { type P205TransientExecutionAuthority } from '../git/git-lifecycle-store.js';
|
|
16
16
|
export declare const INVOKE_PAYLOAD_LIMIT_BYTES: number;
|
|
@@ -98,6 +98,8 @@ export declare function projectReleaseBlockedInvokeResult(response: {
|
|
|
98
98
|
}): InvokeResult | undefined;
|
|
99
99
|
/** P205.07 client parity guard. Pure and deliberately exported for driver tests. */
|
|
100
100
|
export declare function admitClientInvocation(args: string): InvocationAdmissionResultV1;
|
|
101
|
+
/** P224.02 client parity seam; policy remains owned by the shared classifier. */
|
|
102
|
+
export declare function recoverClientInvocation(args: string): ExplicitIntentRecoveryResultV1;
|
|
101
103
|
type InvokeWatchFormat = 'plain' | 'json';
|
|
102
104
|
interface InvokeWatchWritable {
|
|
103
105
|
write(chunk: string): unknown;
|
|
@@ -246,6 +248,8 @@ export declare function sanitizeInvokeCliOutput(instructions: string | undefined
|
|
|
246
248
|
instructions: string;
|
|
247
249
|
metadata: Record<string, unknown> | undefined;
|
|
248
250
|
};
|
|
251
|
+
/** Project only the bounded causal fields admitted by the local Git preflight. */
|
|
252
|
+
export declare function projectYoloChangeEvidenceCliDiagnostic(value: unknown): Record<string, unknown> | undefined;
|
|
249
253
|
type InvokeCliInputSource = InvokeInputSourceV2;
|
|
250
254
|
export interface InvokeCliParsedOptions {
|
|
251
255
|
readonly args: string;
|
|
@@ -549,6 +553,8 @@ interface InvokeRequestBodyBase {
|
|
|
549
553
|
readonly projectIdentityMigration?: ProjectIdentityMigrationRequestV1;
|
|
550
554
|
/** Public-safe proof that the transmitted/materialized args are byte-faithful. */
|
|
551
555
|
readonly inputEvidence: InvokeInputEvidenceV1;
|
|
556
|
+
/** P224.02 hash-only binding from original explicit input to canonical args. */
|
|
557
|
+
readonly invocationRecovery?: ExplicitIntentRecoveryBindingV1;
|
|
552
558
|
readonly idempotencyKey?: string;
|
|
553
559
|
readonly registryVersion: string;
|
|
554
560
|
readonly registryChecksum: string;
|
|
@@ -625,6 +631,13 @@ export declare function detectStateSchemaDrift(stateData: unknown): SchemaDriftI
|
|
|
625
631
|
* Exported for tests only; not part of the public API.
|
|
626
632
|
*/
|
|
627
633
|
export declare function __resetSchemaDriftWarnedForTests(): void;
|
|
634
|
+
export interface CreateEpicPlanningProjectionDiagnosticV1 {
|
|
635
|
+
readonly schemaVersion: 'CreateEpicPlanningProjectionDiagnostic/1.0';
|
|
636
|
+
readonly outcome: 'omitted';
|
|
637
|
+
readonly reasonCode: 'budget-omitted';
|
|
638
|
+
readonly byteLengthBucket: '16385-32768' | '32769-plus';
|
|
639
|
+
readonly publicSafe: true;
|
|
640
|
+
}
|
|
628
641
|
/**
|
|
629
642
|
* Read state.json and construct a sanitized snapshot for the server.
|
|
630
643
|
* Relative paths only - no absolute paths sent to server.
|
|
@@ -732,6 +745,30 @@ export declare function sendEpicClaimAcknowledgement(serverUrl: string, authToke
|
|
|
732
745
|
};
|
|
733
746
|
}, retryOptions?: InvokePhysicalRetryOptions): Promise<boolean>;
|
|
734
747
|
export declare function acknowledgeMaterializedPendingEpicClaims(projectRoot: string, stateSnapshot: StateSnapshot, serverUrl: string, authToken: string, projectId: string | undefined, retryOptions?: InvokePhysicalRetryOptions): Promise<number>;
|
|
748
|
+
export type YoloopInvalidatedSessionRecoveryResultV1 = {
|
|
749
|
+
readonly outcome: 'applied';
|
|
750
|
+
readonly payloadHash: string;
|
|
751
|
+
readonly retryCount: 1;
|
|
752
|
+
readonly publicSafe: true;
|
|
753
|
+
} | {
|
|
754
|
+
readonly outcome: 'blocked';
|
|
755
|
+
readonly reasonCode: string;
|
|
756
|
+
readonly retryCount: 0;
|
|
757
|
+
readonly publicSafe: true;
|
|
758
|
+
};
|
|
759
|
+
/**
|
|
760
|
+
* P224.02 single causal reconciliation. The caller invokes this only for the
|
|
761
|
+
* exact public pair YOLOOP_SPEC_NOT_READY/yoloop-session-invalidated. It reads
|
|
762
|
+
* and mutates the private common authority through the P224.01 CAS, then
|
|
763
|
+
* verifies the durable postimage before authorizing one transport retry.
|
|
764
|
+
*/
|
|
765
|
+
export declare function reconcileInvalidatedYoloopSession(input: {
|
|
766
|
+
readonly projectRoot: string;
|
|
767
|
+
readonly snapshot: StateSnapshot;
|
|
768
|
+
readonly targetEpicId: string;
|
|
769
|
+
readonly originalInputSha256: string;
|
|
770
|
+
readonly canonicalInputSha256: string;
|
|
771
|
+
}): Promise<YoloopInvalidatedSessionRecoveryResultV1>;
|
|
735
772
|
/**
|
|
736
773
|
* Execute the invoke command.
|
|
737
774
|
*
|