@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.
Files changed (76) hide show
  1. package/docs/embedding.md +2 -2
  2. package/package.json +1 -1
  3. package/reference/sdlc/branch.playbook/branch.fsm.d.ts +63 -33
  4. package/reference/sdlc/branch.playbook/branch.fsm.js +190 -108
  5. package/reference/sdlc/branch.playbook/branch.fsm.ts +269 -147
  6. package/reference/sdlc/branch.playbook/branch.gears.md +7 -17
  7. package/reference/sdlc/branch.playbook/branch.playbook.d.ts +12 -16
  8. package/reference/sdlc/branch.playbook/branch.playbook.js +112 -101
  9. package/reference/sdlc/branch.playbook/branch.playbook.ts +128 -171
  10. package/reference/sdlc/branch.playbook/branch.registry.d.ts +3 -2
  11. package/reference/sdlc/branch.playbook/branch.registry.ts +6 -2
  12. package/reference/sdlc/code.playbook/code.fsm.d.ts +143 -90
  13. package/reference/sdlc/code.playbook/code.fsm.introspect.d.ts +8 -8
  14. package/reference/sdlc/code.playbook/code.fsm.introspect.ts +13 -13
  15. package/reference/sdlc/code.playbook/code.fsm.js +609 -649
  16. package/reference/sdlc/code.playbook/code.fsm.ts +890 -821
  17. package/reference/sdlc/code.playbook/code.gears.md +39 -29
  18. package/reference/sdlc/code.playbook/code.playbook.d.ts +13 -16
  19. package/reference/sdlc/code.playbook/code.playbook.js +166 -147
  20. package/reference/sdlc/code.playbook/code.playbook.ts +180 -229
  21. package/reference/sdlc/code.playbook/code.registry.d.ts +3 -2
  22. package/reference/sdlc/code.playbook/code.registry.ts +6 -2
  23. package/reference/sdlc/code.playbook/playbook-captain.d.ts +42 -0
  24. package/reference/sdlc/code.playbook/playbook-captain.js +829 -194
  25. package/reference/sdlc/code.playbook/playbook-captain.ts +1227 -220
  26. package/reference/sdlc/decide.md +1 -0
  27. package/reference/sdlc/decide.playbook/decide.fsm.d.ts +270 -154
  28. package/reference/sdlc/decide.playbook/decide.fsm.js +765 -732
  29. package/reference/sdlc/decide.playbook/decide.fsm.ts +1167 -945
  30. package/reference/sdlc/decide.playbook/decide.gears.md +28 -21
  31. package/reference/sdlc/decide.playbook/decide.playbook.d.ts +11 -59
  32. package/reference/sdlc/decide.playbook/decide.playbook.js +155 -3696
  33. package/reference/sdlc/decide.playbook/decide.playbook.ts +186 -5244
  34. package/reference/sdlc/decide.playbook/decide.registry.d.ts +8 -4
  35. package/reference/sdlc/decide.playbook/decide.registry.js +2 -2
  36. package/reference/sdlc/decide.playbook/decide.registry.ts +13 -6
  37. package/reference/sdlc/dev.playbook/dev.fsm.d.ts +113 -131
  38. package/reference/sdlc/dev.playbook/dev.fsm.js +517 -575
  39. package/reference/sdlc/dev.playbook/dev.fsm.ts +667 -787
  40. package/reference/sdlc/dev.playbook/dev.gears.md +52 -54
  41. package/reference/sdlc/dev.playbook/dev.playbook.d.ts +13 -10
  42. package/reference/sdlc/dev.playbook/dev.playbook.js +128 -120
  43. package/reference/sdlc/dev.playbook/dev.playbook.ts +143 -193
  44. package/reference/sdlc/dev.playbook/dev.registry.d.ts +3 -2
  45. package/reference/sdlc/dev.playbook/dev.registry.ts +6 -2
  46. package/reference/sdlc/pr.playbook/pr.fsm.d.ts +92 -85
  47. package/reference/sdlc/pr.playbook/pr.fsm.js +461 -518
  48. package/reference/sdlc/pr.playbook/pr.fsm.ts +533 -663
  49. package/reference/sdlc/pr.playbook/pr.gears.md +47 -63
  50. package/reference/sdlc/pr.playbook/pr.playbook.d.ts +13 -23
  51. package/reference/sdlc/pr.playbook/pr.playbook.js +118 -112
  52. package/reference/sdlc/pr.playbook/pr.playbook.ts +136 -190
  53. package/reference/sdlc/pr.playbook/pr.registry.d.ts +3 -2
  54. package/reference/sdlc/pr.playbook/pr.registry.ts +4 -2
  55. package/reference/sdlc/review.md +3 -3
  56. package/reference/sdlc/review.playbook/review.fsm.d.ts +150 -116
  57. package/reference/sdlc/review.playbook/review.fsm.js +479 -550
  58. package/reference/sdlc/review.playbook/review.fsm.ts +717 -662
  59. package/reference/sdlc/review.playbook/review.gears.md +32 -29
  60. package/reference/sdlc/review.playbook/review.playbook.d.ts +12 -12
  61. package/reference/sdlc/review.playbook/review.playbook.js +180 -155
  62. package/reference/sdlc/review.playbook/review.playbook.ts +190 -230
  63. package/reference/sdlc/review.playbook/review.registry.d.ts +6 -5
  64. package/reference/sdlc/review.playbook/review.registry.js +3 -3
  65. package/reference/sdlc/review.playbook/review.registry.ts +9 -5
  66. package/slc/gears2fsm.md +72 -3
  67. package/slc/link.md +50 -27
  68. package/slc/materialize-link.mjs +51 -13
  69. package/slc/optimize.md +4 -1
  70. package/slc/prefix-prompts.mjs +29 -28
  71. package/slc/prefix.md +27 -24
  72. package/slc/slc.pin-inputs.json +11 -2
  73. package/slc/text2gears.md +71 -11
  74. package/src/xstate-playbook-runtime.d.ts +54 -15
  75. package/src/xstate-playbook-runtime.js +1154 -248
  76. package/src/xstate-playbook-runtime.ts +1603 -317
