@sublang/playbook 5.0.0 → 7.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 +22 -14
- package/docs/cli.md +138 -90
- package/docs/configuration.md +113 -29
- package/docs/embedding.md +24 -16
- package/package.json +42 -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/bin/launch-config.js +938 -0
- package/reference/sdlc/code.playbook/bin/playbook.js +145 -562
- package/reference/sdlc/code.playbook/bin/provision.js +84 -38
- package/reference/sdlc/code.playbook/bin/run.js +1171 -983
- package/reference/sdlc/code.playbook/bin/session-store.js +1169 -0
- 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.d.ts +70 -3
- package/reference/sdlc/code.playbook/playbook-captain.js +954 -80
- package/reference/sdlc/code.playbook/playbook-captain.ts +1408 -80
- package/reference/sdlc/code.playbook/playbook.config.template.yaml +37 -36
- 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} +545 -372
- package/reference/sdlc/{discuss.playbook/discuss.playbook.ts → decide.playbook/decide.playbook.ts} +665 -454
- 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 +83 -14
- package/slc/text2gears.md +22 -2
- package/src/runtime.d.ts +21 -2
- package/src/runtime.ts +38 -6
- package/src/xstate-playbook-runtime.d.ts +9 -2
- package/src/xstate-playbook-runtime.js +319 -35
- package/src/xstate-playbook-runtime.ts +412 -41
- package/src/xstate-runtime.d.ts +19 -2
- package/src/xstate-runtime.js +384 -57
- package/src/xstate-runtime.ts +542 -71
- 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/docs/embedding.md
CHANGED
|
@@ -8,7 +8,7 @@ one host, and [spex](https://github.com/sublang-ai/spex) (the desktop
|
|
|
8
8
|
app) is another. This guide shows how to wire a playbook runtime into
|
|
9
9
|
your own host.
|
|
10
10
|
|
|
11
|
-
> **Release note:** this guide targets the semver-stable
|
|
11
|
+
> **Release note:** this guide targets the current semver-stable six-port
|
|
12
12
|
> contract; see the [CHANGELOG](../CHANGELOG.md) for migration details.
|
|
13
13
|
|
|
14
14
|
## The runtime contract
|
|
@@ -17,11 +17,11 @@ The port and runtime contracts live in the type-only module
|
|
|
17
17
|
[`@sublang/playbook/runtime`](../src/runtime.ts) — a public,
|
|
18
18
|
semver-stable surface (`PlayerResult`, `PlaybookPorts`,
|
|
19
19
|
`PlaybookRuntime`, `PlaybookSession`, `PlayerCallOptions`,
|
|
20
|
-
`
|
|
21
|
-
`PlaybookRuntimeFactory`) that imports no CODE
|
|
22
|
-
satisfies it once and inherits every playbook.
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
`PlayerSessionStore`, `CaptainCallOptions`, `CaptainResult`,
|
|
21
|
+
`PlaybookTraceEvent`, and `PlaybookRuntimeFactory`) that imports no CODE
|
|
22
|
+
or FSM types, so a host satisfies it once and inherits every playbook.
|
|
23
|
+
The generated CODE, REVIEW, and DECIDE modules re-export their shared
|
|
24
|
+
runtime contract types from their public `playbook` subpaths;
|
|
25
25
|
`PlaybookRuntimeFactory` is available from `@sublang/playbook/runtime`.
|
|
26
26
|
|
|
27
27
|
Generated linked runtimes reuse the XState integration engine exposed
|
|
@@ -32,7 +32,7 @@ nested-playbook bridge.
|
|
|
32
32
|
## Constructing a runtime against your own ports
|
|
33
33
|
|
|
34
34
|
```ts
|
|
35
|
-
import createPlaybookRuntime from '@sublang/playbook/
|
|
35
|
+
import createPlaybookRuntime from '@sublang/playbook/review/playbook';
|
|
36
36
|
import type {
|
|
37
37
|
CaptainCallOptions,
|
|
38
38
|
CaptainResult,
|
|
@@ -104,20 +104,20 @@ const ports: PlaybookPorts = {
|
|
|
104
104
|
};
|
|
105
105
|
|
|
106
106
|
const runtime = createPlaybookRuntime({
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
coderLlm: 'claude-opus-4-8[1m]',
|
|
108
|
+
reviewerLlm: 'gpt-5.5',
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
const playbookSessionId = randomUUID();
|
|
112
112
|
await runtime.init({
|
|
113
113
|
sessionId: playbookSessionId,
|
|
114
|
-
playbookId: '
|
|
114
|
+
playbookId: 'review',
|
|
115
115
|
rootSessionId: playbookSessionId,
|
|
116
116
|
depth: 0,
|
|
117
117
|
ports,
|
|
118
118
|
});
|
|
119
119
|
await runtime.handleBossInput({
|
|
120
|
-
text: '
|
|
120
|
+
text: 'Review the latest commit against the requested intent',
|
|
121
121
|
signal: new AbortController().signal,
|
|
122
122
|
});
|
|
123
123
|
await runtime.dispose();
|
|
@@ -129,11 +129,19 @@ Every init-to-dispose lifecycle is one playbook session. Its
|
|
|
129
129
|
`playbook.trace` telemetry carries that immutable ID plus a contiguous
|
|
130
130
|
sequence across exact Boss input, judge/player calls, FSM transitions,
|
|
131
131
|
visible Captain work, nested playbook calls, status, settlement, and
|
|
132
|
-
disposal.
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
132
|
+
disposal. Without `PlaybookSession.playerSessions`, a standalone runtime
|
|
133
|
+
starts each player fresh and privately retains the latest opaque
|
|
134
|
+
`resumeToken` its adapter returned.
|
|
135
|
+
|
|
136
|
+
A composing host can instead supply a frame-local `PlayerSessionStore`
|
|
137
|
+
view over one root-owned continuation map. The host maps each local role
|
|
138
|
+
to its effective binding, so a nested exact same-name role selects and
|
|
139
|
+
updates the ancestor conversation while an unmatched child role gets
|
|
140
|
+
its own binding. Child return or disposal does not clear the root's
|
|
141
|
+
token, and a new root engagement starts fresh. Trace data and tokens
|
|
142
|
+
never enter Boss-visible status text. Because trace observers do receive
|
|
143
|
+
opaque resume tokens, persisted traces should be protected as sensitive
|
|
144
|
+
data.
|
|
137
145
|
|
|
138
146
|
See
|
|
139
147
|
[`code.playbook.test.ts`](../reference/sdlc/code.playbook/code.playbook.test.ts)
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sublang/playbook",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, and
|
|
5
|
+
"description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, and DECIDE workflows driven by GEARS specs.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"homepage": "https://github.com/sublang-ai/playbook#readme",
|
|
8
8
|
"repository": {
|
|
@@ -40,7 +40,8 @@
|
|
|
40
40
|
"slc/optimize.md",
|
|
41
41
|
"reference/sdlc/captain.md",
|
|
42
42
|
"reference/sdlc/code.md",
|
|
43
|
-
"reference/sdlc/
|
|
43
|
+
"reference/sdlc/review.md",
|
|
44
|
+
"reference/sdlc/decide.md",
|
|
44
45
|
"reference/sdlc/captain.playbook/captain.gears.md",
|
|
45
46
|
"reference/sdlc/captain.playbook/captain.fsm.ts",
|
|
46
47
|
"reference/sdlc/captain.playbook/captain.fsm.js",
|
|
@@ -66,19 +67,31 @@
|
|
|
66
67
|
"reference/sdlc/code.playbook/code.gears.md",
|
|
67
68
|
"reference/sdlc/code.playbook/playbook.config.template.yaml",
|
|
68
69
|
"reference/sdlc/code.playbook/bin/playbook.js",
|
|
70
|
+
"reference/sdlc/code.playbook/bin/launch-config.js",
|
|
69
71
|
"reference/sdlc/code.playbook/bin/run.js",
|
|
72
|
+
"reference/sdlc/code.playbook/bin/session-store.js",
|
|
70
73
|
"reference/sdlc/code.playbook/bin/provision.js",
|
|
71
74
|
"reference/sdlc/code.playbook/bin/adapter-sdk.js",
|
|
72
|
-
"reference/sdlc/
|
|
73
|
-
"reference/sdlc/
|
|
74
|
-
"reference/sdlc/
|
|
75
|
-
"reference/sdlc/
|
|
76
|
-
"reference/sdlc/
|
|
77
|
-
"reference/sdlc/
|
|
78
|
-
"reference/sdlc/
|
|
79
|
-
"reference/sdlc/
|
|
80
|
-
"reference/sdlc/
|
|
81
|
-
"reference/sdlc/
|
|
75
|
+
"reference/sdlc/review.playbook/review.gears.md",
|
|
76
|
+
"reference/sdlc/review.playbook/review.fsm.ts",
|
|
77
|
+
"reference/sdlc/review.playbook/review.fsm.js",
|
|
78
|
+
"reference/sdlc/review.playbook/review.fsm.d.ts",
|
|
79
|
+
"reference/sdlc/review.playbook/review.playbook.ts",
|
|
80
|
+
"reference/sdlc/review.playbook/review.playbook.js",
|
|
81
|
+
"reference/sdlc/review.playbook/review.playbook.d.ts",
|
|
82
|
+
"reference/sdlc/review.playbook/review.registry.ts",
|
|
83
|
+
"reference/sdlc/review.playbook/review.registry.js",
|
|
84
|
+
"reference/sdlc/review.playbook/review.registry.d.ts",
|
|
85
|
+
"reference/sdlc/decide.playbook/decide.gears.md",
|
|
86
|
+
"reference/sdlc/decide.playbook/decide.fsm.ts",
|
|
87
|
+
"reference/sdlc/decide.playbook/decide.fsm.js",
|
|
88
|
+
"reference/sdlc/decide.playbook/decide.fsm.d.ts",
|
|
89
|
+
"reference/sdlc/decide.playbook/decide.playbook.ts",
|
|
90
|
+
"reference/sdlc/decide.playbook/decide.playbook.js",
|
|
91
|
+
"reference/sdlc/decide.playbook/decide.playbook.d.ts",
|
|
92
|
+
"reference/sdlc/decide.playbook/decide.registry.ts",
|
|
93
|
+
"reference/sdlc/decide.playbook/decide.registry.js",
|
|
94
|
+
"reference/sdlc/decide.playbook/decide.registry.d.ts",
|
|
82
95
|
"docs"
|
|
83
96
|
],
|
|
84
97
|
"bin": {
|
|
@@ -110,18 +123,26 @@
|
|
|
110
123
|
"default": "./reference/sdlc/code.playbook/playbook-captain.js"
|
|
111
124
|
},
|
|
112
125
|
"./slc/*": "./slc/*",
|
|
113
|
-
"./
|
|
114
|
-
"types": "./reference/sdlc/
|
|
115
|
-
"default": "./reference/sdlc/
|
|
126
|
+
"./review/playbook": {
|
|
127
|
+
"types": "./reference/sdlc/review.playbook/review.playbook.d.ts",
|
|
128
|
+
"default": "./reference/sdlc/review.playbook/review.playbook.js"
|
|
116
129
|
},
|
|
117
|
-
"./
|
|
118
|
-
"types": "./reference/sdlc/
|
|
119
|
-
"default": "./reference/sdlc/
|
|
130
|
+
"./review/registry": {
|
|
131
|
+
"types": "./reference/sdlc/review.playbook/review.registry.d.ts",
|
|
132
|
+
"default": "./reference/sdlc/review.playbook/review.registry.js"
|
|
133
|
+
},
|
|
134
|
+
"./decide/playbook": {
|
|
135
|
+
"types": "./reference/sdlc/decide.playbook/decide.playbook.d.ts",
|
|
136
|
+
"default": "./reference/sdlc/decide.playbook/decide.playbook.js"
|
|
137
|
+
},
|
|
138
|
+
"./decide/registry": {
|
|
139
|
+
"types": "./reference/sdlc/decide.playbook/decide.registry.d.ts",
|
|
140
|
+
"default": "./reference/sdlc/decide.playbook/decide.registry.js"
|
|
120
141
|
}
|
|
121
142
|
},
|
|
122
143
|
"scripts": {
|
|
123
144
|
"build": "tsc",
|
|
124
|
-
"test": "vitest run",
|
|
145
|
+
"test": "spex lint && vitest run",
|
|
125
146
|
"test:acceptance": "vitest run --config vitest.acceptance.config.ts",
|
|
126
147
|
"smoke:release": "node scripts/release-smoke.mjs",
|
|
127
148
|
"check:links": "node scripts/check-links.mjs",
|
|
@@ -133,7 +154,7 @@
|
|
|
133
154
|
},
|
|
134
155
|
"dependencies": {
|
|
135
156
|
"@sublang/cligent": "^0.19.0",
|
|
136
|
-
"@sublang/spex": "^
|
|
157
|
+
"@sublang/spex": "^2.1.1",
|
|
137
158
|
"p-queue": "^9.3.1",
|
|
138
159
|
"xstate": "^5.19.4",
|
|
139
160
|
"yaml": "^2.9.0"
|
|
@@ -520,6 +520,8 @@ const runtimeSpec = {
|
|
|
520
520
|
snapshotOptions: snapshotCaptainOptions,
|
|
521
521
|
machineInput: (options) => ({ enabledPlaybooks: options.enabledPlaybooks }),
|
|
522
522
|
classifyBossText: (text, ports, signal, snapshotOrState, boundary, options) => classifyControllerTurn(text, ports, signal, snapshotOrState, boundary, options),
|
|
523
|
+
playerStates: {},
|
|
524
|
+
classificationStatus: () => undefined,
|
|
523
525
|
captainStrategy: controllerCaptainStrategy,
|
|
524
526
|
// CAPPLAY-10 / PBRT-52: the Captain's own ControlView context projection —
|
|
525
527
|
// the settlement evidence the machine retains for its decision and reply
|
|
@@ -810,6 +810,8 @@ const runtimeSpec: XStatePlaybookRuntimeSpec<ValidatedCaptainOptions> = {
|
|
|
810
810
|
boundary,
|
|
811
811
|
options,
|
|
812
812
|
) as Promise<import('xstate').EventObject | undefined>,
|
|
813
|
+
playerStates: {},
|
|
814
|
+
classificationStatus: () => undefined,
|
|
813
815
|
captainStrategy: controllerCaptainStrategy,
|
|
814
816
|
// CAPPLAY-10 / PBRT-52: the Captain's own ControlView context projection —
|
|
815
817
|
// the settlement evidence the machine retains for its decision and reply
|
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\>
|