@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.
Files changed (55) hide show
  1. package/dist/release-source.json +1 -1
  2. package/install.ps1 +1 -1
  3. package/install.sh +1 -1
  4. package/package.json +2 -2
  5. package/packages/client/dist/cache/encrypted-cache.d.ts +27 -0
  6. package/packages/client/dist/cache/encrypted-cache.js +1 -1
  7. package/packages/client/dist/commands/invoke.d.ts +38 -1
  8. package/packages/client/dist/commands/invoke.js +79 -79
  9. package/packages/client/dist/config/host-auth-broker.d.ts +31 -0
  10. package/packages/client/dist/config/host-auth-broker.js +1 -0
  11. package/packages/client/dist/config/host-auth-reference.d.ts +32 -0
  12. package/packages/client/dist/config/host-auth-reference.js +1 -0
  13. package/packages/client/dist/config/secure-config.js +1 -1
  14. package/packages/client/dist/continuity/native-agent-types.d.ts +11 -0
  15. package/packages/client/dist/continuity/native-agent-types.js +1 -1
  16. package/packages/client/dist/errors/error-messages.d.ts +3 -0
  17. package/packages/client/dist/errors/error-messages.js +2 -2
  18. package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +11 -1
  19. package/packages/client/dist/git/direct-yolo-checkpoint.js +4 -4
  20. package/packages/client/dist/index.d.ts +2 -0
  21. package/packages/client/dist/index.js +1 -1
  22. package/packages/client/dist/license/host-auth-recovery.d.ts +158 -0
  23. package/packages/client/dist/license/host-auth-recovery.js +1 -0
  24. package/packages/client/dist/license/license-client.d.ts +10 -1
  25. package/packages/client/dist/license/license-client.js +1 -1
  26. package/packages/client/dist/runner/epic-background-dispatcher.d.ts +61 -0
  27. package/packages/client/dist/runner/epic-background-dispatcher.js +1 -0
  28. package/packages/client/dist/runner/headless/background-root.d.ts +65 -0
  29. package/packages/client/dist/runner/headless/background-root.js +1 -0
  30. package/packages/client/dist/runner/headless/epic-terminal-git-runner.d.ts +9 -0
  31. package/packages/client/dist/runner/headless/epic-terminal-git-runner.js +2 -2
  32. package/packages/client/dist/runner/headless/managed-environment-cleanup.d.ts +95 -0
  33. package/packages/client/dist/runner/headless/managed-environment-cleanup.js +1 -0
  34. package/packages/client/dist/state/project-state-snapshot.d.ts +7 -0
  35. package/packages/client/dist/state/project-state-snapshot.js +1 -1
  36. package/packages/client/dist/yolo/change-evidence-collector.d.ts +21 -1
  37. package/packages/client/dist/yolo/change-evidence-collector.js +1 -1
  38. package/packages/shared/dist/invocation/explicit-intent-recovery.d.ts +83 -0
  39. package/packages/shared/dist/invocation/explicit-intent-recovery.js +187 -0
  40. package/packages/shared/dist/invocation/index.d.ts +7 -0
  41. package/packages/shared/dist/invocation/index.js +22 -0
  42. package/targets-stubs/antigravity/gemini.md +1 -1
  43. package/targets-stubs/antigravity/skill/SKILL.md +1 -1
  44. package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
  45. package/targets-stubs/claude-code/neocortex-root.md +2 -2
  46. package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
  47. package/targets-stubs/claude-code/neocortex.md +2 -2
  48. package/targets-stubs/codex/AGENTS.md +24 -21
  49. package/targets-stubs/codex/README.md +6 -1
  50. package/targets-stubs/codex/neocortex.toml +7 -2
  51. package/targets-stubs/cursor/agent.md +2 -2
  52. package/targets-stubs/gemini-cli/agent.md +2 -2
  53. package/targets-stubs/opencode/neocortex-root.md +16 -1
  54. package/targets-stubs/opencode/neocortex.md +6 -0
  55. package/targets-stubs/vscode/neocortex.agent.md +2 -2
@@ -1 +1 @@
1
- {"schemaVersion":1,"sourceRevision":"65f126bb8239b04a46732ff489af24eeb36e00e1","version":"4.60.74"}
1
+ {"schemaVersion":1,"sourceRevision":"9f33eb8a7a523b63cc8f48f4737610df5cb294f9","version":"4.60.75"}
package/install.ps1 CHANGED
@@ -17,7 +17,7 @@ param(
17
17
  [string]$ServerUrl = ('https://{0}.{1}.{2}' -f 'api','neocortex','sh')
18
18
  )
19
19
 
20
- $VERSION = "4.60.74"
20
+ $VERSION = "4.60.75"
21
21
 
22
22
  # =============================================================================
23
23
  # CONFIGURACOES
package/install.sh CHANGED
@@ -4,7 +4,7 @@
4
4
  # Development Orchestrator
5
5
 
6
6
  # Versao do instalador
7
- VERSION="4.60.74"
7
+ VERSION="4.60.75"
8
8
 
9
9
  # Flags
10
10
  MIGRATION_DETECTED=false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ornexus/neocortex",
3
- "version": "4.60.74",
4
- "description": "Neocortex v4.60.74",
3
+ "version": "4.60.75",
4
+ "description": "Neocortex v4.60.75",
5
5
  "keywords": [
6
6
  "claude",
7
7
  "claude-code",
@@ -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 n,writeFile as o,readFile as l,rm as s,readdir as u}from"node:fs/promises";import{join as a}from"node:path";import{createHash as m}from"node:crypto";import{encrypt as p,decrypt as d}from"./crypto-utils.js";import{setSecureFilePermissions as f}from"../config/secure-config.js";import{hasProtectedCachePayloadMarker as y}from"./protected-pi-boundary.js";const c=".enc";class x{cacheDir;passphrase;strictReadOnly;initPromise=null;constructor(t){this.cacheDir=t.cacheDir,this.passphrase=t.passphrase,this.strictReadOnly=t.strictReadOnly??!1}async get(t){try{const r=this.keyToPath(t),e=await l(r,"utf8"),i=d(e,this.passphrase);return i.expired?(this.strictReadOnly||await s(r,{force:!0}).catch(()=>{}),null):i.plaintext}catch{return null}}async set(t,r,e){if(!this.strictReadOnly)try{if(y(r))return;await this.ensureDir();const i=this.keyToPath(t),h=p(r,this.passphrase,e);await o(i,h,"utf8"),f(i)}catch{}}async clear(){if(!this.strictReadOnly)try{const r=(await u(this.cacheDir).catch(()=>[])).filter(e=>e.endsWith(c)).map(e=>s(a(this.cacheDir,e),{force:!0}).catch(()=>{}));await Promise.all(r)}catch{}}keyToPath(t){const r=m("sha256").update(t).digest("hex");return a(this.cacheDir,`${r}${c}`)}ensureDir(){return this.initPromise||(this.initPromise=n(this.cacheDir,{recursive:!0}).then(()=>{}).catch(t=>{throw this.initPromise=null,t})),this.initPromise}}export{x as EncryptedCache};
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
  *