@@ -1,236 +1,182 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
3
- //
4
- // Generated by slc/link.md (FSM-to-Runtime linker).
5
- // Source FSM: ./pr.fsm.ts
6
- // Role metadata: Coder→coder (canonical local role)
7
- // Boss event: deterministic START_PR entry; exact Boss text becomes
8
- // callerInput; pending Coder questions retain BOSS_REPLY
9
- // Adjudication: LLM judge for the one Coder state; coderOutput is carried
10
- // verbatim; pullRequest and pullRequestUrl are judge-authored
11
- // semantic fields; every arm is governed `unchanged`
12
- // Scripts: five DR-016 script states run through the shared factory's
13
- // `sh -c` actor in the optional `cwd` option
14
- // Nested calls: literal code target through the shared bridge
15
- // Compat: artifact schema 3 / runtime ABI 1
16
-
3
+ // Generated by slc/materialize-link.mjs; governed by the complete slc/link.md.
4
+ // FSM: "./pr.fsm.js"; export: prMachine; strategies: shared defaults with labelled string relays and nested actors.
5
+ import { prMachine as machine } from "./pr.fsm.js";
6
+ import type { PlayerInput as SourcePlayerInput } from "./pr.fsm.js";
17
7
  import {
18
- createXStatePlaybookRuntime,
19
- composePlayerContinuation,
20
- snapshotJsonValue,
8
+ createXStatePlaybookRuntime, snapshotJsonValue,
9
+ composePlayerContinuation, type XStatePromptIdentity,
21
10
  type PlaybookPlayerInput,
22
- type XStatePlaybookRuntimeFactory,
23
11
  type XStatePlaybookRuntimeConstruction,
12
+ type XStatePlaybookRuntimeFactory,
24
13
  type XStatePlaybookRuntimeSpecV3,
25
14
  } from '@sublang/playbook/xstate-runtime';
