@sublang/playbook 15.1.0 → 16.0.0
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/docs/embedding.md +2 -2
- package/package.json +1 -1
- package/reference/sdlc/branch.playbook/branch.fsm.d.ts +63 -33
- package/reference/sdlc/branch.playbook/branch.fsm.js +190 -108
- package/reference/sdlc/branch.playbook/branch.fsm.ts +269 -147
- package/reference/sdlc/branch.playbook/branch.gears.md +7 -17
- package/reference/sdlc/branch.playbook/branch.playbook.d.ts +12 -16
- package/reference/sdlc/branch.playbook/branch.playbook.js +112 -101
- package/reference/sdlc/branch.playbook/branch.playbook.ts +128 -171
- package/reference/sdlc/branch.playbook/branch.registry.d.ts +3 -2
- package/reference/sdlc/branch.playbook/branch.registry.ts +6 -2
- package/reference/sdlc/code.playbook/code.fsm.d.ts +143 -90
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +8 -8
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +13 -13
- package/reference/sdlc/code.playbook/code.fsm.js +609 -649
- package/reference/sdlc/code.playbook/code.fsm.ts +890 -821
- package/reference/sdlc/code.playbook/code.gears.md +39 -29
- package/reference/sdlc/code.playbook/code.playbook.d.ts +13 -16
- package/reference/sdlc/code.playbook/code.playbook.js +166 -147
- package/reference/sdlc/code.playbook/code.playbook.ts +180 -229
- package/reference/sdlc/code.playbook/code.registry.d.ts +3 -2
- package/reference/sdlc/code.playbook/code.registry.ts +6 -2
- package/reference/sdlc/code.playbook/playbook-captain.d.ts +42 -0
- package/reference/sdlc/code.playbook/playbook-captain.js +829 -194
- package/reference/sdlc/code.playbook/playbook-captain.ts +1227 -220
- package/reference/sdlc/decide.md +1 -0
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +270 -154
- package/reference/sdlc/decide.playbook/decide.fsm.js +765 -732
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1167 -945
- package/reference/sdlc/decide.playbook/decide.gears.md +28 -21
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -59
- package/reference/sdlc/decide.playbook/decide.playbook.js +155 -3696
- package/reference/sdlc/decide.playbook/decide.playbook.ts +186 -5244
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +8 -4
- package/reference/sdlc/decide.playbook/decide.registry.js +2 -2
- package/reference/sdlc/decide.playbook/decide.registry.ts +13 -6
- package/reference/sdlc/dev.playbook/dev.fsm.d.ts +113 -131
- package/reference/sdlc/dev.playbook/dev.fsm.js +517 -575
- package/reference/sdlc/dev.playbook/dev.fsm.ts +667 -787
- package/reference/sdlc/dev.playbook/dev.gears.md +52 -54
- package/reference/sdlc/dev.playbook/dev.playbook.d.ts +13 -10
- package/reference/sdlc/dev.playbook/dev.playbook.js +128 -120
- package/reference/sdlc/dev.playbook/dev.playbook.ts +143 -193
- package/reference/sdlc/dev.playbook/dev.registry.d.ts +3 -2
- package/reference/sdlc/dev.playbook/dev.registry.ts +6 -2
- package/reference/sdlc/pr.playbook/pr.fsm.d.ts +92 -85
- package/reference/sdlc/pr.playbook/pr.fsm.js +461 -518
- package/reference/sdlc/pr.playbook/pr.fsm.ts +533 -663
- package/reference/sdlc/pr.playbook/pr.gears.md +47 -63
- package/reference/sdlc/pr.playbook/pr.playbook.d.ts +13 -23
- package/reference/sdlc/pr.playbook/pr.playbook.js +118 -112
- package/reference/sdlc/pr.playbook/pr.playbook.ts +136 -190
- package/reference/sdlc/pr.playbook/pr.registry.d.ts +3 -2
- package/reference/sdlc/pr.playbook/pr.registry.ts +4 -2
- package/reference/sdlc/review.md +3 -3
- package/reference/sdlc/review.playbook/review.fsm.d.ts +150 -116
- package/reference/sdlc/review.playbook/review.fsm.js +479 -550
- package/reference/sdlc/review.playbook/review.fsm.ts +717 -662
- package/reference/sdlc/review.playbook/review.gears.md +32 -29
- package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -12
- package/reference/sdlc/review.playbook/review.playbook.js +180 -155
- package/reference/sdlc/review.playbook/review.playbook.ts +190 -230
- package/reference/sdlc/review.playbook/review.registry.d.ts +6 -5
- package/reference/sdlc/review.playbook/review.registry.js +3 -3
- package/reference/sdlc/review.playbook/review.registry.ts +9 -5
- package/slc/gears2fsm.md +72 -3
- package/slc/link.md +50 -27
- package/slc/materialize-link.mjs +51 -13
- package/slc/optimize.md +4 -1
- package/slc/prefix-prompts.mjs +29 -28
- package/slc/prefix.md +27 -24
- package/slc/slc.pin-inputs.json +11 -2
- package/slc/text2gears.md +71 -11
- package/src/xstate-playbook-runtime.d.ts +54 -15
- package/src/xstate-playbook-runtime.js +1154 -248
- package/src/xstate-playbook-runtime.ts +1603 -317
|
@@ -1,92 +1,139 @@
|
|
|
1
|
-
|
|
2
|
-
type
|
|
3
|
-
|
|
1
|
+
/** Canonical lowercase local ids of the source roles Coder and Reviewer. */
|
|
2
|
+
export type ReviewRole = 'coder' | 'reviewer';
|
|
3
|
+
/** One role-id array per parallel group; REVIEW declares no parallel group. */
|
|
4
|
+
export declare const concurrentRoleSets: readonly (readonly ReviewRole[])[];
|
|
5
|
+
/** Delegated-player working leaves (REVIEW-1 through REVIEW-4). */
|
|
6
|
+
export type WorkingStateId = 'firstReview' | 'fixFindings' | 'reviewAfterFix' | 'reviewAfterRejection';
|
|
7
|
+
/** Working leaves that may suspend for, and resume from, a Boss reply. */
|
|
8
|
+
export type ResumableStateId = WorkingStateId;
|
|
9
|
+
/** Root `BOSS_INTERRUPT` targets. */
|
|
10
|
+
export type JumpableStateId = WorkingStateId;
|
|
11
|
+
export type ReviewSourceItem = 'REVIEW-1' | 'REVIEW-2' | 'REVIEW-3' | 'REVIEW-4';
|
|
12
|
+
/** Coder's accepted disposition of the latest findings. */
|
|
13
|
+
export type CoderOutcome = 'committed' | 'rejectedAll';
|
|
4
14
|
export interface PendingBossQuestion {
|
|
5
|
-
questionId: ResumableStateId;
|
|
6
|
-
resumeStateId: ResumableStateId;
|
|
7
|
-
sourceItem:
|
|
8
|
-
asker: {
|
|
15
|
+
readonly questionId: ResumableStateId;
|
|
16
|
+
readonly resumeStateId: ResumableStateId;
|
|
17
|
+
readonly sourceItem: ReviewSourceItem;
|
|
18
|
+
readonly asker: {
|
|
9
19
|
readonly kind: 'role';
|
|
10
|
-
readonly roleId:
|
|
20
|
+
readonly roleId: ReviewRole;
|
|
11
21
|
};
|
|
12
|
-
question: string;
|
|
22
|
+
readonly question: string;
|
|
13
23
|
}
|
|
24
|
+
interface PlayerInputBase {
|
|
25
|
+
/** The source item's full final prompt, verbatim. */
|
|
26
|
+
readonly prompt: string;
|
|
27
|
+
/** This state's local result contract: guard name → description. */
|
|
28
|
+
readonly result: Readonly<Record<string, string>>;
|
|
29
|
+
/** `<caller-input>`: the caller's complete review request. */
|
|
30
|
+
readonly callerInput?: string;
|
|
31
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
32
|
+
readonly bossReply?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface FirstReviewPlayerInput extends PlayerInputBase {
|
|
35
|
+
readonly stateId: 'firstReview';
|
|
36
|
+
readonly role: 'reviewer';
|
|
37
|
+
readonly sourceItem: 'REVIEW-1';
|
|
38
|
+
}
|
|
39
|
+
export interface FixFindingsPlayerInput extends PlayerInputBase {
|
|
40
|
+
readonly stateId: 'fixFindings';
|
|
41
|
+
readonly role: 'coder';
|
|
42
|
+
readonly sourceItem: 'REVIEW-2';
|
|
43
|
+
/** `<reviewer-output>`: Reviewer's verbatim final text of the latest round. */
|
|
44
|
+
readonly reviewerOutput?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ReviewAfterFixPlayerInput extends PlayerInputBase {
|
|
47
|
+
readonly stateId: 'reviewAfterFix';
|
|
48
|
+
readonly role: 'reviewer';
|
|
49
|
+
readonly sourceItem: 'REVIEW-3';
|
|
50
|
+
/** `<latest-commit>`: the receipt-owned latest review-fix commit. */
|
|
51
|
+
readonly latestCommit?: string;
|
|
52
|
+
/** `<coder-output>`: Coder's verbatim final text of the latest fix round. */
|
|
53
|
+
readonly coderOutput?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface ReviewAfterRejectionPlayerInput extends PlayerInputBase {
|
|
56
|
+
readonly stateId: 'reviewAfterRejection';
|
|
57
|
+
readonly role: 'reviewer';
|
|
58
|
+
readonly sourceItem: 'REVIEW-4';
|
|
59
|
+
/** `<coder-output>`: Coder's verbatim final text of the latest fix round. */
|
|
60
|
+
readonly coderOutput?: string;
|
|
61
|
+
}
|
|
62
|
+
export type PlayerInput = FirstReviewPlayerInput | FixFindingsPlayerInput | ReviewAfterFixPlayerInput | ReviewAfterRejectionPlayerInput;
|
|
63
|
+
export type NeedsBossReplyOutput = {
|
|
64
|
+
readonly guard: 'needsBossReply';
|
|
65
|
+
readonly question: string;
|
|
66
|
+
};
|
|
67
|
+
/** Reviewer outcomes (REVIEW-1, REVIEW-3, REVIEW-4). */
|
|
68
|
+
export type ReviewerOutput = {
|
|
69
|
+
readonly guard: 'hasFindings';
|
|
70
|
+
readonly reviewerOutput: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly guard: 'noFindings';
|
|
73
|
+
/** Effect-owned: the exact revision taken from repository authority. */
|
|
74
|
+
readonly evaluatedRevision: string;
|
|
75
|
+
} | NeedsBossReplyOutput;
|
|
76
|
+
/** Coder outcomes (REVIEW-2). */
|
|
77
|
+
export type CoderOutput = {
|
|
78
|
+
readonly guard: 'committed';
|
|
79
|
+
readonly coderOutput: string;
|
|
80
|
+
/** Effect-owned: the runtime fills it from the repository receipt. */
|
|
81
|
+
readonly latestCommit: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly guard: 'rejectedAll';
|
|
84
|
+
readonly coderOutput: string;
|
|
85
|
+
} | NeedsBossReplyOutput;
|
|
86
|
+
export type PlayerOutput = ReviewerOutput | CoderOutput;
|
|
87
|
+
export interface ErrorRecord {
|
|
88
|
+
readonly name: string;
|
|
89
|
+
readonly message: string;
|
|
90
|
+
readonly stack?: string;
|
|
91
|
+
}
|
|
92
|
+
/** Public output interface of the packaged builtin `review`. */
|
|
14
93
|
export interface ReviewOutput {
|
|
15
|
-
noUnsettledFindings: true;
|
|
16
|
-
|
|
17
|
-
* Exact receipt-derived repository revision at which the review scope was
|
|
18
|
-
* evaluated: the closing clean round's `unchanged` receipt observes it as
|
|
19
|
-
* HEAD — the last review-fix commit when one landed, or the caller-supplied
|
|
20
|
-
* scope revision when none did (DR-045).
|
|
21
|
-
*/
|
|
22
|
-
evaluatedRevision: string;
|
|
94
|
+
readonly noUnsettledFindings: true;
|
|
95
|
+
readonly evaluatedRevision: string;
|
|
23
96
|
}
|
|
24
|
-
|
|
97
|
+
/** The machine reads no input: the caller input arrives on `START_REVIEW`. */
|
|
98
|
+
export type ReviewInput = Readonly<Record<never, never>>;
|
|
25
99
|
export interface ReviewContext {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
100
|
+
/** `<caller-input>`: the caller's intent, review scope, and context. */
|
|
101
|
+
readonly callerInput?: string;
|
|
102
|
+
/** `<reviewer-output>`: Reviewer's verbatim final text with findings. */
|
|
103
|
+
readonly reviewerOutput?: string;
|
|
104
|
+
/** `<coder-output>`: Coder's verbatim final text of the latest fix round. */
|
|
105
|
+
readonly coderOutput?: string;
|
|
106
|
+
/** `<latest-commit>`: the accepted, receipt-owned latest review-fix commit. */
|
|
107
|
+
readonly latestCommit?: string;
|
|
108
|
+
/** Coder's accepted disposition of the latest findings. */
|
|
109
|
+
readonly coderOutcome?: CoderOutcome;
|
|
110
|
+
/** Revision evaluated by the clean review round that ended REVIEW. */
|
|
111
|
+
readonly evaluatedRevision?: string;
|
|
112
|
+
readonly lastError?: ErrorRecord;
|
|
113
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
114
|
+
readonly bossReply?: string;
|
|
36
115
|
}
|
|
37
116
|
export type ReviewEvent = {
|
|
38
|
-
type: 'START_REVIEW';
|
|
39
|
-
callerInput: string;
|
|
117
|
+
readonly type: 'START_REVIEW';
|
|
118
|
+
readonly callerInput: string;
|
|
40
119
|
} | {
|
|
41
|
-
type: 'BOSS_INTERRUPT';
|
|
42
|
-
targetId: JumpableStateId;
|
|
43
|
-
bossIntent: string;
|
|
120
|
+
readonly type: 'BOSS_INTERRUPT';
|
|
121
|
+
readonly targetId: JumpableStateId;
|
|
44
122
|
} | {
|
|
45
|
-
type: 'BOSS_REPLY';
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
export interface PlayerInput {
|
|
50
|
-
stateId: ResumableStateId;
|
|
51
|
-
sourceItem: `REVIEW-${1 | 2 | 3 | 4}`;
|
|
52
|
-
role: Role;
|
|
53
|
-
prompt: string;
|
|
54
|
-
result: Readonly<Record<string, string>>;
|
|
55
|
-
callerInput?: string;
|
|
56
|
-
reviewerOutput?: string;
|
|
57
|
-
coderOutput?: string;
|
|
58
|
-
latestCommit?: string;
|
|
59
|
-
pendingBossQuestion?: PendingBossQuestion;
|
|
60
|
-
bossReply?: string;
|
|
61
|
-
}
|
|
62
|
-
export type PlayerOutput = {
|
|
63
|
-
guard: 'hasFindings';
|
|
64
|
-
reviewerOutput: string;
|
|
65
|
-
} | {
|
|
66
|
-
guard: 'noFindings';
|
|
67
|
-
evaluatedRevision: string;
|
|
68
|
-
} | {
|
|
69
|
-
guard: 'committed';
|
|
70
|
-
coderOutput: string;
|
|
71
|
-
latestCommit: string;
|
|
72
|
-
} | {
|
|
73
|
-
guard: 'rejectedAll';
|
|
74
|
-
coderOutput: string;
|
|
75
|
-
} | {
|
|
76
|
-
guard: 'needsBossReply';
|
|
77
|
-
question: string;
|
|
123
|
+
readonly type: 'BOSS_REPLY';
|
|
124
|
+
readonly answer: string;
|
|
125
|
+
readonly questionId?: ResumableStateId;
|
|
78
126
|
};
|
|
79
127
|
export declare const reviewMachine: import("xstate").StateMachine<ReviewContext, {
|
|
80
|
-
type: "START_REVIEW";
|
|
81
|
-
callerInput: string;
|
|
128
|
+
readonly type: "START_REVIEW";
|
|
129
|
+
readonly callerInput: string;
|
|
82
130
|
} | {
|
|
83
|
-
type: "BOSS_INTERRUPT";
|
|
84
|
-
targetId: JumpableStateId;
|
|
85
|
-
bossIntent: string;
|
|
131
|
+
readonly type: "BOSS_INTERRUPT";
|
|
132
|
+
readonly targetId: JumpableStateId;
|
|
86
133
|
} | {
|
|
87
|
-
type: "BOSS_REPLY";
|
|
88
|
-
|
|
89
|
-
|
|
134
|
+
readonly type: "BOSS_REPLY";
|
|
135
|
+
readonly answer: string;
|
|
136
|
+
readonly questionId?: ResumableStateId;
|
|
90
137
|
}, {
|
|
91
138
|
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
92
139
|
}, {
|
|
@@ -104,88 +151,75 @@ export declare const reviewMachine: import("xstate").StateMachine<ReviewContext,
|
|
|
104
151
|
type: "rememberActorError";
|
|
105
152
|
params: import("xstate").NonReducibleUnknown;
|
|
106
153
|
} | {
|
|
107
|
-
type: "
|
|
108
|
-
params: import("xstate").NonReducibleUnknown;
|
|
109
|
-
} | {
|
|
110
|
-
type: "rememberEmptyBossReplyError";
|
|
154
|
+
type: "resetForInterrupt";
|
|
111
155
|
params: import("xstate").NonReducibleUnknown;
|
|
112
156
|
} | {
|
|
113
|
-
type: "
|
|
157
|
+
type: "rememberBossReply";
|
|
114
158
|
params: import("xstate").NonReducibleUnknown;
|
|
115
159
|
} | {
|
|
116
|
-
type: "
|
|
160
|
+
type: "rememberMalformedPlayerOutput";
|
|
117
161
|
params: import("xstate").NonReducibleUnknown;
|
|
118
162
|
} | {
|
|
119
|
-
type: "
|
|
163
|
+
type: "clearBossReplyContext";
|
|
120
164
|
params: import("xstate").NonReducibleUnknown;
|
|
121
165
|
} | {
|
|
122
|
-
type: "
|
|
123
|
-
params:
|
|
166
|
+
type: "setPendingBossQuestion";
|
|
167
|
+
params: {
|
|
168
|
+
readonly resumeStateId: ResumableStateId;
|
|
169
|
+
};
|
|
124
170
|
} | {
|
|
125
|
-
type: "
|
|
171
|
+
type: "rememberMalformedBossReply";
|
|
126
172
|
params: import("xstate").NonReducibleUnknown;
|
|
127
173
|
} | {
|
|
128
|
-
type: "
|
|
174
|
+
type: "startReview";
|
|
129
175
|
params: import("xstate").NonReducibleUnknown;
|
|
130
176
|
} | {
|
|
131
|
-
type: "
|
|
177
|
+
type: "rememberFindings";
|
|
132
178
|
params: import("xstate").NonReducibleUnknown;
|
|
133
179
|
} | {
|
|
134
|
-
type: "
|
|
180
|
+
type: "rememberCoderDisposition";
|
|
135
181
|
params: import("xstate").NonReducibleUnknown;
|
|
136
182
|
} | {
|
|
137
|
-
type: "
|
|
183
|
+
type: "rememberEvaluatedRevision";
|
|
138
184
|
params: import("xstate").NonReducibleUnknown;
|
|
139
185
|
}, {
|
|
140
|
-
type: "needsBossReply";
|
|
141
|
-
params: unknown;
|
|
142
|
-
} | {
|
|
143
186
|
type: "emptyBossReply";
|
|
144
187
|
params: unknown;
|
|
145
188
|
} | {
|
|
146
|
-
type: "
|
|
147
|
-
params: unknown;
|
|
148
|
-
} | {
|
|
149
|
-
type: "noFindings";
|
|
150
|
-
params: unknown;
|
|
151
|
-
} | {
|
|
152
|
-
type: "committed";
|
|
153
|
-
params: unknown;
|
|
154
|
-
} | {
|
|
155
|
-
type: "rejectedAll";
|
|
189
|
+
type: "validStartReview";
|
|
156
190
|
params: unknown;
|
|
157
191
|
} | {
|
|
158
|
-
type: "
|
|
192
|
+
type: "acceptHasFindings";
|
|
159
193
|
params: unknown;
|
|
160
194
|
} | {
|
|
161
|
-
type: "
|
|
195
|
+
type: "acceptNoFindings";
|
|
162
196
|
params: unknown;
|
|
163
197
|
} | {
|
|
164
|
-
type: "
|
|
198
|
+
type: "acceptCommitted";
|
|
165
199
|
params: unknown;
|
|
166
200
|
} | {
|
|
167
|
-
type: "
|
|
201
|
+
type: "acceptRejectedAll";
|
|
168
202
|
params: unknown;
|
|
169
203
|
} | {
|
|
170
|
-
type: "
|
|
204
|
+
type: "acceptNeedsBossReply";
|
|
171
205
|
params: unknown;
|
|
172
|
-
}, never, "done" | "failed" | "ready" | "awaitBossReply" | "
|
|
206
|
+
}, never, "done" | "failed" | "ready" | "awaitBossReply" | "firstReview" | "fixFindings" | "reviewAfterFix" | "reviewAfterRejection", string, Readonly<Record<never, never>>, ReviewOutput, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
173
207
|
id: "review";
|
|
174
208
|
states: {
|
|
175
209
|
readonly ready: {
|
|
176
210
|
id: "ready";
|
|
177
211
|
};
|
|
178
|
-
readonly
|
|
179
|
-
id: "
|
|
212
|
+
readonly firstReview: {
|
|
213
|
+
id: "firstReview";
|
|
180
214
|
};
|
|
181
|
-
readonly
|
|
182
|
-
id: "
|
|
215
|
+
readonly fixFindings: {
|
|
216
|
+
id: "fixFindings";
|
|
183
217
|
};
|
|
184
|
-
readonly
|
|
185
|
-
id: "
|
|
218
|
+
readonly reviewAfterFix: {
|
|
219
|
+
id: "reviewAfterFix";
|
|
186
220
|
};
|
|
187
|
-
readonly
|
|
188
|
-
id: "
|
|
221
|
+
readonly reviewAfterRejection: {
|
|
222
|
+
id: "reviewAfterRejection";
|
|
189
223
|
};
|
|
190
224
|
readonly awaitBossReply: {
|
|
191
225
|
id: "awaitBossReply";
|
|
@@ -198,4 +232,4 @@ export declare const reviewMachine: import("xstate").StateMachine<ReviewContext,
|
|
|
198
232
|
};
|
|
199
233
|
};
|
|
200
234
|
}>;
|
|
201
|
-
export
|
|
235
|
+
export default reviewMachine;
|