@emiliosp/pi-maestro 0.21.0 → 0.23.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +55 -114
  3. package/agents/builder.md +7 -7
  4. package/agents/maestro.md +62 -45
  5. package/agents/simplifier.md +6 -5
  6. package/agents/verifier.md +13 -13
  7. package/docs/adr/0001-keep-the-workflow-independent-of-git.md +25 -0
  8. package/docs/adr/0002-store-escalation-decisions-in-builder-handoffs.md +24 -0
  9. package/docs/adr/0003-route-builder-failures-through-owner-escalations.md +23 -0
  10. package/docs/adr/0004-require-git-only-for-the-simplifier.md +35 -0
  11. package/docs/adr/0005-approve-a-specification-document-set-as-one-contract.md +32 -0
  12. package/docs/adr/0006-maintain-the-roadmap-in-linear.md +25 -0
  13. package/docs/adr/0007-maintain-the-roadmap-in-the-repository.md +27 -0
  14. package/docs/adr/0008-use-pis-registry-for-model-availability.md +23 -0
  15. package/docs/adr/0009-select-optional-phases-in-the-transition-table.md +24 -0
  16. package/docs/adr/0010-use-the-pi-sdk-for-sequential-agent-delegation.md +109 -0
  17. package/docs/adr/0011-separate-initial-setup-ui-from-configuration-rules.md +25 -0
  18. package/docs/adr/0012-filter-main-maestro-registrations-after-native-discovery.md +21 -0
  19. package/docs/adr/README.md +21 -0
  20. package/docs/configuration.md +33 -12
  21. package/docs/glossary.md +38 -49
  22. package/docs/inspiration.md +32 -0
  23. package/docs/roadmap/README.md +42 -0
  24. package/docs/roadmap/maestro-10-improve-status-presentation-and-activation-feedback.md +18 -0
  25. package/docs/roadmap/maestro-11-introduce-maestro-at-activation.md +19 -0
  26. package/docs/roadmap/maestro-12-verify-code-quality-against-agentsmd-instructions.md +21 -0
  27. package/docs/roadmap/maestro-13-check-subagent-extensions-at-activation.md +21 -0
  28. package/docs/roadmap/maestro-14-rename-the-test-support-directory.md +16 -0
  29. package/docs/roadmap/maestro-15-match-handoff-criteria-to-the-approved-spec.md +19 -0
  30. package/docs/roadmap/maestro-16-route-finding-driven-spec-revisions-through-drafting-spec.md +19 -0
  31. package/docs/roadmap/maestro-17-keep-acceptance-criterion-numbering-continuous.md +19 -0
  32. package/docs/roadmap/maestro-18-record-escalation-resolutions-when-the-spec-changes.md +18 -0
  33. package/docs/roadmap/maestro-19-guide-initial-configuration.md +22 -0
  34. package/docs/roadmap/maestro-20-rename-the-npm-package.md +17 -0
  35. package/docs/roadmap/maestro-21-label-acceptance-criterion-coverage.md +18 -0
  36. package/docs/roadmap/maestro-22-avoid-acceptance-criteria-already-covered-by-tests.md +16 -0
  37. package/docs/roadmap/maestro-23-change-agent-models-before-a-builder-run.md +14 -0
  38. package/docs/roadmap/maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent.md +23 -0
  39. package/docs/roadmap/maestro-25-define-workflow-reconciliation.md +19 -0
  40. package/docs/roadmap/maestro-26-exit-maestro-mode-automatically-at-workflow-completion.md +18 -0
  41. package/docs/roadmap/maestro-27-make-all-implementation-phases-optional.md +26 -0
  42. package/docs/roadmap/maestro-28-add-maestro-role-instructions-alongside-the-other-agents.md +14 -0
  43. package/docs/roadmap/maestro-6-display-specs-in-a-browser.md +14 -0
  44. package/docs/roadmap/maestro-7-route-builder-failures-through-owner-escalations.md +19 -0
  45. package/docs/roadmap/maestro-8-store-escalations-and-owner-decisions-in-builder-handoffs.md +19 -0
  46. package/docs/roadmap/maestro-9-format-glossary-terms-consistently.md +14 -0
  47. package/docs/roadmap/maestro-free-1-require-pi-150.md +16 -0
  48. package/docs/roadmap/maestro-free-2-remove-maestro-run-timeouts.md +18 -0
  49. package/docs/roadmap/maestro-free-3-run-the-builder-through-the-pi-sdk.md +31 -0
  50. package/docs/roadmap/maestro-free-4-run-the-verifier-through-the-pi-sdk.md +22 -0
  51. package/docs/roadmap/maestro-free-5-run-the-simplifier-through-the-pi-sdk.md +22 -0
  52. package/docs/roadmap/maestro-free-6-show-sdk-agent-activity-through-pi.md +21 -0
  53. package/docs/roadmap/maestro-free-7-remove-the-pi-subagents-dependency.md +21 -0
  54. package/docs/roadmap/maestro-free-pre-3-implement-internal-sdk-delegation.md +37 -0
  55. package/docs/subagent-integration.md +9 -29
  56. package/docs/workflow.md +62 -246
  57. package/extensions/maestro.ts +96 -19
  58. package/package.json +2 -6
  59. package/src/MaestroPaths.ts +9 -0
  60. package/src/config/assertConfiguration.ts +23 -21
  61. package/src/config/defaults.ts +2 -1
  62. package/src/config/loadConfiguration.ts +3 -2
  63. package/src/config/saveConfiguration.ts +38 -14
  64. package/src/config/schema.ts +13 -0
  65. package/src/maestro/checks/assertEnvironment.ts +8 -33
  66. package/src/maestro/selectAgentModels.ts +70 -0
  67. package/src/maestro/setupInitialConfiguration.ts +26 -0
  68. package/src/maestro/status/formatMaestroStatus.ts +3 -0
  69. package/src/score/collectWorkflowEvidence.ts +170 -0
  70. package/src/score/parseClassifierScores.ts +51 -0
  71. package/src/score/questions.json +24 -0
  72. package/src/score/requestEvaluation.ts +54 -0
  73. package/src/score/scoreWorkflow.ts +100 -0
  74. package/src/tools/child/record-builder-handoff.ts +1 -0
  75. package/src/tools/child/record-simplifier-handoff.ts +2 -1
  76. package/src/tools/child/record-verifier-handoff.ts +1 -0
  77. package/src/tools/main/create-spec.ts +1 -0
  78. package/src/tools/main/mark-spec-ready.ts +1 -0
  79. package/src/tools/main/resolve-escalations.ts +1 -0
  80. package/src/tools/main/resolve-findings.ts +6 -1
  81. package/src/tools/main/run-builder.ts +8 -1
  82. package/src/tools/main/run-simplifier.ts +26 -6
  83. package/src/tools/main/run-verifier.ts +8 -1
  84. package/src/tools/main/score-workflow.ts +43 -0
  85. package/src/ui/selectModel.ts +23 -15
  86. package/src/ui/showAgentRolesSetupMenu.ts +65 -0
  87. package/src/workflow/spec/markSpecReady.ts +13 -3
  88. package/src/workflow/state/schema.ts +3 -0
  89. package/src/workflow/transitions.ts +9 -2
  90. package/templates/spec.md +1 -1
  91. package/ADR.md +0 -457
  92. package/ROADMAP.md +0 -641
  93. package/src/maestro/setupConfiguration.ts +0 -50
  94. package/src/ui/selectSpec.ts +0 -14
  95. package/src/ui/showSetupMenu.ts +0 -44
  96. package/src/ui/showSpecMenu.ts +0 -36
  97. /package/{MISSION.md → docs/MISSION.md} +0 -0
  98. /package/{TECH_STACK.md → docs/TECH_STACK.md} +0 -0