26
- import {
27
- prMachine,
28
- type PlayerInput,
29
- type PrInput,
30
- } from './pr.fsm.js';
31
- import type { PlaybookHostConstructionCapabilities } from '../code.playbook/playbook-captain.js';
32
- import type {
33
- CaptainCallOptions,
34
- CaptainResult,
35
- JsonValue,
36
- NormalizedError,
37
- PlayerCallOptions,
38
- PlaybookCallRequest,
39
- PlaybookCallResult,
40
- PlaybookCallStart,
41
- PlaybookControlReceipt,
42
- PlaybookControlView,
43
- PlaybookPendingCall,
44
- PlaybookPorts,
45
- PlaybookRunResult,
46
- PlaybookRuntime,
47
- PlaybookRuntimeFactory,
48
- PlaybookRuntimeSnapshot,
49
- PlaybookSession,
50
- PlaybookState,
51
- PlaybookStateValue,
52
- PlaybookTraceEvent,
53
- PlaybookTraceType,
15
+ export type {
54
16
  PlayerResult,
17
+ PlayerCallOptions,
55
18
  PlayerSessionStore,
56
- } from '@sublang/playbook/runtime';
57
-
58
- export type {
59
- CaptainCallOptions,
60
19
  CaptainResult,
20
+ CaptainCallOptions,
61
21
  JsonValue,
62
22
  NormalizedError,
63
- PlayerCallOptions,
64
23
  PlaybookCallRequest,
65
24
  PlaybookCallResult,
66
25
  PlaybookCallStart,
67
- PlaybookControlReceipt,
68
- PlaybookControlView,
26
+ PlaybookStateValue,
27
+ PlaybookState,
69
28
  PlaybookPendingCall,
70
- PlaybookPorts,
71
29
  PlaybookRunResult,
72
30
  PlaybookRuntime,
73
31
  PlaybookRuntimeFactory,
74
32
  PlaybookRuntimeSnapshot,
75
33
  PlaybookSession,
76
- PlaybookState,
77
- PlaybookStateValue,
34
+ PlaybookPorts,
78
35
  PlaybookTraceEvent,
79
36
  PlaybookTraceType,
80
- PlayerResult,
81
- PlayerSessionStore,
82
- };
83
-
84
- /**
85
- * PR's per-run options. The machine reads no input of its own; the one
86
- * linker-owned option is the working directory its five script states run
87
- * in (slc/link.md §Script execution). Absent, the process working directory.
88
- */
89
- export type PrPlaybookOptions = PrInput & {
90
- readonly cwd?: string;
91
- };
92
- export type PrPlaybookHostCapabilities =
93
- PlaybookHostConstructionCapabilities &
94
- XStatePlaybookRuntimeConstruction<PrPlaybookOptions, object>['hostCapabilities'];
37
+ PlaybookControlReceipt,
38
+ PlaybookControlView,
39
+ } from '@sublang/playbook/runtime';
95
40
 
96
- const OPTION_KEYS = new Set(['cwd']);
97
- const PLACEHOLDER = /<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>/g;
41
+ export interface PlaybookRuntimeOptions {
42
+ readonly "cwd"?: string;
43
+ }
44
+ export type PlaybookHostCapabilities = XStatePlaybookRuntimeConstruction<
45
+ PlaybookRuntimeOptions, { readonly authority: object }
46
+ >['hostCapabilities'];
98
47
 
