@sublang/playbook 0.4.2 → 0.5.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.
@@ -15,8 +15,9 @@ Players:
15
15
 
16
16
  When Boss gives a coding intent, Captain shall relay it to Coder along with the following prompt:
17
17
  > Assess whether this can be completed in a single commit, following best practices.
18
- > If yes, implement and test, updating both code and specs; otherwise, decompose into tasks as a new IR under @specs/iterations.
19
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; ensure @specs/map.md reflects the changes.
18
+ > If yes, implement and test, updating both code and specs; otherwise, decompose into tasks as a new IR under @specs/iterations and stop without implementing any IR task.
19
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
20
+ > Ensure @specs/map.md reflects the changes.
20
21
  > Do not commit.
21
22
  The resulting changes are Initial Changes.
22
23
 
@@ -49,11 +50,11 @@ When an IR is done, Captain shall prompt Coder:
49
50
  > The set should be complete and coherent.
50
51
  > Avoid implementation specifics.
51
52
  > Avoid redundant spec items.
52
- > Consult @specs/map.md for relevant context and update it to reflect your changes.
53
+ > Ensure @specs/map.md reflects the changes.
53
54
  ## Reviewer
54
55
 
55
56
  For each finding in a review round, Coder either addresses it with changes or challenges it with a rebuttal.
56
- Any code change to address findings starts a new round of review, no matter if some findings are also rebutted.
57
+ Any code change to address findings starts a new round of review, even if some findings are also rebutted.
57
58
  Rounds continue until Reviewer raises no findings.
58
59
 
59
60
  ### CODE-5
@@ -68,8 +69,10 @@ When Committer commits Initial Changes from a Boss coding intent involving chang
68
69
  > - Minimal: essential and concise; every item earns its place; also check with other items.
69
70
  >
70
71
  > Flag anything missing, redundant, over-specified, or under-specified.
71
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
72
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
73
+ > Verify @specs/map.md reflects the changes.
72
74
  > If the change is ready to commit or push, don't raise nitpicks.
75
+ > Do not edit files or commit; report findings only.
73
76
 
74
77
  ### CODE-6
75
78
 
@@ -78,8 +81,10 @@ When Committer commits Initial Changes from a Boss coding intent involving chang
78
81
  > Refer to the commit message.
79
82
  > Flag any issues or improvements (numbered; no duplication).
80
83
  > Think thoroughly — don't just approve or reject.
81
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
84
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
85
+ > Verify @specs/map.md reflects the changes.
82
86
  > If the change is ready to commit or push, don't raise nitpicks.
87
+ > Do not edit files or commit; report findings only.
83
88
 
84
89
  ### CODE-7
85
90
 
@@ -95,8 +100,10 @@ When Committer commits Initial Changes from a Boss coding intent involving chang
95
100
  > Flag anything missing, redundant, over-specified, or under-specified.
96
101
  > Flag any issues or improvements (numbered; no duplication).
97
102
  > Think thoroughly — don't just approve or reject.
98
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
103
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
104
+ > Verify @specs/map.md reflects the changes.
99
105
  > If the change is ready to commit or push, don't raise nitpicks.
106
+ > Do not edit files or commit; report findings only.
100
107
 
101
108
  ### CODE-8
102
109
 
@@ -110,8 +117,10 @@ When Committer commits Initial Changes from an IR task involving changes only in
110
117
  > - Minimal: essential and concise; every item earns its place; also check with other items.
111
118
  >
112
119
  > Flag anything missing, redundant, over-specified, or under-specified.
113
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
120
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
121
+ > Verify @specs/map.md reflects the changes.
114
122
  > If the change is ready to commit or push, don't raise nitpicks.
123
+ > Do not edit files or commit; report findings only.
115
124
 
116
125
  ### CODE-9
117
126
 
@@ -120,8 +129,10 @@ When Committer commits Initial Changes from an IR task involving changes only ou
120
129
  > Refer to the commit message.
121
130
  > Flag any issues or improvements (numbered; no duplication).
122
131
  > Think thoroughly — don't just approve or reject.
123
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
132
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
133
+ > Verify @specs/map.md reflects the changes.
124
134
  > If the change is ready to commit or push, don't raise nitpicks.
135
+ > Do not edit files or commit; report findings only.
125
136
 
126
137
  ### CODE-10
127
138
 
@@ -137,13 +148,15 @@ When Committer commits Initial Changes from an IR task involving changes both in
137
148
  > Flag anything missing, redundant, over-specified, or under-specified.
138
149
  > Flag any issues or improvements (numbered; no duplication).
139
150
  > Think thoroughly — don't just approve or reject.
140
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
151
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
152
+ > Verify @specs/map.md reflects the changes.
141
153
  > If the change is ready to commit or push, don't raise nitpicks.
154
+ > Do not edit files or commit; report findings only.
142
155
 
143
156
  ### CODE-11
144
157
 
145
158
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes only in @specs/user/, @specs/dev/, or @specs/test/ without raising rebuttals, Captain shall prompt Reviewer to begin a review round:
146
- > Review the unstaged/untracked changes.
159
+ > Review the unstaged and untracked changes in the context of the staged changes.
147
160
  > Understand the intent.
