codex-workflow-v2 2.0.0-beta.1 → 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 +47 -3
- 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 +12 -0
- package/dist/src/alpha6/milestone.js +113 -1
- 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 +383 -43
- 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/reviewer.d.ts +4 -0
- package/dist/src/reviewer.js +24 -7
- package/dist/src/reviewer.js.map +1 -1
- 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 +51 -21
- package/dist/src/workflow.js +667 -144
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +8 -1
- package/docs/beta2-initial-assembly-navigation-brief.md +616 -0
- package/docs/development-flow.md +17 -2
- package/docs/lifecycle/state-machine-stabilization.md +641 -0
- package/docs/release.md +11 -2
- package/docs/split-required-recovery.md +5 -4
- package/docs/stable-release-defect-register.md +330 -1
- package/docs/updating-existing-project.md +11 -0
- package/package.json +4 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +56 -1
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +44 -0
- package/references/state-machine.md +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
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import { WorkflowService } from './workflow.js';
|
|
2
|
+
import { CoreTaskOperationLockManager } from './state/lock.js';
|
|
3
|
+
import { correctiveReplanTerminalReadback, driveCorrectiveReplanTransaction } from './state/corrective-replan-executor.js';
|
|
4
|
+
import { CorrectiveReplanTaskTransactionStore } from './state/corrective-replan-transaction.js';
|
|
5
|
+
import { GuardedTransitionCatalog, validateTransitionDefinitionSemantics } from './lifecycle/catalog.js';
|
|
6
|
+
import { installedAuthoritySemanticBindings, projectAuthoritySemanticBundle } from './lifecycle/corrective-replan-authority.js';
|
|
7
|
+
import { correctiveReplanCredentialFunctionBindings } from './lifecycle/corrective-replan-credential-core.js';
|
|
8
|
+
import { correctiveReplanCredentialSchemaArtifacts, correctiveReplanCredentialSchemaValidators } from './lifecycle/corrective-replan-credential-schema.js';
|
|
9
|
+
import { diagnoseCorrectiveReplanCredentialClosure } from './lifecycle/corrective-replan-credentials.js';
|
|
10
|
+
import { hashCorrectivePlanBytes, taskCorrectiveReplanDefinition } from './lifecycle/corrective-replan.js';
|
|
11
|
+
import { evaluateTransition } from './lifecycle/evaluator.js';
|
|
12
|
+
import { evaluateInstalledReleaseRulesForCore, installedCoreRuleBindings, projectReleaseRuleContextForCore, } from './lifecycle/core-static-readiness.js';
|
|
13
|
+
import { hashCanonical, runtimeCatalogHash, runtimeSemanticFingerprint, runtimeSemanticProjection as runtimeProjection, transitionDefinitionManifestHash } from './lifecycle/fingerprint.js';
|
|
14
|
+
import { deepFreeze } from './lifecycle/immutable.js';
|
|
15
|
+
import { createCorrectiveReplanImplementationTable } from './lifecycle/implementation-table.js';
|
|
16
|
+
import { installedPayloadSchemaArtifacts, installedPayloadSchemaValidators, installedTransitionDefinitionArtifact, installedTransitionDefinitionValidator, transitionDefinitionDocumentSha256, transitionDefinitionVocabularySha256, } from './lifecycle/schema-artifact.js';
|
|
17
|
+
import { transitionSemanticRegistry } from './lifecycle/semantic-registry.js';
|
|
18
|
+
import { LIFECYCLE_EPOCH, TRANSITION_DEFINITION_FORMAT_VERSION, } from './lifecycle/types.js';
|
|
19
|
+
const guards = taskCorrectiveReplanDefinition.guards.map((guard) => guard.evaluate);
|
|
20
|
+
const credentialReceiptVerifier = correctiveReplanCredentialFunctionBindings.find((entry) => entry.id === 'credential-verifier.corrective-replan.receipt');
|
|
21
|
+
if (!credentialReceiptVerifier)
|
|
22
|
+
throw new TypeError('Installed corrective-replan receipt verifier is missing.');
|
|
23
|
+
const credentialClosure = diagnoseCorrectiveReplanCredentialClosure();
|
|
24
|
+
if (!credentialClosure.closed)
|
|
25
|
+
throw new TypeError('Installed corrective-replan credential bundle is not closed.');
|
|
26
|
+
const executableTable = createCorrectiveReplanImplementationTable({
|
|
27
|
+
guards,
|
|
28
|
+
identityComparators: installedAuthoritySemanticBindings.filter((entry) => entry.kind === 'identity-comparator').map((entry) => entry.callable),
|
|
29
|
+
verifyReceipt: credentialReceiptVerifier.callable,
|
|
30
|
+
acquireTaskLock: CoreTaskOperationLockManager.prototype.acquire,
|
|
31
|
+
createJournalIntent: CorrectiveReplanTaskTransactionStore.prototype.createIntent,
|
|
32
|
+
recoverCorrectiveReplan: driveCorrectiveReplanTransaction,
|
|
33
|
+
executeCorrectiveReplan: WorkflowService.prototype.executeCorrectiveReplan,
|
|
34
|
+
terminalReadback: correctiveReplanTerminalReadback,
|
|
35
|
+
canonicalJsonSha256: hashCanonical, rawPlanSha256: hashCorrectivePlanBytes,
|
|
36
|
+
});
|
|
37
|
+
const installedExecutables = deepFreeze(Object.values(executableTable).flat());
|
|
38
|
+
const installedFamilySemantics = runtimeProjection(taskCorrectiveReplanDefinition.metadata).semantics;
|
|
39
|
+
const installedTransitionExecutableBinding = deepFreeze({
|
|
40
|
+
transitionId: taskCorrectiveReplanDefinition.metadata.transitionId, version: 1,
|
|
41
|
+
runtimeSemanticFingerprint: taskCorrectiveReplanDefinition.runtimeSemanticFingerprint,
|
|
42
|
+
implementationId: 'implementation.transition.task-corrective-replan', implementationVersion: 2,
|
|
43
|
+
guardCallables: taskCorrectiveReplanDefinition.guards.map((guard, index) => {
|
|
44
|
+
const binding = executable(taskCorrectiveReplanDefinition.metadata.guards[index].evaluator);
|
|
45
|
+
return { guardId: guard.metadata.guardId, semanticVersion: guard.metadata.semanticVersion,
|
|
46
|
+
implementationId: binding.semanticId, implementationVersion: binding.semanticVersion, callable: guard.evaluate };
|
|
47
|
+
}),
|
|
48
|
+
executableSlots: declaredExecutableSlots(), evaluate: evaluateTransition,
|
|
49
|
+
});
|
|
50
|
+
export const installedTransitionExecutableBindings = deepFreeze([installedTransitionExecutableBinding]);
|
|
51
|
+
const issuedCatalogs = new WeakMap();
|
|
52
|
+
export const guardedTransitionCatalog = deepFreeze(new GuardedTransitionCatalog([taskCorrectiveReplanDefinition]));
|
|
53
|
+
export function compileCoreTransitionCatalog(raw) {
|
|
54
|
+
if (!Array.isArray(raw))
|
|
55
|
+
return failed([{ diagnosticId: 'compiler.catalog.input-invalid', path: '/', message: 'Core catalog input must be an array.' }]);
|
|
56
|
+
const diagnostics = diagnoseClosure(raw, installedCoreRuleBindings, installedTransitionExecutableBindings, installedPayloadSchemaArtifacts, installedPayloadSchemaValidators);
|
|
57
|
+
if (diagnostics.length > 0)
|
|
58
|
+
return failed(diagnostics);
|
|
59
|
+
const ir = [];
|
|
60
|
+
const seen = new Set();
|
|
61
|
+
for (const candidate of raw) {
|
|
62
|
+
const definition = structuredClone(candidate);
|
|
63
|
+
if (seen.has(definition.transitionId)) {
|
|
64
|
+
diagnostics.push({ diagnosticId: 'compiler.catalog.transition-duplicate', path: '/transitionId', ref: definition.transitionId, message: 'Transition ID is duplicated.' });
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
67
|
+
seen.add(definition.transitionId);
|
|
68
|
+
const payloadSchemas = bindPayloadSchemas(definition, installedPayloadSchemaArtifacts, installedPayloadSchemaValidators, diagnostics);
|
|
69
|
+
const rules = installedCoreRuleBindings.map((binding) => ({ ...binding, context: projectReleaseRuleContextForCore(definition, binding.id) }));
|
|
70
|
+
const payloadSchemaClosureSha256 = hashCanonical(payloadSchemas.map(projectPayloadBinding));
|
|
71
|
+
const definitionSchema = { schema: { id: installedTransitionDefinitionArtifact.id, version: 1 },
|
|
72
|
+
artifact: installedTransitionDefinitionArtifact, validator: installedTransitionDefinitionValidator };
|
|
73
|
+
ir.push(deepFreeze({ transitionId: definition.transitionId, serializedDefinition: definition,
|
|
74
|
+
transitionExecutableBinding: installedTransitionExecutableBinding, authoritySemanticBindings: installedAuthoritySemanticBindings,
|
|
75
|
+
credentialSemanticBindings: correctiveReplanCredentialFunctionBindings,
|
|
76
|
+
credentialClosureSha256: credentialClosure.closureSha256,
|
|
77
|
+
definitionSchema, rules, payloadSchemas, payloadSchemaClosureSha256 }));
|
|
78
|
+
}
|
|
79
|
+
if (diagnostics.length > 0)
|
|
80
|
+
return failed(diagnostics);
|
|
81
|
+
ir.sort((left, right) => left.transitionId.localeCompare(right.transitionId));
|
|
82
|
+
const frozenIr = deepFreeze(ir);
|
|
83
|
+
const readiness = readinessFromIr(frozenIr);
|
|
84
|
+
const serialized = frozenIr.map((entry) => entry.serializedDefinition);
|
|
85
|
+
const order = frozenIr.map((entry) => semanticOrder(entry.serializedDefinition));
|
|
86
|
+
const canonicalIr = frozenIr.map(projectPrivateIr);
|
|
87
|
+
const provenance = {
|
|
88
|
+
compilerId: 'codex-workflow-exact-family-compiler', compilerVersion: '4.0.0',
|
|
89
|
+
compilerBuildSha256: hashCanonical({ implementation: 'corrective-replan-exact-family', version: 2 }),
|
|
90
|
+
definitionFormatVersion: TRANSITION_DEFINITION_FORMAT_VERSION, lifecycleEpoch: LIFECYCLE_EPOCH,
|
|
91
|
+
rawCatalogSha256: hashCanonical(serialized), runtimeCatalogHash: runtimeCatalogHash(serialized),
|
|
92
|
+
staticCatalogHash: hashCanonical(readiness),
|
|
93
|
+
semanticRegistryClosureSha256: hashCanonical(canonicalIr.map((entry) => entry.registryClosure)),
|
|
94
|
+
executableRegistryClosureSha256: hashCanonical(canonicalIr.map((entry) => entry.transitionExecutableBinding)),
|
|
95
|
+
transitionSchemaArtifactSha256: transitionDefinitionDocumentSha256,
|
|
96
|
+
transitionSchemaVocabularySha256: transitionDefinitionVocabularySha256,
|
|
97
|
+
transitionSchemaValidatorSha256: hashCanonical(projectPayloadValidator(installedTransitionDefinitionValidator)),
|
|
98
|
+
payloadSchemaClosureSha256: frozenIr[0]?.payloadSchemaClosureSha256 ?? hashCanonical([]),
|
|
99
|
+
officialProfileSha256: hashCanonical({}),
|
|
100
|
+
ruleSetSha256: hashCanonical(installedCoreRuleBindings.map(projectRule)),
|
|
101
|
+
canonicalOrderSha256: hashCanonical(order), irSha256: hashCanonical({ transitions: canonicalIr, order, readiness }),
|
|
102
|
+
};
|
|
103
|
+
const catalog = deepFreeze({ kind: 'core-compiled-transition-catalog', provenance,
|
|
104
|
+
transitions: frozenIr.map((entry) => ({ transitionId: entry.transitionId,
|
|
105
|
+
runtimeSemanticFingerprint: entry.serializedDefinition.runtimeSemanticFingerprint,
|
|
106
|
+
definitionManifestHash: entry.serializedDefinition.definitionManifestHash })) });
|
|
107
|
+
issuedCatalogs.set(catalog, deepFreeze({ ir: frozenIr, readiness }));
|
|
108
|
+
return { ok: true, catalog, diagnostics: [], diagnosticsHash: hashCanonical([]) };
|
|
109
|
+
}
|
|
110
|
+
export function evaluateCoreStaticReadiness(catalog) {
|
|
111
|
+
return requireRecord(catalog).readiness;
|
|
112
|
+
}
|
|
113
|
+
export function inspectCorePrivateIr(catalog) {
|
|
114
|
+
return requireRecord(catalog).ir;
|
|
115
|
+
}
|
|
116
|
+
export function diagnoseCoreIssuanceClosure(input) {
|
|
117
|
+
const diagnostics = diagnoseClosure(input.definitions, input.ruleBindings ?? installedCoreRuleBindings, input.transitionExecutableBindings ?? installedTransitionExecutableBindings, input.schemaArtifacts ?? installedPayloadSchemaArtifacts, input.schemaValidators ?? installedPayloadSchemaValidators, input.authoritySemanticBindings ?? installedAuthoritySemanticBindings);
|
|
118
|
+
const ordered = orderDiagnostics(diagnostics);
|
|
119
|
+
return deepFreeze({ issuable: ordered.length === 0, diagnostics: ordered, diagnosticsHash: hashCanonical(ordered) });
|
|
120
|
+
}
|
|
121
|
+
function diagnoseClosure(definitions, rules, transitionBindings, artifacts, validators, authorityBindings = installedAuthoritySemanticBindings) {
|
|
122
|
+
const diagnostics = [];
|
|
123
|
+
exactRules(rules, diagnostics);
|
|
124
|
+
exactTransitionBindings(transitionBindings, diagnostics);
|
|
125
|
+
exactAuthorityBindings(authorityBindings, diagnostics);
|
|
126
|
+
for (const raw of definitions) {
|
|
127
|
+
if (!installedTransitionDefinitionArtifact || !installedTransitionDefinitionValidator.callable(raw)) {
|
|
128
|
+
diagnostics.push({ diagnosticId: 'compiler.schema.document-invalid', path: '/', message: 'Definition fails the installed root schema.' });
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
const semantic = validateTransitionDefinitionSemantics(raw);
|
|
132
|
+
semantic.issues.forEach((entry) => diagnostics.push(entry.ref === undefined
|
|
133
|
+
? { diagnosticId: `compiler.semantic.${entry.ruleId.slice('validation.'.length)}`, path: entry.path, message: entry.message }
|
|
134
|
+
: { diagnosticId: `compiler.semantic.${entry.ruleId.slice('validation.'.length)}`, path: entry.path, ref: entry.ref, message: entry.message }));
|
|
135
|
+
const definition = raw;
|
|
136
|
+
if (definition.transitionId !== 'task.plan.corrective-replan')
|
|
137
|
+
diagnostics.push({ diagnosticId: 'compiler.family.unsupported', path: '/transitionId', ref: definition.transitionId, message: 'No installed exact family compiler.' });
|
|
138
|
+
try {
|
|
139
|
+
const metadata = stripHashes(definition);
|
|
140
|
+
const mismatch = firstDifferencePath(installedFamilySemantics, runtimeProjection(metadata).semantics);
|
|
141
|
+
if (mismatch)
|
|
142
|
+
diagnostics.push({ diagnosticId: 'core.transition-binding.semantic-mismatch', path: mismatch, ref: definition.transitionId, message: `Definition semantics differ from the installed exact family at ${mismatch}.` });
|
|
143
|
+
if (runtimeSemanticFingerprint(metadata) !== definition.runtimeSemanticFingerprint)
|
|
144
|
+
diagnostics.push({ diagnosticId: 'compiler.fingerprint.runtime-mismatch', path: '/runtimeSemanticFingerprint', message: 'Runtime fingerprint is stale.' });
|
|
145
|
+
if (transitionDefinitionManifestHash(metadata, definition.runtimeSemanticFingerprint) !== definition.definitionManifestHash)
|
|
146
|
+
diagnostics.push({ diagnosticId: 'compiler.fingerprint.manifest-mismatch', path: '/definitionManifestHash', message: 'Manifest hash is stale.' });
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
const ref = error.ref;
|
|
150
|
+
diagnostics.push(ref === undefined
|
|
151
|
+
? { diagnosticId: 'compiler.registry.reference-unresolved', path: '/', message: error instanceof Error ? error.message : String(error) }
|
|
152
|
+
: { diagnosticId: 'compiler.registry.reference-unresolved', path: '/', ref, message: error instanceof Error ? error.message : String(error) });
|
|
153
|
+
}
|
|
154
|
+
bindPayloadSchemas(definition, artifacts, validators, diagnostics);
|
|
155
|
+
}
|
|
156
|
+
return diagnostics;
|
|
157
|
+
}
|
|
158
|
+
function exactRules(candidate, diagnostics) {
|
|
159
|
+
for (const installed of installedCoreRuleBindings) {
|
|
160
|
+
const matches = candidate.filter((entry) => sameRef(entry, installed));
|
|
161
|
+
if (matches.length !== 1)
|
|
162
|
+
diagnostics.push({ diagnosticId: matches.length === 0 ? 'core.rule-binding.missing' : 'core.rule-binding.duplicate', path: `/ruleBindings/${installed.id}`, ref: refKey(installed), message: `${installed.id} must be bound exactly once.` });
|
|
163
|
+
else if (matches[0] !== installed || matches[0].callable !== installed.callable
|
|
164
|
+
|| matches[0].implementationId !== installed.implementationId || matches[0].implementationVersion !== installed.implementationVersion) {
|
|
165
|
+
diagnostics.push({ diagnosticId: 'core.rule-binding.callable-substituted', path: `/ruleBindings/${installed.id}`, ref: refKey(installed), message: `${installed.id} callable differs from installed Core identity.` });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function exactAuthorityBindings(candidate, diagnostics) {
|
|
170
|
+
const issue = (id, installed) => diagnostics.push({ diagnosticId: `core.authority-binding.${id}`,
|
|
171
|
+
path: `/authoritySemanticBindings/${installed.id}`, ref: installed.id, message: `${installed.id} authority callable differs from Core.` });
|
|
172
|
+
for (const installed of installedAuthoritySemanticBindings) {
|
|
173
|
+
const matches = candidate.filter((entry) => sameRef(entry, installed));
|
|
174
|
+
if (matches.length !== 1)
|
|
175
|
+
issue(matches.length === 0 ? 'missing' : 'duplicate', installed);
|
|
176
|
+
else if (typeof matches[0].callable !== 'function')
|
|
177
|
+
issue('callable-missing', installed);
|
|
178
|
+
else if (matches[0] !== installed || matches[0].callable !== installed.callable)
|
|
179
|
+
issue('callable-substituted', installed);
|
|
180
|
+
}
|
|
181
|
+
candidate.filter((entry) => !installedAuthoritySemanticBindings.some((installed) => sameRef(entry, installed)))
|
|
182
|
+
.forEach((entry) => issue('extra', entry));
|
|
183
|
+
}
|
|
184
|
+
function exactTransitionBindings(candidate, diagnostics) {
|
|
185
|
+
const expected = installedTransitionExecutableBinding;
|
|
186
|
+
const matches = candidate.filter((entry) => entry.transitionId === expected.transitionId);
|
|
187
|
+
const issue = (id, path, ref) => diagnostics.push({ diagnosticId: `core.transition-binding.${id}`, path, ref, message: `Exact transition binding mismatch: ${ref}.` });
|
|
188
|
+
if (matches.length !== 1)
|
|
189
|
+
issue(matches.length === 0 ? 'missing' : 'duplicate', `/transitionExecutableBindings/${expected.transitionId}`, expected.transitionId);
|
|
190
|
+
candidate.filter((entry) => entry.transitionId !== expected.transitionId).forEach((entry) => issue('extra', '/transitionExecutableBindings', entry.transitionId));
|
|
191
|
+
if (matches.length !== 1 || matches[0] === expected)
|
|
192
|
+
return;
|
|
193
|
+
const actual = matches[0];
|
|
194
|
+
expected.guardCallables.filter((guard) => !actual.guardCallables.some((entry) => entry.guardId === guard.guardId)).forEach((guard) => issue('guard-missing', '/transitionExecutableBindings/guards', guard.guardId));
|
|
195
|
+
actual.guardCallables.filter((guard) => !expected.guardCallables.some((entry) => entry.guardId === guard.guardId) || actual.guardCallables.filter((entry) => entry.guardId === guard.guardId).length > 1).forEach((guard) => issue('guard-extra', '/transitionExecutableBindings/guards', guard.guardId));
|
|
196
|
+
if (actual.guardCallables.map((entry) => entry.guardId).join('\0') !== expected.guardCallables.map((entry) => entry.guardId).join('\0'))
|
|
197
|
+
issue('guard-order-mismatch', '/transitionExecutableBindings/guards', expected.transitionId);
|
|
198
|
+
expected.guardCallables.forEach((guard, index) => { const entry = actual.guardCallables[index]; if (entry?.guardId === guard.guardId && (entry.callable !== guard.callable || entry.semanticVersion !== guard.semanticVersion || entry.implementationId !== guard.implementationId || entry.implementationVersion !== guard.implementationVersion))
|
|
199
|
+
issue('guard-callable-substituted', `/transitionExecutableBindings/guards/${index}`, guard.guardId); });
|
|
200
|
+
if (actual.version !== expected.version)
|
|
201
|
+
issue('semantic-mismatch', '/transitionExecutableBindings/version', expected.transitionId);
|
|
202
|
+
if (actual.runtimeSemanticFingerprint !== expected.runtimeSemanticFingerprint || actual.evaluate !== expected.evaluate || actual.implementationId !== expected.implementationId || actual.implementationVersion !== expected.implementationVersion || actual.executableSlots !== expected.executableSlots)
|
|
203
|
+
issue('semantic-mismatch', '/transitionExecutableBindings', expected.transitionId);
|
|
204
|
+
}
|
|
205
|
+
function bindPayloadSchemas(definition, artifacts, validators, diagnostics) {
|
|
206
|
+
let schemaRefs = [];
|
|
207
|
+
try {
|
|
208
|
+
const closure = runtimeSemanticProjectionForCore(stripHashes(definition));
|
|
209
|
+
schemaRefs = closure.filter((entry) => entry.category === 'schemas').map((entry) => entry.entry);
|
|
210
|
+
}
|
|
211
|
+
catch {
|
|
212
|
+
return [];
|
|
213
|
+
}
|
|
214
|
+
return schemaRefs.map((schema) => {
|
|
215
|
+
const installedArtifact = onlyInstalled(installedPayloadSchemaArtifacts, schema);
|
|
216
|
+
const installedValidator = onlyInstalled(installedPayloadSchemaValidators, schema);
|
|
217
|
+
const artifactMatches = artifacts.filter((entry) => sameRef(entry, schema));
|
|
218
|
+
const validatorMatches = validators.filter((entry) => sameRef(entry, schema));
|
|
219
|
+
if (artifactMatches.length !== 1)
|
|
220
|
+
diagnostics.push({ diagnosticId: artifactMatches.length === 0 ? 'core.payload-artifact.missing' : 'core.payload-artifact.duplicate', path: `/schemaArtifacts/${schema.id}`, ref: refKey(schema), message: `${schema.id} artifact must occur exactly once.` });
|
|
221
|
+
else if (artifactMatches[0] !== installedArtifact)
|
|
222
|
+
diagnostics.push({ diagnosticId: 'core.payload-artifact.subschema-substituted', path: `/schemaArtifacts/${schema.id}`, ref: refKey(schema), message: `${schema.id} artifact identity or subschema differs from Core.` });
|
|
223
|
+
if (validatorMatches.length !== 1)
|
|
224
|
+
diagnostics.push({ diagnosticId: validatorMatches.length === 0 ? 'core.payload-validator.missing' : 'core.payload-validator.duplicate', path: `/schemaValidators/${schema.id}`, ref: refKey(schema), message: `${schema.id} validator must occur exactly once.` });
|
|
225
|
+
else if (validatorMatches[0] !== installedValidator || validatorMatches[0].callable !== installedValidator.callable)
|
|
226
|
+
diagnostics.push({ diagnosticId: 'core.payload-validator.callable-substituted', path: `/schemaValidators/${schema.id}`, ref: refKey(schema), message: `${schema.id} validator differs from Core.` });
|
|
227
|
+
return { schema, artifact: installedArtifact, validator: installedValidator };
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function runtimeSemanticProjectionForCore(metadata) {
|
|
231
|
+
return runtimeProjection(metadata).resolvedRegistryEntries;
|
|
232
|
+
}
|
|
233
|
+
function readinessFromIr(ir) {
|
|
234
|
+
const transitions = ir.map((entry) => ({ transitionId: entry.transitionId,
|
|
235
|
+
blockers: [...evaluateInstalledReleaseRulesForCore(entry.rules)] }));
|
|
236
|
+
const content = { staticReady: ir.length > 0 && transitions.every((entry) => entry.blockers.length === 0),
|
|
237
|
+
catalogBlockers: ir.length === 0 ? ['static.catalog.empty'] : [], transitions };
|
|
238
|
+
return deepFreeze({ ...content, reportHash: hashCanonical(content) });
|
|
239
|
+
}
|
|
240
|
+
function semanticOrder(definition) {
|
|
241
|
+
return { transitionId: definition.transitionId, guards: definition.guards.map((entry) => entry.guardId),
|
|
242
|
+
effects: definition.effects.orderedNodes.map((entry) => ({ id: entry.effectId, ordinal: entry.ordinal, dependsOn: entry.dependsOn })),
|
|
243
|
+
revalidations: definition.admissionBoundary.orderedRevalidations.map((entry) => ({ id: entry.revalidationId, ordinal: entry.ordinal })) };
|
|
244
|
+
}
|
|
245
|
+
function projectPrivateIr(ir) {
|
|
246
|
+
const runtime = runtimeProjection(stripHashes(ir.serializedDefinition));
|
|
247
|
+
return { transitionId: ir.transitionId, semantics: runtime.semantics, registryClosure: runtime.resolvedRegistryEntries,
|
|
248
|
+
transitionExecutableBinding: projectTransitionBinding(ir.transitionExecutableBinding), authoritySemanticBundle: projectAuthoritySemanticBundle(ir.authoritySemanticBindings),
|
|
249
|
+
credentialSemanticBundle: {
|
|
250
|
+
manifestSha256: credentialClosure.manifestSha256,
|
|
251
|
+
closureSha256: ir.credentialClosureSha256,
|
|
252
|
+
artifacts: correctiveReplanCredentialSchemaArtifacts.map(({ document: _document, ...entry }) => entry),
|
|
253
|
+
validators: correctiveReplanCredentialSchemaValidators.map(({ callable: _callable, ...entry }) => entry),
|
|
254
|
+
functions: ir.credentialSemanticBindings.map(({ callable: _callable, ...entry }) => entry),
|
|
255
|
+
},
|
|
256
|
+
definitionSchema: projectPayloadBinding(ir.definitionSchema), rules: ir.rules.map(projectRule),
|
|
257
|
+
payloadSchemas: ir.payloadSchemas.map(projectPayloadBinding), blockers: evaluateInstalledReleaseRulesForCore(ir.rules) };
|
|
258
|
+
}
|
|
259
|
+
function projectTransitionBinding(entry) { return { transitionId: entry.transitionId, version: entry.version, runtimeSemanticFingerprint: entry.runtimeSemanticFingerprint, implementationId: entry.implementationId, implementationVersion: entry.implementationVersion, guards: entry.guardCallables.map(({ callable: _callable, ...guard }) => guard), executableSlots: entry.executableSlots.map((slot) => ({ path: slot.path, binding: projectExecutable(slot.binding) })) }; }
|
|
260
|
+
function projectExecutable(entry) { return { id: entry.id, version: entry.version, semanticId: entry.semanticId, semanticVersion: entry.semanticVersion, wiring: entry.wiring ?? null, implementationResult: entry.implementationResult ?? null, projectionWiring: entry.projectionWiring ?? null }; }
|
|
261
|
+
function projectRule(entry) { return { id: entry.id, version: entry.version, implementationId: entry.implementationId, implementationVersion: entry.implementationVersion }; }
|
|
262
|
+
function projectPayloadBinding(entry) { return { schema: entry.schema, artifact: projectPayloadArtifact(entry.artifact), validator: projectPayloadValidator(entry.validator) }; }
|
|
263
|
+
function projectPayloadArtifact(entry) { return { id: entry.id, version: entry.version, implementationId: entry.implementationId, implementationVersion: entry.implementationVersion, documentSha256: entry.documentSha256, schemaPointer: entry.schemaPointer, subschemaSha256: entry.subschemaSha256 }; }
|
|
264
|
+
function projectPayloadValidator(entry) { return { id: entry.id, version: entry.version, implementationId: entry.implementationId, implementationVersion: entry.implementationVersion, artifactSha256: entry.artifactSha256, subschemaSha256: entry.subschemaSha256 }; }
|
|
265
|
+
function stripHashes(definition) { const { runtimeSemanticFingerprint: _r, semanticFingerprint: _s, definitionManifestHash: _m, ...metadata } = definition; return metadata; }
|
|
266
|
+
function onlyInstalled(entries, ref) { const matches = entries.filter((entry) => sameRef(entry, ref)); return matches.length === 1 ? matches[0] : undefined; }
|
|
267
|
+
function sameRef(left, right) { return left.id === right.id && left.version === right.version; }
|
|
268
|
+
function refKey(ref) { return `${ref.id}@${ref.version}`; }
|
|
269
|
+
function executable(ref) { const matches = installedExecutables.filter((entry) => sameRef(entry, ref)); if (matches.length !== 1)
|
|
270
|
+
throw new TypeError(`Installed executable ${refKey(ref)} is not exact-one.`); return matches[0]; }
|
|
271
|
+
function declaredExecutableSlots() {
|
|
272
|
+
const metadata = taskCorrectiveReplanDefinition.metadata;
|
|
273
|
+
const refs = [
|
|
274
|
+
...metadata.guards.map((guard, index) => [`/guards/${index}/evaluator`, guard.evaluator]),
|
|
275
|
+
...metadata.effects.orderedNodes.map((effect, index) => [`/effects/orderedNodes/${index}/adapter`, effect.adapter]),
|
|
276
|
+
...metadata.admissionBoundary.orderedRevalidations.map((entry, index) => [`/admissionBoundary/orderedRevalidations/${index}/evaluator`, entry.evaluator]),
|
|
277
|
+
...metadata.authority.separationOfDuty.map((constraint, index) => [`/authority/separationOfDuty/${index}/comparator`, constraint.comparator]),
|
|
278
|
+
...metadata.authority.forbiddenCombinations.map((constraint, index) => [`/authority/forbiddenCombinations/${index}/comparator`, constraint.comparator]),
|
|
279
|
+
['/authority/credentialVerifier', { id: 'credential-verifier.corrective-replan.receipt', version: 1 }],
|
|
280
|
+
['/admissionBoundary/lock/policy', metadata.admissionBoundary.lock.policy],
|
|
281
|
+
['/atomicity/journal/adapter', metadata.atomicity.journal.mode === 'required' ? metadata.atomicity.journal.adapter : { id: 'journal-adapter.unreachable', version: 1 }],
|
|
282
|
+
['/atomicity/recovery/adapter', metadata.atomicity.recovery.mode !== 'manual-integrity-stop' ? metadata.atomicity.recovery.adapter : { id: 'recovery-adapter.unreachable', version: 1 }],
|
|
283
|
+
['/executorAdapter', metadata.executorAdapter], ['/atomicity/executionKey/hashPolicy', metadata.atomicity.executionKey.hashPolicy],
|
|
284
|
+
['/atomicity/readback/adapter', metadata.atomicity.readback.adapter], ['/atomicity/readback/resultDigestPolicy', metadata.atomicity.readback.resultDigestPolicy],
|
|
285
|
+
];
|
|
286
|
+
metadata.inputContract.forEach((contract, index) => { const input = transitionSemanticRegistry.inputs.find((entry) => sameRef(entry, contract.input)); if (input?.hashPolicy)
|
|
287
|
+
refs.push([`/inputContract/${index}/hashPolicy`, input.hashPolicy]); });
|
|
288
|
+
return refs.map(([path, ref]) => ({ path, binding: executable(ref) }));
|
|
289
|
+
}
|
|
290
|
+
function firstDifferencePath(left, right, path = '') {
|
|
291
|
+
if (Object.is(left, right))
|
|
292
|
+
return null;
|
|
293
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
294
|
+
for (let index = 0; index < Math.max(left.length, right.length); index += 1) {
|
|
295
|
+
const mismatch = firstDifferencePath(left[index], right[index], `${path}/${index}`);
|
|
296
|
+
if (mismatch)
|
|
297
|
+
return mismatch;
|
|
298
|
+
}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
if (left !== null && right !== null && typeof left === 'object' && typeof right === 'object') {
|
|
302
|
+
for (const key of [...new Set([...Object.keys(left), ...Object.keys(right)])].filter((entry) => entry !== 'description').sort()) {
|
|
303
|
+
const mismatch = firstDifferencePath(left[key], right[key], `${path}/${key}`);
|
|
304
|
+
if (mismatch)
|
|
305
|
+
return mismatch;
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
return path || '/';
|
|
310
|
+
}
|
|
311
|
+
function requireRecord(catalog) { const record = catalog !== null && typeof catalog === 'object' ? issuedCatalogs.get(catalog) : undefined; if (!record) {
|
|
312
|
+
const error = new TypeError('Invalid compiled provenance: catalog was not issued by Workflow Core.');
|
|
313
|
+
Object.assign(error, { code: 'INVALID_COMPILED_PROVENANCE' });
|
|
314
|
+
throw error;
|
|
315
|
+
} return record; }
|
|
316
|
+
function failed(diagnostics) { const ordered = orderDiagnostics(diagnostics); return { ok: false, diagnostics: ordered, diagnosticsHash: hashCanonical(ordered) }; }
|
|
317
|
+
function orderDiagnostics(diagnostics) { return [...diagnostics].sort((left, right) => `${left.path}\0${left.diagnosticId}\0${left.ref ?? ''}`.localeCompare(`${right.path}\0${right.diagnosticId}\0${right.ref ?? ''}`)); }
|
|
318
|
+
//# sourceMappingURL=transition-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transition-core.js","sourceRoot":"","sources":["../../src/transition-core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,gCAAgC,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAC3H,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,wBAAwB,EAAE,qCAAqC,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,kCAAkC,EAAE,8BAA8B,EAAiC,MAAM,4CAA4C,CAAC;AAC/J,OAAO,EAAE,0CAA0C,EAAkC,MAAM,kDAAkD,CAAC;AAC9I,OAAO,EAAE,yCAAyC,EAAE,0CAA0C,EAAE,MAAM,oDAAoD,CAAC;AAC3J,OAAO,EAAE,yCAAyC,EAAE,MAAM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EAAE,CAAC;IAAC,MAAM,KAAK,GAAG,IAAI,SAAS,CAAC,uEAAuE,CAAC,CAAC;IAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,6BAA6B,EAAE,CAAC,CAAC;IAAC,MAAM,KAAK,CAAC;AAAC,CAAC,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC;AACtY,SAAS,MAAM,CAAC,WAA0C,IAA8B,MAAM,OAAO,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;AAC7N,SAAS,gBAAgB,CAAC,WAA0C,IAAI,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,YAAY,KAAK,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,KAAK,CAAC,IAAI,KAAK,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const PACKAGE_NAME = "codex-workflow-v2";
|
|
2
|
-
export declare const PACKAGE_VERSION = "2.0.0-beta.
|
|
2
|
+
export declare const PACKAGE_VERSION = "2.0.0-beta.4";
|
package/dist/src/version.js
CHANGED
package/dist/src/workflow.d.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { type AdoptionPostureEvent, type ContextEnvelope, type CorrectivePlanAuditInput, type DelegationGrant, type DelegationGrantGate, type DelegationPolicyInput, type DiscoveryState, type MilestonePlanInput, type MilestoneState, type KnowledgeSelection, type GraphBinding, type GraphKind, type GraphMode, type GraphRefreshEvidence, type GraphRefreshRequest, type PlanRiskAuditEvent, type ProjectKnowledgeMap, type ReviewInput, type TaskPlanInput, type TaskContextRefreshResult, type TaskState, type UpdatePreflightResult, type
|
|
1
|
+
import { type AdoptionPostureEvent, type ContextEnvelope, type CorrectivePlanAuditInput, type DelegationGrant, type DelegationGrantGate, type DelegationPolicyInput, type DiscoveryState, type MilestonePlanInput, type MilestoneState, type KnowledgeSelection, type GraphBinding, type GraphKind, type GraphMode, type GraphRefreshEvidence, type GraphRefreshRequest, type PlanRiskAuditEvent, type PublicWriterLease, type PublicWriterLeaseDiagnostic, type PublicWriterLeaseRepairResult, type ProjectKnowledgeMap, type ReviewInput, type TaskPlanInput, type TaskContextRefreshResult, type TaskState, type UpdatePreflightResult, type WriterCredentialResult, type WriterCredentialStatus, type WorkflowObservation, type WorkflowRole, type WorkspaceOwner } from './contracts.js';
|
|
2
2
|
import { appendTaskClaim, appendTaskHandback, readTaskC1Posture } from './alpha6/handoff.js';
|
|
3
3
|
import { type AdoptionPreparation } from './alpha6/adoption.js';
|
|
4
4
|
import { type RecordPlanRiskAuditInput } from './alpha6/plan-risk.js';
|
|
5
5
|
import { type ActiveMilestoneAutonomy, type MilestoneAutonomyPreparation } from './alpha7/autonomy.js';
|
|
6
|
-
import { type RepositoryIdentity } from './repository.js';
|
|
7
6
|
import { type ReviewerCommandRunner } from './reviewer.js';
|
|
8
|
-
import { WriterLockManager } from './state/lock.js';
|
|
9
7
|
import { FileStateStore } from './state/store.js';
|
|
8
|
+
import { type CorrectiveYieldExecutionResult } from './state/corrective-yield-executor.js';
|
|
9
|
+
import { type CorrectiveReplanHumanGate, type CorrectiveReplanHumanGateResult, type CorrectiveReplanPublicCandidate, type CorrectiveReplanPublicCredential } from './state/corrective-replan-public.js';
|
|
10
|
+
import type { CorrectiveReplanExecutionResult } from './state/corrective-replan-executor.js';
|
|
10
11
|
export interface DiscoveryInput {
|
|
11
12
|
goal: string;
|
|
12
13
|
outcome?: string;
|
|
@@ -24,10 +25,15 @@ export interface DiscoveryPatch extends Omit<DiscoveryInput, 'goal'> {
|
|
|
24
25
|
goal?: string;
|
|
25
26
|
resolveUnknowns?: string[];
|
|
26
27
|
}
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
export interface WorkflowStatusResult {
|
|
29
|
+
projectId: string;
|
|
30
|
+
discoveries: DiscoveryState[];
|
|
31
|
+
tasks: TaskState[];
|
|
32
|
+
milestones: MilestoneState[];
|
|
33
|
+
milestoneInitialAssembly: MilestoneInitialAssemblyNavigation[];
|
|
34
|
+
delegations: DelegationGrant[];
|
|
35
|
+
adoption: AdoptionPreparation | null;
|
|
36
|
+
observation: WorkflowObservation;
|
|
31
37
|
}
|
|
32
38
|
export interface MilestoneScopeChangePreparation {
|
|
33
39
|
milestoneId: string;
|
|
@@ -55,8 +61,8 @@ export interface Alpha6StrictReviewRescuePreflight {
|
|
|
55
61
|
projectId: string;
|
|
56
62
|
repositoryRoot: string;
|
|
57
63
|
clean: boolean;
|
|
58
|
-
activeLeases:
|
|
59
|
-
staleLeases:
|
|
64
|
+
activeLeases: PublicWriterLease[];
|
|
65
|
+
staleLeases: PublicWriterLease[];
|
|
60
66
|
candidate: {
|
|
61
67
|
taskId: string;
|
|
62
68
|
taskRevision: number;
|
|
@@ -74,11 +80,33 @@ export interface Alpha6StrictReviewRescuePreflight {
|
|
|
74
80
|
expectedRevision?: number;
|
|
75
81
|
}>;
|
|
76
82
|
}
|
|
83
|
+
interface MilestoneInitialAssemblyOption {
|
|
84
|
+
action: 'linked-task-assembly' | 'milestone plan-set';
|
|
85
|
+
commands: string[];
|
|
86
|
+
description: string;
|
|
87
|
+
}
|
|
88
|
+
interface MilestoneInitialAssemblyNavigation {
|
|
89
|
+
milestoneId: string;
|
|
90
|
+
revision: number;
|
|
91
|
+
linkedTaskIds: string[];
|
|
92
|
+
executionAvailable: false;
|
|
93
|
+
options: MilestoneInitialAssemblyOption[];
|
|
94
|
+
}
|
|
77
95
|
export declare class WorkflowService {
|
|
96
|
+
#private;
|
|
78
97
|
readonly store: FileStateStore;
|
|
79
98
|
private readonly now;
|
|
80
99
|
constructor(store?: FileStateStore, now?: () => Date);
|
|
81
|
-
|
|
100
|
+
inspectWriterLease(repository: string, entityId: string): PublicWriterLeaseDiagnostic | null;
|
|
101
|
+
repairStaleWriterLease(repository: string, entityId: string): PublicWriterLeaseRepairResult;
|
|
102
|
+
prepareCorrectiveReplan(repository: string, taskId: string, candidate: CorrectiveReplanPublicCandidate): CorrectiveReplanHumanGateResult;
|
|
103
|
+
confirmCorrectiveReplan(repository: string, taskId: string, candidate: CorrectiveReplanPublicCandidate, gate: CorrectiveReplanHumanGate, confirmationCode: string): CorrectiveReplanPublicCredential;
|
|
104
|
+
executeCorrectiveReplan(repository: string, taskId: string, candidate: CorrectiveReplanPublicCandidate, credential: CorrectiveReplanPublicCredential): CorrectiveReplanExecutionResult;
|
|
105
|
+
recoverCorrectiveReplan(repository: string, taskId: string, transactionId: string): CorrectiveReplanExecutionResult;
|
|
106
|
+
executeCorrectiveYield(repository: string, taskId: string, expectedTaskRevision: number, actor: string, writerToken: string, reason: string): CorrectiveYieldExecutionResult;
|
|
107
|
+
recoverCorrectiveYield(repository: string, taskId: string, transactionId: string): CorrectiveYieldExecutionResult;
|
|
108
|
+
private correctiveReplanController;
|
|
109
|
+
private observationSnapshot;
|
|
82
110
|
prepareDelegation(repository: string, input: DelegationPolicyInput): DelegationGrantGate;
|
|
83
111
|
grantDelegation(repository: string, input: DelegationPolicyInput, confirmationCode: string): DelegationGrant;
|
|
84
112
|
revokeDelegation(repository: string, grantId: string, expectedRevision: number, actor: string, reason: string): DelegationGrant;
|
|
@@ -128,7 +156,8 @@ export declare class WorkflowService {
|
|
|
128
156
|
claimTask(repository: string, taskId: string, expectedRevision: number, actor: string, claimToken: string, writerToken?: string | null): {
|
|
129
157
|
task: TaskState;
|
|
130
158
|
event: ReturnType<typeof appendTaskClaim>;
|
|
131
|
-
lease:
|
|
159
|
+
lease: PublicWriterLease;
|
|
160
|
+
writerCredential: WriterCredentialResult;
|
|
132
161
|
};
|
|
133
162
|
handbackTask(repository: string, taskId: string, expectedRevision: number, actor: string, reason: string, writerToken?: string | null, limitations?: readonly string[], recommendedNext?: string): {
|
|
134
163
|
task: TaskState;
|
|
@@ -137,7 +166,8 @@ export declare class WorkflowService {
|
|
|
137
166
|
startTask(repository: string, taskId: string, expectedRevision: number, workspaceOwner: WorkspaceOwner): TaskState;
|
|
138
167
|
runStep(repository: string, taskId: string, stepId: string, expectedRevision: number, actor: string, writerToken: string | null): {
|
|
139
168
|
task: TaskState;
|
|
140
|
-
lease:
|
|
169
|
+
lease: PublicWriterLease;
|
|
170
|
+
writerCredential: WriterCredentialStatus;
|
|
141
171
|
envelope: ContextEnvelope;
|
|
142
172
|
};
|
|
143
173
|
taskContext(repository: string, taskId: string, role: Exclude<WorkflowRole, 'scope-lead' | 'worker'>): ContextEnvelope;
|
|
@@ -153,14 +183,7 @@ export declare class WorkflowService {
|
|
|
153
183
|
syncTaskBase(repository: string, taskId: string, expectedRevision: number): TaskState;
|
|
154
184
|
mergeTask(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
155
185
|
confirmExternalMerge(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
156
|
-
status(repository: string):
|
|
157
|
-
projectId: string;
|
|
158
|
-
discoveries: DiscoveryState[];
|
|
159
|
-
tasks: TaskState[];
|
|
160
|
-
milestones: MilestoneState[];
|
|
161
|
-
delegations: DelegationGrant[];
|
|
162
|
-
adoption: AdoptionPreparation;
|
|
163
|
-
};
|
|
186
|
+
status(repository: string): WorkflowStatusResult;
|
|
164
187
|
recoverMilestoneTransactions(repository: string): {
|
|
165
188
|
projectId: string;
|
|
166
189
|
recoveredMilestoneIds: string[];
|
|
@@ -168,7 +191,7 @@ export declare class WorkflowService {
|
|
|
168
191
|
prepareAdoption(repository: string): AdoptionPreparation;
|
|
169
192
|
applyAdoption(repository: string, actor: string, confirmationCode: string): AdoptionPostureEvent;
|
|
170
193
|
updatePreflight(repository: string): UpdatePreflightResult & {
|
|
171
|
-
adoption: AdoptionPreparation;
|
|
194
|
+
adoption: AdoptionPreparation | null;
|
|
172
195
|
};
|
|
173
196
|
alpha6StrictReviewRescuePreflight(repository: string): Alpha6StrictReviewRescuePreflight;
|
|
174
197
|
scanKnowledgeMap(repository: string): ProjectKnowledgeMap;
|
|
@@ -188,6 +211,7 @@ export declare class WorkflowService {
|
|
|
188
211
|
private delegatedAuthorization;
|
|
189
212
|
private assertHandoffGrant;
|
|
190
213
|
private nextForTaskWithDelegation;
|
|
214
|
+
private taskPlanContract;
|
|
191
215
|
private assertTaskContextChangeAllowed;
|
|
192
216
|
private taskHasTerminalCorrectiveDecision;
|
|
193
217
|
private taskTerminalCorrectivePosture;
|
|
@@ -200,7 +224,12 @@ export declare class WorkflowService {
|
|
|
200
224
|
private readMilestoneCurrent;
|
|
201
225
|
private readMilestoneScopeChangeCurrent;
|
|
202
226
|
private listMilestonesCurrent;
|
|
227
|
+
private listMilestonesObserved;
|
|
228
|
+
private taskGitNavigationOverride;
|
|
229
|
+
private withTaskNavigationContracts;
|
|
230
|
+
private describeMilestoneInitialAssembly;
|
|
203
231
|
private prepareMilestoneScopeChangeCandidate;
|
|
232
|
+
private publicWriterLeaseDiagnostic;
|
|
204
233
|
private proveWriterLeaseTokenForHandoff;
|
|
205
234
|
private proveOptionalWriterLeaseToken;
|
|
206
235
|
private assertTaskMutationAllowedByHandoff;
|
|
@@ -217,3 +246,4 @@ export declare class WorkflowService {
|
|
|
217
246
|
private validateKnowledgeTargets;
|
|
218
247
|
private assertReviewFresh;
|
|
219
248
|
}
|
|
249
|
+
export {};
|