@sublang/playbook 5.0.0 → 6.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/README.md +11 -7
- package/docs/cli.md +38 -35
- package/docs/configuration.md +58 -15
- package/docs/embedding.md +24 -16
- package/package.json +40 -21
- package/reference/sdlc/captain.playbook/captain.playbook.js +2 -0
- package/reference/sdlc/captain.playbook/captain.playbook.ts +2 -0
- package/reference/sdlc/code.md +55 -97
- package/reference/sdlc/code.playbook/code.fsm.d.ts +229 -94
- package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +26 -44
- package/reference/sdlc/code.playbook/code.fsm.introspect.js +61 -66
- package/reference/sdlc/code.playbook/code.fsm.introspect.ts +100 -149
- package/reference/sdlc/code.playbook/code.fsm.js +587 -1347
- package/reference/sdlc/code.playbook/code.fsm.ts +809 -1650
- package/reference/sdlc/code.playbook/code.gears.md +51 -263
- package/reference/sdlc/code.playbook/code.playbook.d.ts +8 -47
- package/reference/sdlc/code.playbook/code.playbook.js +69 -656
- package/reference/sdlc/code.playbook/code.playbook.ts +90 -867
- package/reference/sdlc/code.playbook/code.registry.d.ts +9 -25
- package/reference/sdlc/code.playbook/code.registry.js +20 -78
- package/reference/sdlc/code.playbook/code.registry.ts +58 -122
- package/reference/sdlc/code.playbook/playbook-captain.js +93 -15
- package/reference/sdlc/code.playbook/playbook-captain.ts +115 -19
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +33 -22
- package/reference/sdlc/decide.md +54 -0
- package/reference/sdlc/decide.playbook/decide.fsm.d.ts +261 -0
- package/reference/sdlc/decide.playbook/decide.fsm.js +894 -0
- package/reference/sdlc/decide.playbook/decide.fsm.ts +1152 -0
- package/reference/sdlc/decide.playbook/decide.gears.md +88 -0
- package/reference/sdlc/decide.playbook/decide.playbook.d.ts +67 -0
- package/reference/sdlc/{discuss.playbook/discuss.playbook.js → decide.playbook/decide.playbook.js} +471 -362
- package/reference/sdlc/{discuss.playbook/discuss.playbook.ts → decide.playbook/decide.playbook.ts} +575 -443
- package/reference/sdlc/decide.playbook/decide.registry.d.ts +41 -0
- package/reference/sdlc/decide.playbook/decide.registry.js +60 -0
- package/reference/sdlc/decide.playbook/decide.registry.ts +125 -0
- package/reference/sdlc/review.md +81 -0
- package/reference/sdlc/review.playbook/review.fsm.d.ts +183 -0
- package/reference/sdlc/review.playbook/review.fsm.js +524 -0
- package/reference/sdlc/review.playbook/review.fsm.ts +652 -0
- package/reference/sdlc/review.playbook/review.gears.md +112 -0
- package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -0
- package/reference/sdlc/review.playbook/review.playbook.js +112 -0
- package/reference/sdlc/review.playbook/review.playbook.ts +201 -0
- package/reference/sdlc/review.playbook/review.registry.d.ts +43 -0
- package/reference/sdlc/review.playbook/review.registry.js +73 -0
- package/reference/sdlc/review.playbook/review.registry.ts +138 -0
- package/slc/gears2fsm.md +13 -4
- package/slc/link.md +48 -2
- package/slc/text2gears.md +22 -2
- package/src/runtime.d.ts +7 -0
- package/src/runtime.ts +12 -0
- package/src/xstate-playbook-runtime.d.ts +9 -2
- package/src/xstate-playbook-runtime.js +255 -21
- package/src/xstate-playbook-runtime.ts +333 -28
- package/src/xstate-runtime.js +25 -0
- package/src/xstate-runtime.ts +51 -0
- package/reference/sdlc/discuss.md +0 -93
- package/reference/sdlc/discuss.playbook/discuss.fsm.d.ts +0 -396
- package/reference/sdlc/discuss.playbook/discuss.fsm.js +0 -2067
- package/reference/sdlc/discuss.playbook/discuss.fsm.ts +0 -2465
- package/reference/sdlc/discuss.playbook/discuss.gears.md +0 -258
- package/reference/sdlc/discuss.playbook/discuss.playbook.d.ts +0 -113
- package/reference/sdlc/discuss.playbook/discuss.registry.d.ts +0 -58
- package/reference/sdlc/discuss.playbook/discuss.registry.js +0 -97
- package/reference/sdlc/discuss.playbook/discuss.registry.ts +0 -153
package/reference/sdlc/code.md
CHANGED
|
@@ -1,105 +1,63 @@
|
|
|
1
1
|
<!-- SPDX-License-Identifier: Apache-2.0 -->
|
|
2
2
|
<!-- SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai> -->
|
|
3
|
+
<!-- AI agents: do not edit this file without human approval. -->
|
|
3
4
|
|
|
4
5
|
# Code
|
|
5
6
|
|
|
6
7
|
Players:
|
|
7
8
|
|
|
8
9
|
- Coder
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
When
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
>
|
|
62
|
-
|
|
63
|
-
When any changes are made by Coder but not reviewed (outside of any Initial Changes), Captain shall prompt Reviewer to begin a review round:
|
|
64
|
-
> Review the unstaged and untracked changes in the context of the staged changes.
|
|
65
|
-
> Understand the intent.
|
|
66
|
-
|
|
67
|
-
When Reviewer begins a review round involving spec item files, Captain shall prompt Reviewer:
|
|
68
|
-
> Verify any affected spec items are:
|
|
69
|
-
>
|
|
70
|
-
> - Complete & coherent: sufficient for you to reimplement code.
|
|
71
|
-
> - Right level: external behavior users rely on or internal system behavior (organized per @specs/meta.md), not implementation specifics; integration/system testing, not unit testing.
|
|
72
|
-
> - Minimal: essential and concise; every item earns its place; also check with other items.
|
|
73
|
-
> - Well organized: spec packages are finely scoped, with high cohesion and low coupling.
|
|
74
|
-
>
|
|
75
|
-
> Flag anything missing, redundant, over-specified, or under-specified.
|
|
76
|
-
|
|
77
|
-
When Reviewer begins a review round involving any changes outside spec item files, Captain shall prompt Reviewer:
|
|
78
|
-
> Flag any issues or improvements (numbered; no duplication).
|
|
79
|
-
> Think thoroughly — don't just approve or reject.
|
|
80
|
-
|
|
81
|
-
When Reviewer begins any review round, Captain shall prompt Reviewer:
|
|
82
|
-
> For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
|
|
83
|
-
> Verify @specs/map.md reflects the changes.
|
|
84
|
-
> If the change is ready to commit or push, don't raise nitpicks.
|
|
85
|
-
> Do not edit files or commit; report findings only.
|
|
86
|
-
|
|
87
|
-
When Coder raises any rebuttals, Captain shall relay them to Reviewer along with the following prompt:
|
|
88
|
-
> For each rebuttal below, challenge or accept it, with strong reasoning, solid evidence, and comprehensive thinking.
|
|
89
|
-
> Do not edit files or commit; report findings only.
|
|
90
|
-
|
|
91
|
-
## Committer
|
|
92
|
-
|
|
93
|
-
When Coder makes any Initial Changes or Reviewer raises no findings on uncommitted changes, Captain shall prompt Committer:
|
|
94
|
-
> Make a commit of the changes that belong in the repo, following @specs/packages/git.md (reread if necessary).
|
|
95
|
-
> If that spec is absent, follow the legacy @specs/dev/git.md; if neither exists, follow the repository's existing commit conventions and do not search elsewhere.
|
|
96
|
-
> Write the commit message concisely.
|
|
97
|
-
|
|
98
|
-
When Captain prompts Committer and only Coder has played since the last commit, Captain shall also append:
|
|
99
|
-
> Coder is \<coder-llm\>.
|
|
100
|
-
|
|
101
|
-
When Captain prompts Committer and both Coder and Reviewer have played since the last commit, Captain shall also append:
|
|
102
|
-
> Coder is \<coder-llm\>; Reviewer is \<reviewer-llm\>.
|
|
103
|
-
|
|
104
|
-
When Captain prompts Committer, Captain shall also append:
|
|
105
|
-
> Format the `Co-authored-by` `<model>` token as the conventional human form of the substituted id (e.g., `claude-opus-4-7` → `Claude-Opus-4.7`, `gpt-5.5` → `GPT-5.5`).
|
|
10
|
+
|
|
11
|
+
The caller supplies the coding intent including any specific context.
|
|
12
|
+
|
|
13
|
+
A coding intent follows either one direct implementation phase or an IR sequence consisting of a new-IR phase and one phase for each IR task.
|
|
14
|
+
Each phase ends with one new Coder commit (owned by `code`).
|
|
15
|
+
After each `code`-owned commit, Captain shall call the `review` playbook and wait until it passes with no unsettled findings.
|
|
16
|
+
Playbook `review` owns every review round and every review-fix commit.
|
|
17
|
+
Do not amend any reviewed commit.
|
|
18
|
+
|
|
19
|
+
When `review` passes a direct implementation phase, `code` is complete.
|
|
20
|
+
When `review` passes a new IR or a nonfinal IR-task phase, Captain shall continue with the next unfinished IR-task phase.
|
|
21
|
+
When `review` passes the final IR-task phase, `code` is complete.
|
|
22
|
+
When `review` returns an authored abort or failure, or a terminal result that does not prove exact approval, `code` shall start no further phase and shall report the failure and the last `code`-owned commit to its caller.
|
|
23
|
+
When the nested `review` call fails outside that authored result contract, `code` shall park as failed and retain the control-plane error instead of reporting an authored review outcome.
|
|
24
|
+
|
|
25
|
+
At the start of the first phase, Captain shall relay to Coder the complete caller input and any relevant run results in quotes (`>`), along with the following instruction:
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
Assess whether the coding intent can be completed well in one commit.
|
|
29
|
+
If yes, implement and test it, update the affected specs, and ensure @specs/map.md remains accurate.
|
|
30
|
+
Otherwise, decompose it into tasks sized to exactly one commit each, add a new IR under @specs/intents, and do not implement any IR task in this phase.
|
|
31
|
+
Plan affected spec updates before, with, or after their corresponding code changes, either as standalone IR tasks or as explicit work within related tasks.
|
|
32
|
+
|
|
33
|
+
Consult @specs/map.md for relevant context and @specs/meta.md for spec requirements, if needed.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
At the start of every IR-task phase, Captain shall relay to Coder the exact next task and any relevant run results in quotes (`>`), along with the following instruction:
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
Read IR-<#> and implement exactly the next unfinished task, including corresponding tests or specs if any.
|
|
40
|
+
Do not implement a later task in this phase.
|
|
41
|
+
Mark the IR's progress and deliverables when relevant.
|
|
42
|
+
If the IR will be finished after this phase, double-check that all acceptance criteria are met.
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
At the start of *every* phase, Captain shall append the following instruction:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
Do not re-run tests or builds whose inputs have not changed since any previous reported run.
|
|
49
|
+
Make the phase's minimal changes and then one new commit, following @specs/packages/git.md; never amend an existing commit.
|
|
50
|
+
Make the commit message explain concisely what changed and why, including relevant verification.
|
|
51
|
+
Report it as exactly one final-response line beginning `Commit: `, followed only by the exact commit identity.
|
|
52
|
+
Coder is <coder-llm>; format the model token in conventional human form.
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
After the first phase (either direct implementation or a new-IR phase), Captain shall call playbook `review` and input the following in quotes (`>`):
|
|
56
|
+
|
|
57
|
+
> Initial intent: \<caller-input\>
|
|
58
|
+
> Coder output: \<coder-output\>
|
|
59
|
+
|
|
60
|
+
After every IR-task phase, Captain shall call playbook `review` and input the following in quotes (`>`):
|
|
61
|
+
|
|
62
|
+
> IR task: \<ir-task\>
|
|
63
|
+
> Coder output: \<coder-output\>
|
|
@@ -1,112 +1,247 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
type WorkflowKind = 'singleCommit' | 'iteration' | 'specSummary';
|
|
4
|
-
type ChangeOrigin = 'bossIntent' | 'irTask';
|
|
5
|
-
type ReviewSubject = 'commit' | 'changes';
|
|
6
|
-
type AfterReview = 'continueIr' | 'summarizeSpecs' | 'done';
|
|
7
|
-
type ResumableStateId = Exclude<JumpableStateId, 'ready' | 'failed'>;
|
|
8
|
-
type PendingBossQuestion = {
|
|
9
|
-
questionId: ResumableStateId;
|
|
10
|
-
resumeStateId: ResumableStateId;
|
|
11
|
-
sourceItem: string;
|
|
12
|
-
player: Player;
|
|
13
|
-
question: string;
|
|
1
|
+
export type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
|
|
2
|
+
readonly [key: string]: JsonValue;
|
|
14
3
|
};
|
|
15
|
-
export type
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
challenges?: string;
|
|
25
|
-
coderPlayer?: string;
|
|
26
|
-
reviewerPlayer?: string;
|
|
27
|
-
committerPlayer?: string;
|
|
28
|
-
pendingBossQuestion?: PendingBossQuestion;
|
|
29
|
-
bossReply?: string;
|
|
4
|
+
export type CodeStateId = 'runFirstPhase' | 'reviewFirstCommit' | 'runIrTask' | 'reviewIrTask';
|
|
5
|
+
export type CodeSourceItem = 'CODE-1' | 'CODE-2' | 'CODE-3' | 'CODE-4';
|
|
6
|
+
export type CodePhase = 'direct' | 'ir-created' | 'ir-task-more' | 'ir-task-final';
|
|
7
|
+
export type PendingBossQuestion = {
|
|
8
|
+
readonly questionId: 'runFirstPhase' | 'runIrTask';
|
|
9
|
+
readonly resumeStateId: 'runFirstPhase' | 'runIrTask';
|
|
10
|
+
readonly sourceItem: 'CODE-1' | 'CODE-3';
|
|
11
|
+
readonly player: 'Coder';
|
|
12
|
+
readonly question: string;
|
|
30
13
|
};
|
|
31
|
-
export type PlayerInput =
|
|
32
|
-
|
|
14
|
+
export type PlayerInput = {
|
|
15
|
+
readonly stateId: 'runFirstPhase' | 'runIrTask';
|
|
16
|
+
readonly player: 'Coder';
|
|
17
|
+
readonly sourceItem: 'CODE-1' | 'CODE-3';
|
|
18
|
+
readonly prompt: string;
|
|
19
|
+
readonly result: Readonly<Record<string, string>>;
|
|
20
|
+
readonly callerInput: string;
|
|
21
|
+
readonly runResults: string;
|
|
22
|
+
readonly coderPlayer: string;
|
|
23
|
+
readonly irNumber?: string;
|
|
24
|
+
readonly irTask?: string;
|
|
25
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
26
|
+
readonly bossReply?: string;
|
|
33
27
|
};
|
|
34
|
-
export type
|
|
35
|
-
guard:
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
export type PlayerOutput = {
|
|
29
|
+
readonly guard: 'directCommit';
|
|
30
|
+
readonly coderOutput: string;
|
|
31
|
+
readonly latestCommit: string;
|
|
32
|
+
} | {
|
|
33
|
+
readonly guard: 'irCommit';
|
|
34
|
+
readonly coderOutput: string;
|
|
35
|
+
readonly latestCommit: string;
|
|
36
|
+
readonly irNumber: string;
|
|
37
|
+
readonly irTask: string;
|
|
38
|
+
} | {
|
|
39
|
+
readonly guard: 'moreTasks';
|
|
40
|
+
readonly coderOutput: string;
|
|
41
|
+
readonly latestCommit: string;
|
|
42
|
+
readonly irTask: string;
|
|
43
|
+
} | {
|
|
44
|
+
readonly guard: 'finalTask';
|
|
45
|
+
readonly coderOutput: string;
|
|
46
|
+
readonly latestCommit: string;
|
|
47
|
+
} | {
|
|
48
|
+
readonly guard: 'needsBossReply';
|
|
49
|
+
readonly question: string;
|
|
50
|
+
};
|
|
51
|
+
export type PlaybookInput = {
|
|
52
|
+
readonly stateId: 'reviewFirstCommit' | 'reviewIrTask';
|
|
53
|
+
readonly sourceItem: 'CODE-2' | 'CODE-4';
|
|
54
|
+
readonly playbookId: 'review';
|
|
55
|
+
readonly text: string;
|
|
56
|
+
};
|
|
57
|
+
export type ReviewOutput = {
|
|
58
|
+
readonly approvedCommit: 'latest';
|
|
59
|
+
readonly noUnsettledFindings: true;
|
|
60
|
+
};
|
|
61
|
+
export type CompactError = {
|
|
62
|
+
readonly name: string;
|
|
63
|
+
readonly message: string;
|
|
64
|
+
};
|
|
65
|
+
export type CodePlaybookOutput = {
|
|
66
|
+
readonly status: 'complete';
|
|
67
|
+
/** Exact identity of the latest CODE-owned commit. */
|
|
68
|
+
readonly lastCodeCommit: string;
|
|
69
|
+
/** Exact Coder final text produced after that commit. */
|
|
70
|
+
readonly lastCodeOutput: string;
|
|
71
|
+
} | {
|
|
72
|
+
readonly status: 'review-failed';
|
|
73
|
+
/** Exact identity of the latest CODE-owned commit. */
|
|
74
|
+
readonly lastCodeCommit: string;
|
|
75
|
+
/** Exact Coder final text produced after that commit. */
|
|
76
|
+
readonly lastCodeOutput: string;
|
|
77
|
+
readonly error: CompactError;
|
|
43
78
|
};
|
|
44
|
-
export type PlayerOutput = CaptainOutput;
|
|
45
79
|
export type CodingInput = {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
coderPlayer?: string;
|
|
49
|
-
reviewerPlayer?: string;
|
|
50
|
-
committerPlayer?: string;
|
|
80
|
+
readonly coderPlayer?: string;
|
|
81
|
+
readonly runResults?: string;
|
|
51
82
|
};
|
|
52
|
-
export type CodingContext =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
83
|
+
export type CodingContext = {
|
|
84
|
+
readonly coderPlayer: string;
|
|
85
|
+
readonly runResults: string;
|
|
86
|
+
readonly callerInput?: string;
|
|
87
|
+
readonly coderOutput?: string;
|
|
88
|
+
readonly latestCommit?: string;
|
|
89
|
+
readonly irNumber?: string;
|
|
90
|
+
readonly irTask?: string;
|
|
91
|
+
readonly nextIrTask?: string;
|
|
92
|
+
readonly phase?: CodePhase;
|
|
93
|
+
readonly completion?: 'complete' | 'review-failed';
|
|
94
|
+
readonly reviewError?: CompactError;
|
|
95
|
+
readonly lastError?: unknown;
|
|
96
|
+
readonly pendingBossQuestion?: PendingBossQuestion;
|
|
97
|
+
readonly bossReply?: string;
|
|
64
98
|
};
|
|
65
99
|
export type CodingEvent = {
|
|
66
|
-
type: '
|
|
67
|
-
|
|
100
|
+
readonly type: 'START_CODE';
|
|
101
|
+
readonly callerInput: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: 'BOSS_REPLY';
|
|
104
|
+
readonly answer: string;
|
|
105
|
+
readonly questionId?: 'runFirstPhase' | 'runIrTask';
|
|
106
|
+
};
|
|
107
|
+
export declare const codingMachine: import("xstate").StateMachine<CodingContext, {
|
|
108
|
+
readonly type: "START_CODE";
|
|
109
|
+
readonly callerInput: string;
|
|
68
110
|
} | {
|
|
69
|
-
type:
|
|
70
|
-
|
|
111
|
+
readonly type: "BOSS_REPLY";
|
|
112
|
+
readonly answer: string;
|
|
113
|
+
readonly questionId?: "runFirstPhase" | "runIrTask";
|
|
114
|
+
}, {
|
|
115
|
+
[x: string]: import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<JsonValue | undefined, PlaybookInput, import("xstate").EventObject>> | import("xstate").ActorRefFromLogic<import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>> | undefined;
|
|
116
|
+
}, {
|
|
117
|
+
src: "playbook";
|
|
118
|
+
logic: import("xstate").PromiseActorLogic<JsonValue | undefined, PlaybookInput, import("xstate").EventObject>;
|
|
119
|
+
id: string | undefined;
|
|
71
120
|
} | {
|
|
72
|
-
|
|
73
|
-
|
|
121
|
+
src: "player";
|
|
122
|
+
logic: import("xstate").PromiseActorLogic<PlayerOutput, PlayerInput, import("xstate").EventObject>;
|
|
123
|
+
id: string | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
type: "rememberActorError";
|
|
126
|
+
params: import("xstate").NonReducibleUnknown;
|
|
74
127
|
} | {
|
|
75
|
-
type:
|
|
76
|
-
|
|
77
|
-
intent?: string;
|
|
78
|
-
irNumber?: string;
|
|
128
|
+
type: "startCoding";
|
|
129
|
+
params: import("xstate").NonReducibleUnknown;
|
|
79
130
|
} | {
|
|
80
|
-
type:
|
|
81
|
-
|
|
82
|
-
questionId?: ResumableStateId;
|
|
83
|
-
};
|
|
84
|
-
export declare const codingMachine: import("xstate").StateMachine<CodingContext, {
|
|
85
|
-
type: "START_CODING";
|
|
86
|
-
intent: string;
|
|
131
|
+
type: "rememberDirectCommit";
|
|
132
|
+
params: import("xstate").NonReducibleUnknown;
|
|
87
133
|
} | {
|
|
88
|
-
type: "
|
|
89
|
-
|
|
134
|
+
type: "rememberIrCommit";
|
|
135
|
+
params: import("xstate").NonReducibleUnknown;
|
|
90
136
|
} | {
|
|
91
|
-
type: "
|
|
92
|
-
|
|
137
|
+
type: "rememberMoreTasks";
|
|
138
|
+
params: import("xstate").NonReducibleUnknown;
|
|
93
139
|
} | {
|
|
94
|
-
type: "
|
|
95
|
-
|
|
96
|
-
intent?: string;
|
|
97
|
-
irNumber?: string;
|
|
140
|
+
type: "rememberFinalTask";
|
|
141
|
+
params: import("xstate").NonReducibleUnknown;
|
|
98
142
|
} | {
|
|
99
|
-
type: "
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
143
|
+
type: "advanceToNextIrTask";
|
|
144
|
+
params: import("xstate").NonReducibleUnknown;
|
|
145
|
+
} | {
|
|
146
|
+
type: "rememberPendingQuestion";
|
|
147
|
+
params: import("xstate").NonReducibleUnknown;
|
|
148
|
+
} | {
|
|
149
|
+
type: "rememberBossReply";
|
|
150
|
+
params: import("xstate").NonReducibleUnknown;
|
|
151
|
+
} | {
|
|
152
|
+
type: "rememberEmptyBossReplyError";
|
|
153
|
+
params: import("xstate").NonReducibleUnknown;
|
|
154
|
+
} | {
|
|
155
|
+
type: "completeSuccessfully";
|
|
156
|
+
params: import("xstate").NonReducibleUnknown;
|
|
157
|
+
} | {
|
|
158
|
+
type: "completeWithReviewFailure";
|
|
159
|
+
params: import("xstate").NonReducibleUnknown;
|
|
160
|
+
} | {
|
|
161
|
+
type: "completeWithInvalidReviewOutput";
|
|
162
|
+
params: import("xstate").NonReducibleUnknown;
|
|
163
|
+
} | {
|
|
164
|
+
type: "rememberMalformedPlayerOutput";
|
|
165
|
+
params: import("xstate").NonReducibleUnknown;
|
|
104
166
|
}, {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
167
|
+
type: "needsBossReply";
|
|
168
|
+
params: unknown;
|
|
169
|
+
} | {
|
|
170
|
+
type: "isDirectCommit";
|
|
171
|
+
params: unknown;
|
|
172
|
+
} | {
|
|
173
|
+
type: "isIrCommit";
|
|
174
|
+
params: unknown;
|
|
175
|
+
} | {
|
|
176
|
+
type: "isMoreTasks";
|
|
177
|
+
params: unknown;
|
|
178
|
+
} | {
|
|
179
|
+
type: "isFinalTask";
|
|
180
|
+
params: unknown;
|
|
181
|
+
} | {
|
|
182
|
+
type: "authoredReviewFailure";
|
|
183
|
+
params: unknown;
|
|
184
|
+
} | {
|
|
185
|
+
type: "reviewApprovedDirect";
|
|
186
|
+
params: unknown;
|
|
187
|
+
} | {
|
|
188
|
+
type: "reviewApprovedIrCreated";
|
|
189
|
+
params: unknown;
|
|
190
|
+
} | {
|
|
191
|
+
type: "reviewApprovedMoreTasks";
|
|
192
|
+
params: unknown;
|
|
193
|
+
} | {
|
|
194
|
+
type: "reviewApprovedFinalTask";
|
|
195
|
+
params: unknown;
|
|
196
|
+
} | {
|
|
197
|
+
type: "emptyBossReply";
|
|
198
|
+
params: unknown;
|
|
199
|
+
} | {
|
|
200
|
+
type: "resumesFirstPhase";
|
|
201
|
+
params: unknown;
|
|
202
|
+
} | {
|
|
203
|
+
type: "resumesIrTask";
|
|
204
|
+
params: unknown;
|
|
205
|
+
}, never, "done" | "failed" | "awaitBossReply" | "ready" | "runFirstPhase" | "reviewFirstCommit" | "runIrTask" | "reviewIrTask", string, CodingInput, {
|
|
206
|
+
readonly status: "complete";
|
|
207
|
+
/** Exact identity of the latest CODE-owned commit. */
|
|
208
|
+
readonly lastCodeCommit: string;
|
|
209
|
+
/** Exact Coder final text produced after that commit. */
|
|
210
|
+
readonly lastCodeOutput: string;
|
|
211
|
+
} | {
|
|
212
|
+
readonly status: "review-failed";
|
|
213
|
+
/** Exact identity of the latest CODE-owned commit. */
|
|
214
|
+
readonly lastCodeCommit: string;
|
|
215
|
+
/** Exact Coder final text produced after that commit. */
|
|
216
|
+
readonly lastCodeOutput: string;
|
|
217
|
+
readonly error: CompactError;
|
|
218
|
+
}, import("xstate").EventObject, import("xstate").MetaObject, {
|
|
219
|
+
id: "code";
|
|
220
|
+
states: {
|
|
221
|
+
readonly ready: {
|
|
222
|
+
id: "ready";
|
|
223
|
+
};
|
|
224
|
+
readonly runFirstPhase: {
|
|
225
|
+
id: "runFirstPhase";
|
|
226
|
+
};
|
|
227
|
+
readonly reviewFirstCommit: {
|
|
228
|
+
id: "reviewFirstCommit";
|
|
229
|
+
};
|
|
230
|
+
readonly runIrTask: {
|
|
231
|
+
id: "runIrTask";
|
|
232
|
+
};
|
|
233
|
+
readonly reviewIrTask: {
|
|
234
|
+
id: "reviewIrTask";
|
|
235
|
+
};
|
|
236
|
+
readonly awaitBossReply: {
|
|
237
|
+
id: "awaitBossReply";
|
|
238
|
+
};
|
|
239
|
+
readonly failed: {
|
|
240
|
+
id: "failed";
|
|
241
|
+
};
|
|
242
|
+
readonly done: {
|
|
243
|
+
id: "done";
|
|
244
|
+
};
|
|
245
|
+
};
|
|
111
246
|
}>;
|
|
112
|
-
export
|
|
247
|
+
export default codingMachine;
|
|
@@ -1,54 +1,36 @@
|
|
|
1
|
-
import type { CodingContext, PlayerInput, codingMachine } from './code.fsm.js';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export interface CaptainTransition {
|
|
1
|
+
import type { CodingContext, PlaybookInput, PlayerInput, codingMachine } from './code.fsm.js';
|
|
2
|
+
export type TransitionGuard = (args: {
|
|
3
|
+
context: CodingContext;
|
|
4
|
+
event: unknown;
|
|
5
|
+
}) => boolean;
|
|
6
|
+
export interface InvokingTransition {
|
|
9
7
|
readonly index: number;
|
|
10
8
|
readonly target: string;
|
|
11
|
-
readonly guard
|
|
9
|
+
readonly guard?: TransitionGuard;
|
|
12
10
|
readonly actions: unknown;
|
|
13
11
|
}
|
|
14
|
-
export interface
|
|
12
|
+
export interface PlayerStateInfo {
|
|
15
13
|
readonly stateId: string;
|
|
16
|
-
readonly
|
|
17
|
-
readonly
|
|
14
|
+
readonly sourceItem: string;
|
|
15
|
+
readonly getInput: (context: CodingContext) => PlayerInput;
|
|
16
|
+
readonly transitions: readonly InvokingTransition[];
|
|
18
17
|
}
|
|
19
|
-
export interface
|
|
20
|
-
readonly
|
|
21
|
-
readonly
|
|
22
|
-
readonly
|
|
23
|
-
readonly
|
|
18
|
+
export interface NestedPlaybookStateInfo {
|
|
19
|
+
readonly stateId: string;
|
|
20
|
+
readonly sourceItem: string;
|
|
21
|
+
readonly getInput: (context: CodingContext) => PlaybookInput;
|
|
22
|
+
readonly transitions: readonly InvokingTransition[];
|
|
24
23
|
}
|
|
25
|
-
export interface
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
28
|
-
readonly target: string;
|
|
29
|
-
readonly guard: TransitionGuard;
|
|
30
|
-
readonly actions: unknown;
|
|
24
|
+
export interface AwaitBossReplyInfo {
|
|
25
|
+
readonly stateId: 'awaitBossReply';
|
|
26
|
+
readonly bossReplyTransitions: readonly InvokingTransition[];
|
|
31
27
|
}
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export
|
|
37
|
-
readonly
|
|
38
|
-
readonly target: string;
|
|
39
|
-
};
|
|
40
|
-
readonly continueIr: {
|
|
41
|
-
readonly target: string;
|
|
42
|
-
};
|
|
43
|
-
readonly summarizeIr: {
|
|
28
|
+
export declare function enumeratePlayerStates(machine: typeof codingMachine): readonly PlayerStateInfo[];
|
|
29
|
+
export declare const enumerateCaptainStates: typeof enumeratePlayerStates;
|
|
30
|
+
export declare function enumerateNestedPlaybookStates(machine: typeof codingMachine): readonly NestedPlaybookStateInfo[];
|
|
31
|
+
export declare function enumerateAwaitBossReply(machine: typeof codingMachine): AwaitBossReplyInfo;
|
|
32
|
+
export declare function enumerateRootEvents(machine: typeof codingMachine): {
|
|
33
|
+
readonly startCode: {
|
|
44
34
|
readonly target: string;
|
|
45
35
|
};
|
|
46
|
-
|
|
47
|
-
readonly bossInterruptTargetDescriptions: ReadonlyArray<{
|
|
48
|
-
readonly stateId: string;
|
|
49
|
-
readonly description: string;
|
|
50
|
-
}>;
|
|
51
|
-
}
|
|
52
|
-
export declare function enumerateCaptainStates(machine: typeof codingMachine): readonly CaptainStateInfo[];
|
|
53
|
-
export declare function enumerateRootEvents(machine: typeof codingMachine): RootEventTable;
|
|
54
|
-
export declare function enumerateAwaitBossReply(machine: typeof codingMachine): AwaitBossReplyInfo;
|
|
36
|
+
};
|