99
- const VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string> = new Set([
100
- 'coderOutput',
48
+ const OPTION_SCHEMA = {
49
+ "cwd": {
50
+ "type": "string",
51
+ "required": false
52
+ }
53
+ } as const;
54
+ const INPUT_MAPPING = {} as const;
55
+ const RESUMABLE_STATE_IDS: ReadonlySet<string> = new Set([
56
+ "openPullRequest"
101
57
  ]);
102
- // Every failure terminal leaves the delivery unfinished: no pull request is
103
- // guaranteed to exist after notPublished, the three fix terminals leave it
104
- // open, and mergeRefused leaves it in the state GitHub reports.
105
58
  const UNFINISHED_FINAL_STATE_IDS: ReadonlySet<string> = new Set([
106
- 'notPublished',
107
- 'fixFailed',
108
- 'fixNotPublished',
109
- 'checksStillFailing',
110
- 'mergeRefused',
59
+ "notPublished",
60
+ "fixFailed",
61
+ "fixNotPublished",
62
+ "checksFailed",
63
+ "mergeUnconfirmed"
111
64
  ]);
112
-
113
- function snapshotPrOptions(value: unknown): PrPlaybookOptions {
114
- const captured = snapshotJsonValue(value, 'PR runtime options');
115
- if (
116
- captured === null ||
117
- typeof captured !== 'object' ||
118
- Array.isArray(captured)
119
- ) {
120
- throw new TypeError('PR runtime options must be an object');
65
+ const VERBATIM_PAYLOAD_FIELDS: ReadonlySet<string> = new Set([
66
+ "coderOutput"
67
+ ]);
68
+ export function validateOptions(value: unknown): PlaybookRuntimeOptions {
69
+ const captured = snapshotJsonValue(value === undefined ? {} : value, "PR runtime options");
70
+ if (captured === null || typeof captured !== 'object' || Array.isArray(captured)) {
71
+ throw new TypeError("PR runtime options must be an object");
121
72
  }
122
- const record = captured as Readonly<Record<string, JsonValue>>;
123
- for (const [key, option] of Object.entries(record)) {
124
- if (!OPTION_KEYS.has(key)) {
125
- throw new TypeError(`PR runtime options.${key} is not declared`);
126
- }
127
- if (typeof option !== 'string' || option.length === 0) {
128
- throw new TypeError(`PR runtime options.${key} must be a non-empty string`);
73
+ const fields = captured as Readonly<Record<string, unknown>>;
74
+ for (const key of Object.keys(captured)) {
75
+ if (!Object.hasOwn(OPTION_SCHEMA, key)) throw new TypeError("PR runtime options." + key + ' is not declared');
76
+ }
77
+ for (const [key, schema] of Object.entries(OPTION_SCHEMA) as [string, { type: string; required: boolean }][]) {
78
+ if (!Object.hasOwn(captured, key)) {
79
+ if (schema.required) throw new TypeError("PR runtime options." + key + ' is required');
80
+ } else if (typeof fields[key] !== schema.type || (schema.type === 'number' && !Number.isFinite(fields[key]))) {
81
+ throw new TypeError("PR runtime options." + key + ' must be a ' + schema.type);
129
82
  }
130
83
  }
131
- return captured as unknown as PrPlaybookOptions;
84
+ return captured as unknown as PlaybookRuntimeOptions;
132
85
  }
133
-
134
- function placeholderField(token: string): string {
135
- if (token === '#') return 'irNumber';
136
- return token.replace(/-([A-Za-z0-9_$])/g, (_match, next: string) =>
137
- next.toUpperCase(),
138
- );
139
- }
140
-
141
- function quotedContinuation(value: string): string {
142
- return value.replaceAll('\n', '\n> ');
143
- }
144
-
145
- /**
146
- * Preserve the authored Markdown quote marker around every line of the
147
- * relayed caller input. The generic composer preserves the marker itself;
148
- * PR's override additionally keeps a multiline value inside that quote.
149
- */
150
- function composePlayerPrompt(input: PlayerInput, resuming = false): string {
151
- const fields = input as unknown as Record<string, unknown>;
152
- const body = input.prompt.replace(
153
- PLACEHOLDER,
154
- (match: string, token: string, offset: number, source: string) => {
155
- const value = fields[placeholderField(token)];
86
+ function renderPlayerPrompt(input: SourcePlayerInput, promptIdentity: XStatePromptIdentity, resuming = false): string {
87
+ const fields = input as unknown as Readonly<Record<string, unknown>>;
88
+ const mapping: Readonly<Record<string, string>> = {};
89
+ const identities: Readonly<Record<string, string>> = {};
90
+ const omitted = new Set<string>([]);
91
+ const fieldFor = (token: string): string => Object.hasOwn(mapping, token) ? mapping[token]! : (token === '#' ? 'irNumber' : token.replace(/-([A-Za-z0-9_$])/g, (_match: string, next: string) => next.toUpperCase()));
92
+ const parts = input.prompt.split(/(\r?\n)/);
93
+ let body = '';
94
+ for (let index = 0; index < parts.length; index += 2) {
95
+ const line = parts[index]!;
96
+ if (omitted.has(line)) {
97
+ const token = /<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>$/.exec(line)![1]!;
98
+ if (fields[fieldFor(token)] === '') continue;
99
+ }
100
+ body += line.replace(/<(#|[A-Za-z_$][A-Za-z0-9_$-]*)>/g, (match: string, token: string): string => {
101
+ const value = Object.hasOwn(identities, token) ? promptIdentity(identities[token]!) : fields[fieldFor(token)];
156
102
  if (typeof value !== 'string') return match;
157
- const lineStart = source.lastIndexOf('\n', offset - 1) + 1;
158
- return source.slice(lineStart, offset).startsWith('> ')
159
- ? quotedContinuation(value)
160
- : value;
161
- },
162
- );
103
+ return line.startsWith('> ') ? value.replace(/\r?\n/g, (ending: string) => ending + '> ') : value;
104
+ }) + (parts[index + 1] ?? '');
105
+ }
163
106
  return composePlayerContinuation(input, body, resuming);
164
107
  }
165
-
166
- export const _internal = {
167
- composePlayerPrompt,
168
- VERBATIM_PAYLOAD_FIELDS,
169
- UNFINISHED_FINAL_STATE_IDS,
170
- };
171
-
108
+ const composePlayerPrompt = (input: PlaybookPlayerInput, promptIdentity: XStatePromptIdentity, resuming?: boolean): string =>
109
+ renderPlayerPrompt(input as SourcePlayerInput, promptIdentity, resuming);
172
110
  const runtimeSpec = {
173
- label: 'PR',
174
- // DR-022 / slc/link.md: the declaration carries the value current at link
175
- // time — a literal, never the loading engine's RUNTIME_ABI self-report,
176
- // which would follow whatever engine loads the module and make the
177
- // factory's skew check compare that engine with itself.
178
- compat: { artifactSchema: 3, runtimeAbi: 1 },
179
- snapshotOptions: snapshotPrOptions,
180
- entryEvent: {
181
- type: 'START_PR',
182
- textField: 'callerInput',
183
- // `startPr` copies the entry text here, so the failure-state retry reads
184
- // it back from the persisted machine snapshot and survives a continued
185
- // session (DR-034).
186
- contextField: 'callerInput',
111
+ composePlayerPrompt,
112
+ ...{
113
+ "label": "PR",
114
+ "compat": {
115
+ "artifactSchema": 3,
116
+ "runtimeAbi": 1
187
117
  },
188
- roleStates: {
189
- openPullRequest: {
190
- role: 'coder',
191
- label: 'Coder is publishing the branch and opening its pull request.',
192
- },
118
+ "entryEvent": {
119
+ "type": "START_PR",
120
+ "textField": "callerInput",
121
+ "contextField": "callerInput"
193
122
  },
194
- // DR-050: PR owns no repository commit — pushing a branch and opening a
195
- // pull request move only remote-tracking refs and forge state, so every
196
- // Coder outcome is governed with the `unchanged` repository disposition.
197
- // The pull request number and URL are judge-authored semantic fields; the
198
- // Coder's report on a refused publication is carried verbatim.
199
- outcomeAuthority: {
200
- governedPlayerStates: {
201
- openPullRequest: {
202
- opened: {
203
- fields: { pullRequest: 'semantic', pullRequestUrl: 'semantic' },
204
- repositoryDisposition: 'unchanged',
205
- },
206
- notPublished: {
207
- fields: { coderOutput: 'presentation' },
208
- repositoryDisposition: 'unchanged',
123
+ "bossEvents": [],
124
+ "roleStates": {
125
+ "openPullRequest": {
126
+ "role": "coder",
127
+ "label": "Coder is publishing the branch and opening its pull request without changing any file or making any commit."
128
+ }
129
+ },
130
+ "outcomeAuthority": {
131
+ "governedPlayerStates": {
132
+ "openPullRequest": {
133
+ "opened": {
134
+ "fields": {
135
+ "pullRequest": "semantic",
136
+ "pullRequestUrl": "semantic"
137
+ },
138
+ "repositoryDisposition": "unchanged"
209
139
  },
210
- needsBossReply: {
211
- fields: { question: 'presentation' },
212
- repositoryDisposition: 'unchanged',
140
+ "notPublished": {
141
+ "fields": {
142
+ "coderOutput": "presentation"
143
+ },
144
+ "repositoryDisposition": "unchanged"
213
145
  },
214
- },
215
- },
146
+ "needsBossReply": {
147
+ "fields": {
148
+ "question": "presentation"
149
+ },
150
+ "repositoryDisposition": "unchanged"
151
+ }
152
+ }
153
+ }
216
154
  },
217
- composePlayerPrompt: (input: PlaybookPlayerInput, _identity, resuming) =>
218
- composePlayerPrompt(input as PlayerInput, resuming),
155
+ "placeholderFields": {},
156
+ "transitionEventFields": [
157
+ "callerInput",
158
+ "answer",
159
+ "questionId"
160
+ ],
161
+ "controlContextFields": []
162
+ },
163
+ snapshotOptions: validateOptions,
164
+ machineInput: (options: PlaybookRuntimeOptions) => Object.fromEntries(
165
+ Object.entries(INPUT_MAPPING).filter(([, key]) => options[key as keyof PlaybookRuntimeOptions] !== undefined)
166
+ .map(([field, key]) => [field, options[key as keyof PlaybookRuntimeOptions]]),
167
+ ),
219
168
  verbatimPayloadFields: VERBATIM_PAYLOAD_FIELDS,
220
- controlContextFields: [],
169
+ resumableStateIds: RESUMABLE_STATE_IDS,
221
170
  unfinishedFinalStateIds: UNFINISHED_FINAL_STATE_IDS,
222
- transitionEventFields: ['callerInput', 'answer', 'questionId'],
223
- } satisfies XStatePlaybookRuntimeSpecV3<PrPlaybookOptions>;
171
+ } satisfies XStatePlaybookRuntimeSpecV3<PlaybookRuntimeOptions>;
224
172
 
173
+ export const _internal = {
174
+ composePlayerPrompt,
175
+ RESUMABLE_STATE_IDS,
176
+ UNFINISHED_FINAL_STATE_IDS,
177
+ VERBATIM_PAYLOAD_FIELDS,
178
+ };
225
179
  const createPlaybookRuntime: XStatePlaybookRuntimeFactory<
226
- XStatePlaybookRuntimeConstruction<
227
- PrPlaybookOptions,
228
- PrPlaybookHostCapabilities
229
- >,
230
- 3
231
- > = createXStatePlaybookRuntime<
232
- PrPlaybookOptions,
233
- PrPlaybookHostCapabilities
234
- >(prMachine, runtimeSpec);
235
-
180
+ XStatePlaybookRuntimeConstruction<PlaybookRuntimeOptions, PlaybookHostCapabilities>, 3
181
+ > = createXStatePlaybookRuntime<PlaybookRuntimeOptions, PlaybookHostCapabilities>(machine, runtimeSpec);
236
182
  export default createPlaybookRuntime;
@@ -1,4 +1,5 @@
1
- import { type PrPlaybookHostCapabilities, type PlaybookRuntime } from './pr.playbook.js';
1
+ import type { PlaybookHostConstructionCapabilities } from '../code.playbook/playbook-captain.js';
2
+ import { type PlaybookHostCapabilities, type PlaybookRuntime } from './pr.playbook.js';
2
3
  export interface PlaybookSummaryPolicy {
3
4
  stateCountLabels: Readonly<Record<string, string>>;
4
5
  copyPasteGuardNames: readonly string[];
@@ -24,7 +25,7 @@ export interface PrPlaybookRegistryEntry {
24
25
  concurrentRoleSets: readonly [];
25
26
  summaryPolicy: PlaybookSummaryPolicy;
26
27
  validateOptions(optionSlice: unknown): PrOptions;
27
- createRuntime(options: PrOptions, hostCapabilities: PrPlaybookHostCapabilities): PlaybookRuntime;
28
+ createRuntime(options: PrOptions, hostCapabilities: PlaybookHostConstructionCapabilities & PlaybookHostCapabilities): PlaybookRuntime;
28
29
  }
29
30
  export declare const prStateCountLabels: {
30
31
  readonly openPullRequest: "publication round";
@@ -1,8 +1,9 @@
1
1
  // SPDX-License-Identifier: Apache-2.0
2
2
  // SPDX-FileCopyrightText: 2026 SubLang International <https://sublang.ai>
3
3
 
4
+ import type { PlaybookHostConstructionCapabilities } from '../code.playbook/playbook-captain.js';
4
5
  import createPlaybookRuntime, {
5
- type PrPlaybookHostCapabilities,
6
+ type PlaybookHostCapabilities,
6
7
  type PlaybookRuntime,
7
8
  } from './pr.playbook.js';
8
9
 
@@ -35,7 +36,8 @@ export interface PrPlaybookRegistryEntry {
35
36
  validateOptions(optionSlice: unknown): PrOptions;
36
37
  createRuntime(
37
38
  options: PrOptions,
38
- hostCapabilities: PrPlaybookHostCapabilities,
39
+ hostCapabilities: PlaybookHostConstructionCapabilities &
40
+ PlaybookHostCapabilities,
39
41
  ): PlaybookRuntime;
40
42
  }
41
43
 
@@ -57,7 +57,7 @@ Captain shall append the round’s context in quotes (`>`):
57
57
  > Original request: <caller-input>
58
58
  > Coder output: <coder-output>
59
59
 
60
- At the start of *every* review round, Captain shall relay to Reviewer the original intent, the review scope and context, the exact repository revision being evaluated, any Coder feedback from the preceding round, and any relevant run results, in quotes (`>`) after the instruction.
60
+ At the start of *every* review round, Captain shall relay to Reviewer the original intent, the review scope and context, any Coder feedback from the preceding round, and any relevant run results, in quotes (`>`) after the instruction.
61
61
 
62
62
  At the start of *every* review round, Captain shall append the following instruction to the end of the prompt:
63
63
 
@@ -83,7 +83,7 @@ Consult @specs/meta.md for spec requirements if needed; verify affected specs fo
83
83
  Finding numbers are references within this review only.
84
84
  No review transition shall depend on numbering or any fixed presentation format of either player's reply.
85
85
 
86
- When Reviewer raises or keeps any finding, Captain shall relay the original intent, the review scope and context, the exact repository revision being evaluated, the Reviewer's findings, and any relevant run results to Coder, in quotes (`>`), along with the following prompt:
86
+ When Reviewer raises or keeps any finding, Captain shall relay the original intent, the review scope and context, the Reviewer's findings, and any relevant run results to Coder, in quotes (`>`), along with the following prompt:
87
87
 
88
88
  > Original request: <caller-input>
89
89
  > Reviewer findings: <reviewer-output>
@@ -109,7 +109,7 @@ Report every disposition, all relevant run results, and every rebuttal.
109
109
 
110
110
  Captain shall use the repository-effect receipt as the authoritative identity of any review-fix commit.
111
111
 
112
- When Coder makes a new commit or decides to reject all findings, Captain shall relay the above required context to Reviewer and begin the next review round.
112
+ When Coder makes a new commit or decides to reject all findings, Captain shall relay the round's context above to Reviewer and begin the next review round.
113
113
  Reviewer shall read the context information and follow the corresponding instructions.
114
114
  Rounds continue until Reviewer affirmatively reports that the requested review is complete and no unsettled findings remain.
115
115
  A progress report, status update, or promise of a later result supports no review outcome.