148
161
  > Verify any affected spec items are:
149
162
  >
@@ -152,23 +165,27 @@ When Coder makes unreviewed changes (outside of any Initial Changes) involving c
152
165
  > - Minimal: essential and concise; every item earns its place; also check with other items.
153
166
  >
154
167
  > Flag anything missing, redundant, over-specified, or under-specified.
155
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
168
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
169
+ > Verify @specs/map.md reflects the changes.
156
170
  > If the change is ready to commit or push, don't raise nitpicks.
171
+ > Do not edit files or commit; report findings only.
157
172
 
158
173
  ### CODE-12
159
174
 
160
175
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes only outside @specs/user/, @specs/dev/, and @specs/test/ without raising rebuttals, Captain shall prompt Reviewer to begin a review round:
161
- > Review the unstaged/untracked changes.
176
+ > Review the unstaged and untracked changes in the context of the staged changes.
162
177
  > Understand the intent.
163
178
  > Flag any issues or improvements (numbered; no duplication).
164
179
  > Think thoroughly — don't just approve or reject.
165
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
180
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
181
+ > Verify @specs/map.md reflects the changes.
166
182
  > If the change is ready to commit or push, don't raise nitpicks.
183
+ > Do not edit files or commit; report findings only.
167
184
 
168
185
  ### CODE-13
169
186
 
170
187
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes both in and outside @specs/user/, @specs/dev/, and @specs/test/ without raising rebuttals, Captain shall prompt Reviewer to begin a review round:
171
- > Review the unstaged/untracked changes.
188
+ > Review the unstaged and untracked changes in the context of the staged changes.
172
189
  > Understand the intent.
173
190
  > Verify any affected spec items are:
174
191
  >
@@ -179,18 +196,21 @@ When Coder makes unreviewed changes (outside of any Initial Changes) involving c
179
196
  > Flag anything missing, redundant, over-specified, or under-specified.
180
197
  > Flag any issues or improvements (numbered; no duplication).
181
198
  > Think thoroughly — don't just approve or reject.
182
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
199
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
200
+ > Verify @specs/map.md reflects the changes.
183
201
  > If the change is ready to commit or push, don't raise nitpicks.
202
+ > Do not edit files or commit; report findings only.
184
203
 
185
204
  ### CODE-14
186
205
 
187
206
  When Coder raises rebuttals without making code changes, Captain shall relay them to Reviewer along with the following prompt:
188
207
  > For each rebuttal below, challenge or accept it, with strong reasoning, solid evidence, and comprehensive thinking.
208
+ > Do not edit files or commit; report findings only.
189
209
 
190
210
  ### CODE-15
191
211
 
192
212
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes only in @specs/user/, @specs/dev/, or @specs/test/ and also raises rebuttals, Captain shall prompt Reviewer to begin a review round and relay the rebuttals along with the following prompt:
193
- > Review the unstaged/untracked changes.
213
+ > Review the unstaged and untracked changes in the context of the staged changes.
194
214
  > Understand the intent.
195
215
  > Verify any affected spec items are:
196
216
  >
@@ -199,25 +219,29 @@ When Coder makes unreviewed changes (outside of any Initial Changes) involving c
199
219
  > - Minimal: essential and concise; every item earns its place; also check with other items.
200
220
  >
201
221
  > Flag anything missing, redundant, over-specified, or under-specified.
202
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
222
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
223
+ > Verify @specs/map.md reflects the changes.
203
224
  > If the change is ready to commit or push, don't raise nitpicks.
225
+ > Do not edit files or commit; report findings only.
204
226
  > For each rebuttal below, challenge or accept it, with strong reasoning, solid evidence, and comprehensive thinking.
205
227
 
206
228
  ### CODE-16
207
229
 
208
230
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes only outside @specs/user/, @specs/dev/, and @specs/test/ and also raises rebuttals, Captain shall prompt Reviewer to begin a review round and relay the rebuttals along with the following prompt:
209
- > Review the unstaged/untracked changes.
231
+ > Review the unstaged and untracked changes in the context of the staged changes.
210
232
  > Understand the intent.
211
233
  > Flag any issues or improvements (numbered; no duplication).
212
234
  > Think thoroughly — don't just approve or reject.
213
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
235
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
236
+ > Verify @specs/map.md reflects the changes.
214
237
  > If the change is ready to commit or push, don't raise nitpicks.
238
+ > Do not edit files or commit; report findings only.
215
239
  > For each rebuttal below, challenge or accept it, with strong reasoning, solid evidence, and comprehensive thinking.
216
240
 
217
241
  ### CODE-17
218
242
 
219
243
  When Coder makes unreviewed changes (outside of any Initial Changes) involving changes both in and outside @specs/user/, @specs/dev/, and @specs/test/ and also raises rebuttals, Captain shall prompt Reviewer to begin a review round and relay the rebuttals along with the following prompt:
220
- > Review the unstaged/untracked changes.
244
+ > Review the unstaged and untracked changes in the context of the staged changes.
221
245
  > Understand the intent.
