codex-workflow-v2 2.0.0-alpha.6.2 → 2.0.0-alpha.7.1
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 +43 -71
- package/dist/src/alpha6/handoff.d.ts +1 -0
- package/dist/src/alpha6/handoff.js +6 -0
- package/dist/src/alpha6/handoff.js.map +1 -1
- package/dist/src/alpha6/milestone.d.ts +3 -0
- package/dist/src/alpha6/milestone.js +57 -3
- package/dist/src/alpha6/milestone.js.map +1 -1
- package/dist/src/alpha6/plan-risk.js +61 -0
- package/dist/src/alpha6/plan-risk.js.map +1 -1
- package/dist/src/alpha6/remediation.d.ts +4 -20
- package/dist/src/alpha6/remediation.js +73 -150
- package/dist/src/alpha6/remediation.js.map +1 -1
- package/dist/src/alpha7/autonomy.d.ts +61 -0
- package/dist/src/alpha7/autonomy.js +256 -0
- package/dist/src/alpha7/autonomy.js.map +1 -0
- package/dist/src/cli.js +23 -16
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +11 -6
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/state/lock.d.ts +1 -3
- package/dist/src/state/lock.js +2 -5
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/workflow.d.ts +21 -65
- package/dist/src/workflow.js +548 -657
- package/dist/src/workflow.js.map +1 -1
- package/docs/alpha7.1-implementation-brief.md +268 -0
- package/docs/autonomy-guardrails.md +56 -20
- package/docs/decisions.md +16 -4
- package/docs/delegated-approval.md +12 -5
- package/docs/development-flow.md +12 -7
- package/docs/release.md +4 -6
- package/docs/updating-existing-project.md +9 -39
- package/docs/validation-report.md +50 -63
- package/package.json +2 -2
- package/plugins/codex-workflow-gateway/references/protocol.md +53 -17
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +33 -9
- package/references/state-machine.md +31 -13
- package/roles/delivery-coordinator.md +10 -1
- package/roles/technical-planner.md +3 -0
- package/schemas/context-envelope.schema.json +0 -10
- package/schemas/milestone-autonomy-event.schema.json +45 -0
- package/schemas/milestone-scope-change-event.schema.json +3 -1
- package/schemas/plan-risk-audit-event.schema.json +21 -4
- package/schemas/corrective-plan-audit-record.schema.json +0 -47
package/dist/src/workflow.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { type AdoptionPostureEvent, type ContextEnvelope, 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 ProjectKnowledgeMap, type ReviewInput, type TaskPlanInput, type TaskContextRefreshResult, type TaskState, type UpdatePreflightResult, type WriterLease, 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
|
+
import { type ActiveMilestoneAutonomy, type MilestoneAutonomyPreparation } from './alpha7/autonomy.js';
|
|
5
6
|
import { type RepositoryIdentity } from './repository.js';
|
|
6
7
|
import { type ReviewerCommandRunner } from './reviewer.js';
|
|
7
8
|
import { WriterLockManager } from './state/lock.js';
|
|
@@ -45,7 +46,7 @@ export interface MilestoneScopeChangePreparation {
|
|
|
45
46
|
memberships: MilestoneState['memberships'];
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
export interface
|
|
49
|
+
export interface Alpha6StrictReviewRescuePreflight {
|
|
49
50
|
eligible: boolean;
|
|
50
51
|
mutationFree: true;
|
|
51
52
|
runnerPackageVersion: string;
|
|
@@ -54,6 +55,8 @@ export interface Alpha6C1StrictReviewRescuePreflight {
|
|
|
54
55
|
projectId: string;
|
|
55
56
|
repositoryRoot: string;
|
|
56
57
|
clean: boolean;
|
|
58
|
+
activeLeases: WriterLease[];
|
|
59
|
+
staleLeases: WriterLease[];
|
|
57
60
|
candidate: {
|
|
58
61
|
taskId: string;
|
|
59
62
|
taskRevision: number;
|
|
@@ -61,62 +64,20 @@ export interface Alpha6C1StrictReviewRescuePreflight {
|
|
|
61
64
|
completionCommit: string;
|
|
62
65
|
currentHead: string;
|
|
63
66
|
knowledgeBindingStale: boolean;
|
|
64
|
-
claimant: string | null;
|
|
65
|
-
handoffExpiresAt: string | null;
|
|
66
|
-
lease: {
|
|
67
|
-
entityId: string;
|
|
68
|
-
owner: string;
|
|
69
|
-
pid: number;
|
|
70
|
-
hostname: string;
|
|
71
|
-
acquiredAt: string;
|
|
72
|
-
heartbeatAt: string;
|
|
73
|
-
expiresAt: string;
|
|
74
|
-
stale: boolean;
|
|
75
|
-
tokenBound: boolean;
|
|
76
|
-
} | null;
|
|
77
|
-
} | null;
|
|
78
|
-
blockers: string[];
|
|
79
|
-
requiredAction: {
|
|
80
|
-
action: 'update rescue-review';
|
|
81
|
-
taskId: string;
|
|
82
|
-
stepId: string;
|
|
83
|
-
expectedRevision: number;
|
|
84
|
-
actor: string;
|
|
85
|
-
requiresBoundWriterToken: true;
|
|
86
|
-
} | null;
|
|
87
|
-
}
|
|
88
|
-
export interface Alpha6CorrectiveRescuePreflight {
|
|
89
|
-
eligible: boolean;
|
|
90
|
-
mutationFree: true;
|
|
91
|
-
runnerPackageVersion: string;
|
|
92
|
-
requiredProjectPackageVersion: '2.0.0-alpha.6';
|
|
93
|
-
declaredProjectPackageVersion: string | null;
|
|
94
|
-
requiredHead: string;
|
|
95
|
-
currentHead: string;
|
|
96
|
-
clean: boolean;
|
|
97
|
-
candidate: {
|
|
98
|
-
taskId: string;
|
|
99
|
-
taskRevision: 14;
|
|
100
|
-
taskStatus: 'ready';
|
|
101
|
-
stepId: 'STEP-001';
|
|
102
|
-
stepStatus: 'failed';
|
|
103
|
-
attemptCount: 2;
|
|
104
|
-
briefHash: string;
|
|
105
|
-
planHash: string;
|
|
106
|
-
claimant: string;
|
|
107
|
-
lease: Omit<WriterLease, 'token'> & {
|
|
108
|
-
stale: boolean;
|
|
109
|
-
tokenBound: true;
|
|
110
|
-
};
|
|
111
|
-
milestoneScopeHash: string | null;
|
|
112
67
|
} | null;
|
|
113
68
|
blockers: string[];
|
|
69
|
+
requiredActions: Array<{
|
|
70
|
+
action: 'locks repair' | 'task step-review';
|
|
71
|
+
entityId?: string;
|
|
72
|
+
taskId?: string;
|
|
73
|
+
stepId?: string;
|
|
74
|
+
expectedRevision?: number;
|
|
75
|
+
}>;
|
|
114
76
|
}
|
|
115
77
|
export declare class WorkflowService {
|
|
116
78
|
readonly store: FileStateStore;
|
|
117
79
|
private readonly now;
|
|
118
|
-
|
|
119
|
-
constructor(store?: FileStateStore, now?: () => Date, alpha6CorrectiveRescueHead?: string);
|
|
80
|
+
constructor(store?: FileStateStore, now?: () => Date);
|
|
120
81
|
context(repository: string): WorkflowContext;
|
|
121
82
|
prepareDelegation(repository: string, input: DelegationPolicyInput): DelegationGrantGate;
|
|
122
83
|
grantDelegation(repository: string, input: DelegationPolicyInput, confirmationCode: string): DelegationGrant;
|
|
@@ -136,6 +97,9 @@ export declare class WorkflowService {
|
|
|
136
97
|
setMilestonePlan(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput): MilestoneState;
|
|
137
98
|
prepareMilestoneScopeChange(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput, actor: string): MilestoneScopeChangePreparation;
|
|
138
99
|
applyMilestoneScopeChange(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput, actor: string, confirmationCode: string): MilestoneState;
|
|
100
|
+
prepareMilestoneAutonomy(repository: string, milestoneId: string, expectedRevision: number, principal: string, delegate: string, expiresAt: string): MilestoneAutonomyPreparation;
|
|
101
|
+
grantMilestoneAutonomy(repository: string, milestoneId: string, expectedRevision: number, principal: string, delegate: string, expiresAt: string, confirmationCode: string): ActiveMilestoneAutonomy;
|
|
102
|
+
evolveMilestonePlanAutonomously(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput, actor: string): MilestoneState;
|
|
139
103
|
authorizeMilestone(repository: string, milestoneId: string, expectedRevision: number, actor: string, reason?: string, delegationGrantId?: string | null): MilestoneState;
|
|
140
104
|
validateMilestone(repository: string, milestoneId: string, expectedRevision: number): MilestoneState;
|
|
141
105
|
acceptMilestone(repository: string, milestoneId: string, expectedRevision: number, actor: string, confirmationCode: string, delegationGrantId?: string | null): MilestoneState;
|
|
@@ -170,15 +134,12 @@ export declare class WorkflowService {
|
|
|
170
134
|
lease: WriterLease;
|
|
171
135
|
envelope: ContextEnvelope;
|
|
172
136
|
};
|
|
173
|
-
taskContext(repository: string, taskId: string, role: Exclude<WorkflowRole, 'scope-lead' | 'worker'
|
|
137
|
+
taskContext(repository: string, taskId: string, role: Exclude<WorkflowRole, 'scope-lead' | 'worker'>): ContextEnvelope;
|
|
174
138
|
completeStep(repository: string, taskId: string, stepId: string, expectedRevision: number, writerToken: string, notes: string[], actor?: string): TaskState;
|
|
175
|
-
alpha6C1StrictReviewRescuePreflight(repository: string): Alpha6C1StrictReviewRescuePreflight;
|
|
176
|
-
alpha6C1StrictReviewRescue(repository: string, taskId: string, stepId: string, expectedRevision: number, actor: string, writerToken: string, runner?: ReviewerCommandRunner): TaskState;
|
|
177
139
|
reviewStep(repository: string, taskId: string, stepId: string, expectedRevision: number, runner?: ReviewerCommandRunner, actor?: string, writerToken?: string | null): TaskState;
|
|
178
|
-
private reviewStepWithKnowledgePolicy;
|
|
179
140
|
submitTask(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
180
141
|
recordReview(repository: string, taskId: string, expectedRevision: number, review: ReviewInput, actor?: string, writerToken?: string | null): TaskState;
|
|
181
|
-
recordStepCorrectiveDecision(repository: string, taskId: string, stepId: string, expectedRevision: number, correctiveAudit: CorrectivePlanAuditInput, actor?: string, writerToken?: string | null): CorrectiveDecisionEvent;
|
|
142
|
+
recordStepCorrectiveDecision(repository: string, taskId: string, stepId: string, expectedRevision: number, correctiveAudit: CorrectivePlanAuditInput, actor?: string, writerToken?: string | null): import("./contracts.js").CorrectiveDecisionEvent;
|
|
182
143
|
setTaskResult(repository: string, taskId: string, expectedRevision: number, summary: string, limitations: string[]): TaskState;
|
|
183
144
|
acceptTask(repository: string, taskId: string, expectedRevision: number, actor: string, delegationGrantId?: string | null): TaskState;
|
|
184
145
|
syncTaskBase(repository: string, taskId: string, expectedRevision: number): TaskState;
|
|
@@ -201,18 +162,12 @@ export declare class WorkflowService {
|
|
|
201
162
|
updatePreflight(repository: string): UpdatePreflightResult & {
|
|
202
163
|
adoption: AdoptionPreparation;
|
|
203
164
|
};
|
|
204
|
-
|
|
205
|
-
alpha6CorrectiveRescueApply(repository: string, taskId: string, expectedRevision: number, actor: string, writerToken: string, plan: TaskPlanInput, decisionAudit: CorrectivePlanAuditInput, correctivePlanAudit: CorrectivePlanAuditInput): {
|
|
206
|
-
task: TaskState;
|
|
207
|
-
decision: CorrectiveDecisionEvent;
|
|
208
|
-
lease: Omit<WriterLease, 'token'> & {
|
|
209
|
-
tokenRetained: true;
|
|
210
|
-
};
|
|
211
|
-
};
|
|
165
|
+
alpha6StrictReviewRescuePreflight(repository: string): Alpha6StrictReviewRescuePreflight;
|
|
212
166
|
scanKnowledgeMap(repository: string): ProjectKnowledgeMap;
|
|
213
167
|
showKnowledgeMap(repository: string): ProjectKnowledgeMap;
|
|
214
168
|
knowledgeMapStatus(repository: string): ProjectKnowledgeMap;
|
|
215
169
|
approveKnowledgeMap(repository: string, expectedRevision: number, selections: KnowledgeSelection[], actor: string, delegationGrantId?: string | null): ProjectKnowledgeMap;
|
|
170
|
+
private approveKnowledgeMapForTaskRefresh;
|
|
216
171
|
reconcileKnowledgeMap(repository: string, expectedRevision: number): ProjectKnowledgeMap;
|
|
217
172
|
graphRefreshRequest(repository: string, graphKind: GraphKind, mode?: GraphMode): GraphRefreshRequest;
|
|
218
173
|
graphStatus(repository: string, graphKind: GraphKind, mode?: GraphMode): {
|
|
@@ -227,6 +182,7 @@ export declare class WorkflowService {
|
|
|
227
182
|
private nextForTaskWithDelegation;
|
|
228
183
|
private delegatedApprovalOptions;
|
|
229
184
|
private delegatedContextRefreshOptions;
|
|
185
|
+
private assertPlanBoundedSupportingSourceGrant;
|
|
230
186
|
private assertDelegationScopeExists;
|
|
231
187
|
private assertExecutionAuthorizationFresh;
|
|
232
188
|
private assertMilestoneAuthorizationFresh;
|