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.
Files changed (128) hide show
  1. package/README.md +35 -2
  2. package/dist/src/alpha6/adoption.js +13 -3
  3. package/dist/src/alpha6/adoption.js.map +1 -1
  4. package/dist/src/alpha6/handoff.d.ts +21 -0
  5. package/dist/src/alpha6/handoff.js +100 -19
  6. package/dist/src/alpha6/handoff.js.map +1 -1
  7. package/dist/src/alpha6/milestone.d.ts +2 -0
  8. package/dist/src/alpha6/milestone.js +15 -0
  9. package/dist/src/alpha6/milestone.js.map +1 -1
  10. package/dist/src/alpha6/plan-risk.d.ts +1 -0
  11. package/dist/src/alpha6/plan-risk.js +6 -0
  12. package/dist/src/alpha6/plan-risk.js.map +1 -1
  13. package/dist/src/cli.js +188 -65
  14. package/dist/src/cli.js.map +1 -1
  15. package/dist/src/contracts.d.ts +111 -5
  16. package/dist/src/contracts.js +1 -1
  17. package/dist/src/credential-output.d.ts +10 -0
  18. package/dist/src/credential-output.js +73 -0
  19. package/dist/src/credential-output.js.map +1 -0
  20. package/dist/src/errors.d.ts +1 -1
  21. package/dist/src/errors.js.map +1 -1
  22. package/dist/src/index.d.ts +1 -1
  23. package/dist/src/index.js +1 -1
  24. package/dist/src/index.js.map +1 -1
  25. package/dist/src/lifecycle/canonical-hash.d.ts +6 -0
  26. package/dist/src/lifecycle/canonical-hash.js +24 -0
  27. package/dist/src/lifecycle/canonical-hash.js.map +1 -0
  28. package/dist/src/lifecycle/catalog.d.ts +26 -0
  29. package/dist/src/lifecycle/catalog.js +208 -0
  30. package/dist/src/lifecycle/catalog.js.map +1 -0
  31. package/dist/src/lifecycle/compiler-inspection.d.ts +48 -0
  32. package/dist/src/lifecycle/compiler-inspection.js +29 -0
  33. package/dist/src/lifecycle/compiler-inspection.js.map +1 -0
  34. package/dist/src/lifecycle/core-static-readiness.d.ts +6 -0
  35. package/dist/src/lifecycle/core-static-readiness.js +130 -0
  36. package/dist/src/lifecycle/core-static-readiness.js.map +1 -0
  37. package/dist/src/lifecycle/corrective-replan-authority.d.ts +53 -0
  38. package/dist/src/lifecycle/corrective-replan-authority.js +139 -0
  39. package/dist/src/lifecycle/corrective-replan-authority.js.map +1 -0
  40. package/dist/src/lifecycle/corrective-replan-binding-manifest.d.ts +21 -0
  41. package/dist/src/lifecycle/corrective-replan-binding-manifest.js +35 -0
  42. package/dist/src/lifecycle/corrective-replan-binding-manifest.js.map +1 -0
  43. package/dist/src/lifecycle/corrective-replan-credential-core.d.ts +86 -0
  44. package/dist/src/lifecycle/corrective-replan-credential-core.js +534 -0
  45. package/dist/src/lifecycle/corrective-replan-credential-core.js.map +1 -0
  46. package/dist/src/lifecycle/corrective-replan-credential-schema.d.ts +17 -0
  47. package/dist/src/lifecycle/corrective-replan-credential-schema.js +44 -0
  48. package/dist/src/lifecycle/corrective-replan-credential-schema.js.map +1 -0
  49. package/dist/src/lifecycle/corrective-replan-credentials.d.ts +47 -0
  50. package/dist/src/lifecycle/corrective-replan-credentials.js +103 -0
  51. package/dist/src/lifecycle/corrective-replan-credentials.js.map +1 -0
  52. package/dist/src/lifecycle/corrective-replan.d.ts +64 -0
  53. package/dist/src/lifecycle/corrective-replan.js +548 -0
  54. package/dist/src/lifecycle/corrective-replan.js.map +1 -0
  55. package/dist/src/lifecycle/evaluator.d.ts +2 -0
  56. package/dist/src/lifecycle/evaluator.js +35 -0
  57. package/dist/src/lifecycle/evaluator.js.map +1 -0
  58. package/dist/src/lifecycle/fingerprint.d.ts +31 -0
  59. package/dist/src/lifecycle/fingerprint.js +388 -0
  60. package/dist/src/lifecycle/fingerprint.js.map +1 -0
  61. package/dist/src/lifecycle/immutable.d.ts +1 -0
  62. package/dist/src/lifecycle/immutable.js +10 -0
  63. package/dist/src/lifecycle/immutable.js.map +1 -0
  64. package/dist/src/lifecycle/implementation-table.d.ts +29 -0
  65. package/dist/src/lifecycle/implementation-table.js +87 -0
  66. package/dist/src/lifecycle/implementation-table.js.map +1 -0
  67. package/dist/src/lifecycle/index.d.ts +4 -0
  68. package/dist/src/lifecycle/index.js +5 -0
  69. package/dist/src/lifecycle/index.js.map +1 -0
  70. package/dist/src/lifecycle/schema-artifact.d.ts +12 -0
  71. package/dist/src/lifecycle/schema-artifact.js +214 -0
  72. package/dist/src/lifecycle/schema-artifact.js.map +1 -0
  73. package/dist/src/lifecycle/semantic-registry.d.ts +6 -0
  74. package/dist/src/lifecycle/semantic-registry.js +489 -0
  75. package/dist/src/lifecycle/semantic-registry.js.map +1 -0
  76. package/dist/src/lifecycle/types.d.ts +718 -0
  77. package/dist/src/lifecycle/types.js +4 -0
  78. package/dist/src/lifecycle/types.js.map +1 -0
  79. package/dist/src/observation.d.ts +20 -0
  80. package/dist/src/observation.js +171 -0
  81. package/dist/src/observation.js.map +1 -0
  82. package/dist/src/state/corrective-replan-executor.d.ts +64 -0
  83. package/dist/src/state/corrective-replan-executor.js +598 -0
  84. package/dist/src/state/corrective-replan-executor.js.map +1 -0
  85. package/dist/src/state/corrective-replan-public-schema.d.ts +3 -0
  86. package/dist/src/state/corrective-replan-public-schema.js +43 -0
  87. package/dist/src/state/corrective-replan-public-schema.js.map +1 -0
  88. package/dist/src/state/corrective-replan-public.d.ts +95 -0
  89. package/dist/src/state/corrective-replan-public.js +618 -0
  90. package/dist/src/state/corrective-replan-public.js.map +1 -0
  91. package/dist/src/state/corrective-replan-transaction.d.ts +158 -0
  92. package/dist/src/state/corrective-replan-transaction.js +723 -0
  93. package/dist/src/state/corrective-replan-transaction.js.map +1 -0
  94. package/dist/src/state/corrective-yield-executor.d.ts +31 -0
  95. package/dist/src/state/corrective-yield-executor.js +236 -0
  96. package/dist/src/state/corrective-yield-executor.js.map +1 -0
  97. package/dist/src/state/corrective-yield-transaction.d.ts +97 -0
  98. package/dist/src/state/corrective-yield-transaction.js +591 -0
  99. package/dist/src/state/corrective-yield-transaction.js.map +1 -0
  100. package/dist/src/state/lock.d.ts +75 -3
  101. package/dist/src/state/lock.js +582 -30
  102. package/dist/src/state/lock.js.map +1 -1
  103. package/dist/src/state/store.d.ts +3 -0
  104. package/dist/src/state/store.js +65 -12
  105. package/dist/src/state/store.js.map +1 -1
  106. package/dist/src/transition-core.d.ts +67 -0
  107. package/dist/src/transition-core.js +318 -0
  108. package/dist/src/transition-core.js.map +1 -0
  109. package/dist/src/version.d.ts +1 -1
  110. package/dist/src/version.js +1 -1
  111. package/dist/src/workflow.d.ts +34 -22
  112. package/dist/src/workflow.js +486 -141
  113. package/dist/src/workflow.js.map +1 -1
  114. package/docs/lifecycle/state-machine-stabilization.md +641 -0
  115. package/docs/release.md +4 -2
  116. package/docs/updating-existing-project.md +9 -0
  117. package/package.json +4 -1
  118. package/schemas/adoption-posture-event.schema.json +1 -1
  119. package/schemas/context-envelope.schema.json +1 -1
  120. package/schemas/corrective-replan-credentials.private.schema.json +98 -0
  121. package/schemas/corrective-replan-execution-event.private.schema.json +53 -0
  122. package/schemas/corrective-replan-public.schema.json +142 -0
  123. package/schemas/corrective-replan-task-transaction.private.schema.json +151 -0
  124. package/schemas/corrective-yield-task-transaction.private.schema.json +98 -0
  125. package/schemas/remediation-event.schema.json +11 -1
  126. package/schemas/task-handoff-event.schema.json +1 -1
  127. package/schemas/transition-definition.schema.json +2609 -0
  128. package/schemas/transition-payloads.schema.json +140 -0