package/ROADMAP.md DELETED
@@ -1,641 +0,0 @@
1
- # Roadmap
2
-
3
- This file is the source of truth for planned outcomes and recorded completion. Roadmap entries are not permission to implement them. The `owner` selects work and approves
4
- its `specification` before implementation starts. Backlog items have no agreed order or date. The `owner` approves priority and scope changes.
5
-
6
- Completed entries preserve recorded outcomes and evidence, which may describe behavior later changed.
7
-
8
- ## Overview
9
-
10
- | ID | Item | Status |
11
- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------- | --------- |
12
- | MAESTRO-6 | [Display specs in a browser](#maestro-6-display-specs-in-a-browser) | Backlog |
13
- | MAESTRO-7 | [Route builder failures through owner escalations](#maestro-7-route-builder-failures-through-owner-escalations) | Completed |
14
- | MAESTRO-8 | [Store escalations and owner decisions in builder handoffs](#maestro-8-store-escalations-and-owner-decisions-in-builder-handoffs) | Completed |
15
- | MAESTRO-9 | [Format glossary terms consistently](#maestro-9-format-glossary-terms-consistently) | Completed |
16
- | MAESTRO-10 | [Improve status presentation and activation feedback](#maestro-10-improve-status-presentation-and-activation-feedback) | Completed |
17
- | MAESTRO-11 | [Introduce Maestro at activation](#maestro-11-introduce-maestro-at-activation) | Completed |
18
- | MAESTRO-12 | [Verify code quality against AGENTS.md instructions](#maestro-12-verify-code-quality-against-agentsmd-instructions) | Completed |
19
- | MAESTRO-13 | [Check subagent extensions at activation](#maestro-13-check-subagent-extensions-at-activation) | Completed |
20
- | MAESTRO-14 | [Rename the test support directory](#maestro-14-rename-the-test-support-directory) | Completed |
21
- | MAESTRO-15 | [Match handoff criteria to the approved spec](#maestro-15-match-handoff-criteria-to-the-approved-spec) | Completed |
22
- | MAESTRO-16 | [Route finding-driven spec revisions through drafting-spec](#maestro-16-route-finding-driven-spec-revisions-through-drafting-spec) | Completed |
23
- | MAESTRO-17 | [Keep acceptance criterion numbering continuous](#maestro-17-keep-acceptance-criterion-numbering-continuous) | Completed |
24
- | MAESTRO-18 | [Record escalation resolutions when the spec changes](#maestro-18-record-escalation-resolutions-when-the-spec-changes) | Completed |
25
- | MAESTRO-19 | [Guide initial configuration](#maestro-19-guide-initial-configuration) | Completed |
26
- | MAESTRO-20 | [Rename the npm package](#maestro-20-rename-the-npm-package) | Backlog |
27
- | MAESTRO-21 | [Label acceptance criterion coverage](#maestro-21-label-acceptance-criterion-coverage) | Completed |
28
- | MAESTRO-22 | [Avoid acceptance criteria already covered by tests](#maestro-22-avoid-acceptance-criteria-already-covered-by-tests) | Completed |
29
- | MAESTRO-23 | [Change agent models before a builder run](#maestro-23-change-agent-models-before-a-builder-run) | Backlog |
30
- | MAESTRO-24 | [Add a simplifier with one clear purpose per agent](#maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent) | Completed |
31
- | MAESTRO-25 | [Define workflow reconciliation](#maestro-25-define-workflow-reconciliation) | Completed |
32
- | MAESTRO-26 | [Exit Maestro mode automatically at workflow completion](#maestro-26-exit-maestro-mode-automatically-at-workflow-completion) | Completed |
33
- | MAESTRO-27 | [Make all implementation phases optional](#maestro-27-make-all-implementation-phases-optional) | Completed |
34
- | MAESTRO-28 | [Add Maestro role instructions alongside the other agents](#maestro-28-add-maestro-role-instructions-alongside-the-other-agents) | Backlog |
35
- | MAESTRO-FREE-1 | [Require Pi 1.5.0](#maestro-free-1-require-pi-150) | Completed |
36
- | MAESTRO-FREE-2 | [Remove Maestro run timeouts](#maestro-free-2-remove-maestro-run-timeouts) | Completed |
37
- | MAESTRO-FREE-PRE-3 | [Implement internal SDK delegation](#maestro-free-pre-3-implement-internal-sdk-delegation) | Completed |
38
- | MAESTRO-FREE-3 | [Run the builder through the Pi SDK](#maestro-free-3-run-the-builder-through-the-pi-sdk) | Completed |
39
- | MAESTRO-FREE-4 | [Run the verifier through the Pi SDK](#maestro-free-4-run-the-verifier-through-the-pi-sdk) | Completed |
40
- | MAESTRO-FREE-5 | [Run the simplifier through the Pi SDK](#maestro-free-5-run-the-simplifier-through-the-pi-sdk) | Completed |
41
- | MAESTRO-FREE-6 | [Show SDK agent activity through Pi](#maestro-free-6-show-sdk-agent-activity-through-pi) | Completed |
42
- | MAESTRO-FREE-7 | [Remove the pi-subagents dependency](#maestro-free-7-remove-the-pi-subagents-dependency) | Completed |
43
-
44
- ## MAESTRO-6: Display specs in a browser
45
-
46
- ### Objective
47
-
48
- Display the `spec` documents in a browser to improve readability and help the `owner` understand the proposed change, requirements, and `acceptance criteria`.
49
-
50
- ### Completed when
51
-
52
- The `owner` can read the `spec` documents in a browser with formatting designed for human comprehension.
53
-
54
- ## MAESTRO-19: Guide initial configuration
55
-
56
- ### Objective
57
-
58
- Help the `owner` create `Maestro` configuration through selectors, without writing the file manually. Implemented for verification under the
59
- [approved `specification`](.specs/20261108-141712-maestro-19-guide-initial-configuration-with-pi-selectors/spec.md).
60
-
61
- ### Agreed UX
62
-
63
- 1. When `.pi/maestro.json` is absent, `/maestro` opens setup instead of attempting activation with an implicit configuration.
64
- 2. The setup screen offers `Select builder`, `Select verifier`, `Select simplifier`, and `Confirm`. Each role opens model selection followed by supported thinking choices
65
- in Pi's returned order, starting at the first level. Completed selections appear on the main screen and can be replaced.
66
- 3. `Maestro` has no default models or fallback to Pi's main model. Setup uses `.specs`; selected roles are enabled and unselected roles are disabled, without separate
67
- phase controls. Confirmation with no roles enables `spec` preparation only.
68
- 4. `Confirm` saves `.pi/maestro.json`, then activates `Maestro` without another command. Escape on the main screen cancels without saving; nested cancellation discards
69
- only the pending role edit.
70
- 5. An existing configuration missing a required model produces an error and prevents activation. Setup does not complete the file automatically.
71
-
72
- ### Selector approach
73
-
74
- Use Pi's standard `ctx.ui.select()` for short setup choices. For model selection, compose Pi's public `Input` and `SelectList` components through `ctx.ui.custom()`, using
75
- `ctx.modelRegistry.getAvailable()` as the model source. Provide search and a bounded, navigable list without changing the main conversation's model.
76
-
77
- Inspection of Pi 1.5.0 confirmed that `ctx.ui.select()` does not provide search or a bounded list. The exported `ModelSelectorComponent` requires the session's
78
- `ModelRuntime`, which the public extension context does not expose. Do not access private runtime state or create a separate runtime to reuse that component. Reuse Pi's
79
- public controls instead of rebuilding rendering and navigation. No new library is needed.
80
-
81
- ### Verification
82
-
83
- [Verifier report](.specs/20261108-141712-maestro-19-guide-initial-configuration-with-pi-selectors/handoffs/verifier/V1.json). Later owner-requested changes are outside
84
- that independent verification. The latest `npm run check` passed all 301 tests.
85
-
86
- ### Completed when
87
-
88
- The `owner` can create a valid project configuration through selectors, confirm it, and activate `Maestro` without writing the file manually.
89
-
90
- ## MAESTRO-20: Rename the npm package
91
-
92
- ### Objective
93
-
94
- Rename `@emiliosp/pi-maestro` to `pi-maestro-sdd`. The `owner` installs the package under the new name. This item changes the package identity, not the development
95
- workflow.
96
-
97
- Compatibility with installations under the old name must be decided in the `specification`. No `specification` is approved yet.
98
-
99
- ### Completed when
100
-
101
- Package metadata and installation documentation use the new name. The package is available under that name.
102
-
103
- ## MAESTRO-23: Change agent models before a builder run
104
-
105
- ### Objective
106
-
107
- Let the `owner` change the `builder` and `verifier` models during `spec` preparation and the `ready-for-builder` phase. The selected models apply to subsequent `runs`.
108
-
109
- ### Completed when
110
-
111
- The `owner` can select available models in those phases. `Maestro` uses the selections.
112
-
113
- ## MAESTRO-25: Define workflow reconciliation
114
-
115
- Implemented for verification under the [approved spec](.specs/20261109-142858-resume-an-interrupted-workflow-from-drafting-spec/spec.md). When existing `specs` are
116
- available, `/maestro` offers a new `spec` or selection of an existing `spec` to restart. Every restart returns to `drafting-spec` for document review and renewed
117
- `GREEN FLAG`, regardless of the saved phase. Restart preserves saved `owner` decisions and does not recover an interrupted agent or reconcile partial saves.
118
-
119
- ## MAESTRO-28: Add Maestro role instructions alongside the other agents
120
-
121
- ### Objective
122
-
123
- Add `agents/maestro.md` for `Maestro` role instructions alongside `agents/builder.md`, `agents/verifier.md`, and `agents/simplifier.md`.
124
-
125
- ### Completed when
126
-
127
- `Maestro` role instructions are maintained in `agents/maestro.md` alongside the other agent role files.
128
-
129
- ## MAESTRO-FREE-3: Run the builder through the Pi SDK
130
-
131
- Implementation follows the [approved migration specification](.specs/20261106-092601-feat-migrate-builder-verifier-and-simplifier-to-the-pi-sdk/spec.md). SDK integration
132
- is implemented; `owner` acceptance is pending. Each role now receives only its own `handoff` tool.
133
-
134
- ### Objective
135
-
136
- Connect `builder` delegation to the internal SDK executor delivered by [MAESTRO-FREE-PRE-3](#maestro-free-pre-3-implement-internal-sdk-delegation), following
137
- [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation). Preserve the existing role instructions, `handoffs`, and workflow behavior.
138
-
139
- ### Scope and dependencies
140
-
141
- Requires [MAESTRO-FREE-PRE-3](#maestro-free-pre-3-implement-internal-sdk-delegation). Implement FREE-3, [FREE-4](#maestro-free-4-run-the-verifier-through-the-pi-sdk), and
142
- [FREE-5](#maestro-free-5-run-the-simplifier-through-the-pi-sdk) as one migration of all three roles. Their identifiers retain the role-specific verification scope, not
143
- separate execution mechanisms or releases. Do not introduce temporary mixed-engine routing or an engine selector. Verify each role and the supported optional-phase
144
- combinations before completing the migration. Human documentation must describe the resulting SDK execution. Live progress remains in
145
- [MAESTRO-FREE-6](#maestro-free-6-show-sdk-agent-activity-through-pi); existing workflow-phase status remains available in the meantime.
146
-
147
- ### Completed when
148
-
149
- 1. An approved `spec` can be implemented by an SDK `builder` with fresh conversation history, the configured model and thinking level, role guidance, global and project
150
- instructions, skills, working tools, and existing `handoff` tools.
151
- 2. It reuses the established executor's context and tool loading without another execution mechanism. Role instructions continue to forbid further delegation.
152
- 3. `done` and `escalation` outcomes preserve existing saved `handoffs`, validation, phase transitions, and subsequent workflow routes. A later `builder` `pass` starts
153
- fresh and reads saved decisions rather than restoring the previous conversation.
154
- 4. Errors stop the workflow without rollback or repair. Manual cancellation reaches `session.abort()`, and child sessions and subscriptions are cleaned up on every exit.
155
- 5. Native Pi session files are saved beneath the project's Pi session directory in `subagents/`. The `owner` receives the saved path on completion or failure when a file
156
- exists; it can be inspected or exported with Pi, without automatic resumption.
157
- 6. Existing trust, configuration, and model checks remain applicable. Activation and execution no longer require `pi-subagents` ping or launch-contract checks for any
158
- role. A `builder`-only workflow uses the SDK without requiring a `pi-subagents` availability reply.
159
- 7. Each `run` waits for its child to finish or be interrupted before another starts. Existing optional-phase behavior remains intact.
160
-
161
- ## MAESTRO-FREE-4: Run the verifier through the Pi SDK
162
-
163
- Implementation follows the [approved migration specification](.specs/20261106-092601-feat-migrate-builder-verifier-and-simplifier-to-the-pi-sdk/spec.md). SDK integration
164
- is implemented; `owner` acceptance is pending.
165
-
166
- ### Objective
167
-
168
- Connect the `verifier` to the SDK executor delivered by [MAESTRO-FREE-PRE-3](#maestro-free-pre-3-implement-internal-sdk-delegation), following
169
- [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation). Implement this role's switch together with FREE-3 and FREE-5 under the
170
- [shared migration scope](#maestro-free-3-run-the-builder-through-the-pi-sdk). Do not redesign verification or its reports.
171
-
172
- ### Completed when
173
-
174
- 1. The SDK `verifier` independently checks the approved `spec` and saves existing numbered `handoffs`, preserving criterion validation, `finding` decisions, and phase
175
- transitions.
176
- 2. It reuses the established fresh-session context, tools, persistence, cancellation, cleanup, and error policy without a second execution mechanism.
177
- 3. Activation and execution no longer use `pi-subagents` for the `verifier`.
178
- 4. Workflows with verification enabled or disabled retain their existing routes, with all enabled roles using the common SDK executor.
179
-
180
- ## MAESTRO-FREE-5: Run the simplifier through the Pi SDK
181
-
182
- Implementation follows the [approved migration specification](.specs/20261106-092601-feat-migrate-builder-verifier-and-simplifier-to-the-pi-sdk/spec.md). SDK integration
183
- is implemented; `owner` acceptance is pending.
184
-
185
- ### Objective
186
-
187
- Connect the `simplifier` to the SDK executor delivered by [MAESTRO-FREE-PRE-3](#maestro-free-pre-3-implement-internal-sdk-delegation), following
188
- [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation). Implement this role's switch together with FREE-3 and FREE-4 under the
189
- [shared migration scope](#maestro-free-3-run-the-builder-through-the-pi-sdk). Keep its existing purpose and Git-only scope.
190
-
191
- ### Completed when
192
-
193
- 1. The SDK `simplifier` preserves the current Git readiness decision, skip behavior, and entry routes. No Git readiness check moves into activation or an earlier phase.
194
- 2. Successful execution saves the existing unnumbered `S.json` `handoff` and reaches `candidate-ready`; optional-phase behavior remains unchanged.
195
- 3. It reuses the established context, tools, persistence, cancellation, cleanup, and error policy.
196
- 4. Activation and execution no longer use `pi-subagents` for the `simplifier`. All roles migrate together, so no workflow path requires its ping, launch preflight, or
197
- fixed delegation deadline.
198
-
199
- ## MAESTRO-FREE-6: Show SDK agent activity through Pi
200
-
201
- Implemented under the [approved specification](.specs/20261106-143021-maestro-free-6-show-sdk-agent-activity-through-pi/spec.md), with `builder` checks passing. `Owner`
202
- acceptance is pending. Review follow-up moved the shared role executor to `src/delegation/executeRoleTask.ts` and separated event tracking in `trackAgentActivity.ts` from
203
- UI updates in `createAgentProgress.ts`. The full check passes all 293 tests.
204
-
205
- ### Objective
206
-
207
- Show activity for SDK-based agent `runs` through Pi's standard `onUpdate` presentation, as decided in
208
- [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation). Requires the shared migration covered by
209
- [MAESTRO-FREE-3](#maestro-free-3-run-the-builder-through-the-pi-sdk), FREE-4, and FREE-5, and applies to all three roles through the common executor.
210
-
211
- ### Completed when
212
-
213
- 1. Progress reports the role, elapsed time, current tool, and recent normal assistant text, including activity while the agent produces no text.
214
- 2. Pi controls layout, truncation, and expansion. There is no custom renderer, fixed line count, transcript inspector, or artificial progress prompting.
215
- 3. Intermediate text stays out of the main model's context. Final workflow results, saved session contents, and cancellation behavior remain unchanged.
216
- 4. Progress subscriptions are released when the child finishes, fails, or is interrupted.
217
-
218
- ## MAESTRO-FREE-7: Remove the pi-subagents dependency
219
-
220
- Implementation follows the [approved migration specification](.specs/20261106-092601-feat-migrate-builder-verifier-and-simplifier-to-the-pi-sdk/spec.md). Code cleanup is
221
- included in this migration. Package declarations, lockfile entries, bundling, and `pi.subagents` metadata are removed.
222
-
223
- ### Objective
224
-
225
- Finish [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation) by removing the package dependency, bundling, and remaining integration metadata after
226
- [MAESTRO-FREE-3](#maestro-free-3-run-the-builder-through-the-pi-sdk), [MAESTRO-FREE-4](#maestro-free-4-run-the-verifier-through-the-pi-sdk), and
227
- [MAESTRO-FREE-5](#maestro-free-5-run-the-simplifier-through-the-pi-sdk). This is dependency removal, not another execution-engine switch.
228
-
229
- ### Completed when
230
-
231
- 1. `Maestro` neither imports nor bundles `pi-subagents`, and package metadata, role frontmatter, tests, installation instructions, and current human documentation no
232
- longer require it. Historical records remain historical evidence.
233
- 2. A clean installation can activate and complete workflows without `pi-subagents` installed or enabled, including the supported optional-phase combinations.
234
- 3. Existing workflow and `handoff` formats remain unchanged. No compatibility framework, engine-selection flags, or migration of interrupted workflows is added.
235
-
236
- ## MAESTRO-26: Exit Maestro mode automatically at workflow completion
237
-
238
- Implemented in `0.13.0`. `Maestro` automatically turns off after successfully delivering the final summary of a completed workflow, including when Git is unavailable and
239
- simplification is skipped. Live tools, status, instructions, and active `spec` selection are cleared; saved workflow files and other extensions remain unchanged.
240
- Intermediate phases and interrupted workflows do not trigger automatic exit.
241
-
242
- Linear marks this item Done, but its description still says final `owner` acceptance is pending. Acceptance is not inferred from that status or the release.
243
-
244
- ### Evidence
245
-
246
- [Changelog](CHANGELOG.md#0130), [merged PR #43](https://github.com/emilioSp/pi-maestro/pull/43),
247
- [specification](.specs/20261030-145712-automatically-exit-maestro-mode-at-workflow-completion/spec.md), and
248
- [original issue](https://linear.app/emilio-spatola/issue/MAESTRO-26/feat-exit-maestro-mode-automatically-at-workflow-completion).
249
-
250
- Completed entries include historical records imported from Linear.
251
-
252
- ## MAESTRO-FREE-1: Require Pi 1.5.0
253
-
254
- ### Objective
255
-
256
- Adopt Pi 1.5.0 as the minimum supported host and verification baseline for [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation), without changing the
257
- delegation engine or adding compatibility fallbacks.
258
-
259
- ### Completed when
260
-
261
- 1. Declared requirements and the development verification environment use the selected Pi baseline consistently.
262
- 2. The existing extension and `pi-subagents` workflow continue to work on Pi 1.5.0.
263
-
264
- ### Implementation and evidence
265
-
266
- The `owner` confirmed completion. `README.md` declares Pi 1.5.0 as the minimum host. Development dependencies for the four Pi packages are pinned to 1.5.0, so type checks
267
- and tests run against that baseline. Schema enums use TypeBox `Type.Enum` with an explicit string type. `npm run check` passes on 1.5.0, including the extension and
268
- `pi-subagents` integration tests.
269
-
270
- ## MAESTRO-FREE-2: Remove Maestro run timeouts
271
-
272
- ### Recorded outcome
273
-
274
- The `owner` confirmed completion of the timeout configuration removal implemented in `0.16.0`. The three `timeoutMinutes` settings, their defaults, and their
275
- configuration documentation were removed. Existing TypeBox validation rejects configuration retaining those fields, without migration or compatibility handling.
276
-
277
- The `pi-subagents` integration then in use still received a fixed deadline of 9,999 minutes. This was not unlimited execution. The SDK delegation replacement under
278
- [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation) later removed that deadline and the `pi-subagents` dependency.
279
-
280
- ### Evidence
281
-
282
- [Changelog](CHANGELOG.md#0160), [PR #46](https://github.com/emilioSp/pi-maestro/pull/46), and [configuration schema](src/config/schema.ts).
283
-
284
- ## MAESTRO-FREE-PRE-3: Implement internal SDK delegation
285
-
286
- ### Implementation and evidence
287
-
288
- Registration follow-up: caller-supplied tools use an inline `extensionFactories` entry instead of SDK `customTools`. This `owner`-requested change is implemented for
289
- review, with role-specific registration checked by the [workflow integration test](extensions/maestro.integration.test.ts).
290
-
291
- The standalone executor is implemented under `src/delegation/` against the [approved specification](.specs/20261105-212231-implement-internal-pi-sdk-delegation/spec.md).
292
- Review follow-up consolidated execution orchestration and session lifecycle in `executeTask`; pure reply interpretation remains in `readTaskResult`. Manual verification
293
- on Pi 1.5.0 exercised fresh context, native and additional tools, MCP through tool search and codemode, sequential waiting, failure, cancellation, cleanup, and native
294
- session persistence. See [manual evidence](.specs/20261105-212231-implement-internal-pi-sdk-delegation/handoffs/verifier/V1.json). The three workflow roles still use
295
- `pi-subagents`. The `owner` confirmed completion. The caller's message is named `prompt`, execution is inlined in `executeTask`, and cancellation comments explain Node.js
296
- `AbortError`. At the owner's request, cancellation is forwarded only by the signal listener, without checks before or after the prompt or a retry at `agent_start`. An
297
- already cancelled signal does not prevent submission, and an aborted signal alone does not turn a normal Pi result into an interruption.
298
-
299
- ### Objective
300
-
301
- Implement and verify one internal execution operation using `createAgentSession()`, following [ADR-010](ADR.md#adr-010-use-the-pi-sdk-for-sequential-agent-delegation).
302
- The operation is independent of the `builder`, `verifier`, and `simplifier` roles. Callers supply the task, role instructions, model settings, working directory, and
303
- additional tools needed for that execution.
304
-
305
- ### Scope and dependencies
306
-
307
- Requires [MAESTRO-FREE-1](#maestro-free-1-require-pi-150) and [MAESTRO-FREE-2](#maestro-free-2-remove-maestro-run-timeouts). This item implements the execution mechanism
308
- without switching existing workflow tools away from `pi-subagents`. FREE-3, FREE-4, and FREE-5 connect the three roles to it together after it is verified.
309
-
310
- The executor manages child sessions, not the workflow. It does not select phases, interpret role outcomes, or validate `handoffs`. Those responsibilities remain with the
311
- callers and existing workflow operations. Communication remains task-and-`handoff`, without shared in-memory workflow state or a live supervisor dialogue. This is not a
312
- new public tool or a general-purpose orchestration framework. Live progress presentation remains in [MAESTRO-FREE-6](#maestro-free-6-show-sdk-agent-activity-through-pi).
313
-
314
- ### Completed when
315
-
316
- 1. The operation executes a supplied task in a fresh SDK conversation with the supplied model and thinking level, role guidance, global and project instructions, skills,
317
- working tools, and caller-supplied additional tools. It does not depend on any of the three workflow roles.
318
- 2. Enabled global and project extensions and native Pi tool support load as defined in ADR-010, excluding the main `Maestro` extension. The main session retains its
319
- `Maestro` mode while the child executes. No compatibility adapters, integration health gates, or delegation-prevention tool filters are added.
320
- 3. Execution waits for the child to finish, fail, or be interrupted before another child starts. The executor imposes no automatic deadline and does not start a new
321
- session to retry or repair failed work.
322
- 4. Manual cancellation reaches `session.abort()` and waits for interruption. Sessions, subscriptions, and owned resources are released on every exit, without rollback,
323
- workflow changes, or synthetic `handoffs`. Execution errors propagate to the caller.
324
- 5. Native Pi sessions are persisted in `subagents/` beneath Pi's project session directory, resolved through Pi's API. The saved path is available to the caller on
325
- completion or failure when a file exists. Every execution starts fresh; no automatic resumption is introduced.
326
- 6. Successful execution, execution failure, cancellation, context and tool loading, and session persistence are verified independently of the workflow migration. The
327
- existing three role tools still use `pi-subagents` at the end of this item.
328
-
329
- ## MAESTRO-27: Make all implementation phases optional
330
-
331
- ### Objective
332
-
333
- Make the entire implementation stage optional, including the `builder`, `verifier`, and `simplifier` phases. Let the `owner` use `Maestro` only to prepare and approve a
334
- `spec`, leaving implementation to another workflow.
335
-
336
- When implementation runs in `Maestro`, the `owner` can still independently enable or disable the `verifier` and `simplifier` phases. `Spec` preparation and approval
337
- remain required.
338
-
339
- ### Completed when
340
-
341
- 1. The `owner` can complete a workflow with only an approved `spec`, without running the `builder`, `verifier`, or `simplifier`.
342
- 2. Implementation can be performed through another workflow using the approved `spec`, without requiring further execution in `Maestro`.
343
- 3. The existing requested combinations remain available: `builder` only; `builder` and `verifier`; `builder` and `simplifier`; or all three.
344
- 4. Disabled phases are not delegated and do not block workflow completion.
345
- 5. The workflow reaches `candidate-ready` after `spec` approval when no agent phases are selected, or after the selected phases complete and any required `owner`
346
- decisions are resolved.
347
- 6. The final summary clearly identifies skipped phases and does not claim that skipped implementation or verification has been completed.
348
-
349
- ### Implementation and evidence
350
-
351
- Implemented under the [specification](.specs/20261103-161424-maestro-27-make-implementation-phases-optional/spec.md). The `owner` confirmed completion. Each agent's
352
- `required` boolean in `.pi/maestro.json` defaults to `true`. Flags are set before activation and remain unchanged during the workflow. Disabling `builder` skips all three
353
- agents; otherwise `verifier` and `simplifier` are independently optional. `Spec` preparation and approval remain required. The activation notice lists only enabled agents
354
- and no agents when `builder` is disabled.
355
-
356
- The [README](README.md#the-idea) presents the two uses of `Maestro`: writing and approving a `spec` only, or also implementing it through optional agent phases.
357
-
358
- ### Context
359
-
360
- [MAESTRO-24](#maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent) introduced the `simplifier`. Its existing Git-unavailable skip is not an explicit `owner`
361
- choice. This item originally made only the post-`builder` phases optional. The `owner` expanded the scope to include the `builder`, so `Maestro` can also be used solely
362
- for writing and approving a `spec`.
363
-
364
- ## MAESTRO-7: Route builder failures through owner escalations
365
-
366
- Route reportable `builder` problems through `owner` `escalations` instead of a terminal failure phase.
367
-
368
- Released in `0.9.0`. The `builder` reports only `done` or `escalation`. Reportable technical problems use the existing `owner` `escalation` process. Individual `probe`
369
- results retain `failed`. Execution errors and missing or invalid saved results still stop the workflow without automatic recovery.
370
-
371
- All 8 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
372
-
373
- ### Evidence
374
-
375
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md),
376
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-101454-route-builder-failures-through-owner-escalations/handoffs/verifier/V1.json),
377
- and [merged PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
378
-
379
- ## MAESTRO-8: Store escalations and owner decisions in builder handoffs
380
-
381
- Keep `escalation` questions and `owner` answers together in numbered `builder` `handoffs`.
382
-
383
- Numbered `builder` `handoffs` contain multiple `escalation` questions and their `owner` resolutions. The `owner` resolves all current questions in one batch. Earlier
384
- `handoffs` remain available as history. All 10 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
385
-
386
- ### Evidence
387
-
388
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md),
389
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261008-132344-store-escalations-in-builder-handoffs/handoffs/verifier/V1.json),
390
- and [merged PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
391
-
392
- ## MAESTRO-9: Format glossary terms consistently
393
-
394
- Apply glossary formatting across documentation and record its exclusions.
395
-
396
- Applied glossary formatting across the documentation and recorded its exclusions in `AGENTS.md` and the documentation audit skill. The approved change document uses the
397
- term `spec`. The `owner` confirmed completion.
398
-
399
- ### Evidence
400
-
401
- [Glossary](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/docs/glossary.md) and
402
- [workflow documentation](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/docs/workflow.md).
403
-
404
- ## MAESTRO-10: Improve status presentation and activation feedback
405
-
406
- Show clearer status and configured agent details without adding model context.
407
-
408
- The status bar uses phase icons, theme colors, and shortened `spec` IDs. Successful activation shows the configured `builder` and `verifier` settings without adding the
409
- notice to session history or model context. All 12 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
410
-
411
- ### Evidence
412
-
413
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/spec.md),
414
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/handoffs/verifier/V1.json),
415
- and [merged PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
416
-
417
- ## MAESTRO-11: Introduce Maestro at activation
418
-
419
- Introduce `Maestro` at activation and load relevant documentation only when needed.
420
-
421
- Implemented in `0.9.1`. Successful activation introduces `Maestro` and invites the `owner` to ask how it works. The UI-only notice retains the configured agent details
422
- and does not add session history or start a model request.
423
-
424
- Active instructions identify absolute paths to the installed README and documentation directory. `Maestro` reads relevant documentation on demand without automatically
425
- loading its contents.
426
-
427
- All 6 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
428
-
429
- ### Evidence
430
-
431
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-171954-introduce-maestro-at-activation/spec.md),
432
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-171954-introduce-maestro-at-activation/handoffs/verifier/V1.json),
433
- and [merged PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
434
-
435
- ## MAESTRO-12: Verify code quality against AGENTS.md instructions
436
-
437
- Historical outcome: the extra review described below was removed by [MAESTRO-24](#maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent) in `0.11.0`.
438
-
439
- Require the `verifier` to review affected code against applicable `AGENTS.md` code-quality directives.
440
-
441
- Implemented in `0.9.2`. `Verifier` guidance now requires code-quality review only for code affected by the approved change when applicable `AGENTS.md` directives exist.
442
- All existing duties remain unchanged, including independent verification of every `acceptance criterion`.
443
-
444
- Instruction-violation `findings` identify the instruction file, quote the rule, and explain the violating code through existing evidence fields. Missing files or
445
- code-quality directives cause only the added review to be skipped. Personal style preferences are not requirements.
446
-
447
- All 5 `acceptance criteria` passed through independent inspection of the written guidance, with no `verifier` `findings`. No additional model trials were performed. The
448
- saved workflow reached `candidate-ready`.
449
-
450
- ### Evidence
451
-
452
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/spec.md),
453
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/handoffs/verifier/V1.json),
454
- and [merged PR #34](https://github.com/emilioSp/pi-maestro/pull/34).
455
-
456
- ## MAESTRO-13: Check subagent extensions at activation
457
-
458
- Historical outcome: activation no longer requires the parent `pi-subagents` availability check after the SDK migration. See [changelog](CHANGELOG.md).
459
-
460
- Require a successful parent `pi-subagents` availability reply before activation.
461
-
462
- Implemented in `0.9.3`. Activation requires a matching successful version 1 `ping` reply from the parent `pi-subagents` extension within 2000 ms. A failed or invalid
463
- reply, emission error, or timeout prevents activation and reports the installation requirement. The check starts no agent and makes no model request. It confirms parent
464
- extension availability, not child execution readiness.
465
-
466
- All 7 `acceptance criteria` passed using controlled replies and code inspection, with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
467
-
468
- A later integration test requested by the `owner` directly checks the environment check's failed-reply error. This test addition is outside the completed independent
469
- verification.
470
-
471
- ### Evidence
472
-
473
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/spec.md),
474
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/handoffs/verifier/V1.json),
475
- and [merged PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
476
-
477
- ## MAESTRO-14: Rename the test support directory
478
-
479
- Rename `test/` to `tests/` and update affected references.
480
-
481
- Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture paths, lint configuration, and project instructions. This follows the global instruction to
482
- keep fixtures under `tests/fixtures`. Source tests remain next to their source files. Historical `handoffs` retain their recorded paths.
483
-
484
- ### Evidence
485
-
486
- [Test support](https://github.com/emilioSp/pi-maestro/tree/839ab9eb9753df22804d750657a616a9959c2c47/tests/support/),
487
- [fixtures](https://github.com/emilioSp/pi-maestro/tree/839ab9eb9753df22804d750657a616a9959c2c47/tests/fixtures/), and
488
- [lint configuration](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.oxlintrc.json).
489
-
490
- ## MAESTRO-15: Match handoff criteria to the approved spec
491
-
492
- Require every approved `spec` criterion ID in each submitted `builder` and `verifier` `handoff`.
493
-
494
- Implemented in `0.9.5` with the narrower scope approved by the `owner`. Both `handoff` submissions require every `acceptance criterion` ID from the approved `spec` before
495
- saving a report or changing phase. Extra report IDs remain allowed. Existing report validation is unchanged, and no new check rejects duplicate `spec` IDs.
496
-
497
- Both `acceptance criteria` passed independent verification with no `findings`. The saved workflow reached `candidate-ready`.
498
-
499
- Later changes requested by the `owner` extracted the shared check and replaced repeated integration scenarios with unit tests. One missing-ID integration test remains per
500
- role. These changes are outside the completed independent verification. The final `npm run check` passed all 227 tests and coverage thresholds.
501
-
502
- ### Evidence
503
-
504
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md),
505
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/handoffs/verifier/V1.json),
506
- and [merged PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
507
-
508
- ## MAESTRO-16: Route finding-driven spec revisions through drafting-spec
509
-
510
- Record `finding` decisions before `spec` revision and require renewed `GREEN FLAG` before another `builder` `run`.
511
-
512
- Implemented the approved revision route. `Maestro` records every current `finding` decision before returning to `drafting-spec` when revision is required. The `owner`
513
- reviews the same revised `spec` and gives renewed `GREEN FLAG` before separate approval and another `builder` `run`. Revision takes priority in mixed batches. Direct
514
- approval from `finding-decisions` is rejected.
515
-
516
- Later event naming cleanup identifies `builder` and `owner` actions explicitly. Both revision routes use `OWNER_REQUEST_SPEC_REVISION` without changing the phase flow.
517
- Batch resolution uses `RESOLVE_ESCALATIONS`, and the status label refers to `escalations` in the plural. The saved decision phases are named `escalation-decisions` and
518
- `finding-decisions`.
519
-
520
- ### Evidence
521
-
522
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261015-154812-route-finding-driven-spec-revisions-through-drafting-spec/spec.md)
523
- and
524
- [resolution integration tests](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/src/tools/main/resolve-findings.integration.test.ts).
525
-
526
- ## MAESTRO-17: Keep acceptance criterion numbering continuous
527
-
528
- Reject gaps in `acceptance criterion` numbering before approving a `spec`.
529
-
530
- Implemented in `0.9.4`. `Spec` approval rejects numbered `acceptance criterion` headings that do not start at `AC1` and continue without gaps. Rejection leaves saved
531
- files unchanged.
532
-
533
- `Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner`
534
- approval is required.
535
-
536
- All 3 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
537
-
538
- ### Evidence
539
-
540
- [Specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/spec.md),
541
- [verifier report](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/handoffs/verifier/V1.json),
542
- and [merged PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
543
-
544
- ## MAESTRO-18: Record escalation resolutions when the spec changes
545
-
546
- ### Objective
547
-
548
- Save every current `escalation` answer in the original `builder` `handoff`, whether the `spec` stays unchanged or requires revision. Each `resolution` records the owner's
549
- chosen solution and reason. A decision requiring revision also identifies the `escalation` and describes the agreed `spec` change.
550
-
551
- ### Agreed flow
552
-
553
- `Maestro` records the complete decision batch through `maestro_resolve_escalations` before changing phase.
554
-
555
- | Decision | Next phase and action |
556
- | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
557
- | No `spec` change | `escalation-decisions` → `ready-for-builder`. The `builder` continues under the approved `spec`, without renewed approval. |
558
- | `Spec` change required | `escalation-decisions` → `drafting-spec`. The `owner` and `Maestro` revise and review the same `spec`. |
559
- | Revised `spec` receives renewed `GREEN FLAG` | `drafting-spec` → `ready-for-builder` through separate `maestro_mark_spec_ready` approval. |
560
-
561
- Direct `spec` approval from `escalation-decisions` is rejected. Recording answers does not move to `ready-for-verifier`; that phase requires a completed `builder` `pass`.
562
-
563
- ### Implementation boundaries
564
-
565
- Reuse the existing resolution operation and `handoff` fields. Do not add a parallel decision store, tool, or workflow phase. Define both resolution transitions explicitly
566
- in `src/workflow/transitions.ts` and apply them through `transitionWorkflow`. Direct phase assignment elsewhere is banned. Preserve initial `spec` approval, `verifier`
567
- `finding` decisions, existing batch validation, and historical `handoffs`.
568
-
569
- ### Completed when
570
-
571
- Saved `resolutions`, workflow phases, tool results, agent instructions, and human documentation follow the agreed flow. Verification checks both observable behavior and
572
- use of the central transition definitions for each resolution branch. Passing behavior tests alone is not enough. The new `spec` includes coverage labels and omits
573
- `acceptance criteria` already covered by tests of the same scenario.
574
-
575
- ## MAESTRO-21: Label acceptance criterion coverage
576
-
577
- Historical outcome: the `Coverage` field described below was removed in `0.12.0`. See [changelog](CHANGELOG.md#0120).
578
-
579
- Label each `acceptance criterion` as success, failure, or unchanged behavior.
580
-
581
- Implemented with [MAESTRO-22](#maestro-22-avoid-acceptance-criteria-already-covered-by-tests) as one task, as selected by the `owner`. The `spec` template and `Maestro`
582
- guidance require one `Coverage` label per `acceptance criterion`:
583
-
584
- | Label | Purpose |
585
- | ----------- | -------------------------------------------- |
586
- | `success` | A valid action produces the required result. |
587
- | `failure` | An invalid action is correctly rejected. |
588
- | `unchanged` | The change preserves existing behavior. |
589
-
590
- Use `unchanged` when the criterion explicitly checks behavior that the change must preserve. Labels describe scenarios, not test outcomes. A `failure` scenario passes
591
- when the invalid action is correctly rejected. A `spec` does not need all three categories. `Maestro` includes labels when presenting criteria to the `owner` and checks
592
- them against scenarios and `expected results` during review. Approval validation and `handoff` formats remain unchanged.
593
-
594
- The existing creation integration test now checks that the generated `spec` includes the coverage field. The final `npm run check` passed all 238 tests and coverage
595
- thresholds. No model trials were performed.
596
-
597
- ### Evidence
598
-
599
- [Spec template](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/templates/spec.md),
600
- [Maestro guidance](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/src/maestro/instructions/getMaestroInstructions.ts),
601
- [creation integration test](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/src/specs/create.integration.test.ts), and
602
- [workflow documentation](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/docs/workflow.md#acceptance-criteria).
603
-
604
- ## MAESTRO-22: Avoid acceptance criteria already covered by tests
605
-
606
- Omit `acceptance criteria` whose exact scenarios already have test coverage.
607
-
608
- Implemented with [MAESTRO-21](#maestro-21-label-acceptance-criterion-coverage). `Maestro` inspects existing tests before writing `acceptance criteria`. It omits a
609
- criterion only when a test covers the same starting conditions, action, and `expected result`. Partial or uncertain coverage does not justify omission. Similar tests do
610
- not count.
611
-
612
- During `spec` review, `Maestro` removes criteria whose exact scenarios already have test coverage. It keeps numbering continuous from `AC1` and updates affected
613
- references. Required behavior remains documented in the requirements and constraints. The same rules apply during `spec` revisions. No automatic approval check was added.
614
-
615
- Verification consisted of inspecting the written guidance and running `npm run check`. No model trials were performed.
616
-
617
- ### Evidence
618
-
619
- [Maestro guidance](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/src/maestro/instructions/getMaestroInstructions.ts),
620
- [spec template](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/templates/spec.md), and
621
- [workflow documentation](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/docs/workflow.md#acceptance-criteria).
622
-
623
- ## MAESTRO-24: Add a simplifier with one clear purpose per agent
624
-
625
- Run the `simplifier` after accepted verification, with a Git-only file scope and separate report.
626
-
627
- Completed under the
628
- [specification](https://github.com/emilioSp/pi-maestro/blob/839ab9eb9753df22804d750657a616a9959c2c47/.specs/20261016-090319-add-a-dedicated-simplifier-after-verification/spec.md).
629
- The `owner` confirmed completion. The `builder` implements the approved `spec`. The `verifier` checks its `acceptance criteria`. The `simplifier` refactors accepted code
630
- for clarity. The extra code-quality review introduced in [MAESTRO-12](#maestro-12-verify-code-quality-against-agentsmd-instructions) is removed from the verifier's
631
- instructions.
632
-
633
- Successful verification and rejection of all current `findings` save `simplifier-running`. `Maestro` calls `maestro_run_simplifier` without another approval or
634
- verification cycle. Only that tool checks Git readiness. If Git is unavailable, it warns and saves `candidate-ready` without delegation or a `simplifier` `handoff`.
635
-
636
- The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files. It preserves observable behavior and the accepted
637
- check baseline. Rejected `findings` remain rejected, not passed. Required caller updates can include initially unchanged files. Unrelated refactoring, index changes, and
638
- automatic commits are excluded.
639
-
640
- A completed `pass` saves the fixed, unnumbered `handoffs/simplifier/S.json`, then saves `candidate-ready`. The report contains refactored files, a summary, and notes. No
641
- refactoring is required when selected code is already clear. Maestro's final summary separates this report from independent `verifier` evidence.