@atolis-hq/wake 0.4.103 → 0.4.105
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/dist/src/activities/agent/agent-activity.js +3 -0
- package/dist/src/activities/contracts/activity.d.ts +16 -0
- package/dist/src/bootstrap/artifact-mcp.js +20 -1
- package/dist/src/bootstrap/config/root-schema.d.ts +16 -0
- package/dist/src/bootstrap/delegation-authority.js +17 -0
- package/dist/src/bootstrap/surface-api-delivery.js +25 -0
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler-ports.d.ts +3 -1
- package/dist/src/control-plane/application/advance-once-dispatch.js +4 -2
- package/dist/src/execution/application/candidate-workspaces.d.ts +13 -0
- package/dist/src/execution/application/candidate-workspaces.js +75 -0
- package/dist/src/execution/application/execution-service.js +27 -11
- package/dist/src/execution/application/run-lifecycle.js +1 -0
- package/dist/src/execution/contracts/candidate.d.ts +31 -0
- package/dist/src/execution/contracts/candidate.js +40 -0
- package/dist/src/execution/contracts/commands.d.ts +2 -0
- package/dist/src/execution/contracts/events.d.ts +11 -0
- package/dist/src/execution/contracts/events.js +2 -0
- package/dist/src/execution/contracts/repository-assignment.d.ts +5 -0
- package/dist/src/execution/contracts/repository-assignment.js +8 -0
- package/dist/src/execution/contracts/views.d.ts +2 -0
- package/dist/src/execution/contracts/vocabulary.d.ts +5 -0
- package/dist/src/execution/contracts/vocabulary.js +4 -0
- package/dist/src/execution/contracts/workspace.d.ts +6 -0
- package/dist/src/execution/index.d.ts +1 -0
- package/dist/src/execution/index.js +1 -0
- package/dist/src/execution/infrastructure/workspace/git-source.d.ts +2 -2
- package/dist/src/execution/infrastructure/workspace/git-source.js +18 -1
- package/dist/src/execution/infrastructure/workspace/git-workspace.d.ts +2 -4
- package/dist/src/execution/infrastructure/workspace/git-workspace.js +12 -1
- package/dist/src/orchestration/application/conversation-command-reactor.js +25 -0
- package/dist/src/orchestration/application/delegated-work.d.ts +14 -0
- package/dist/src/orchestration/application/delegated-work.js +63 -20
- package/dist/src/orchestration/application/delegation-attention-escalations.d.ts +11 -0
- package/dist/src/orchestration/application/delegation-attention-escalations.js +36 -0
- package/dist/src/orchestration/application/delegation-attention-state.d.ts +53 -0
- package/dist/src/orchestration/application/delegation-attention-state.js +194 -0
- package/dist/src/orchestration/application/delegation-attention.d.ts +58 -0
- package/dist/src/orchestration/application/delegation-attention.js +206 -0
- package/dist/src/orchestration/application/delegation-commands.d.ts +18 -1
- package/dist/src/orchestration/application/delegation-commands.js +18 -1
- package/dist/src/orchestration/application/delegation-gate.d.ts +4 -1
- package/dist/src/orchestration/application/delegation-gate.js +15 -3
- package/dist/src/orchestration/application/delivery-coordinator.d.ts +279 -0
- package/dist/src/orchestration/application/delivery-coordinator.js +213 -0
- package/dist/src/orchestration/application/delivery-facts-reader.d.ts +9 -0
- package/dist/src/orchestration/application/delivery-facts-reader.js +46 -0
- package/dist/src/orchestration/application/delivery-preparation.d.ts +15 -0
- package/dist/src/orchestration/application/delivery-preparation.js +100 -0
- package/dist/src/orchestration/application/delivery-sources.d.ts +10 -0
- package/dist/src/orchestration/application/delivery-sources.js +41 -0
- package/dist/src/orchestration/application/orchestration-repository.d.ts +3 -1
- package/dist/src/orchestration/application/orchestration-repository.js +10 -1
- package/dist/src/orchestration/application/orchestration-service.d.ts +284 -1
- package/dist/src/orchestration/application/orchestration-service.js +71 -5
- package/dist/src/orchestration/contracts/config.d.ts +16 -0
- package/dist/src/orchestration/contracts/config.js +7 -1
- package/dist/src/orchestration/contracts/delegation-ports.d.ts +4 -0
- package/dist/src/orchestration/contracts/delegation.d.ts +76 -2
- package/dist/src/orchestration/contracts/delegation.js +54 -1
- package/dist/src/orchestration/contracts/delivery-ports.d.ts +9 -0
- package/dist/src/orchestration/contracts/delivery-ports.js +1 -0
- package/dist/src/orchestration/contracts/delivery.d.ts +252 -0
- package/dist/src/orchestration/contracts/delivery.js +134 -0
- package/dist/src/orchestration/contracts/event-decoder.js +17 -2
- package/dist/src/orchestration/contracts/event-factory.js +13 -1
- package/dist/src/orchestration/contracts/events.d.ts +23 -1
- package/dist/src/orchestration/contracts/events.js +6 -0
- package/dist/src/orchestration/contracts/views.d.ts +9 -0
- package/dist/src/orchestration/contracts/vocabulary.d.ts +65 -0
- package/dist/src/orchestration/contracts/vocabulary.js +59 -0
- package/dist/src/orchestration/domain/compiler.js +2 -0
- package/dist/src/orchestration/domain/delivery-candidate.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-candidate.js +92 -0
- package/dist/src/orchestration/domain/delivery-facts.d.ts +83 -0
- package/dist/src/orchestration/domain/delivery-facts.js +34 -0
- package/dist/src/orchestration/domain/delivery-qa.d.ts +32 -0
- package/dist/src/orchestration/domain/delivery-qa.js +77 -0
- package/dist/src/orchestration/domain/delivery-replacement.d.ts +9 -0
- package/dist/src/orchestration/domain/delivery-replacement.js +54 -0
- package/dist/src/orchestration/domain/delivery-selection.d.ts +17 -0
- package/dist/src/orchestration/domain/delivery-selection.js +132 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.d.ts +4 -0
- package/dist/src/orchestration/domain/delivery-workflow-policy.js +13 -0
- package/dist/src/orchestration/domain/operator-retry-policy.js +24 -13
- package/dist/src/orchestration/domain/workflow-instance-events.d.ts +2 -0
- package/dist/src/orchestration/domain/workflow-instance-events.js +39 -0
- package/dist/src/orchestration/index.d.ts +5 -3
- package/dist/src/orchestration/index.js +3 -2
- package/dist/src/surfaces/api/contracts/work.d.ts +16 -0
- package/dist/src/surfaces/mcp/delegation.js +51 -1
- package/dist/src/surfaces/web-assets/assets/index-BfhxlN_h.js +1192 -0
- package/dist/src/surfaces/web-assets/index.html +1 -1
- package/package.json +1 -1
- package/dist/src/surfaces/web-assets/assets/index-C5R-aWzH.js +0 -1192
|
@@ -3,7 +3,8 @@ import type { ActivationId, ActivityName, ActivityOutcome, ActivityOutcomeKind }
|
|
|
3
3
|
import type { WorkItemId } from '../../work/index.js';
|
|
4
4
|
import type { OrchestrationWaitingActivityOutcome } from './activity-outcome.js';
|
|
5
5
|
import type { ApprovalAuthority, CompiledResourceTransition, CompiledWorkflow, StageConfig, TransitionTarget } from './config.js';
|
|
6
|
-
import type { DelegationInputs, DelegationReservation, DelegationResult } from './delegation.js';
|
|
6
|
+
import type { DelegationAttentionRequest, DelegationAttentionResponse, DelegationInputs, DelegationReservation, DelegationResult } from './delegation.js';
|
|
7
|
+
import type { DeliveryCandidate, DeliveryCompletionBlock, DeliveryQa, DeliverySelection } from './delivery.js';
|
|
7
8
|
import type { CommandName, OrchestrationGroupId, SignalName, StageName, WorkflowInstanceId, WorkflowName } from './identifiers.js';
|
|
8
9
|
import type { ChildOrchestrationGroupStreamId, ChildOrchestrationGroupStreamRef, PrimaryOrchestrationGroupStreamRef, WorkflowDefinitionsStreamRef, WorkflowInstanceStreamRef } from './streams.js';
|
|
9
10
|
export declare const OrchestrationEventType: {
|
|
@@ -16,7 +17,13 @@ export declare const OrchestrationEventType: {
|
|
|
16
17
|
readonly DelegationWaitStarted: "orchestration.delegation-wait-started";
|
|
17
18
|
readonly DelegationJoined: "orchestration.delegation-joined";
|
|
18
19
|
readonly DelegationFailed: "orchestration.delegation-failed";
|
|
20
|
+
readonly DelegationAttentionRequested: "orchestration.delegation-attention-requested";
|
|
21
|
+
readonly DelegationAttentionResponded: "orchestration.delegation-attention-responded";
|
|
22
|
+
readonly DelegationAttentionResolved: "orchestration.delegation-attention-resolved";
|
|
19
23
|
readonly DelegationReconciliationFailed: "orchestration.delegation-reconciliation-failed";
|
|
24
|
+
readonly DeliverySelectionRevised: "orchestration.delivery-selection-revised";
|
|
25
|
+
readonly DeliveryCandidateRecorded: "orchestration.delivery-candidate-recorded";
|
|
26
|
+
readonly DeliveryQaRecorded: "orchestration.delivery-qa-recorded";
|
|
20
27
|
readonly WorkflowDefinitionRegistered: "orchestration.workflow-definition-registered";
|
|
21
28
|
readonly InstanceStarted: "orchestration.instance-started";
|
|
22
29
|
readonly StageEntered: "orchestration.stage-entered";
|
|
@@ -66,6 +73,17 @@ export interface OrchestrationEventPayloads {
|
|
|
66
73
|
readonly reason: string;
|
|
67
74
|
};
|
|
68
75
|
readonly [OrchestrationEventType.SignalDeferred]: DeferredWorkflowSignal;
|
|
76
|
+
readonly [OrchestrationEventType.DelegationAttentionRequested]: DelegationAttentionRequest;
|
|
77
|
+
readonly [OrchestrationEventType.DelegationAttentionResponded]: DelegationAttentionResponse;
|
|
78
|
+
readonly [OrchestrationEventType.DelegationAttentionResolved]: {
|
|
79
|
+
readonly cohortId: string;
|
|
80
|
+
readonly attentionKey: string;
|
|
81
|
+
readonly activationId: ActivationId;
|
|
82
|
+
/** The batched human question, published through the ordinary accepted-outcome route. */
|
|
83
|
+
readonly escalation?: string;
|
|
84
|
+
/** The assessment run itself failed; the cohort is untouched and may be re-assessed. */
|
|
85
|
+
readonly assessmentFailure?: string;
|
|
86
|
+
};
|
|
69
87
|
readonly [OrchestrationEventType.DelegationFailed]: {
|
|
70
88
|
readonly cohortId: string;
|
|
71
89
|
readonly reason: string;
|
|
@@ -74,6 +92,9 @@ export interface OrchestrationEventPayloads {
|
|
|
74
92
|
readonly cohortId: string;
|
|
75
93
|
readonly reason: string;
|
|
76
94
|
};
|
|
95
|
+
readonly [OrchestrationEventType.DeliverySelectionRevised]: DeliverySelection;
|
|
96
|
+
readonly [OrchestrationEventType.DeliveryCandidateRecorded]: DeliveryCandidate;
|
|
97
|
+
readonly [OrchestrationEventType.DeliveryQaRecorded]: DeliveryQa;
|
|
77
98
|
readonly [OrchestrationEventType.DelegationReserved]: DelegationReservation;
|
|
78
99
|
readonly [OrchestrationEventType.DelegationRegistered]: {
|
|
79
100
|
readonly cohortId: string;
|
|
@@ -153,6 +174,7 @@ export interface OrchestrationEventPayloads {
|
|
|
153
174
|
readonly [OrchestrationEventType.InstanceCompleted]: Readonly<Record<never, never>>;
|
|
154
175
|
readonly [OrchestrationEventType.InstanceBlocked]: {
|
|
155
176
|
readonly reason: string;
|
|
177
|
+
readonly deliveryGate?: DeliveryCompletionBlock['deliveryGate'];
|
|
156
178
|
};
|
|
157
179
|
readonly [OrchestrationEventType.OperatorRetryRequested]: {
|
|
158
180
|
readonly activationId: ActivationId;
|
|
@@ -9,7 +9,13 @@ export const OrchestrationEventType = {
|
|
|
9
9
|
DelegationWaitStarted: 'orchestration.delegation-wait-started',
|
|
10
10
|
DelegationJoined: 'orchestration.delegation-joined',
|
|
11
11
|
DelegationFailed: 'orchestration.delegation-failed',
|
|
12
|
+
DelegationAttentionRequested: 'orchestration.delegation-attention-requested',
|
|
13
|
+
DelegationAttentionResponded: 'orchestration.delegation-attention-responded',
|
|
14
|
+
DelegationAttentionResolved: 'orchestration.delegation-attention-resolved',
|
|
12
15
|
DelegationReconciliationFailed: 'orchestration.delegation-reconciliation-failed',
|
|
16
|
+
DeliverySelectionRevised: 'orchestration.delivery-selection-revised',
|
|
17
|
+
DeliveryCandidateRecorded: 'orchestration.delivery-candidate-recorded',
|
|
18
|
+
DeliveryQaRecorded: 'orchestration.delivery-qa-recorded',
|
|
13
19
|
WorkflowDefinitionRegistered: 'orchestration.workflow-definition-registered',
|
|
14
20
|
InstanceStarted: 'orchestration.instance-started',
|
|
15
21
|
StageEntered: 'orchestration.stage-entered',
|
|
@@ -54,12 +54,21 @@ export interface WorkflowInstanceView {
|
|
|
54
54
|
readonly cohortId: string;
|
|
55
55
|
readonly activationId: ActivationId;
|
|
56
56
|
};
|
|
57
|
+
/** Set while a coalesced attention activation owns the parent; the cohort wait is suspended. */
|
|
58
|
+
readonly delegationAttention?: {
|
|
59
|
+
readonly cohortId: string;
|
|
60
|
+
readonly attentionKey: string;
|
|
61
|
+
readonly activationId: ActivationId;
|
|
62
|
+
};
|
|
57
63
|
readonly delegationWait?: {
|
|
58
64
|
readonly cohortId: string;
|
|
59
65
|
readonly activationId: ActivationId;
|
|
60
66
|
};
|
|
61
67
|
readonly status: WorkflowStatus;
|
|
62
68
|
readonly blockReason?: string;
|
|
69
|
+
readonly deliveryGateBlock?: {
|
|
70
|
+
readonly retryStage: StageName;
|
|
71
|
+
};
|
|
63
72
|
readonly currentStage: StageName;
|
|
64
73
|
readonly pendingActivation?: ActivityActivationView;
|
|
65
74
|
readonly repeatCounts: Readonly<Record<string, number>>;
|
|
@@ -56,6 +56,23 @@ export declare const DelegationPrerequisiteCondition: {
|
|
|
56
56
|
readonly DeliveryReady: "delivery-ready";
|
|
57
57
|
readonly MergedChange: "merged-change";
|
|
58
58
|
};
|
|
59
|
+
export declare const DelegationBlockerKind: {
|
|
60
|
+
/** Terminal failure, cancellation, exhausted budget or a changed consumed input. */
|
|
61
|
+
readonly Failed: "failed";
|
|
62
|
+
/** A child workflow blocked for assignment clarification the parent may answer. */
|
|
63
|
+
readonly Context: "assignment-context";
|
|
64
|
+
};
|
|
65
|
+
export type DelegationBlockerKind = ValueOf<typeof DelegationBlockerKind>;
|
|
66
|
+
export declare const DelegationAttentionRejection: {
|
|
67
|
+
readonly NoAttention: "no-attention";
|
|
68
|
+
readonly OutsideHierarchy: "outside-hierarchy";
|
|
69
|
+
readonly UnknownBlocker: "unknown-blocker";
|
|
70
|
+
readonly NotAnswerable: "not-answerable";
|
|
71
|
+
readonly StaleRevision: "stale-revision";
|
|
72
|
+
readonly NotBlocked: "not-blocked";
|
|
73
|
+
readonly Duplicate: "duplicate";
|
|
74
|
+
};
|
|
75
|
+
export type DelegationAttentionRejection = ValueOf<typeof DelegationAttentionRejection>;
|
|
59
76
|
export declare const DelegationConflictCode: {
|
|
60
77
|
readonly SelfDependency: "self-dependency";
|
|
61
78
|
readonly MissingTarget: "missing-target";
|
|
@@ -66,6 +83,9 @@ export declare const DelegationConflictCode: {
|
|
|
66
83
|
readonly MultipleBases: "multiple-bases";
|
|
67
84
|
readonly WaitCycle: "wait-cycle";
|
|
68
85
|
readonly StalePlan: "stale-plan";
|
|
86
|
+
readonly AttentionOpen: "attention-open";
|
|
87
|
+
readonly ReplacementUnsupported: "replacement-unsupported";
|
|
88
|
+
readonly ReplacementInvalid: "replacement-invalid";
|
|
69
89
|
};
|
|
70
90
|
export type DelegationConflictCode = ValueOf<typeof DelegationConflictCode>;
|
|
71
91
|
export declare const PrerequisiteBlockCode: {
|
|
@@ -77,3 +97,48 @@ export declare const PrerequisiteBlockCode: {
|
|
|
77
97
|
readonly Blocked: "prerequisite-blocked";
|
|
78
98
|
};
|
|
79
99
|
export type PrerequisiteBlockCode = ValueOf<typeof PrerequisiteBlockCode>;
|
|
100
|
+
export declare const DeliveryRejection: {
|
|
101
|
+
/** The submitted revision is not the current one; re-inspect before retrying. */
|
|
102
|
+
readonly StaleSelection: "stale-selection";
|
|
103
|
+
/** An original required assignment has no qualifying output or authorized replacement. */
|
|
104
|
+
readonly UncoveredRequirement: "uncovered-requirement";
|
|
105
|
+
readonly UnknownRequirement: "unknown-requirement";
|
|
106
|
+
/** The named output is not a qualifying result of the claimed child. */
|
|
107
|
+
readonly OutputMismatch: "output-mismatch";
|
|
108
|
+
/** A replacement did not name the output currently selected, or is not criteria-preserving. */
|
|
109
|
+
readonly ReplacementConflict: "replacement-conflict";
|
|
110
|
+
/** The selection still contains results whose upstream input was replaced. */
|
|
111
|
+
readonly StaleOutput: "stale-output";
|
|
112
|
+
readonly NoSelection: "no-selection";
|
|
113
|
+
readonly CandidateCoverage: "candidate-coverage";
|
|
114
|
+
/** A retained ref is missing, outside the delivery namespace, or no longer at its recorded commit. */
|
|
115
|
+
readonly SourceUnavailable: "source-unavailable";
|
|
116
|
+
readonly UnknownCandidate: "unknown-candidate";
|
|
117
|
+
/** QA named revisions other than the candidate's exact set. */
|
|
118
|
+
readonly RevisionMismatch: "revision-mismatch";
|
|
119
|
+
readonly InvalidVerdict: "invalid-verdict";
|
|
120
|
+
/** An identity was reused for different content. */
|
|
121
|
+
readonly Conflict: "identity-conflict";
|
|
122
|
+
};
|
|
123
|
+
export type DeliveryRejection = ValueOf<typeof DeliveryRejection>;
|
|
124
|
+
export declare const QaVerdict: {
|
|
125
|
+
readonly Pass: "pass";
|
|
126
|
+
readonly Fail: "fail";
|
|
127
|
+
/** The environment or a source was unavailable; never a pass. */
|
|
128
|
+
readonly Blocked: "blocked";
|
|
129
|
+
};
|
|
130
|
+
export type QaVerdict = ValueOf<typeof QaVerdict>;
|
|
131
|
+
export declare const CandidateSourceKind: {
|
|
132
|
+
/** The selected output revision is itself the tip (a single change or an intentional stack). */
|
|
133
|
+
readonly Output: "output";
|
|
134
|
+
/** An agent-assembled commit published under the delivery's retained ref namespace. */
|
|
135
|
+
readonly RetainedRef: "retained-ref";
|
|
136
|
+
};
|
|
137
|
+
export type CandidateSourceKind = ValueOf<typeof CandidateSourceKind>;
|
|
138
|
+
export declare const DeliveryCompletion: {
|
|
139
|
+
/** The parent may finish once the current candidate has an effective QA pass. */
|
|
140
|
+
readonly QaApproved: "qa-approved";
|
|
141
|
+
/** The parent additionally needs governed integration, which is not yet available. */
|
|
142
|
+
readonly MergeRequired: "merge-required";
|
|
143
|
+
};
|
|
144
|
+
export type DeliveryCompletion = ValueOf<typeof DeliveryCompletion>;
|
|
@@ -49,6 +49,21 @@ export const DelegationPrerequisiteCondition = defineClosedVocabulary({
|
|
|
49
49
|
DeliveryReady: 'delivery-ready',
|
|
50
50
|
MergedChange: 'merged-change',
|
|
51
51
|
});
|
|
52
|
+
export const DelegationBlockerKind = defineClosedVocabulary({
|
|
53
|
+
/** Terminal failure, cancellation, exhausted budget or a changed consumed input. */
|
|
54
|
+
Failed: 'failed',
|
|
55
|
+
/** A child workflow blocked for assignment clarification the parent may answer. */
|
|
56
|
+
Context: 'assignment-context',
|
|
57
|
+
});
|
|
58
|
+
export const DelegationAttentionRejection = defineClosedVocabulary({
|
|
59
|
+
NoAttention: 'no-attention',
|
|
60
|
+
OutsideHierarchy: 'outside-hierarchy',
|
|
61
|
+
UnknownBlocker: 'unknown-blocker',
|
|
62
|
+
NotAnswerable: 'not-answerable',
|
|
63
|
+
StaleRevision: 'stale-revision',
|
|
64
|
+
NotBlocked: 'not-blocked',
|
|
65
|
+
Duplicate: 'duplicate',
|
|
66
|
+
});
|
|
52
67
|
export const DelegationConflictCode = defineClosedVocabulary({
|
|
53
68
|
SelfDependency: 'self-dependency',
|
|
54
69
|
MissingTarget: 'missing-target',
|
|
@@ -59,6 +74,9 @@ export const DelegationConflictCode = defineClosedVocabulary({
|
|
|
59
74
|
MultipleBases: 'multiple-bases',
|
|
60
75
|
WaitCycle: 'wait-cycle',
|
|
61
76
|
StalePlan: 'stale-plan',
|
|
77
|
+
AttentionOpen: 'attention-open',
|
|
78
|
+
ReplacementUnsupported: 'replacement-unsupported',
|
|
79
|
+
ReplacementInvalid: 'replacement-invalid',
|
|
62
80
|
});
|
|
63
81
|
export const PrerequisiteBlockCode = defineClosedVocabulary({
|
|
64
82
|
Waiting: 'prerequisite-waiting',
|
|
@@ -68,3 +86,44 @@ export const PrerequisiteBlockCode = defineClosedVocabulary({
|
|
|
68
86
|
Cycle: 'prerequisite-cycle',
|
|
69
87
|
Blocked: 'prerequisite-blocked',
|
|
70
88
|
});
|
|
89
|
+
export const DeliveryRejection = defineClosedVocabulary({
|
|
90
|
+
/** The submitted revision is not the current one; re-inspect before retrying. */
|
|
91
|
+
StaleSelection: 'stale-selection',
|
|
92
|
+
/** An original required assignment has no qualifying output or authorized replacement. */
|
|
93
|
+
UncoveredRequirement: 'uncovered-requirement',
|
|
94
|
+
UnknownRequirement: 'unknown-requirement',
|
|
95
|
+
/** The named output is not a qualifying result of the claimed child. */
|
|
96
|
+
OutputMismatch: 'output-mismatch',
|
|
97
|
+
/** A replacement did not name the output currently selected, or is not criteria-preserving. */
|
|
98
|
+
ReplacementConflict: 'replacement-conflict',
|
|
99
|
+
/** The selection still contains results whose upstream input was replaced. */
|
|
100
|
+
StaleOutput: 'stale-output',
|
|
101
|
+
NoSelection: 'no-selection',
|
|
102
|
+
CandidateCoverage: 'candidate-coverage',
|
|
103
|
+
/** A retained ref is missing, outside the delivery namespace, or no longer at its recorded commit. */
|
|
104
|
+
SourceUnavailable: 'source-unavailable',
|
|
105
|
+
UnknownCandidate: 'unknown-candidate',
|
|
106
|
+
/** QA named revisions other than the candidate's exact set. */
|
|
107
|
+
RevisionMismatch: 'revision-mismatch',
|
|
108
|
+
InvalidVerdict: 'invalid-verdict',
|
|
109
|
+
/** An identity was reused for different content. */
|
|
110
|
+
Conflict: 'identity-conflict',
|
|
111
|
+
});
|
|
112
|
+
export const QaVerdict = defineClosedVocabulary({
|
|
113
|
+
Pass: 'pass',
|
|
114
|
+
Fail: 'fail',
|
|
115
|
+
/** The environment or a source was unavailable; never a pass. */
|
|
116
|
+
Blocked: 'blocked',
|
|
117
|
+
});
|
|
118
|
+
export const CandidateSourceKind = defineClosedVocabulary({
|
|
119
|
+
/** The selected output revision is itself the tip (a single change or an intentional stack). */
|
|
120
|
+
Output: 'output',
|
|
121
|
+
/** An agent-assembled commit published under the delivery's retained ref namespace. */
|
|
122
|
+
RetainedRef: 'retained-ref',
|
|
123
|
+
});
|
|
124
|
+
export const DeliveryCompletion = defineClosedVocabulary({
|
|
125
|
+
/** The parent may finish once the current candidate has an effective QA pass. */
|
|
126
|
+
QaApproved: 'qa-approved',
|
|
127
|
+
/** The parent additionally needs governed integration, which is not yet available. */
|
|
128
|
+
MergeRequired: 'merge-required',
|
|
129
|
+
});
|
|
@@ -5,6 +5,7 @@ import { ApprovalAuthorityKind, TransitionTargetKind } from '../contracts/vocabu
|
|
|
5
5
|
import { defaultApprovalAwait } from './approval-defaults.js';
|
|
6
6
|
import { compileCommands } from './command-compiler.js';
|
|
7
7
|
import { reportUnroutedOutcomes } from './compile-diagnostics.js';
|
|
8
|
+
import { assertDeliveryQa } from './delivery-workflow-policy.js';
|
|
8
9
|
import { compileResourceTransitions } from './resource-transition-compiler.js';
|
|
9
10
|
import { compileTarget, isReservedRouteTarget, isReservedTerminalTarget, } from './transition-target.js';
|
|
10
11
|
import { assertCyclesBounded, assertReachable, remainingAgentSteps } from './workflow-graph.js';
|
|
@@ -24,6 +25,7 @@ export function compileWorkflow(name, input, activities, knownWorkflowNames = [n
|
|
|
24
25
|
const compiledEntry = stageName(entry);
|
|
25
26
|
const declaredWatchIds = new Set((config.watches ?? []).map((watch) => watch.id));
|
|
26
27
|
const stages = compileStages(compiledName, config.stages, activities, declaredWatchIds);
|
|
28
|
+
assertDeliveryQa(config, stages, activities);
|
|
27
29
|
const commands = compileCommands(config, activities);
|
|
28
30
|
const watches = compileWatches(config, rawStageNames, knownWorkflowNames);
|
|
29
31
|
assertReachable(compiledEntry, stages);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DeliveryCandidate, DeliveryCandidateCommand } from '../contracts/delivery.js';
|
|
2
|
+
import { type DeliveryFacts } from './delivery-facts.js';
|
|
3
|
+
export interface CandidatePlan {
|
|
4
|
+
readonly candidate: DeliveryCandidate;
|
|
5
|
+
}
|
|
6
|
+
/** The namespace a delivery's candidate refs must live in; no automatic deletion is performed. */
|
|
7
|
+
export declare const retainedRefPrefix: (root: string, candidateId: string) => string;
|
|
8
|
+
/** Shapes the candidate manifest from the current selection; source verification is separate. */
|
|
9
|
+
export declare function planCandidate(facts: DeliveryFacts, command: DeliveryCandidateCommand, root: string): CandidatePlan;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { CandidateSourceKind, DeliveryRejection } from '../contracts/vocabulary.js';
|
|
3
|
+
import { currentSelection, isChange, outputKey, reject, requirements, } from './delivery-facts.js';
|
|
4
|
+
import { staleEntries } from './delivery-selection.js';
|
|
5
|
+
const sameKeys = (left, right) => isDeepStrictEqual(left.map(outputKey).sort(), right.map(outputKey).sort());
|
|
6
|
+
/** The namespace a delivery's candidate refs must live in; no automatic deletion is performed. */
|
|
7
|
+
export const retainedRefPrefix = (root, candidateId) => `refs/wake/delivery/${root}/${candidateId}/`;
|
|
8
|
+
/** Shapes the candidate manifest from the current selection; source verification is separate. */
|
|
9
|
+
export function planCandidate(facts, command, root) {
|
|
10
|
+
const current = currentSelection(facts);
|
|
11
|
+
if (current === undefined)
|
|
12
|
+
throw reject(DeliveryRejection.NoSelection, 'Record a delivery selection first');
|
|
13
|
+
if (command.selectionRevision !== current.revision)
|
|
14
|
+
throw reject(DeliveryRejection.StaleSelection, `Selection is at revision ${current.revision}, not ${command.selectionRevision}`);
|
|
15
|
+
const stale = staleEntries(facts);
|
|
16
|
+
if (stale.size > 0)
|
|
17
|
+
throw reject(DeliveryRejection.StaleOutput, `Replace or reverify stale results first: ${[...stale].join(', ')}`);
|
|
18
|
+
const byRepository = new Map();
|
|
19
|
+
for (const entry of current.entries.filter((candidate) => isChange(candidate.output))) {
|
|
20
|
+
const { repositoryResourceId } = entry.output.reference;
|
|
21
|
+
byRepository.set(repositoryResourceId, [
|
|
22
|
+
...(byRepository.get(repositoryResourceId) ?? []),
|
|
23
|
+
entry,
|
|
24
|
+
]);
|
|
25
|
+
}
|
|
26
|
+
const requested = command.repositories.map((entry) => entry.resourceId);
|
|
27
|
+
if (new Set(requested).size !== requested.length ||
|
|
28
|
+
!isDeepStrictEqual([...requested].sort(), [...byRepository.keys()].sort()))
|
|
29
|
+
throw reject(DeliveryRejection.CandidateCoverage, 'The candidate must name exactly the repositories of the selected changes, once each');
|
|
30
|
+
const repositories = command.repositories.map((request) => repositoryOf(request, byRepository.get(request.resourceId) ?? [], root, command.candidateId));
|
|
31
|
+
return {
|
|
32
|
+
candidate: {
|
|
33
|
+
candidateId: command.candidateId,
|
|
34
|
+
selectionRevision: current.revision,
|
|
35
|
+
repositories: repositories.sort((a, b) => a.resourceId.localeCompare(b.resourceId)),
|
|
36
|
+
context: current.entries
|
|
37
|
+
.filter((entry) => !isChange(entry.output))
|
|
38
|
+
.map((entry) => ({
|
|
39
|
+
childWorkItemId: entry.childWorkItemId,
|
|
40
|
+
outputName: entry.output.name,
|
|
41
|
+
})),
|
|
42
|
+
criteria: [
|
|
43
|
+
...new Set(requirements(facts.reservations).flatMap((requirement) => requirement.criteria)),
|
|
44
|
+
],
|
|
45
|
+
...(command.recipe === undefined ? {} : { recipe: command.recipe }),
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function repositoryOf(request, entries, root, candidateId) {
|
|
50
|
+
const expected = entries.map((entry) => ({
|
|
51
|
+
childWorkItemId: entry.childWorkItemId,
|
|
52
|
+
outputName: entry.output.name,
|
|
53
|
+
}));
|
|
54
|
+
const source = request.source;
|
|
55
|
+
if (source.kind === CandidateSourceKind.Output) {
|
|
56
|
+
if (!sameKeys([source.tip, ...(source.includes ?? [])], expected))
|
|
57
|
+
throw reject(DeliveryRejection.CandidateCoverage, `Candidate for ${request.resourceId} must account for every selected change in it; independent changes need an assembled retained ref`);
|
|
58
|
+
const tip = entries.find((entry) => outputKey(source.tip) === outputKey(keyOf(entry)));
|
|
59
|
+
if (tip === undefined)
|
|
60
|
+
throw reject(DeliveryRejection.CandidateCoverage, 'The tip is not a selected change');
|
|
61
|
+
const reference = tip.output.reference;
|
|
62
|
+
return {
|
|
63
|
+
resourceId: request.resourceId,
|
|
64
|
+
revision: reference.revision,
|
|
65
|
+
pullRequestBase: reference.pullRequestBase,
|
|
66
|
+
source: { kind: CandidateSourceKind.Output, tip: source.tip },
|
|
67
|
+
contributions: expected,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
if (!sameKeys(source.contributions, expected))
|
|
71
|
+
throw reject(DeliveryRejection.CandidateCoverage, `Assembly for ${request.resourceId} must declare every selected change in it`);
|
|
72
|
+
assertRetainedRef(source.ref, retainedRefPrefix(root, candidateId));
|
|
73
|
+
const bases = entries.map((entry) => entry.output.reference.pullRequestBase);
|
|
74
|
+
return {
|
|
75
|
+
resourceId: request.resourceId,
|
|
76
|
+
revision: source.revision,
|
|
77
|
+
pullRequestBase: [...bases].sort()[0],
|
|
78
|
+
source: { kind: CandidateSourceKind.RetainedRef, ref: source.ref },
|
|
79
|
+
contributions: expected,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
const keyOf = (entry) => ({
|
|
83
|
+
childWorkItemId: entry.childWorkItemId,
|
|
84
|
+
outputName: entry.output.name,
|
|
85
|
+
});
|
|
86
|
+
function assertRetainedRef(ref, prefix) {
|
|
87
|
+
if (!ref.startsWith(prefix) ||
|
|
88
|
+
ref.length === prefix.length ||
|
|
89
|
+
!/^[A-Za-z0-9._/-]+$/.test(ref) ||
|
|
90
|
+
ref.includes('..'))
|
|
91
|
+
throw reject(DeliveryRejection.SourceUnavailable, `Retained refs must live under ${prefix}`);
|
|
92
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { DelegationReservation, DelegationResult } from '../contracts/delegation.js';
|
|
2
|
+
import { DeliveryRejectionError, type DeliveryCandidate, type DeliveryOutputKey, type DeliveryQa, type DeliverySelection } from '../contracts/delivery.js';
|
|
3
|
+
import type { DeliveryRejection } from '../contracts/vocabulary.js';
|
|
4
|
+
export type Output = DelegationResult['outputs'][number];
|
|
5
|
+
export type Child = DelegationReservation['children'][number];
|
|
6
|
+
export type ChangeReference = Extract<Output['reference'], {
|
|
7
|
+
readonly repositoryResourceId: string;
|
|
8
|
+
}>;
|
|
9
|
+
/** Everything the delivery rules read; all of it is journal-derived. */
|
|
10
|
+
export interface DeliveryFacts {
|
|
11
|
+
readonly reservations: readonly DelegationReservation[];
|
|
12
|
+
readonly results: readonly DelegationResult[];
|
|
13
|
+
/** Outputs each child consumed as prerequisites, by child WorkItem. */
|
|
14
|
+
readonly consumed: ReadonlyMap<string, readonly Output[]>;
|
|
15
|
+
readonly selections: readonly DeliverySelection[];
|
|
16
|
+
readonly candidates: readonly DeliveryCandidate[];
|
|
17
|
+
readonly qa: readonly DeliveryQa[];
|
|
18
|
+
}
|
|
19
|
+
export declare const outputKey: (key: DeliveryOutputKey) => string;
|
|
20
|
+
export declare const entryKey: (entry: {
|
|
21
|
+
cohortId: string;
|
|
22
|
+
assignmentId: string;
|
|
23
|
+
}, name: string) => string;
|
|
24
|
+
export declare const reject: (code: DeliveryRejection, message: string) => DeliveryRejectionError;
|
|
25
|
+
export declare const isChange: (output: Output) => output is Output & {
|
|
26
|
+
reference: ChangeReference;
|
|
27
|
+
};
|
|
28
|
+
export declare function currentSelection(facts: DeliveryFacts): DeliverySelection | undefined;
|
|
29
|
+
export interface Requirement {
|
|
30
|
+
readonly cohortId: string;
|
|
31
|
+
readonly assignmentId: string;
|
|
32
|
+
readonly outputName: string;
|
|
33
|
+
readonly child: Child;
|
|
34
|
+
readonly criteria: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
/** Original required assignments: those not themselves declared as a replacement. */
|
|
37
|
+
export declare function requirements(reservations: readonly DelegationReservation[]): Requirement[];
|
|
38
|
+
export declare function childOf(reservations: readonly DelegationReservation[], id: string): {
|
|
39
|
+
cohortId: string;
|
|
40
|
+
child: {
|
|
41
|
+
assignmentId: string;
|
|
42
|
+
objective: string;
|
|
43
|
+
criteria: string[];
|
|
44
|
+
workflowName: import("../index.js").WorkflowName;
|
|
45
|
+
workflowFingerprint: string;
|
|
46
|
+
context: {
|
|
47
|
+
workItemId: import("../../work/index.js").WorkItemId;
|
|
48
|
+
revisionId: string;
|
|
49
|
+
}[];
|
|
50
|
+
outputs: ({
|
|
51
|
+
name: string;
|
|
52
|
+
path: string;
|
|
53
|
+
} | {
|
|
54
|
+
name: string;
|
|
55
|
+
kind: "change";
|
|
56
|
+
requireReview?: boolean | undefined;
|
|
57
|
+
requireChecks?: boolean | undefined;
|
|
58
|
+
})[];
|
|
59
|
+
workItemId: import("../../work/index.js").WorkItemId;
|
|
60
|
+
workflowInstanceId: import("../index.js").WorkflowInstanceId;
|
|
61
|
+
grantId: string;
|
|
62
|
+
repositoryResourceIds?: string[] | undefined;
|
|
63
|
+
prerequisites?: {
|
|
64
|
+
assignmentId: string;
|
|
65
|
+
output: string;
|
|
66
|
+
condition: "accepted-output" | "pushed-change" | "delivery-ready" | "merged-change";
|
|
67
|
+
cohortId?: string | undefined;
|
|
68
|
+
useAsBase?: boolean | undefined;
|
|
69
|
+
}[] | undefined;
|
|
70
|
+
replaces?: {
|
|
71
|
+
cohortId: string;
|
|
72
|
+
assignmentId: string;
|
|
73
|
+
} | undefined;
|
|
74
|
+
repository?: {
|
|
75
|
+
resourceId: string;
|
|
76
|
+
sourceRef: string;
|
|
77
|
+
pullRequestBase: string;
|
|
78
|
+
sourceRevision: string;
|
|
79
|
+
} | undefined;
|
|
80
|
+
prerequisiteWorkItemIds?: import("../../work/index.js").WorkItemId[] | undefined;
|
|
81
|
+
};
|
|
82
|
+
} | undefined;
|
|
83
|
+
export declare function qualifying(facts: DeliveryFacts, key: DeliveryOutputKey): Output | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DeliveryRejectionError, } from '../contracts/delivery.js';
|
|
2
|
+
export const outputKey = (key) => `${key.childWorkItemId}/${key.outputName}`;
|
|
3
|
+
export const entryKey = (entry, name) => `${entry.cohortId}/${entry.assignmentId}/${name}`;
|
|
4
|
+
export const reject = (code, message) => new DeliveryRejectionError(code, message);
|
|
5
|
+
export const isChange = (output) => 'repositoryResourceId' in output.reference;
|
|
6
|
+
export function currentSelection(facts) {
|
|
7
|
+
return facts.selections.at(-1);
|
|
8
|
+
}
|
|
9
|
+
/** Original required assignments: those not themselves declared as a replacement. */
|
|
10
|
+
export function requirements(reservations) {
|
|
11
|
+
return reservations.flatMap((reservation) => reservation.children
|
|
12
|
+
.filter((child) => child.replaces === undefined)
|
|
13
|
+
.flatMap((child) => child.outputs.map((output) => ({
|
|
14
|
+
cohortId: reservation.cohortId,
|
|
15
|
+
assignmentId: child.assignmentId,
|
|
16
|
+
outputName: output.name,
|
|
17
|
+
child,
|
|
18
|
+
criteria: child.criteria,
|
|
19
|
+
}))));
|
|
20
|
+
}
|
|
21
|
+
export function childOf(reservations, id) {
|
|
22
|
+
for (const reservation of reservations) {
|
|
23
|
+
const child = reservation.children.find((entry) => entry.workItemId === id);
|
|
24
|
+
if (child !== undefined)
|
|
25
|
+
return { cohortId: reservation.cohortId, child };
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
export function qualifying(facts, key) {
|
|
30
|
+
return facts.results
|
|
31
|
+
.filter((result) => result.childWorkItemId === key.childWorkItemId)
|
|
32
|
+
.flatMap((result) => result.outputs)
|
|
33
|
+
.find((output) => output.name === key.outputName);
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { DeliveryCandidate, DeliveryQa, DeliveryQaCommand } from '../contracts/delivery.js';
|
|
2
|
+
import { DeliveryCompletion } from '../contracts/vocabulary.js';
|
|
3
|
+
import { type DeliveryFacts } from './delivery-facts.js';
|
|
4
|
+
/** The exact repository and revision set QA must have checked. */
|
|
5
|
+
export declare const revisionSet: (items: readonly {
|
|
6
|
+
resourceId: string;
|
|
7
|
+
revision: string;
|
|
8
|
+
}[]) => string[];
|
|
9
|
+
/** QA can only vouch for the candidate's own revisions, and never passes without an environment. */
|
|
10
|
+
export declare function assertQa(facts: DeliveryFacts, command: DeliveryQaCommand): DeliveryQa;
|
|
11
|
+
export interface DeliveryState {
|
|
12
|
+
readonly selectionRevision: number;
|
|
13
|
+
readonly stale: readonly string[];
|
|
14
|
+
readonly candidate: DeliveryCandidate | null;
|
|
15
|
+
/** The latest candidate belongs to the current selection and nothing in it is stale. */
|
|
16
|
+
readonly candidateCurrent: boolean;
|
|
17
|
+
readonly qa: DeliveryQa | null;
|
|
18
|
+
/** The latest QA is for the current candidate; older verdicts stay historical. */
|
|
19
|
+
readonly qaEffective: boolean;
|
|
20
|
+
readonly repair: {
|
|
21
|
+
readonly failedRounds: number;
|
|
22
|
+
readonly exhausted: boolean;
|
|
23
|
+
readonly unresolvedFindings: readonly string[];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export declare function deliveryState(facts: DeliveryFacts): DeliveryState;
|
|
27
|
+
export interface CompletionDecision {
|
|
28
|
+
readonly complete: boolean;
|
|
29
|
+
readonly reason?: string;
|
|
30
|
+
}
|
|
31
|
+
/** DC-24 handoff boundary: QA approval finishes a QA-approved parent but never a merge-required one. */
|
|
32
|
+
export declare function completionDecision(state: DeliveryState, mode: DeliveryCompletion): CompletionDecision;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { DeliveryCompletion, DeliveryRejection, QaVerdict } from '../contracts/vocabulary.js';
|
|
3
|
+
import { currentSelection, entryKey, reject, requirements, } from './delivery-facts.js';
|
|
4
|
+
import { staleEntries } from './delivery-selection.js';
|
|
5
|
+
/** The exact repository and revision set QA must have checked. */
|
|
6
|
+
export const revisionSet = (items) => items.map((item) => `${item.resourceId}@${item.revision.toLowerCase()}`).sort();
|
|
7
|
+
/** QA can only vouch for the candidate's own revisions, and never passes without an environment. */
|
|
8
|
+
export function assertQa(facts, command) {
|
|
9
|
+
const candidate = facts.candidates.find((entry) => entry.candidateId === command.candidateId);
|
|
10
|
+
if (candidate === undefined)
|
|
11
|
+
throw reject(DeliveryRejection.UnknownCandidate, `Unknown candidate ${command.candidateId}`);
|
|
12
|
+
if (!isDeepStrictEqual(revisionSet(command.revisions), revisionSet(candidate.repositories)))
|
|
13
|
+
throw reject(DeliveryRejection.RevisionMismatch, 'QA must check exactly the candidate repository revisions; testing main or another candidate cannot satisfy the gate');
|
|
14
|
+
if (!command.environment.available && command.verdict !== QaVerdict.Blocked)
|
|
15
|
+
throw reject(DeliveryRejection.InvalidVerdict, 'An unavailable environment must be reported as blocked');
|
|
16
|
+
if (command.verdict === QaVerdict.Pass)
|
|
17
|
+
assertPass(candidate, command);
|
|
18
|
+
if (command.verdict === QaVerdict.Fail && command.findings.length === 0)
|
|
19
|
+
throw reject(DeliveryRejection.InvalidVerdict, 'A failing verdict must state its findings');
|
|
20
|
+
return { ...command };
|
|
21
|
+
}
|
|
22
|
+
function assertPass(candidate, command) {
|
|
23
|
+
if (!command.environment.available)
|
|
24
|
+
throw reject(DeliveryRejection.InvalidVerdict, 'An unavailable environment is a blocker, never a pass');
|
|
25
|
+
if (command.findings.length > 0)
|
|
26
|
+
throw reject(DeliveryRejection.InvalidVerdict, 'A passing verdict cannot carry findings');
|
|
27
|
+
if (candidate.recipe !== undefined && command.environment.recipe !== candidate.recipe)
|
|
28
|
+
throw reject(DeliveryRejection.InvalidVerdict, 'QA must run the configured environment and test recipe');
|
|
29
|
+
}
|
|
30
|
+
export function deliveryState(facts) {
|
|
31
|
+
const current = currentSelection(facts);
|
|
32
|
+
const stale = [...staleEntries(facts)];
|
|
33
|
+
const candidate = facts.candidates.at(-1) ?? null;
|
|
34
|
+
const candidateCurrent = isCandidateCurrent(facts, current, candidate, stale);
|
|
35
|
+
const qa = facts.qa.filter((entry) => entry.candidateId === candidate?.candidateId).at(-1) ?? null;
|
|
36
|
+
const qaEffective = qa !== null && qa.runId !== undefined && qa.activationId !== undefined && candidateCurrent;
|
|
37
|
+
return {
|
|
38
|
+
selectionRevision: current?.revision ?? 0,
|
|
39
|
+
stale,
|
|
40
|
+
candidate,
|
|
41
|
+
candidateCurrent,
|
|
42
|
+
qa,
|
|
43
|
+
qaEffective,
|
|
44
|
+
repair: {
|
|
45
|
+
failedRounds: facts.qa.filter((entry) => entry.verdict === QaVerdict.Fail).length,
|
|
46
|
+
exhausted: facts.qa.at(-1)?.exhausted === true,
|
|
47
|
+
unresolvedFindings: qaEffective && qa.verdict !== QaVerdict.Pass ? qa.findings : [],
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** DC-24 handoff boundary: QA approval finishes a QA-approved parent but never a merge-required one. */
|
|
52
|
+
export function completionDecision(state, mode) {
|
|
53
|
+
if (state.stale.length > 0)
|
|
54
|
+
return {
|
|
55
|
+
complete: false,
|
|
56
|
+
reason: `Stale results need reverification: ${state.stale.join(', ')}`,
|
|
57
|
+
};
|
|
58
|
+
if (state.candidate === null || !state.candidateCurrent)
|
|
59
|
+
return { complete: false, reason: 'No current candidate has been recorded for the selection' };
|
|
60
|
+
if (state.qa === null || !state.qaEffective)
|
|
61
|
+
return { complete: false, reason: 'The current candidate has no QA result' };
|
|
62
|
+
if (state.qa.verdict !== QaVerdict.Pass)
|
|
63
|
+
return { complete: false, reason: `QA verdict is ${state.qa.verdict}` };
|
|
64
|
+
if (mode === DeliveryCompletion.MergeRequired)
|
|
65
|
+
return {
|
|
66
|
+
complete: false,
|
|
67
|
+
reason: 'Governed integration is required and its gates are not satisfied',
|
|
68
|
+
};
|
|
69
|
+
return { complete: true };
|
|
70
|
+
}
|
|
71
|
+
function isCandidateCurrent(facts, current, candidate, stale) {
|
|
72
|
+
return (candidate !== null &&
|
|
73
|
+
current !== undefined &&
|
|
74
|
+
candidate.selectionRevision === current?.revision &&
|
|
75
|
+
stale.length === 0 &&
|
|
76
|
+
requirements(facts.reservations).every((requirement) => current.entries.some((entry) => entryKey(entry, entry.output.name) === entryKey(requirement, requirement.outputName))));
|
|
77
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DelegatedAssignment } from '../contracts/delegation.js';
|
|
2
|
+
import { type Child, type DeliveryFacts } from './delivery-facts.js';
|
|
3
|
+
/** The original must be a required assignment of this delivery, never another replacement. */
|
|
4
|
+
export declare function originalOf(facts: DeliveryFacts, replaces: NonNullable<DelegatedAssignment['replaces']>): Child;
|
|
5
|
+
/**
|
|
6
|
+
* A corrective child keeps the original acceptance criteria, repository and outputs. When the
|
|
7
|
+
* original contribution is unmerged it must be the starting point, aimed at the intended base.
|
|
8
|
+
*/
|
|
9
|
+
export declare function assertCriteriaPreserving(facts: DeliveryFacts, original: Child, assignment: DelegatedAssignment): void;
|