@@ -0,0 +1,17 @@
1
+ export declare const credentialSchemaIds: readonly ["schema.corrective-replan-binding", "schema.corrective-replan-plan-validation-attestation", "schema.corrective-replan-human-confirmation-input", "schema.corrective-replan-receipt", "schema.corrective-replan-stored-plan-validation-event"];
2
+ export interface CredentialSchemaArtifact {
3
+ readonly id: typeof credentialSchemaIds[number];
4
+ readonly version: 1;
5
+ readonly implementationId: `implementation.${string}`;
6
+ readonly implementationVersion: 1;
7
+ readonly documentBytesSha256: string;
8
+ readonly schemaPointer: string;
9
+ readonly subschemaCanonicalSha256: string;
10
+ readonly document: unknown;
11
+ }
12
+ export interface CredentialSchemaValidator extends Omit<CredentialSchemaArtifact, 'document' | 'documentBytesSha256' | 'schemaPointer'> {
13
+ readonly artifactDocumentBytesSha256: string;
14
+ readonly callable: (payload: unknown) => boolean;
15
+ }
16
+ export declare const correctiveReplanCredentialSchemaArtifacts: readonly CredentialSchemaArtifact[];
17
+ export declare const correctiveReplanCredentialSchemaValidators: readonly CredentialSchemaValidator[];
@@ -0,0 +1,44 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { readFileSync } from 'node:fs';
3
+ import { Ajv2020 } from 'ajv/dist/2020.js';
4
+ import { hashCanonical } from './fingerprint.js';
5
+ import { deepFreeze } from './immutable.js';
6
+ export const credentialSchemaIds = [
7
+ 'schema.corrective-replan-binding', 'schema.corrective-replan-plan-validation-attestation',
8
+ 'schema.corrective-replan-human-confirmation-input', 'schema.corrective-replan-receipt',
9
+ 'schema.corrective-replan-stored-plan-validation-event',
10
+ ];
11
+ const names = ['correctiveReplanBindingV1', 'planValidationAttestationV1', 'humanConfirmationInputV1',
12
+ 'correctiveReplanReceiptV1', 'storedPlanValidationEventV1'];
13
+ const bytes = readFileSync(new URL('../../../schemas/corrective-replan-credentials.private.schema.json', import.meta.url));
14
+ const document = JSON.parse(bytes.toString('utf8'));
15
+ const ajv = new Ajv2020({
16
+ allErrors: true,
17
+ strict: true,
18
+ formats: {
19
+ 'date-time': {
20
+ type: 'string',
21
+ validate(value) {
22
+ const parsed = Date.parse(value);
23
+ return Number.isFinite(parsed) && new Date(parsed).toISOString() === value;
24
+ },
25
+ },
26
+ },
27
+ });
28
+ if (!ajv.validateSchema(document))
29
+ throw new TypeError(`Invalid private credential schema: ${ajv.errorsText(ajv.errors)}`);
30
+ ajv.addSchema(document, document.$id);
31
+ const documentSha256 = createHash('sha256').update(bytes).digest('hex');
32
+ const artifacts = credentialSchemaIds.map((id, index) => ({ id, version: 1,
33
+ implementationId: `implementation.schema-artifact.${names[index]}`, implementationVersion: 1,
34
+ documentBytesSha256: documentSha256, schemaPointer: `#/$defs/${names[index]}`, subschemaCanonicalSha256: hashCanonical(document.$defs[names[index]]), document }));
35
+ const validators = artifacts.map((artifact, index) => {
36
+ const validate = ajv.compile({ $ref: `${document.$id}#/$defs/${names[index]}` });
37
+ return { id: artifact.id, version: 1,
38
+ implementationId: `implementation.schema-validator.ajv-draft-2020-12.${names[index]}`,
39
+ implementationVersion: 1, artifactDocumentBytesSha256: documentSha256,
40
+ subschemaCanonicalSha256: artifact.subschemaCanonicalSha256, callable: (payload) => validate(payload) === true };
41
+ });
42
+ export const correctiveReplanCredentialSchemaArtifacts = deepFreeze(artifacts);
43
+ export const correctiveReplanCredentialSchemaValidators = deepFreeze(validators);
44
+ //# sourceMappingURL=corrective-replan-credential-schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corrective-replan-credential-schema.js","sourceRoot":"","sources":["../../../src/lifecycle/corrective-replan-credential-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,kCAAkC,EAAE,sDAAsD;IAC1F,mDAAmD,EAAE,kCAAkC;IACvF,uDAAuD;CAC/C,CAAC;AACX,MAAM,KAAK,GAAG,CAAC,2BAA2B,EAAE,6BAA6B,EAAE,0BAA0B;IACnG,2BAA2B,EAAE,6BAA6B,CAAU,CAAC;AACvE,MAAM,KAAK,GAAG,YAAY,CAAC,IAAI,GAAG,CAAC,oEAAoE,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3H,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAA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,MAAM,UAAU,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE;IACnD,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,GAAG,WAAW,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;IACjF,OAAO,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,EAAE,CAAU;QAC3C,gBAAgB,EAAE,qDAAqD,KAAK,CAAC,KAAK,CAAC,EAAW;QAC9F,qBAAqB,EAAE,CAAU,EAAE,2BAA2B,EAAE,cAAc;QAC9E,wBAAwB,EAAE,QAAQ,CAAC,wBAAwB,EAAE,QAAQ,EAAE,CAAC,OAAgB,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;AAC9H,CAAC,CAAC,CAAC;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAwC,UAAU,CAAC,SAAS,CAAC,CAAC;AACpH,MAAM,CAAC,MAAM,0CAA0C,GAAyC,UAAU,CAAC,UAAU,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ type ClosureIssue = {
2
+ issueId: string;
3
+ path: string;
4
+ ref?: string;
5
+ message: string;
6
+ };
7
+ export declare function diagnoseCorrectiveReplanCredentialClosure(input?: unknown): {
8
+ closed: boolean;
9
+ issues: ClosureIssue[];
10
+ manifestSha256: string;
11
+ closureSha256: string;
12
+ pendingBlockers: never[];
13
+ };
14
+ export declare const correctiveReplanCredentialInspection: {
15
+ authorityBindingManifest: {
16
+ manifestSha256: string;
17
+ id: "binding-manifest.corrective-replan.exact-v1";
18
+ version: 1;
19
+ rows: {
20
+ ordinal: number;
21
+ bindingId: string;
22
+ projection: {
23
+ id: `projection.${string}`;
24
+ version: 1;
25
+ };
26
+ fieldId: `field.${string}`;
27
+ valueKind: "sha256" | "literal" | "safe-integer" | "entity-id" | "git-oid" | "actor-role";
28
+ canonicalization: "exact" | "lowercase-hex" | "safe-nonnegative-integer" | "nfc-trim" | "lowercase-git-oid" | "registered-enum";
29
+ receiptPath: `/binding/values/${string}`;
30
+ }[];
31
+ };
32
+ executionLinkage: {
33
+ status: "active";
34
+ transitionId: "task.plan.corrective-replan";
35
+ };
36
+ kernelDescriptor: {
37
+ id: string;
38
+ version: 1;
39
+ wiring: "invoked";
40
+ buildSha256: string;
41
+ };
42
+ schemaArtifacts: readonly import("./corrective-replan-credential-schema.js").CredentialSchemaArtifact[];
43
+ schemaValidators: readonly import("./corrective-replan-credential-schema.js").CredentialSchemaValidator[];
44
+ functionBindings: readonly import("./corrective-replan-credential-core.js").CredentialFunctionBinding[];
45
+ diagnoseClosure: typeof diagnoseCorrectiveReplanCredentialClosure;
46
+ };
47
+ export {};
@@ -0,0 +1,103 @@
1
+ import { types as utilTypes } from 'node:util';
2
+ import { correctiveReplanBindingManifest } from './corrective-replan-binding-manifest.js';
3
+ import { correctiveReplanCredentialFunctionBindings } from './corrective-replan-credential-core.js';
4
+ import { correctiveReplanCredentialSchemaArtifacts, correctiveReplanCredentialSchemaValidators } from './corrective-replan-credential-schema.js';
5
+ import { hashCanonical } from './fingerprint.js';
6
+ import { deepFreeze } from './immutable.js';
7
+ const executionLinkage = deepFreeze({ status: 'active', transitionId: 'task.plan.corrective-replan' });
8
+ const kernelDescriptor = deepFreeze({ id: 'credential-kernel.corrective-replan', version: 1, wiring: 'invoked',
9
+ buildSha256: hashCanonical({ family: 'corrective-replan', kernelVersion: 1, manifestSha256: correctiveReplanBindingManifest.manifestSha256,
10
+ functions: correctiveReplanCredentialFunctionBindings.map(({ id, version, implementationId, implementationVersion }) => ({ id, version, implementationId, implementationVersion })) }) });
11
+ export function diagnoseCorrectiveReplanCredentialClosure(input = undefined) {
12
+ try {
13
+ const issues = [];
14
+ const allowed = ['authorityBindingManifest', 'schemaArtifacts', 'schemaValidators', 'functionBindings'];
15
+ let source = top(input);
16
+ if (!source || Object.keys(source).some((key) => !allowed.includes(key))) {
17
+ issues.push(problem('credential.closure.input-invalid', '/', 'closure-input'));
18
+ source = {};
19
+ }
20
+ const artifacts = collection(source.schemaArtifacts, correctiveReplanCredentialSchemaArtifacts);
21
+ if (!artifacts)
22
+ issues.push(problem('credential.closure.collection-invalid', '/schemaArtifacts', 'schemaArtifacts'));
23
+ const validators = collection(source.schemaValidators, correctiveReplanCredentialSchemaValidators);
24
+ if (!validators)
25
+ issues.push(problem('credential.closure.collection-invalid', '/schemaValidators', 'schemaValidators'));
26
+ const functions = collection(source.functionBindings, correctiveReplanCredentialFunctionBindings);
27
+ if (!functions)
28
+ issues.push(problem('credential.closure.collection-invalid', '/functionBindings', 'functionBindings'));
29
+ if ((source.authorityBindingManifest ?? correctiveReplanBindingManifest) !== correctiveReplanBindingManifest)
30
+ issues.push(problem('credential.manifest.substituted', '/authorityBindingManifest', correctiveReplanBindingManifest.id));
31
+ exact(correctiveReplanCredentialSchemaArtifacts, artifacts ?? [], 'schemaArtifacts', 'credential.schema-artifact', false, issues);
32
+ exact(correctiveReplanCredentialSchemaValidators, validators ?? [], 'schemaValidators', 'credential.schema-validator', true, issues);
33
+ exact(correctiveReplanCredentialFunctionBindings, functions ?? [], 'functionBindings', 'credential.function', true, issues);
34
+ return finish(issues);
35
+ }
36
+ catch {
37
+ return finish([problem('credential.closure.input-invalid', '/', 'closure-input')]);
38
+ }
39
+ }
40
+ function finish(issues) {
41
+ const ordered = issues.sort((a, b) => { const left = `${a.path}\0${a.issueId}`; const right = `${b.path}\0${b.issueId}`; return left < right ? -1 : left > right ? 1 : 0; });
42
+ const projection = { manifestSha256: correctiveReplanBindingManifest.manifestSha256, artifacts: correctiveReplanCredentialSchemaArtifacts.map(project), validators: correctiveReplanCredentialSchemaValidators.map(project), functions: correctiveReplanCredentialFunctionBindings.map(project), pendingBlockers: [] };
43
+ return deepFreeze({ closed: ordered.length === 0, issues: ordered, manifestSha256: correctiveReplanBindingManifest.manifestSha256, closureSha256: hashCanonical(projection), pendingBlockers: [] });
44
+ }
45
+ function top(input) {
46
+ if (input === undefined)
47
+ return {};
48
+ if (!plain(input))
49
+ return null;
50
+ const keys = Reflect.ownKeys(input);
51
+ if (keys.some((key) => typeof key !== 'string'))
52
+ return null;
53
+ const descriptors = Object.getOwnPropertyDescriptors(input);
54
+ const result = Object.create(null);
55
+ for (const key of keys) {
56
+ const descriptor = descriptors[key];
57
+ if (!descriptor?.enumerable || !('value' in descriptor))
58
+ return null;
59
+ result[key] = descriptor.value;
60
+ }
61
+ return result;
62
+ }
63
+ function collection(value, installed) {
64
+ if (value === undefined)
65
+ return installed.map(view);
66
+ if (utilTypes.isProxy(value) || !Array.isArray(value) || value.length > 16)
67
+ return null;
68
+ const keys = Reflect.ownKeys(value);
69
+ const descriptors = Object.getOwnPropertyDescriptors(value);
70
+ const names = keys.filter((key) => key !== 'length');
71
+ if (names.some((key, index) => typeof key !== 'string' || key !== String(index)) || names.length !== value.length)
72
+ return null;
73
+ const result = [];
74
+ for (const key of names) {
75
+ const cell = descriptors[key];
76
+ if (!cell?.enumerable || !('value' in cell) || !plain(cell.value))
77
+ return null;
78
+ const row = Object.getOwnPropertyDescriptors(cell.value);
79
+ if (Reflect.ownKeys(cell.value).some((name) => typeof name !== 'string' || !row[name]?.enumerable || !('value' in row[name])) || typeof row.id?.value !== 'string' || !row.id.value.includes('.') || !/^[A-Za-z0-9][A-Za-z0-9._-]{0,255}$/.test(row.id.value) || typeof row.version?.value !== 'number')
80
+ return null;
81
+ result.push({ original: cell.value, index: Number(key), id: row.id.value, version: row.version.value, callable: row.callable?.value });
82
+ }
83
+ return result;
84
+ }
85
+ function exact(installed, candidate, collectionName, prefix, callable, issues) {
86
+ for (const expected of installed) {
87
+ const matches = candidate.filter((entry) => entry.id === expected.id && entry.version === expected.version);
88
+ if (matches.length !== 1)
89
+ issues.push(problem(`${prefix}.${matches.length ? 'duplicate' : 'missing'}`, `/${prefix}/${expected.id}`, expected.id));
90
+ else if (matches[0].original !== expected || (callable && matches[0].callable !== expected.callable))
91
+ issues.push(problem(`${prefix}.${callable ? 'callable-substituted' : 'substituted'}`, `/${prefix}/${expected.id}`, expected.id));
92
+ }
93
+ candidate.filter((entry) => !installed.some((expected) => expected.id === entry.id && expected.version === entry.version)).forEach((entry) => issues.push({ issueId: `${prefix}.extra`, path: `/${collectionName}/${entry.index}`, ref: 'closure-extra-row', message: 'Candidate row is not installed.' }));
94
+ }
95
+ function view(entry, index) { return { original: entry, index, id: entry.id, version: entry.version, callable: entry.callable }; }
96
+ function problem(issueId, path, ref) { return { issueId, path, ref, message: `${ref} is not the installed exact identity.` }; }
97
+ function project(entry) { const { callable: _callable, document: _document, ...value } = entry; return value; }
98
+ function plain(value) { if (value === null || typeof value !== 'object' || Array.isArray(value) || utilTypes.isProxy(value))
99
+ return false; const prototype = Object.getPrototypeOf(value); return prototype === Object.prototype || prototype === null; }
100
+ export const correctiveReplanCredentialInspection = deepFreeze({ authorityBindingManifest: correctiveReplanBindingManifest, executionLinkage, kernelDescriptor,
101
+ schemaArtifacts: correctiveReplanCredentialSchemaArtifacts, schemaValidators: correctiveReplanCredentialSchemaValidators,
102
+ functionBindings: correctiveReplanCredentialFunctionBindings, diagnoseClosure: diagnoseCorrectiveReplanCredentialClosure });
103
+ //# sourceMappingURL=corrective-replan-credentials.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corrective-replan-credentials.js","sourceRoot":"","sources":["../../../src/lifecycle/corrective-replan-credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,0CAA0C,EAAE,MAAM,wCAAwC,CAAC;AACpG,OAAO,EAAE,yCAAyC,EAAE,0CAA0C,EAAE,MAAM,0CAA0C,CAAC;AACjJ,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,E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CAAC,CAAC;AAEnR,MAAM,CAAC,MAAM,oCAAoC,GAAG,UAAU,CAAC,EAAE,wBAAwB,EAAE,+BAA+B,EAAE,gBAAgB,EAAE,gBAAgB;IAC5J,eAAe,EAAE,yCAAyC,EAAE,gBAAgB,EAAE,0CAA0C;IACxH,gBAAgB,EAAE,0CAA0C,EAAE,eAAe,EAAE,yCAAyC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,64 @@
1
+ import type { CorrectiveDecisionEvent, RemediationEvent, StepStatus, TaskPlanInput, TaskState, TaskStatus } from '../contracts.js';
2
+ import type { BlockedTransitionNavigation, ExecutableTransitionDefinition, HumanGateTransitionNavigation, TransitionEvaluation } from './types.js';
3
+ export declare const TASK_CORRECTIVE_REPLAN_TRANSITION_ID: "task.plan.corrective-replan";
4
+ export interface CorrectiveReplanPosture {
5
+ readonly posture: string;
6
+ readonly stepId: string;
7
+ readonly attemptCount: number;
8
+ readonly correctiveDecision: CorrectiveDecisionEvent | null;
9
+ }
10
+ export declare function identifyCorrectiveReplanPosture(task: Readonly<TaskState>, guardedStepIds: readonly string[], decisions: readonly CorrectiveDecisionEvent[], remediations: readonly RemediationEvent[]): CorrectiveReplanPosture | null;
11
+ export interface PreparedCorrectiveReplanCandidate {
12
+ readonly planBytes: string;
13
+ readonly planHash: string;
14
+ readonly stepIds: readonly string[];
15
+ }
16
+ export interface CorrectiveReplanSnapshot {
17
+ readonly taskId: string;
18
+ readonly taskRevision: number;
19
+ readonly taskStatus: TaskStatus;
20
+ readonly currentPlanHash: string | null;
21
+ readonly stepId: string;
22
+ readonly stepStatus: StepStatus | null;
23
+ readonly inProgressStepIds: readonly string[];
24
+ readonly remediationAttemptCount: number;
25
+ readonly correctivePosture: string;
26
+ readonly correctiveDecision: CorrectiveDecisionEvent | null;
27
+ readonly candidatePlanHash: string | null;
28
+ readonly candidateStepIds: readonly string[] | null;
29
+ readonly actorRoleEligible: boolean;
30
+ readonly c1ClaimAbsent: boolean;
31
+ readonly writerLeaseAbsent: boolean;
32
+ readonly planValidationPassed: boolean;
33
+ readonly receiptValid: boolean;
34
+ readonly riskAuditPassed: boolean;
35
+ }
36
+ export interface CorrectiveReplanAdmissionFacts {
37
+ readonly actorRoleEligible: boolean;
38
+ readonly c1ClaimAbsent: boolean;
39
+ readonly writerLeaseAbsent: boolean;
40
+ readonly planValidationPassed: boolean;
41
+ readonly receiptValid: boolean;
42
+ readonly riskAuditPassed: boolean;
43
+ }
44
+ export interface CorrectiveReplanAvailabilityBindings {
45
+ readonly taskId: string;
46
+ readonly expectedRevision: number;
47
+ readonly currentPlanHash: string;
48
+ readonly stepId: string;
49
+ readonly correctiveDecisionEventId: string;
50
+ }
51
+ export interface CorrectiveReplanExecutionBindings extends CorrectiveReplanAvailabilityBindings {
52
+ readonly candidatePlanHash: string;
53
+ readonly candidateStepIds: readonly string[];
54
+ }
55
+ export type CorrectiveReplanBindings = CorrectiveReplanAvailabilityBindings | CorrectiveReplanExecutionBindings;
56
+ export declare const taskCorrectiveReplanDefinition: ExecutableTransitionDefinition<CorrectiveReplanSnapshot, CorrectiveReplanBindings>;
57
+ export declare function prepareCorrectiveReplanCandidate(task: Readonly<TaskState>, plan: Readonly<TaskPlanInput>): PreparedCorrectiveReplanCandidate;
58
+ export declare function hashCorrectivePlanBytes(planBytes: string): string;
59
+ export declare function evaluateTaskCorrectiveReplanAvailability(task: Readonly<TaskState>, posture: Readonly<CorrectiveReplanPosture>): TransitionEvaluation<CorrectiveReplanAvailabilityBindings>;
60
+ export declare function evaluateTaskCorrectiveReplanCandidate(task: Readonly<TaskState>, posture: Readonly<CorrectiveReplanPosture>, candidate: Readonly<PreparedCorrectiveReplanCandidate>): TransitionEvaluation<CorrectiveReplanExecutionBindings>;
61
+ export declare function evaluateTaskCorrectiveReplanAdmission(task: Readonly<TaskState>, posture: Readonly<CorrectiveReplanPosture>, candidate: Readonly<PreparedCorrectiveReplanCandidate>, facts: Readonly<CorrectiveReplanAdmissionFacts>): TransitionEvaluation<CorrectiveReplanExecutionBindings>;
62
+ export declare const evaluateTaskCorrectiveReplan: typeof evaluateTaskCorrectiveReplanAvailability;
63
+ export declare function correctiveReplanNavigation(evaluation: TransitionEvaluation<CorrectiveReplanAvailabilityBindings>): HumanGateTransitionNavigation<CorrectiveReplanAvailabilityBindings>;
64
+ export declare function correctiveReplanBlockedNavigation(evaluation: TransitionEvaluation<CorrectiveReplanAvailabilityBindings>): BlockedTransitionNavigation;