codex-workflow-v2 2.0.0-beta.2 → 2.0.0-beta.4
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/README.md +35 -2
- package/dist/src/alpha6/adoption.js +13 -3
- package/dist/src/alpha6/adoption.js.map +1 -1
- package/dist/src/alpha6/handoff.d.ts +21 -0
- package/dist/src/alpha6/handoff.js +100 -19
- package/dist/src/alpha6/handoff.js.map +1 -1
- package/dist/src/alpha6/milestone.d.ts +2 -0
- package/dist/src/alpha6/milestone.js +15 -0
- package/dist/src/alpha6/milestone.js.map +1 -1
- package/dist/src/alpha6/plan-risk.d.ts +1 -0
- package/dist/src/alpha6/plan-risk.js +6 -0
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/cli.js +188 -65
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +111 -5
- package/dist/src/contracts.js +1 -1
- package/dist/src/credential-output.d.ts +10 -0
- package/dist/src/credential-output.js +73 -0
- package/dist/src/credential-output.js.map +1 -0
- package/dist/src/errors.d.ts +1 -1
- package/dist/src/errors.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
- package/dist/src/lifecycle/canonical-hash.js +24 -0
- package/dist/src/lifecycle/canonical-hash.js.map +1 -0
- package/dist/src/lifecycle/catalog.d.ts +26 -0
- package/dist/src/lifecycle/catalog.js +208 -0
- package/dist/src/lifecycle/catalog.js.map +1 -0
- package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
- package/dist/src/lifecycle/compiler-inspection.js +29 -0
- package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
- package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
- package/dist/src/lifecycle/core-static-readiness.js +130 -0
- package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
- package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
- package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
- package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js +534 -0
- package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
- package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
- package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
- package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
- package/dist/src/lifecycle/corrective-replan.js +548 -0
- package/dist/src/lifecycle/corrective-replan.js.map +1 -0
- package/dist/src/lifecycle/evaluator.d.ts +2 -0
- package/dist/src/lifecycle/evaluator.js +35 -0
- package/dist/src/lifecycle/evaluator.js.map +1 -0
- package/dist/src/lifecycle/fingerprint.d.ts +31 -0
- package/dist/src/lifecycle/fingerprint.js +388 -0
- package/dist/src/lifecycle/fingerprint.js.map +1 -0
- package/dist/src/lifecycle/immutable.d.ts +1 -0
- package/dist/src/lifecycle/immutable.js +10 -0
- package/dist/src/lifecycle/immutable.js.map +1 -0
- package/dist/src/lifecycle/implementation-table.d.ts +29 -0
- package/dist/src/lifecycle/implementation-table.js +87 -0
- package/dist/src/lifecycle/implementation-table.js.map +1 -0
- package/dist/src/lifecycle/index.d.ts +4 -0
- package/dist/src/lifecycle/index.js +5 -0
- package/dist/src/lifecycle/index.js.map +1 -0
- package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
- package/dist/src/lifecycle/schema-artifact.js +214 -0
- package/dist/src/lifecycle/schema-artifact.js.map +1 -0
- package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
- package/dist/src/lifecycle/semantic-registry.js +489 -0
- package/dist/src/lifecycle/semantic-registry.js.map +1 -0
- package/dist/src/lifecycle/types.d.ts +718 -0
- package/dist/src/lifecycle/types.js +4 -0
- package/dist/src/lifecycle/types.js.map +1 -0
- package/dist/src/observation.d.ts +20 -0
- package/dist/src/observation.js +171 -0
- package/dist/src/observation.js.map +1 -0
- package/dist/src/state/corrective-replan-executor.d.ts +64 -0
- package/dist/src/state/corrective-replan-executor.js +598 -0
- package/dist/src/state/corrective-replan-executor.js.map +1 -0
- package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
- package/dist/src/state/corrective-replan-public-schema.js +43 -0
- package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
- package/dist/src/state/corrective-replan-public.d.ts +95 -0
- package/dist/src/state/corrective-replan-public.js +618 -0
- package/dist/src/state/corrective-replan-public.js.map +1 -0
- package/dist/src/state/corrective-replan-transaction.d.ts +158 -0
- package/dist/src/state/corrective-replan-transaction.js +723 -0
- package/dist/src/state/corrective-replan-transaction.js.map +1 -0
- package/dist/src/state/corrective-yield-executor.d.ts +31 -0
- package/dist/src/state/corrective-yield-executor.js +236 -0
- package/dist/src/state/corrective-yield-executor.js.map +1 -0
- package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
- package/dist/src/state/corrective-yield-transaction.js +591 -0
- package/dist/src/state/corrective-yield-transaction.js.map +1 -0
- package/dist/src/state/lock.d.ts +75 -3
- package/dist/src/state/lock.js +582 -30
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/state/store.d.ts +3 -0
- package/dist/src/state/store.js +65 -12
- package/dist/src/state/store.js.map +1 -1
- package/dist/src/transition-core.d.ts +67 -0
- package/dist/src/transition-core.js +318 -0
- package/dist/src/transition-core.js.map +1 -0
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflow.d.ts +34 -22
- package/dist/src/workflow.js +486 -141
- package/dist/src/workflow.js.map +1 -1
- package/docs/lifecycle/state-machine-stabilization.md +641 -0
- package/docs/release.md +4 -2
- package/docs/updating-existing-project.md +9 -0
- package/package.json +4 -1
- package/schemas/adoption-posture-event.schema.json +1 -1
- package/schemas/context-envelope.schema.json +1 -1
- package/schemas/corrective-replan-credentials.private.schema.json +98 -0
- package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
- package/schemas/corrective-replan-public.schema.json +142 -0
- package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
- package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
- package/schemas/remediation-event.schema.json +11 -1
- package/schemas/task-handoff-event.schema.json +1 -1
- package/schemas/transition-definition.schema.json +2609 -0
- package/schemas/transition-payloads.schema.json +140 -0
package/dist/src/state/lock.d.ts
CHANGED
|
@@ -1,14 +1,86 @@
|
|
|
1
|
-
import { type WriterLease } from '../contracts.js';
|
|
1
|
+
import { STATE_SCHEMA_VERSION, type PublicCoreTaskOperation, type PublicWriterLease, type WriterLease } from '../contracts.js';
|
|
2
|
+
export interface CoreTaskOperationMutex {
|
|
3
|
+
schemaVersion: typeof STATE_SCHEMA_VERSION;
|
|
4
|
+
kind: 'core-task-operation-mutex';
|
|
5
|
+
entityId: string;
|
|
6
|
+
operationId: string;
|
|
7
|
+
transitionId: string;
|
|
8
|
+
mutexId: string;
|
|
9
|
+
nonceSha256: string;
|
|
10
|
+
owner: 'workflow-core';
|
|
11
|
+
acquiredAt: string;
|
|
12
|
+
expiresAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CoreTaskOperationHandle {
|
|
15
|
+
readonly __coreTaskOperationHandle?: never;
|
|
16
|
+
}
|
|
17
|
+
export interface WriterLeaseHandle {
|
|
18
|
+
readonly __writerLeaseHandle?: never;
|
|
19
|
+
}
|
|
2
20
|
export declare class WriterLockManager {
|
|
3
21
|
private readonly locksRoot;
|
|
4
22
|
private readonly now;
|
|
5
|
-
|
|
23
|
+
private readonly trustedRoot?;
|
|
24
|
+
constructor(locksRoot: string, now?: () => Date, trustedRoot?: string | undefined);
|
|
6
25
|
acquire(entityId: string, owner: string, leaseMs?: number): WriterLease;
|
|
7
26
|
heartbeat(entityId: string, token: string, leaseMs?: number): WriterLease;
|
|
8
27
|
release(entityId: string, token: string): void;
|
|
28
|
+
prove(entityId: string, token: string): WriterLeaseHandle;
|
|
29
|
+
proofBinding(handle: WriterLeaseHandle): {
|
|
30
|
+
entityId: string;
|
|
31
|
+
owner: string;
|
|
32
|
+
expiresAt: string;
|
|
33
|
+
tokenSha256: string;
|
|
34
|
+
contentSha256: string;
|
|
35
|
+
};
|
|
9
36
|
inspect(entityId: string): WriterLease | null;
|
|
10
37
|
list(): WriterLease[];
|
|
11
38
|
repairStale(entityId: string): WriterLease;
|
|
12
|
-
private
|
|
39
|
+
private requireConsumableToken;
|
|
13
40
|
private file;
|
|
14
41
|
}
|
|
42
|
+
export declare function listWriterLeases(locksRoot: string, trustedRoot?: string): WriterLease[];
|
|
43
|
+
export declare function inspectWriterLease(locksRoot: string, entityId: string, trustedRoot?: string): WriterLease | null;
|
|
44
|
+
export declare function listCoreTaskOperationMutexes(locksRoot: string, trustedRoot?: string): CoreTaskOperationMutex[];
|
|
45
|
+
export declare function toPublicWriterLease(lease: WriterLease, now: Date): PublicWriterLease;
|
|
46
|
+
export declare class CoreTaskOperationLockManager {
|
|
47
|
+
private readonly locksRoot;
|
|
48
|
+
private readonly now;
|
|
49
|
+
private readonly trustedRoot?;
|
|
50
|
+
constructor(locksRoot: string, now?: () => Date, trustedRoot?: string | undefined);
|
|
51
|
+
acquire(input: {
|
|
52
|
+
entityId: string;
|
|
53
|
+
operationId: string;
|
|
54
|
+
transitionId: string;
|
|
55
|
+
leaseMs?: number;
|
|
56
|
+
}): CoreTaskOperationHandle;
|
|
57
|
+
acquireForRecovery(input: {
|
|
58
|
+
entityId: string;
|
|
59
|
+
operationId: string;
|
|
60
|
+
transitionId: string;
|
|
61
|
+
leaseMs?: number;
|
|
62
|
+
}): CoreTaskOperationHandle;
|
|
63
|
+
transferFromWriter(writerHandle: WriterLeaseHandle, input: {
|
|
64
|
+
entityId: string;
|
|
65
|
+
operationId: string;
|
|
66
|
+
transitionId: 'task.coordination.corrective-yield';
|
|
67
|
+
leaseMs?: number;
|
|
68
|
+
}): CoreTaskOperationHandle;
|
|
69
|
+
acquireYieldRecovery(input: {
|
|
70
|
+
entityId: string;
|
|
71
|
+
operationId: string;
|
|
72
|
+
transitionId: 'task.coordination.corrective-yield';
|
|
73
|
+
expectedWriterContentSha256: string;
|
|
74
|
+
expectedWriterTokenSha256: string;
|
|
75
|
+
leaseMs?: number;
|
|
76
|
+
}): CoreTaskOperationHandle;
|
|
77
|
+
release(handle: CoreTaskOperationHandle): void;
|
|
78
|
+
private materializeMutex;
|
|
79
|
+
}
|
|
80
|
+
export declare function assertCoreTaskOperationHandle(locksRoot: string, trustedRoot: string | undefined, handle: unknown, now: Date, expected?: {
|
|
81
|
+
entityId?: string;
|
|
82
|
+
operationId?: string;
|
|
83
|
+
transitionId?: string;
|
|
84
|
+
}): CoreTaskOperationMutex;
|
|
85
|
+
export declare function inspectCoreTaskOperationMutex(locksRoot: string, entityId: string, trustedRoot?: string): CoreTaskOperationMutex | null;
|
|
86
|
+
export declare function toPublicCoreTaskOperation(mutex: CoreTaskOperationMutex, now: Date): PublicCoreTaskOperation;
|