222
246
  > Verify any affected spec items are:
223
247
  >
@@ -228,8 +252,10 @@ When Coder makes unreviewed changes (outside of any Initial Changes) involving c
228
252
  > Flag anything missing, redundant, over-specified, or under-specified.
229
253
  > Flag any issues or improvements (numbered; no duplication).
230
254
  > Think thoroughly — don't just approve or reject.
231
- > Consult @specs/map.md or @specs/meta.md for relevant context if needed; verify @specs/map.md reflects the changes.
255
+ > For context discovery, @specs/map.md indexes all spec files and @specs/meta.md describes the spec format.
256
+ > Verify @specs/map.md reflects the changes.
232
257
  > If the change is ready to commit or push, don't raise nitpicks.
258
+ > Do not edit files or commit; report findings only.
233
259
  > For each rebuttal below, challenge or accept it, with strong reasoning, solid evidence, and comprehensive thinking.
234
260
 
235
261
  ## Committer
@@ -238,6 +264,7 @@ When Coder makes unreviewed changes (outside of any Initial Changes) involving c
238
264
 
239
265
  When Coder makes any Initial Changes and Reviewer has not played since the last commit, Captain shall prompt Committer:
240
266
  > Make a commit of the changes that belong in the repo, following @specs/dev/git.md (reread if necessary).
267
+ > Write concisely.
241
268
  > Coder is <coder-llm>.
242
269
  > 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`).
243
270
 
@@ -247,6 +274,7 @@ Result guard: `needsBossInput` — Committing requires additional Boss input or
247
274
 
248
275
  When Coder makes any Initial Changes and Reviewer has played since the last commit, or Reviewer raises no findings on uncommitted changes and Coder has played since the last commit, Captain shall prompt Committer:
249
276
  > Make a commit of the changes that belong in the repo, following @specs/dev/git.md (reread if necessary).
277
+ > Write concisely.
250
278
  > Coder is <coder-llm>; Reviewer is <reviewer-llm>.
251
279
  > 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`).
252
280
 
@@ -22,6 +22,16 @@ export interface PlaybookRuntime {
22
22
  dispose(): Promise<void>;
23
23
  }
24
24
  export type CodePlaybookOptions = CodingInput;
25
+ declare function normalizeErrorCompact(err: unknown): {
26
+ name: string;
27
+ message: string;
28
+ } | undefined;
29
+ declare function normalizeErrorFull(err: unknown): {
30
+ name: string;
31
+ message: string;
32
+ stack?: string;
33
+ } | undefined;
34
+ declare function normalizeEventForTelemetry(event: unknown): unknown;
25
35
  declare function composePlayerPrompt(input: CaptainInput): string;
26
36
  declare function resolvePlayerId(input: CaptainInput): string;
27
37
  declare function adjudicate(input: CaptainInput, finalText: string, ports: PlaybookPorts, signal: AbortSignal): Promise<CaptainOutput>;
@@ -39,8 +49,9 @@ interface PendingBossQuestionForStatus {
39
49
  question: string;
40
50
  }
41
51
  declare function pendingBossQuestionFromContext(context: Record<string, unknown>): PendingBossQuestionForStatus | undefined;
42
- declare function formatAwaitBossReplyEntry(context: Record<string, unknown>): string;
43
- declare function formatStateEntry(stateId: string, context?: Record<string, unknown>): string | undefined;
52
+ declare function formatAwaitBossReplyQuestion(context: Record<string, unknown>): string;
53
+ declare function formatAwaitBossReplyMarker(context: Record<string, unknown>): string;
54
+ declare function formatStateEntry(stateId: string): string | undefined;
44
55
  declare function formatTransition(event: unknown): string | undefined;
45
56
  declare function formatClassification(eventType: string): string;
46
57
  declare function stateTelemetryPayload(from: unknown, to: string, event: unknown, context: Record<string, unknown>): Record<string, unknown>;
@@ -53,11 +64,16 @@ export declare const _internal: {
53
64
  STATE_LABELS: Readonly<Record<string, string>>;
54
65
  stateMetadata: ReadonlyMap<string, StateMetadata>;
55
66
  pendingBossQuestionFromContext: typeof pendingBossQuestionFromContext;
56
- formatAwaitBossReplyEntry: typeof formatAwaitBossReplyEntry;
67
+ formatAwaitBossReplyQuestion: typeof formatAwaitBossReplyQuestion;
68
+ formatAwaitBossReplyMarker: typeof formatAwaitBossReplyMarker;
57
69
  formatStateEntry: typeof formatStateEntry;
58
70
  formatTransition: typeof formatTransition;
59
71
  formatClassification: typeof formatClassification;
60
72
  stateTelemetryPayload: typeof stateTelemetryPayload;
73
+ normalizeErrorCompact: typeof normalizeErrorCompact;
74
+ normalizeErrorFull: typeof normalizeErrorFull;
75
+ normalizeEventForTelemetry: typeof normalizeEventForTelemetry;
76
+ VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string>;
61
77
  };
62
78
  export default function createPlaybookRuntime(options: CodePlaybookOptions): PlaybookRuntime;
63
79
  export {};