@sublang/playbook 18.0.0 → 18.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sublang/playbook",
3
- "version": "18.0.0",
3
+ "version": "18.0.1",
4
4
  "type": "module",
5
5
  "description": "Composable XState v5 playbook runtime with compiled Captain, CODE, REVIEW, DECIDE, DEV, BRANCH, PR, and INSPECT workflows driven by GEARS specs.",
6
6
  "license": "Apache-2.0",
@@ -276,6 +276,7 @@
276
276
  "test:acceptance": "node scripts/run-live-acceptance.mjs",
277
277
  "smoke:release": "node scripts/release-smoke.mjs",
278
278
  "check:links": "node scripts/check-links.mjs",
279
+ "prepush": "bash scripts/prepush.sh",
279
280
  "playbook": "node reference/sdlc/code.playbook/bin/playbook.js"
280
281
  },
281
282
  "publishConfig": {
@@ -283,7 +284,7 @@
283
284
  "provenance": true
284
285
  },
285
286
  "dependencies": {
286
- "@sublang/cligent": "^0.36.0",
287
+ "@sublang/cligent": "^0.36.1",
287
288
  "@sublang/spex": "^3.0.0",
288
289
  "p-queue": "^9.3.1",
289
290
  "xstate": "^5.19.4",
@@ -10,14 +10,14 @@ Roles:
10
10
 
11
11
  The caller supplies a coding request together with any relevant context.
12
12
 
13
- A new coding intent follows either one direct implementation phase or an IR sequence consisting of a new-IR phase followed by one phase for each IR task.
13
+ A new change intent, including standalone documentation or status maintenance that does not implement an identified unfinished IR task, follows either one direct implementation phase or an IR sequence consisting of a new-IR phase followed by one phase for each IR task.
14
14
  An existing IR follows one IR-task phase for each remaining unfinished task, starting with its next unfinished task.
15
15
  Each completed phase ends with one new Coder commit (owned by `code`).
16
16
  After each `code`-owned commit, Captain shall call the `review` playbook and wait until it passes with no unsettled findings.
17
17
  Playbook `review` owns every review round and every review-fix commit.
18
18
  Do not rewrite any existing commit.
19
19
 
20
- When `review` passes a direct implementation phase, `code` is complete.
20
+ When `review` passes a direct phase, `code` is complete.
21
21
  When `review` passes a new IR or a nonfinal IR-task phase, Captain shall continue with the next unfinished IR-task phase.
22
22
  When `review` passes the final IR-task phase, `code` is complete.
23
23
  When `review` returns an authored abort or failure, or a terminal result that does not establish that the supplied scope was evaluated with no unsettled findings, `code` shall start no further phase and shall report the failure and the last `code`-owned commit to its caller.
@@ -29,15 +29,18 @@ At the start of the first phase, Captain shall relay to Coder the complete calle
29
29
  > Run results: <run-results>
30
30
 
31
31
  ```markdown
32
- First determine whether the coding request starts a new coding intent or continues an existing IR with unfinished work.
32
+ First determine whether the request starts a new change intent or continues an existing IR with unfinished work.
33
33
  If the request may continue an existing IR but does not identify it unambiguously, ask Boss before changing files.
34
34
 
35
- For a new coding intent, assess whether it can be completed well in one commit.
35
+ Treat standalone documentation or status maintenance that does not implement an identified unfinished IR task as a new change intent, even when it refers to an IR with no unfinished task.
36
+ Do not invent or reopen an IR task, claim unperformed work complete, or infer an owner decision not supplied by the caller.
37
+
38
+ For a new change intent, assess whether it can be completed well in one commit.
36
39
  If it can, implement and test it, update the affected specs, and ensure @specs/map.md remains accurate.
37
40
  If it cannot, 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.
38
41
  Plan affected spec updates before, with, or after their corresponding code changes, either as standalone IR tasks or as explicit work within related tasks.
39
42
 
40
- For an existing IR, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.
43
+ For an existing IR with unfinished work, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.
41
44
  Do not implement a later task in this phase.
42
45
  Mark the IR's progress and deliverables when relevant.
43
46
  After implementing an IR task, identify it and state whether any IR task still has unfinished Coder work; if so identify the next unfinished task, otherwise state this was the final IR task's Coder work.
@@ -14,15 +14,18 @@ const REVIEW_PLAYBOOK_ID = 'review';
14
14
  // Prompts and result contracts (verbatim from code.gears.md)
15
15
  // ---------------------------------------------------------------------------
16
16
  const FIRST_PHASE_PROMPT = [
17
- 'First determine whether the coding request starts a new coding intent or continues an existing IR with unfinished work.',
17
+ 'First determine whether the request starts a new change intent or continues an existing IR with unfinished work.',
18
18
  'If the request may continue an existing IR but does not identify it unambiguously, ask Boss before changing files.',
19
19
  '',
20
- 'For a new coding intent, assess whether it can be completed well in one commit.',
20
+ 'Treat standalone documentation or status maintenance that does not implement an identified unfinished IR task as a new change intent, even when it refers to an IR with no unfinished task.',
21
+ 'Do not invent or reopen an IR task, claim unperformed work complete, or infer an owner decision not supplied by the caller.',
22
+ '',
23
+ 'For a new change intent, assess whether it can be completed well in one commit.',
21
24
  'If it can, implement and test it, update the affected specs, and ensure @specs/map.md remains accurate.',
22
25
  'If it cannot, 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.',
23
26
  'Plan affected spec updates before, with, or after their corresponding code changes, either as standalone IR tasks or as explicit work within related tasks.',
24
27
  '',
25
- 'For an existing IR, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.',
28
+ 'For an existing IR with unfinished work, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.',
26
29
  'Do not implement a later task in this phase.',
27
30
  "Mark the IR's progress and deliverables when relevant.",
28
31
  "After implementing an IR task, identify it and state whether any IR task still has unfinished Coder work; if so identify the next unfinished task, otherwise state this was the final IR task's Coder work.",
@@ -86,8 +89,8 @@ const REVIEW_IR_TASK_PHASE_TEMPLATE = [
86
89
  ].join('\n');
87
90
  const NEEDS_BOSS_REPLY_DESCRIPTION = "The acting agent's prose surfaces a clarifying question for Boss that the agent cannot answer alone. Output shall include `question: <verbatim question text from the acting agent's prose>`.";
88
91
  const FIRST_PHASE_RESULT = {
89
- directCommit: "Coder completed the new coding intent as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.",
90
- irCommit: "Coder decomposed the new coding intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.",
92
+ directCommit: "Coder completed the new change intent, including standalone documentation or status maintenance that does not implement an identified unfinished IR task (even when it refers to an IR with no unfinished task), as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.",
93
+ irCommit: "Coder decomposed the new change intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.",
91
94
  moreTasks: "Coder continued an existing IR, implemented exactly its next unfinished task, made its one new commit, and at least one IR task remains unfinished; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, `irNumber` identifying the continued IR, and `irTask` naming the implemented task.",
92
95
  finalTask: "Coder continued an existing IR, implemented its final unfinished task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, `irNumber` identifying the continued IR, and `irTask` naming the implemented task.",
93
96
  needsBossReply: NEEDS_BOSS_REPLY_DESCRIPTION,
@@ -99,8 +102,8 @@ const IR_TASK_PHASE_RESULT = {
99
102
  };
100
103
  const STATE_DESCRIPTIONS = {
101
104
  ready: 'Waiting for a coding request.',
102
- firstPhase: 'Coder runs the first coding phase: a direct implementation, a new IR, or the next task of an existing IR.',
103
- reviewNewIntentPhase: 'REVIEW examines the commit of the direct implementation or new-IR phase.',
105
+ firstPhase: 'Coder runs the first phase: a direct change, a new IR, or an existing IR\'s next unfinished task.',
106
+ reviewNewIntentPhase: 'REVIEW examines the commit of the direct or new-IR phase.',
104
107
  irTaskPhase: "Coder implements the identified IR's next unfinished task.",
105
108
  reviewIrTaskPhase: 'REVIEW examines the commit of the IR-task phase.',
106
109
  awaitBossReply: "Waiting for Boss to answer the acting agent's question.",
@@ -251,15 +251,18 @@ export type CodeEvent =
251
251
  // ---------------------------------------------------------------------------
252
252
 
253
253
  const FIRST_PHASE_PROMPT = [
254
- 'First determine whether the coding request starts a new coding intent or continues an existing IR with unfinished work.',
254
+ 'First determine whether the request starts a new change intent or continues an existing IR with unfinished work.',
255
255
  'If the request may continue an existing IR but does not identify it unambiguously, ask Boss before changing files.',
256
256
  '',
257
- 'For a new coding intent, assess whether it can be completed well in one commit.',
257
+ 'Treat standalone documentation or status maintenance that does not implement an identified unfinished IR task as a new change intent, even when it refers to an IR with no unfinished task.',
258
+ 'Do not invent or reopen an IR task, claim unperformed work complete, or infer an owner decision not supplied by the caller.',
259
+ '',
260
+ 'For a new change intent, assess whether it can be completed well in one commit.',
258
261
  'If it can, implement and test it, update the affected specs, and ensure @specs/map.md remains accurate.',
259
262
  'If it cannot, 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.',
260
263
  'Plan affected spec updates before, with, or after their corresponding code changes, either as standalone IR tasks or as explicit work within related tasks.',
261
264
  '',
262
- 'For an existing IR, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.',
265
+ 'For an existing IR with unfinished work, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.',
263
266
  'Do not implement a later task in this phase.',
264
267
  "Mark the IR's progress and deliverables when relevant.",
265
268
  "After implementing an IR task, identify it and state whether any IR task still has unfinished Coder work; if so identify the next unfinished task, otherwise state this was the final IR task's Coder work.",
@@ -330,9 +333,9 @@ const NEEDS_BOSS_REPLY_DESCRIPTION =
330
333
 
331
334
  const FIRST_PHASE_RESULT = {
332
335
  directCommit:
333
- "Coder completed the new coding intent as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.",
336
+ "Coder completed the new change intent, including standalone documentation or status maintenance that does not implement an identified unfinished IR task (even when it refers to an IR with no unfinished task), as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.",
334
337
  irCommit:
335
- "Coder decomposed the new coding intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.",
338
+ "Coder decomposed the new change intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.",
336
339
  moreTasks:
337
340
  "Coder continued an existing IR, implemented exactly its next unfinished task, made its one new commit, and at least one IR task remains unfinished; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, `irNumber` identifying the continued IR, and `irTask` naming the implemented task.",
338
341
  finalTask:
@@ -351,9 +354,9 @@ const IR_TASK_PHASE_RESULT = {
351
354
  const STATE_DESCRIPTIONS = {
352
355
  ready: 'Waiting for a coding request.',
353
356
  firstPhase:
354
- 'Coder runs the first coding phase: a direct implementation, a new IR, or the next task of an existing IR.',
357
+ 'Coder runs the first phase: a direct change, a new IR, or an existing IR\'s next unfinished task.',
355
358
  reviewNewIntentPhase:
356
- 'REVIEW examines the commit of the direct implementation or new-IR phase.',
359
+ 'REVIEW examines the commit of the direct or new-IR phase.',
357
360
  irTaskPhase: "Coder implements the identified IR's next unfinished task.",
358
361
  reviewIrTaskPhase: 'REVIEW examines the commit of the IR-task phase.',
359
362
  awaitBossReply: "Waiting for Boss to answer the acting agent's question.",
@@ -17,15 +17,18 @@ When the request may continue an existing IR that it does not identify unambiguo
17
17
 
18
18
  When the first coding phase begins for the caller's coding request and any relevant context, Captain shall prompt Coder:
19
19
 
20
- > First determine whether the coding request starts a new coding intent or continues an existing IR with unfinished work.
20
+ > First determine whether the request starts a new change intent or continues an existing IR with unfinished work.
21
21
  > If the request may continue an existing IR but does not identify it unambiguously, ask Boss before changing files.
22
22
  >
23
- > For a new coding intent, assess whether it can be completed well in one commit.
23
+ > Treat standalone documentation or status maintenance that does not implement an identified unfinished IR task as a new change intent, even when it refers to an IR with no unfinished task.
24
+ > Do not invent or reopen an IR task, claim unperformed work complete, or infer an owner decision not supplied by the caller.
25
+ >
26
+ > For a new change intent, assess whether it can be completed well in one commit.
24
27
  > If it can, implement and test it, update the affected specs, and ensure @specs/map.md remains accurate.
25
28
  > If it cannot, 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.
26
29
  > Plan affected spec updates before, with, or after their corresponding code changes, either as standalone IR tasks or as explicit work within related tasks.
27
30
  >
28
- > For an existing IR, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.
31
+ > For an existing IR with unfinished work, read the identified IR and implement exactly its next unfinished task, including corresponding tests or specs if any.
29
32
  > Do not implement a later task in this phase.
30
33
  > Mark the IR's progress and deliverables when relevant.
31
34
  > After implementing an IR task, identify it and state whether any IR task still has unfinished Coder work; if so identify the next unfinished task, otherwise state this was the final IR task's Coder work.
@@ -49,8 +52,8 @@ When the first coding phase begins for the caller's coding request and any relev
49
52
  > > Run results: <run-results>
50
53
 
51
54
  Results:
52
- - `directCommit`: Coder completed the new coding intent as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.
53
- - `irCommit`: Coder decomposed the new coding intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.
55
+ - `directCommit`: Coder completed the new change intent, including standalone documentation or status maintenance that does not implement an identified unfinished IR task (even when it refers to an IR with no unfinished task), as one direct implementation phase and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>` and `latestCommit: <commit identity>`.
56
+ - `irCommit`: Coder decomposed the new change intent into a new IR, implemented no IR task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, and `irNumber` identifying the created IR.
54
57
  - `moreTasks`: Coder continued an existing IR, implemented exactly its next unfinished task, made its one new commit, and at least one IR task remains unfinished; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, `irNumber` identifying the continued IR, and `irTask` naming the implemented task.
55
58
  - `finalTask`: Coder continued an existing IR, implemented its final unfinished task, and made its one new commit; Coder's result affirmatively supports this outcome, and no fixed presentation format of the reply is required. Output shall include `coderOutput: <verbatim final text>`, `latestCommit: <commit identity>`, `irNumber` identifying the continued IR, and `irTask` naming the implemented task.
56
59
 
@@ -58,7 +61,7 @@ Results:
58
61
 
59
62
  Captain waits until `review` passes with no unsettled findings; playbook `review` owns every review round and every review-fix commit, and no existing commit is rewritten.
60
63
 
61
- When a direct implementation or new-IR phase ends with its one new `code`-owned commit, Captain shall call playbook `review`:
64
+ When a direct or new-IR phase ends with its one new `code`-owned commit, Captain shall call playbook `review`:
62
65
 
63
66
  > > Original intent: <caller-input>
64
67
  > > Review scope: the commit <code-commit> from this coding phase and its resulting repository state.
@@ -69,7 +72,7 @@ On each successful nested REVIEW, Captain shall freeze the previous phase review
69
72
  CODE scope commit and evaluated revision remain distinct because REVIEW may create fix commits.
70
73
  No caller option, player prose or repository status text supplies this record.
71
74
  The record survives permitted restoration and the current task's Boss-answer continuation, and a fresh run or explicit Boss interruption clears it.
72
- When `review` passes a direct implementation phase, `code` is complete and returns to its caller the exact last `code`-owned commit, the exact final evaluated repository revision, and the fact that every phase's review passed with no unsettled findings.
75
+ When `review` passes a direct phase, `code` is complete and returns to its caller the exact last `code`-owned commit, the exact final evaluated repository revision, and the fact that every phase's review passed with no unsettled findings.
73
76
  When `review` passes a new-IR phase, Captain continues with the next unfinished IR-task phase.
74
77
  When `review` returns an authored abort or failure, or a terminal result that does not establish that the supplied scope was evaluated with no unsettled findings, `code` starts no further phase and reports the failure and the last `code`-owned commit to its caller.
75
78
  When the nested `review` call fails outside that authored result contract, `code` parks as failed and retains the control-plane error instead of reporting an authored review outcome.
@@ -86,7 +86,7 @@ const runtimeSpec = {
86
86
  "roleStates": {
87
87
  "firstPhase": {
88
88
  "role": "coder",
89
- "label": "Coder runs the first coding phase: a direct implementation, a new IR, or the next task of an existing IR."
89
+ "label": "Coder runs the first phase: a direct change, a new IR, or an existing IR's next unfinished task."
90
90
  },
91
91
  "irTaskPhase": {
92
92
  "role": "coder",
@@ -123,7 +123,7 @@ const runtimeSpec = {
123
123
  "roleStates": {
124
124
  "firstPhase": {
125
125
  "role": "coder",
126
- "label": "Coder runs the first coding phase: a direct implementation, a new IR, or the next task of an existing IR."
126
+ "label": "Coder runs the first phase: a direct change, a new IR, or an existing IR's next unfinished task."
127
127
  },
128
128
  "irTaskPhase": {
129
129
  "role": "coder",