codex-workflow-v2 2.0.0-alpha.4 → 2.0.0-alpha.6
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 +86 -10
- package/dist/src/alpha6/adoption.d.ts +55 -0
- package/dist/src/alpha6/adoption.js +920 -0
- package/dist/src/alpha6/adoption.js.map +1 -0
- package/dist/src/alpha6/handoff.d.ts +39 -0
- package/dist/src/alpha6/handoff.js +975 -0
- package/dist/src/alpha6/handoff.js.map +1 -0
- package/dist/src/alpha6/journal.d.ts +30 -0
- package/dist/src/alpha6/journal.js +369 -0
- package/dist/src/alpha6/journal.js.map +1 -0
- package/dist/src/alpha6/milestone.d.ts +49 -0
- package/dist/src/alpha6/milestone.js +1049 -0
- package/dist/src/alpha6/milestone.js.map +1 -0
- package/dist/src/alpha6/plan-risk.d.ts +32 -0
- package/dist/src/alpha6/plan-risk.js +847 -0
- package/dist/src/alpha6/plan-risk.js.map +1 -0
- package/dist/src/alpha6/remediation.d.ts +20 -0
- package/dist/src/alpha6/remediation.js +748 -0
- package/dist/src/alpha6/remediation.js.map +1 -0
- package/dist/src/alpha6/review.d.ts +46 -0
- package/dist/src/alpha6/review.js +785 -0
- package/dist/src/alpha6/review.js.map +1 -0
- package/dist/src/alpha6/store-sidecars.d.ts +35 -0
- package/dist/src/alpha6/store-sidecars.js +281 -0
- package/dist/src/alpha6/store-sidecars.js.map +1 -0
- package/dist/src/cli.js +88 -19
- package/dist/src/cli.js.map +1 -1
- package/dist/src/contracts.d.ts +259 -0
- package/dist/src/git.js +2 -1
- package/dist/src/git.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/reviewer.d.ts +6 -1
- package/dist/src/reviewer.js +145 -32
- package/dist/src/reviewer.js.map +1 -1
- package/dist/src/state/lock.d.ts +1 -0
- package/dist/src/state/lock.js +7 -1
- package/dist/src/state/lock.js.map +1 -1
- package/dist/src/state/store.d.ts +39 -1
- package/dist/src/state/store.js +127 -1
- package/dist/src/state/store.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 +78 -8
- package/dist/src/workflow.js +1312 -74
- package/dist/src/workflow.js.map +1 -1
- package/docs/autonomy-guardrails.md +143 -0
- package/docs/decisions.md +23 -0
- package/docs/delegated-approval.md +30 -5
- package/docs/development-flow.md +40 -1
- package/docs/pdf/codex-workflow-v2-architecture-ru.pdf +155 -136
- package/docs/pdf/codex-workflow-v2-chat-only-guide-ru.pdf +236 -223
- package/docs/pdf/codex-workflow-v2-technical-reference-ru.pdf +225 -206
- package/docs/project-memory.md +7 -0
- package/docs/release.md +7 -0
- package/docs/updating-existing-project.md +53 -5
- package/docs/validation-report.md +47 -34
- package/package.json +1 -1
- package/plugins/codex-workflow-gateway/references/protocol.md +150 -6
- package/plugins/codex-workflow-gateway/skills/codex-workflow-gateway/SKILL.md +16 -1
- package/references/git-policy.md +5 -2
- package/references/state-machine.md +36 -0
- package/references/validation-and-review.md +28 -1
- package/roles/delivery-coordinator.md +11 -0
- package/roles/independent-reviewer.md +3 -0
- package/roles/technical-planner.md +7 -0
- package/roles/worker.md +4 -0
- package/schemas/adoption-posture-event.schema.json +129 -0
- package/schemas/corrective-decision-event.schema.json +55 -0
- package/schemas/corrective-plan-audit.schema.json +20 -0
- package/schemas/milestone-scope-change-event.schema.json +68 -0
- package/schemas/milestone-transaction-journal.schema.json +95 -0
- package/schemas/plan-risk-audit-event.schema.json +90 -0
- package/schemas/remediation-event.schema.json +53 -0
- package/schemas/reviewer-attestation-event.schema.json +49 -0
- package/schemas/step-review-event.schema.json +74 -0
- package/schemas/task-handoff-event.schema.json +116 -0
package/dist/src/workflow.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { type ContextEnvelope, 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 ProjectKnowledgeMap, type ReviewInput, type TaskPlanInput, type TaskState, type WriterLease, type WorkflowRole, type WorkspaceOwner } from './contracts.js';
|
|
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
|
+
import { appendTaskClaim, appendTaskHandback, readTaskC1Posture } from './alpha6/handoff.js';
|
|
3
|
+
import { type AdoptionPreparation } from './alpha6/adoption.js';
|
|
4
|
+
import { type RecordPlanRiskAuditInput } from './alpha6/plan-risk.js';
|
|
2
5
|
import { type RepositoryIdentity } from './repository.js';
|
|
6
|
+
import { type ReviewerCommandRunner } from './reviewer.js';
|
|
3
7
|
import { WriterLockManager } from './state/lock.js';
|
|
4
8
|
import { FileStateStore } from './state/store.js';
|
|
5
9
|
export interface DiscoveryInput {
|
|
@@ -24,6 +28,23 @@ export interface WorkflowContext {
|
|
|
24
28
|
store: FileStateStore;
|
|
25
29
|
locks: WriterLockManager;
|
|
26
30
|
}
|
|
31
|
+
export interface MilestoneScopeChangePreparation {
|
|
32
|
+
milestoneId: string;
|
|
33
|
+
revision: number;
|
|
34
|
+
actor: string;
|
|
35
|
+
candidatePlanHash: string;
|
|
36
|
+
candidateMembershipRevision: number;
|
|
37
|
+
confirmationCodeBindingHash: string;
|
|
38
|
+
confirmationCode: string;
|
|
39
|
+
after: {
|
|
40
|
+
outcome: string;
|
|
41
|
+
successSignal: string;
|
|
42
|
+
acceptance: string[];
|
|
43
|
+
checks: string[];
|
|
44
|
+
taskIds: string[];
|
|
45
|
+
memberships: MilestoneState['memberships'];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
27
48
|
export declare class WorkflowService {
|
|
28
49
|
readonly store: FileStateStore;
|
|
29
50
|
private readonly now;
|
|
@@ -45,34 +66,69 @@ export declare class WorkflowService {
|
|
|
45
66
|
milestoneRoot: string;
|
|
46
67
|
};
|
|
47
68
|
setMilestonePlan(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput): MilestoneState;
|
|
69
|
+
prepareMilestoneScopeChange(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput, actor: string): MilestoneScopeChangePreparation;
|
|
70
|
+
applyMilestoneScopeChange(repository: string, milestoneId: string, expectedRevision: number, plan: MilestonePlanInput, actor: string, confirmationCode: string): MilestoneState;
|
|
48
71
|
authorizeMilestone(repository: string, milestoneId: string, expectedRevision: number, actor: string, reason?: string, delegationGrantId?: string | null): MilestoneState;
|
|
49
72
|
validateMilestone(repository: string, milestoneId: string, expectedRevision: number): MilestoneState;
|
|
50
73
|
acceptMilestone(repository: string, milestoneId: string, expectedRevision: number, actor: string, confirmationCode: string, delegationGrantId?: string | null): MilestoneState;
|
|
51
74
|
cancelMilestone(repository: string, milestoneId: string, expectedRevision: number, reason: string): MilestoneState;
|
|
52
|
-
setTaskPlan(repository: string, taskId: string, expectedRevision: number, plan: TaskPlanInput): TaskState;
|
|
75
|
+
setTaskPlan(repository: string, taskId: string, expectedRevision: number, plan: TaskPlanInput, correctiveAudit?: CorrectivePlanAuditInput | null, planRiskAudit?: RecordPlanRiskAuditInput | null): TaskState;
|
|
53
76
|
rebindTaskKnowledge(repository: string, taskId: string, expectedRevision: number): TaskState;
|
|
77
|
+
refreshTaskContext(repository: string, taskId: string, expectedTaskRevision: number, expectedKnowledgeMapRevision: number, actor: string, delegationGrantId: string | null): TaskContextRefreshResult;
|
|
54
78
|
authorizeTask(repository: string, taskId: string, expectedRevision: number, actor: string, reason?: string, delegationGrantId?: string | null): TaskState;
|
|
79
|
+
recordPlanRiskAudit(repository: string, taskId: string, expectedRevision: number, input: RecordPlanRiskAuditInput): PlanRiskAuditEvent;
|
|
80
|
+
showTaskHandoff(repository: string, taskId: string): {
|
|
81
|
+
task: TaskState;
|
|
82
|
+
posture: ReturnType<typeof readTaskC1Posture>;
|
|
83
|
+
claimTokenAvailable: false;
|
|
84
|
+
};
|
|
85
|
+
handoffTask(repository: string, taskId: string, expectedRevision: number, actor: string, targetActor: string, reason: string, writerToken?: string | null, grantId?: string | null, expiresAt?: string | null): {
|
|
86
|
+
task: TaskState;
|
|
87
|
+
event: import("./contracts.js").TaskHandoffEvent;
|
|
88
|
+
bundle: import("./contracts.js").TaskHandoffBundle;
|
|
89
|
+
};
|
|
90
|
+
claimTask(repository: string, taskId: string, expectedRevision: number, actor: string, claimToken: string, writerToken?: string | null): {
|
|
91
|
+
task: TaskState;
|
|
92
|
+
event: ReturnType<typeof appendTaskClaim>;
|
|
93
|
+
lease: WriterLease;
|
|
94
|
+
};
|
|
95
|
+
handbackTask(repository: string, taskId: string, expectedRevision: number, actor: string, reason: string, writerToken?: string | null, limitations?: readonly string[], recommendedNext?: string): {
|
|
96
|
+
task: TaskState;
|
|
97
|
+
event: ReturnType<typeof appendTaskHandback>;
|
|
98
|
+
};
|
|
55
99
|
startTask(repository: string, taskId: string, expectedRevision: number, workspaceOwner: WorkspaceOwner): TaskState;
|
|
56
|
-
runStep(repository: string, taskId: string, stepId: string, expectedRevision: number,
|
|
100
|
+
runStep(repository: string, taskId: string, stepId: string, expectedRevision: number, actor: string, writerToken: string | null): {
|
|
57
101
|
task: TaskState;
|
|
58
102
|
lease: WriterLease;
|
|
59
103
|
envelope: ContextEnvelope;
|
|
60
104
|
};
|
|
61
105
|
taskContext(repository: string, taskId: string, role: Exclude<WorkflowRole, 'scope-lead' | 'worker'>): ContextEnvelope;
|
|
62
|
-
completeStep(repository: string, taskId: string, stepId: string, expectedRevision: number, writerToken: string, notes: string[]): TaskState;
|
|
63
|
-
|
|
64
|
-
|
|
106
|
+
completeStep(repository: string, taskId: string, stepId: string, expectedRevision: number, writerToken: string, notes: string[], actor?: string): TaskState;
|
|
107
|
+
reviewStep(repository: string, taskId: string, stepId: string, expectedRevision: number, runner?: ReviewerCommandRunner, actor?: string, writerToken?: string | null): TaskState;
|
|
108
|
+
submitTask(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
109
|
+
recordReview(repository: string, taskId: string, expectedRevision: number, review: ReviewInput, actor?: string, writerToken?: string | null): TaskState;
|
|
110
|
+
recordStepCorrectiveDecision(repository: string, taskId: string, stepId: string, expectedRevision: number, correctiveAudit: CorrectivePlanAuditInput, actor?: string, writerToken?: string | null): import("./contracts.js").CorrectiveDecisionEvent;
|
|
65
111
|
setTaskResult(repository: string, taskId: string, expectedRevision: number, summary: string, limitations: string[]): TaskState;
|
|
66
112
|
acceptTask(repository: string, taskId: string, expectedRevision: number, actor: string, delegationGrantId?: string | null): TaskState;
|
|
67
113
|
syncTaskBase(repository: string, taskId: string, expectedRevision: number): TaskState;
|
|
68
|
-
mergeTask(repository: string, taskId: string, expectedRevision: number, writerToken: string): TaskState;
|
|
69
|
-
confirmExternalMerge(repository: string, taskId: string, expectedRevision: number, writerToken: string): TaskState;
|
|
114
|
+
mergeTask(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
115
|
+
confirmExternalMerge(repository: string, taskId: string, expectedRevision: number, writerToken: string, actor?: string): TaskState;
|
|
70
116
|
status(repository: string): {
|
|
71
117
|
projectId: string;
|
|
72
118
|
discoveries: DiscoveryState[];
|
|
73
119
|
tasks: TaskState[];
|
|
74
120
|
milestones: MilestoneState[];
|
|
75
121
|
delegations: DelegationGrant[];
|
|
122
|
+
adoption: AdoptionPreparation;
|
|
123
|
+
};
|
|
124
|
+
recoverMilestoneTransactions(repository: string): {
|
|
125
|
+
projectId: string;
|
|
126
|
+
recoveredMilestoneIds: string[];
|
|
127
|
+
};
|
|
128
|
+
prepareAdoption(repository: string): AdoptionPreparation;
|
|
129
|
+
applyAdoption(repository: string, actor: string, confirmationCode: string): AdoptionPostureEvent;
|
|
130
|
+
updatePreflight(repository: string): UpdatePreflightResult & {
|
|
131
|
+
adoption: AdoptionPreparation;
|
|
76
132
|
};
|
|
77
133
|
scanKnowledgeMap(repository: string): ProjectKnowledgeMap;
|
|
78
134
|
showKnowledgeMap(repository: string): ProjectKnowledgeMap;
|
|
@@ -88,14 +144,28 @@ export declare class WorkflowService {
|
|
|
88
144
|
recordGraphFallback(repository: string, graphKind: GraphKind, mode: GraphMode, expectedRevision: number | null, reason: string): GraphBinding;
|
|
89
145
|
next(repository: string): Record<string, unknown>;
|
|
90
146
|
private delegatedAuthorization;
|
|
147
|
+
private assertHandoffGrant;
|
|
91
148
|
private nextForTaskWithDelegation;
|
|
92
149
|
private delegatedApprovalOptions;
|
|
150
|
+
private delegatedContextRefreshOptions;
|
|
93
151
|
private assertDelegationScopeExists;
|
|
94
152
|
private assertExecutionAuthorizationFresh;
|
|
95
153
|
private assertMilestoneAuthorizationFresh;
|
|
154
|
+
private readMilestoneCurrent;
|
|
155
|
+
private readMilestoneScopeChangeCurrent;
|
|
156
|
+
private listMilestonesCurrent;
|
|
157
|
+
private prepareMilestoneScopeChangeCandidate;
|
|
158
|
+
private proveWriterLeaseTokenForHandoff;
|
|
159
|
+
private proveOptionalWriterLeaseToken;
|
|
160
|
+
private assertTaskMutationAllowedByHandoff;
|
|
96
161
|
private readGraphBindingOrNull;
|
|
97
162
|
private requireActiveKnowledgeMap;
|
|
163
|
+
private inspectAdoptionPreparation;
|
|
164
|
+
private computeAdoptionBoundaryBlockers;
|
|
165
|
+
private collectAdoptionSidecarInventory;
|
|
98
166
|
private assertKnowledgeMapBinding;
|
|
167
|
+
private readCurrentAdoptionPostureStrict;
|
|
168
|
+
private requireExecutionAdoptionPosture;
|
|
99
169
|
private assertTaskKnowledgeBinding;
|
|
100
170
|
private validateKnowledgeTargets;
|
|
101
171
|
private assertReviewFresh;
|