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,139 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { correctiveReplanBindingManifest } from './corrective-replan-binding-manifest.js';
3
+ import { hashCanonical } from './fingerprint.js';
4
+ import { deepFreeze } from './immutable.js';
5
+ const eligibleRole = (input) => roleVerdict(input);
6
+ const authorValidator = (input) => identityVerdict(input);
7
+ const authorRiskAuditor = (input) => identityVerdict(input);
8
+ const authorHumanPrincipal = (input) => identityVerdict(input);
9
+ export const installedAuthoritySemanticBindings = deepFreeze([
10
+ binding('authority-role-evaluator.corrective-replan.eligible-role', 'authority-role-evaluator.corrective-replan.eligible-role', 'role-evaluator', eligibleRole),
11
+ binding('identity-comparator.corrective-replan.author-validator', 'identity-comparator.corrective-replan.author-validator', 'identity-comparator', authorValidator),
12
+ binding('identity-comparator.corrective-replan.author-risk-auditor', 'identity-comparator.corrective-replan.author-risk-auditor', 'identity-comparator', authorRiskAuditor),
13
+ binding('identity-comparator.corrective-replan.author-human-principal', 'identity-comparator.corrective-replan.author-human-principal', 'identity-comparator', authorHumanPrincipal),
14
+ ]);
15
+ const ref = (id) => ({ id, version: 1 });
16
+ const constraints = [
17
+ constraint('constraint.corrective-replan.author-not-validator', 'author-validator', 'actor.validator'),
18
+ constraint('constraint.corrective-replan.author-not-risk-auditor', 'author-risk-auditor', 'actor.risk-auditor'),
19
+ constraint('constraint.corrective-replan.author-not-human-principal', 'author-human-principal', 'principal.human'),
20
+ ];
21
+ /** Diagnostic-only assessment of the installed static tuple. It cannot issue a Core handle. */
22
+ export function assessCorrectiveReplanAuthorityTuple(tuple) {
23
+ const value = record(tuple);
24
+ const issues = [];
25
+ extraFields(value, ['transitionId', 'actor', 'eligibleRoles', 'roleEvaluator', 'humanPrincipal', 'capability', 'delegation', 'ownership', 'constraints', 'priorPlanAuthorization'], '/', 'authority.tuple.extra-field', issues);
26
+ extraFields(record(value.actor), ['identity', 'basis'], '/actor/', 'authority.tuple.extra-field', issues);
27
+ extraFields(record(value.humanPrincipal), ['identity', 'basis', 'kind'], '/humanPrincipal/', 'authority.tuple.extra-field', issues);
28
+ extraFields(record(value.capability), ['id', 'version', 'source', 'issuer', 'transitionId', 'scope', 'bindingManifest'], '/capability/', 'authority.tuple.extra-field', issues);
29
+ extraFields(record(value.priorPlanAuthorization), ['disposition', 'authority'], '/priorPlanAuthorization/', 'authority.tuple.extra-field', issues);
30
+ check(value, '/transitionId', 'authority.transition.mismatch', 'task.plan.corrective-replan', issues);
31
+ check(value, '/actor/identity', 'authority.actor.identity-mismatch', ref('identity.actor'), issues);
32
+ check(value, '/actor/basis', 'authority.actor.basis-mismatch', ref('principal-basis.human-confirmation'), issues);
33
+ check(value, '/eligibleRoles', 'authority.role-evaluator.mismatch', ['delivery-coordinator', 'technical-planner'], issues);
34
+ check(value, '/roleEvaluator', 'authority.role-evaluator.mismatch', ref('authority-role-evaluator.corrective-replan.eligible-role'), issues);
35
+ check(value, '/humanPrincipal/identity', 'authority.principal.identity-mismatch', ref('identity.human-principal'), issues);
36
+ check(value, '/humanPrincipal/basis', 'authority.principal.basis-mismatch', ref('principal-basis.human-confirmation'), issues);
37
+ check(value, '/humanPrincipal/kind', 'authority.principal.kind-mismatch', 'human', issues);
38
+ const capability = get(value, '/capability');
39
+ if (!isRecord(capability))
40
+ issue(issues, 'authority.capability.missing', '/capability');
41
+ else {
42
+ check(value, '/capability/id', 'authority.capability.id-mismatch', 'capability.task.corrective-replan', issues);
43
+ check(value, '/capability/version', 'authority.capability.version-mismatch', 1, issues);
44
+ check(value, '/capability/source', 'authority.capability.source-mismatch', ref('authority-source.human-confirmation'), issues);
45
+ check(value, '/capability/issuer', 'authority.capability.issuer-mismatch', ref('identity.human-principal'), issues);
46
+ check(value, '/capability/transitionId', 'authority.capability.transition-mismatch', 'task.plan.corrective-replan', issues);
47
+ check(value, '/capability/scope', 'authority.capability.scope-mismatch', { entity: 'task', task: 'taskId', guardedStep: 'guardedStepId' }, issues);
48
+ if (capability.bindingManifest !== correctiveReplanBindingManifest)
49
+ issue(issues, 'authority.capability.binding-manifest-mismatch', '/capability/bindingManifest');
50
+ }
51
+ check(value, '/delegation', 'authority.delegation.not-forbidden', ref('delegation.forbidden'), issues);
52
+ check(value, '/ownership', 'authority.ownership.not-clear', { c1Claim: 'none', writerLease: 'none' }, issues);
53
+ const rows = Array.isArray(value.constraints) ? value.constraints : [];
54
+ const seen = new Set();
55
+ rows.forEach((entry, index) => {
56
+ const id = isRecord(entry) && typeof entry.constraintId === 'string' ? entry.constraintId : '';
57
+ if (seen.has(id))
58
+ issue(issues, 'authority.constraint.duplicate', `/constraints/${index}/constraintId`);
59
+ else if (id === 'constraint.corrective-replan.validator-not-risk-auditor')
60
+ issue(issues, 'authority.constraint.forbidden-validator-risk', `/constraints/${index}`);
61
+ else if (!constraints.some((expected) => expected.constraintId === id))
62
+ issue(issues, 'authority.constraint.unknown', `/constraints/${index}/constraintId`);
63
+ seen.add(id);
64
+ if (isRecord(entry))
65
+ extraFields(entry, ['constraintId', 'comparator', 'operands', 'relation', 'missing', 'enforcement'], `/constraints/${index}/`, 'authority.constraint.extra-field', issues);
66
+ });
67
+ constraints.forEach((expected, index) => {
68
+ const actualIndex = rows.findIndex((entry) => isRecord(entry) && entry.constraintId === expected.constraintId);
69
+ if (actualIndex < 0)
70
+ return issue(issues, 'authority.constraint.missing', `/constraints/${index}`);
71
+ for (const field of ['comparator', 'operands', 'relation', 'missing', 'enforcement']) {
72
+ check(value, `/constraints/${actualIndex}/${field}`, `authority.constraint.${field === 'comparator' ? 'comparator-id' : field}-mismatch`, expected[field], issues, field === 'comparator' ? `/constraints/${index}/${field}/id` : `/constraints/${index}/${field}`);
73
+ if (field === 'comparator')
74
+ check(value, `/constraints/${actualIndex}/comparator/version`, 'authority.constraint.comparator-version-mismatch', 1, issues, `/constraints/${index}/comparator/version`);
75
+ }
76
+ });
77
+ check(value, '/priorPlanAuthorization/disposition', 'authority.plan-bound-grant-active', 'superseded', issues);
78
+ check(value, '/priorPlanAuthorization/authority', 'authority.plan-bound-grant-active', 'none', issues);
79
+ const ordered = [...issues].sort((a, b) => `${a.path}\0${a.issueId}`.localeCompare(`${b.path}\0${b.issueId}`));
80
+ const blockers = [];
81
+ if (ordered.some((entry) => entry.issueId === 'authority.capability.missing'))
82
+ blockers.push('static.authority.exact-capability-missing');
83
+ if (ordered.some((entry) => entry.issueId === 'authority.plan-bound-grant-active'))
84
+ blockers.push('static.authority.plan-bound-grant-not-superseded');
85
+ if (ordered.length > 0)
86
+ blockers.push('static.authority.exact-tuple-invalid');
87
+ const content = { staticTupleValid: ordered.length === 0, blockers: [...new Set(blockers)], issues: ordered,
88
+ bindings: installedAuthoritySemanticBindings };
89
+ return deepFreeze({ ...content, reportHash: hashCanonical({ ...content, bindings: content.bindings.map(projectBinding) }) });
90
+ }
91
+ function binding(id, suffix, kind, callable) {
92
+ return { id, version: 1, kind, implementationId: `implementation.${suffix}`, implementationVersion: 1, wiring: 'invoked', callable };
93
+ }
94
+ export function projectAuthoritySemanticBundle(bindings) {
95
+ const projection = { bundleVersion: 2, bindingManifest: correctiveReplanBindingManifest, bindings: bindings.map(projectBinding) };
96
+ return deepFreeze({ ...projection, bundleSha256: createHash('sha256').update(JSON.stringify(projection)).digest('hex') });
97
+ }
98
+ function constraint(constraintId, suffix, right) {
99
+ return { constraintId,
100
+ comparator: ref(`identity-comparator.corrective-replan.${suffix}`), operands: ['actor.author', right],
101
+ relation: 'not-equal', missing: 'block', enforcement: 'static-and-runtime' };
102
+ }
103
+ function roleVerdict(input) {
104
+ const value = record(input);
105
+ const roles = ['delivery-coordinator', 'technical-planner'];
106
+ if (!/^[a-f0-9]{64}$/.test(String(value.actorIdentityHash ?? '')) || !sameSet(value.eligibleRoles, roles)
107
+ || typeof value.actorRole !== 'string' || value.actorRole.length === 0)
108
+ return verdict(false, 'ROLE_INPUT_INVALID');
109
+ return roles.includes(value.actorRole) ? verdict(true, null) : verdict(false, 'ROLE_NOT_ELIGIBLE');
110
+ }
111
+ function identityVerdict(input) {
112
+ const value = record(input);
113
+ const valid = /^[a-f0-9]{64}$/;
114
+ if (typeof value.leftIdentityHash !== 'string' || typeof value.rightIdentityHash !== 'string'
115
+ || !valid.test(value.leftIdentityHash) || !valid.test(value.rightIdentityHash))
116
+ return verdict(false, 'IDENTITY_INPUT_INVALID');
117
+ return value.leftIdentityHash !== value.rightIdentityHash ? verdict(true, null) : verdict(false, 'IDENTITY_CONSTRAINT_VIOLATED');
118
+ }
119
+ function verdict(passed, reasonCode) { return deepFreeze({ passed, blocked: !passed, reasonCode }); }
120
+ function projectBinding({ callable: _callable, wiring: _wiring, ...binding }) { return binding; }
121
+ function record(value) { return isRecord(value) ? value : {}; }
122
+ function isRecord(value) { return value !== null && typeof value === 'object' && !Array.isArray(value); }
123
+ function get(value, path) {
124
+ return path.split('/').filter(Boolean).reduce((cursor, key) => Array.isArray(cursor) && /^\d+$/.test(key) ? cursor[Number(key)] : isRecord(cursor) ? cursor[key] : undefined, value);
125
+ }
126
+ function check(value, path, issueId, expected, issues, reportedPath = path) {
127
+ const actual = get(value, path);
128
+ if (actual === undefined || hashCanonical(actual) !== hashCanonical(expected))
129
+ issue(issues, issueId, reportedPath);
130
+ }
131
+ function sameSet(value, expected) {
132
+ return Array.isArray(value) && value.length === expected.length
133
+ && new Set(value).size === expected.length && value.every((entry) => typeof entry === 'string' && expected.includes(entry));
134
+ }
135
+ function extraFields(value, allowed, prefix, issueId, issues) {
136
+ Object.keys(value).filter((key) => !allowed.includes(key)).forEach((key) => issue(issues, issueId, `${prefix}${key}`));
137
+ }
138
+ function issue(issues, issueId, path) { issues.push({ issueId, path, message: `${issueId} at ${path}.` }); }
139
+ //# sourceMappingURL=corrective-replan-authority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corrective-replan-authority.js","sourceRoot":"","sources":["../../../src/lifecycle/corrective-replan-authority.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAiB5C,MAAM,YAAY,GAAsB,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACtE,MAAM,eAAe,GAAsB,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;AAC7E,MAAM,iBAAiB,GAAsB,CAAC,KAAK,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC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AAO,KAAK,KAAK,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AAAC,CAAC;AAChI,SAAS,WAAW,CAAC,KAAiB,EAAE,OAA0B,EAAE,MAAc,EAAE,OAAe,EAAE,MAAwB;IAC3H,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACzH,CAAC;AACD,SAAS,KAAK,CAAC,MAAwB,EAAE,OAAe,EAAE,IAAY,IAAU,MAAM,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,OAAO,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ type ValueKind = 'literal' | 'sha256' | 'safe-integer' | 'entity-id' | 'git-oid' | 'actor-role';
2
+ type Canonicalization = 'exact' | 'lowercase-hex' | 'safe-nonnegative-integer' | 'nfc-trim' | 'lowercase-git-oid' | 'registered-enum';
3
+ export declare const correctiveReplanBindingManifest: {
4
+ manifestSha256: string;
5
+ id: "binding-manifest.corrective-replan.exact-v1";
6
+ version: 1;
7
+ rows: {
8
+ ordinal: number;
9
+ bindingId: string;
10
+ projection: {
11
+ id: `projection.${string}`;
12
+ version: 1;
13
+ };
14
+ fieldId: `field.${string}`;
15
+ valueKind: ValueKind;
16
+ canonicalization: Canonicalization;
17
+ receiptPath: `/binding/values/${string}`;
18
+ }[];
19
+ };
20
+ export declare const correctiveReplanBindingIds: string[];
21
+ export {};
@@ -0,0 +1,35 @@
1
+ import { hashCanonical } from './canonical-hash.js';
2
+ import { deepFreeze } from './immutable.js';
3
+ const ref = (id) => ({ id, version: 1 });
4
+ const row = (bindingId, projection, fieldId, valueKind, canonicalization) => ({
5
+ ordinal: rowsOrdinal++, bindingId, projection: ref(projection), fieldId, valueKind, canonicalization,
6
+ receiptPath: `/binding/values/${bindingId}`,
7
+ });
8
+ let rowsOrdinal = 0;
9
+ const protocol = (id, field, kind, canonical) => row(id, 'projection.corrective-replan.protocol', field, kind, canonical);
10
+ const state = (id, field, kind, canonical) => row(id, 'projection.corrective-replan.state', field, kind, canonical);
11
+ const candidate = (id, field) => row(id, 'projection.corrective-replan.candidate', field, 'sha256', 'lowercase-hex');
12
+ const authority = (id, field, kind, canonical) => row(id, 'projection.corrective-replan.authority', field, kind, canonical);
13
+ const rows = [
14
+ protocol('transitionId', 'field.transition-id', 'literal', 'exact'), protocol('runtimeFingerprint', 'field.runtime-fingerprint', 'sha256', 'lowercase-hex'),
15
+ protocol('catalogHash', 'field.catalog-hash', 'sha256', 'lowercase-hex'), protocol('lifecycleEpoch', 'field.lifecycle-epoch', 'safe-integer', 'safe-nonnegative-integer'),
16
+ state('taskId', 'field.task-id', 'entity-id', 'nfc-trim'), state('revision', 'field.task-revision', 'safe-integer', 'safe-nonnegative-integer'),
17
+ state('currentPlanHash', 'field.current-plan-hash', 'sha256', 'lowercase-hex'), state('briefHash', 'field.brief-hash', 'sha256', 'lowercase-hex'),
18
+ state('knowledgeRevision', 'field.knowledge-revision', 'safe-integer', 'safe-nonnegative-integer'), state('knowledgeHash', 'field.knowledge-hash', 'sha256', 'lowercase-hex'),
19
+ state('gitHead', 'field.git-head', 'git-oid', 'lowercase-git-oid'), state('guardedStepId', 'field.guarded-step-id', 'entity-id', 'nfc-trim'),
20
+ state('correctiveDecisionEventId', 'field.corrective-decision-event-id', 'entity-id', 'nfc-trim'), state('correctiveDecisionHash', 'field.corrective-decision-hash', 'sha256', 'lowercase-hex'),
21
+ state('attemptCount', 'field.attempt-count', 'safe-integer', 'safe-nonnegative-integer'), state('remediationTailHash', 'field.remediation-tail-hash', 'sha256', 'lowercase-hex'),
22
+ candidate('candidatePlanHash', 'field.candidate-plan-hash'), candidate('candidateStepSetHash', 'field.candidate-step-set-hash'),
23
+ candidate('planAuthorIdentityHash', 'field.plan-author-identity-hash'), candidate('planValidationHash', 'field.plan-validation-hash'),
24
+ candidate('planValidatorIdentityHash', 'field.plan-validator-identity-hash'), candidate('riskAuditHash', 'field.risk-audit-hash'), candidate('riskAuditorIdentityHash', 'field.risk-auditor-identity-hash'),
25
+ authority('actorIdentityHash', 'field.actor-identity-hash', 'sha256', 'lowercase-hex'), authority('actorRole', 'field.actor-role', 'actor-role', 'registered-enum'),
26
+ authority('humanPrincipalIdentityHash', 'field.human-principal-identity-hash', 'sha256', 'lowercase-hex'), authority('capabilityId', 'field.capability-id', 'literal', 'exact'),
27
+ authority('capabilityVersion', 'field.capability-version', 'safe-integer', 'safe-nonnegative-integer'),
28
+ ];
29
+ const identity = { id: 'binding-manifest.corrective-replan.exact-v1', version: 1, rows };
30
+ export const correctiveReplanBindingManifest = deepFreeze({
31
+ ...identity,
32
+ manifestSha256: hashCanonical({ ...identity, rows: [...rows].sort((a, b) => a.bindingId.localeCompare(b.bindingId)) }),
33
+ });
34
+ export const correctiveReplanBindingIds = deepFreeze(rows.map(({ bindingId }) => bindingId));
35
+ //# sourceMappingURL=corrective-replan-binding-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"corrective-replan-binding-manifest.js","sourceRoot":"","sources":["../../../src/lifecycle/corrective-replan-binding-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAG5C,MAAM,GAAG,GAAG,CAAqB,EAAO,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,CAAU,EAAE,CAAC,CAAC;AAG3E,MAAM,GAAG,GAAG,CAAC,SAAiB,EAAE,UAAwB,EAAE,OAA0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AmB,EAAE,2BAA2B,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,SAAS,CAAC,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,iBAAiB,CAAC;IACnK,SAAS,CAAC,4BAA4B,EAAE,qCAAqC,EAAE,QAAQ,EAAE,eAAe,CAAC,EAAE,SAAS,CAAC,cAAc,EAAE,qBAAqB,EAAE,SAAS,EAAE,OAAO,CAAC;IAC/K,SAAS,CAAC,mBAAmB,EAAE,0BAA0B,EAAE,cAAc,EAAE,0BAA0B,CAAC;CACvG,CAAC;AAEF,MAAM,QAAQ,GAAG,EAAE,EAAE,EAAE,6CAAsD,EAAE,OAAO,EAAE,CAAU,EAAE,IAAI,EAAE,CAAC;AAC3G,MAAM,CAAC,MAAM,+BAA+B,GAAG,UAAU,CAAC;IACxD,GAAG,QAAQ;IACX,cAAc,EAAE,aAAa,CAAC,EAAE,GAAG,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;CACvH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC"}
@@ -0,0 +1,86 @@
1
+ type JsonRecord = Record<string, unknown>;
2
+ type Reason = 'schema' | 'binding' | 'authority' | 'sod' | 'time' | 'integrity' | 'provenance';
3
+ type Issue = Readonly<{
4
+ issueId: string;
5
+ path: string;
6
+ reasonClass: Reason;
7
+ }>;
8
+ type Result<T> = Readonly<{
9
+ ok: true;
10
+ value: Readonly<T>;
11
+ issues: readonly [];
12
+ }> | Readonly<{
13
+ ok: false;
14
+ value: null;
15
+ issues: readonly Issue[];
16
+ reportHash: string;
17
+ }>;
18
+ type Verification<T> = Readonly<{
19
+ valid: true;
20
+ projection: Readonly<T>;
21
+ issues: readonly [];
22
+ reportHash: string;
23
+ }> | Readonly<{
24
+ valid: false;
25
+ projection: null;
26
+ issues: readonly Issue[];
27
+ reportHash: string;
28
+ }>;
29
+ declare const planBrand: unique symbol;
30
+ declare const challengeBrand: unique symbol;
31
+ declare const confirmationBrand: unique symbol;
32
+ declare const receiptBrand: unique symbol;
33
+ declare const eventBrand: unique symbol;
34
+ export type PlanValidationHandle = Readonly<{
35
+ [planBrand]: never;
36
+ }>;
37
+ export type HumanChallengeHandle = Readonly<{
38
+ [challengeBrand]: never;
39
+ }>;
40
+ export type VerifiedConfirmationHandle = Readonly<{
41
+ [confirmationBrand]: never;
42
+ }>;
43
+ export type ReceiptHandle = Readonly<{
44
+ [receiptBrand]: never;
45
+ }>;
46
+ export type StoredPlanValidationEventHandle = Readonly<{
47
+ [eventBrand]: never;
48
+ }>;
49
+ export interface CorrectiveReplanCredentialCorePorts {
50
+ readonly snapshotSource: {
51
+ readCorrectiveReplanSnapshot(taskId: string): unknown;
52
+ };
53
+ readonly coreClock: {
54
+ nowMs(): number;
55
+ };
56
+ readonly idSource: {
57
+ nextId(kind: 'plan-validation-attestation' | 'human-challenge' | 'receipt' | 'plan-validation-event'): string;
58
+ };
59
+ readonly challengeCodeSource: {
60
+ issueConfirmationCode(): string;
61
+ };
62
+ readonly validationEventTailSource: {
63
+ readPlanValidationTail(taskId: string): unknown;
64
+ };
65
+ }
66
+ export interface CorrectiveReplanCredentialKernel {
67
+ issuePlanValidation(input: unknown): Result<JsonRecord>;
68
+ issueHumanChallenge(input: unknown): Result<JsonRecord>;
69
+ confirmHuman(input: unknown): Result<JsonRecord>;
70
+ issueReceipt(input: unknown): Result<JsonRecord>;
71
+ verifyReceipt(input: unknown): Verification<JsonRecord>;
72
+ materializeStoredEvent(input: unknown): Result<JsonRecord>;
73
+ verifyStoredEvent(input: unknown): Verification<JsonRecord>;
74
+ }
75
+ export interface CredentialFunctionBinding {
76
+ readonly id: string;
77
+ readonly version: 1;
78
+ readonly kind: 'materializer' | 'verifier';
79
+ readonly implementationId: `implementation.${string}`;
80
+ readonly implementationVersion: 1;
81
+ readonly wiring: 'invoked';
82
+ readonly callable: (issuer: unknown, input: unknown) => unknown;
83
+ }
84
+ export declare function createCorrectiveReplanCredentialKernel(ports: CorrectiveReplanCredentialCorePorts): CorrectiveReplanCredentialKernel;
85
+ export declare const correctiveReplanCredentialFunctionBindings: readonly CredentialFunctionBinding[];
86
+ export {};