@emiliosp/pi-maestro 0.11.0 → 0.12.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 (73) hide show
  1. package/ADR.md +54 -22
  2. package/CHANGELOG.md +42 -28
  3. package/MISSION.md +2 -4
  4. package/README.md +53 -24
  5. package/ROADMAP.md +64 -64
  6. package/TECH_STACK.md +3 -3
  7. package/agents/builder.md +53 -57
  8. package/agents/simplifier.md +79 -61
  9. package/agents/verifier.md +52 -64
  10. package/docs/configuration.md +1 -1
  11. package/docs/glossary.md +43 -40
  12. package/docs/subagent-integration.md +7 -8
  13. package/docs/workflow.md +135 -62
  14. package/extensions/maestro-subagent.ts +1 -0
  15. package/extensions/maestro.ts +9 -30
  16. package/package.json +38 -39
  17. package/src/MaestroPaths.ts +22 -35
  18. package/src/artifacts/builder-handoff/assertBuilderHandoff.ts +6 -15
  19. package/src/artifacts/builder-handoff/schema.ts +3 -6
  20. package/src/artifacts/simplifier-handoff/assertSimplifierHandoff.ts +3 -3
  21. package/src/artifacts/simplifier-handoff/schema.ts +1 -0
  22. package/src/artifacts/verifier-handoff/assertVerifierHandoff.ts +4 -10
  23. package/src/artifacts/verifier-handoff/schema.ts +3 -6
  24. package/src/artifacts/verifier-handoff/writeVerifierHandoff.ts +1 -3
  25. package/src/config/assertConfiguration.ts +3 -6
  26. package/src/config/defaults.ts +1 -5
  27. package/src/config/loadConfiguration.ts +4 -11
  28. package/src/config/schema.ts +1 -2
  29. package/src/ids/createSpecId.ts +1 -2
  30. package/src/ids/isValidSpecId.ts +1 -2
  31. package/src/maestro/checks/assertEnvironment.ts +19 -50
  32. package/src/maestro/instructions/getMaestroInstructions.ts +45 -26
  33. package/src/maestro/status/formatMaestroStatus.ts +4 -13
  34. package/src/maestro/status/refreshMaestroStatus.ts +3 -7
  35. package/src/specs/create.ts +14 -4
  36. package/src/specs/template.ts +10 -14
  37. package/src/tools/child/record-builder-handoff.ts +1 -0
  38. package/src/tools/child/record-simplifier-handoff.ts +4 -4
  39. package/src/tools/child/record-verifier-handoff.ts +2 -3
  40. package/src/tools/child/utils/resolveWorkflowContext.ts +1 -4
  41. package/src/tools/main/create-spec.ts +3 -2
  42. package/src/tools/main/mark-spec-ready.ts +2 -1
  43. package/src/tools/main/resolve-escalations.ts +1 -0
  44. package/src/tools/main/resolve-findings.ts +6 -20
  45. package/src/tools/main/run-builder.ts +37 -57
  46. package/src/tools/main/run-simplifier.ts +10 -20
  47. package/src/tools/main/run-verifier.ts +31 -55
  48. package/src/tools/utils/pi-subagent-delegation.ts +13 -22
  49. package/src/tools/utils/resolveToolRunContext.ts +2 -3
  50. package/src/utils/is-errno-exception.ts +1 -3
  51. package/src/utils/path-exists.ts +1 -0
  52. package/src/utils/path-strictly-within.ts +3 -6
  53. package/src/utils/path-within-or-equal.ts +1 -4
  54. package/src/utils/read-json.ts +1 -4
  55. package/src/utils/write-json.ts +1 -4
  56. package/src/workflow/builder/completeBuilderPass.ts +3 -2
  57. package/src/workflow/builder/prepareBuilderRun.ts +3 -8
  58. package/src/workflow/builder/resolveEscalations.ts +2 -6
  59. package/src/workflow/builder/utils/getWorkflowEventByBuilderHandoff.ts +1 -3
  60. package/src/workflow/simplifier/completeSimplifierPass.ts +2 -3
  61. package/src/workflow/spec/markSpecReady.ts +10 -4
  62. package/src/workflow/state/readWorkflowState.ts +2 -7
  63. package/src/workflow/state/schema.ts +5 -10
  64. package/src/workflow/state/writeWorkflowState.ts +1 -4
  65. package/src/workflow/transitions.ts +3 -11
  66. package/src/workflow/utils/assertSpecAcceptanceCriteria.ts +2 -1
  67. package/src/workflow/utils/getAgentRole.ts +1 -3
  68. package/src/workflow/verifier/completeVerifierPass.ts +1 -0
  69. package/src/workflow/verifier/resolveFindings.ts +9 -29
  70. package/src/workflow/verifier/utils/getWorkflowEventByVerifierHandoff.ts +5 -20
  71. package/templates/design.md +20 -0
  72. package/templates/proposal.md +23 -0
  73. package/templates/spec.md +21 -50
package/docs/workflow.md CHANGED
@@ -2,19 +2,20 @@
2
2
 
3
3
  `Maestro` manages one spec-driven workflow in the current Pi session. The `owner` works directly with `Maestro`.
4
4
 
5
- The approved `spec.md` defines behavior, scope, constraints, technical decisions, and `acceptance criteria` for the change.
5
+ The approved `spec` is one document set: `proposal.md` explains motivation and scope, `spec.md` defines behavior and `acceptance criteria`, and optional `design.md`
6
+ records significant technical decisions. The set forms one contract for the change.
6
7
 
7
- An `acceptance criterion` contains a coverage label, a `probe`, an `expected result`, and an example. A `probe` is a scenario used to test behavior.
8
+ An `acceptance criterion` contains a `probe`, an `expected result`, and an example. A `probe` is a scenario used to test behavior.
8
9
 
9
10
  A `handoff` is a saved agent report. `Builder` and `verifier` reports contain `probe` outcomes. The simplifier's report records refactored files, a summary, and notes.
10
11
 
11
- A `builder` `handoff` can contain `escalations`, which are questions that need `owner` decisions.
12
- A `verifier` `handoff` can contain `findings`, which are technical issues.
12
+ A `builder` `handoff` can contain `escalations`, which are questions that need `owner` decisions. A `verifier` `handoff` can contain `findings`, which are technical
13
+ issues.
13
14
 
14
15
  ## Roles
15
16
 
16
17
  | Role | Responsibility |
17
- |--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|
18
+ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
18
19
  | `Owner` | Decides requirements, scope, technical decisions, `spec` approval, `escalation` answers, and `finding` decisions. Performs the final review. |
19
20
  | `Maestro` | Prepares the `spec` with the `owner`, records workflow progress, runs agents, presents issues, and saves `owner` decisions. |
20
21
  | `Builder` | Implements the approved `spec` and runs every `probe`. Reports completion or an `escalation`, including technical problems that prevent completion. |
@@ -31,11 +32,9 @@ Maestro's Pi status shows the current phase.
31
32
 
32
33
  `pi-subagents` FleetView and `/subagents-fleet` show live agent activity and transcripts.
33
34
 
34
- Saved `handoffs` provide a structured account of each reported `run`.
35
- The `builder` reports its outcome, `probe` results, notes, and any `escalation` questions.
36
- The `verifier` reports its independent checks, results, and `findings`.
37
- The `simplifier` reports its refactoring separately.
38
- Recorded `owner` decisions explain how questions and issues were resolved. Earlier numbered reports remain available for inspection.
35
+ Saved `handoffs` provide a structured account of each reported `run`. The `builder` reports its outcome, `probe` results, notes, and any `escalation` questions. The
36
+ `verifier` reports its independent checks, results, and `findings`. The `simplifier` reports its refactoring separately. Recorded `owner` decisions explain how questions
37
+ and issues were resolved. Earlier numbered reports remain available for inspection.
39
38
 
40
39
  For example, the `owner` can read `B1.json` to see what the `builder` reports implementing and which `probes` it ran. `V1.json` shows what the `verifier` reports checking
41
40
  independently and which issues it found.
@@ -52,7 +51,7 @@ flowchart TD
52
51
  buildOutcome{Builder outcome}
53
52
  verify[Verifier checks live project files]
54
53
  findings{Findings?}
55
- simplify[Simplifier refactors accepted code or skips if Git is unavailable]
54
+ simplify[Simplifier refactors accepted code]
56
55
  candidate[Candidate ready]
57
56
  summary[Maestro summarizes results]
58
57
  review[Owner performs the final review]
@@ -86,7 +85,7 @@ alone does not establish a completed action.
86
85
  The default path is `.specs/<spec-id>/workflow.json`. The `spec` directory is [configurable](configuration.md).
87
86
 
88
87
  | Phase | Meaning |
89
- |------------------------|--------------------------------------------------------------------------------------------------------------------------------|
88
+ | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
90
89
  | `drafting-spec` | The `owner` and `Maestro` prepare the initial `spec` or revise it after recorded `escalation` answers or `finding` decisions. |
91
90
  | `ready-for-builder` | The approved `spec` or recorded `owner` decisions permit a `builder` `run`. |
92
91
  | `builder-running` | A `builder` `run` is active. |
@@ -97,48 +96,124 @@ The default path is `.specs/<spec-id>/workflow.json`. The `spec` directory is [c
97
96
  | `simplifier-running` | Verification succeeded or the `owner` rejected all current `findings`. The `simplifier` can run or skip if Git is unavailable. |
98
97
  | `candidate-ready` | Simplification completed. The workflow is complete. |
99
98
 
99
+ ## Specification documents
100
+
101
+ Each new `spec` uses these documents in the same directory:
102
+
103
+ | Document | Content | Presence |
104
+ | ------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
105
+ | `proposal.md` | Problem, goal, scope, and exclusions. | Always created. |
106
+ | `spec.md` | Required behavior, constraints, deltas, and `acceptance criteria` next to their requirements. | Always created. |
107
+ | `design.md` | Approved technical decisions, brief reasons, relevant contracts, risks, and prototype references. | Only when significant technical decisions need to be recorded. |
108
+
100
109
  ## Spec approval
101
110
 
102
111
  For the initial `spec`:
103
112
 
104
- 1. `Maestro` creates `spec.md` and `workflow.json` in `drafting-spec` and prepares the `spec` with the `owner`.
105
- 2. The `owner` reviews the requirements, scope, technical decisions, and `acceptance criteria`.
106
- 3. `Maestro` asks the `owner` to inspect the current `spec.md` and reply `GREEN FLAG` to approve it and start the `builder`.
113
+ 1. `Maestro` creates `proposal.md`, `spec.md`, and `workflow.json` in `drafting-spec`, then prepares the documents with the `owner`. It adds `design.md` only when needed.
114
+ 2. The `owner` reviews the complete document set: motivation, scope, requirements, `acceptance criteria`, and any approved technical decisions.
115
+ 3. `Maestro` asks the `owner` to inspect `proposal.md`, `spec.md`, and `design.md` when present and reply `GREEN FLAG` once to approve the entire set and start the
116
+ `builder`.
107
117
  4. After that reply, `Maestro` saves `ready-for-builder` and starts the `builder` in the foreground.
108
118
 
109
- Approval freezes the `spec`. The `spec` and its visual prototypes remain unchanged during `builder`, `verifier`, and `simplifier` execution.
110
- See [Spec revision](#spec-revision) for permitted revisions.
119
+ Approval freezes all present `spec` documents and visual prototypes together. None may change during `builder`, `verifier`, or `simplifier` execution. See
120
+ [Spec revision](#spec-revision) for permitted revisions.
121
+
122
+ ## Requirement deltas
123
+
124
+ Each requirement has exactly one `Delta` field. It describes the impact of the requirement against the current system's behavior.
125
+
126
+ | Value | Meaning |
127
+ | ---------- | ------------------------------------------------------------------------- |
128
+ | `added` | Introduces behavior or a constraint that did not exist before the change. |
129
+ | `modified` | Changes existing behavior or a constraint. |
130
+ | `removed` | Removes behavior that must no longer be available. |
131
+
132
+ The `spec` describes only requirements added, modified, or removed by the change. Existing behavior must continue working unless explicitly changed or removed. Unchanged
133
+ behavior is implicit, not an inventory of requirements to repeat in every `spec`.
134
+
135
+ For `modified` or `removed` requirements, a short `Before` description is included only when it helps explain the change. For example,
136
+ `Before: Tokens expire 30 minutes after issuance.`
137
+
138
+ ## Requirement coverage
139
+
140
+ Each requirement has its own section and a unique, stable ID, such as `REQ1`. Its `Verified by` field links to the `acceptance criteria` or existing tests that verify it.
141
+ The mapping appears only under the requirement, not again inside each `acceptance criterion`. Requirements use `### REQ<number>:` headings; their criteria immediately
142
+ follow as `#### AC<number>:` subsections. Each requirement-associated AC is defined once under its primary requirement; other requirements can link to it. AC numbering is
143
+ continuous across the whole document, including standalone regression criteria, not restarted for each requirement or section.
144
+
145
+ For example, a change that introduces persistent item titles can describe its requirement and linked `acceptance criterion` in `spec.md` as follows:
146
+
147
+ ```markdown
148
+ ### REQ1: Persist saved titles
149
+
150
+ Delta: added
151
+
152
+ Saving and reopening an item must preserve its title.
153
+
154
+ Verified by: [AC1](#ac1-saved-title-is-persisted)
155
+
156
+ #### AC1: Saved title is persisted
157
+
158
+ 1. Probe: Save a change to an item's title, then reopen the item.
159
+ 2. Expected result: The saved title is still present.
160
+ 3. Example: Change the title from "Draft" to "Ready", save, and reopen the item. The title is "Ready".
161
+ ```
162
+
163
+ A requirement can link to several `acceptance criteria`, and one criterion can verify several requirements (1:N). When an existing test covers the exact starting
164
+ conditions, action, and `expected result`, `Verified by` links to the test file relative to `spec.md` and includes the exact scenario name. No duplicate criterion is
165
+ needed. A requirement can reference both criteria and existing tests.
166
+
167
+ Before approval, `Maestro` follows the links and checks that their combined scenarios verify the whole requirement. Missing, partial, or uncertain coverage must be
168
+ resolved with an appropriate criterion or a confirmed existing test. References are updated when criterion headings or test locations change, including during `spec`
169
+ revisions.
111
170
 
112
171
  ## Acceptance criteria
113
172
 
114
- Each `acceptance criterion` has a unique ID and describes one observable result.
173
+ Each `acceptance criterion` has a unique ID and describes one observable result. A criterion can verify a changed requirement or check a relevant regression in existing
174
+ behavior without an associated requirement.
175
+
176
+ Standalone regression criteria belong in an optional `## Regression checks` section, with `### AC<number>:` headings. They do not need a `REQ` heading, `Delta`, or an
177
+ artificial requirement association. Only regressions relevant to the change belong here; unchanged requirements are not listed. The section is omitted when unnecessary.
178
+
179
+ For example, if saving item descriptions already works, adding title persistence may warrant this regression check without a new requirement for descriptions:
180
+
181
+ ```markdown
182
+ ## Regression checks
183
+
184
+ ### AC2: Existing descriptions remain saved
185
+
186
+ 1. Probe: Change and save the title of an item with a saved description, then reopen it.
187
+ 2. Expected result: The description is unchanged.
188
+ 3. Example: An item's saved description is "Buy milk". Change its title from "Draft" to "Shopping", save, and reopen it. Its description is still "Buy milk".
189
+ ```
115
190
 
116
- Each criterion contains these parts:
191
+ Both nested and standalone criteria share one continuous AC sequence and are checked by the `builder` and `verifier`. Standalone criteria have the same fields as
192
+ requirement-associated criteria:
117
193
 
118
- | Part | Content |
119
- |-------------------|-------------------------------------------------------------------------------------|
120
- | Coverage | One label that states the scenario's purpose: `success`, `failure`, or `unchanged`. |
121
- | `Probe` | Starting conditions and the action or observation that checks the behavior. |
122
- | `Expected result` | The measurable result the `probe` observes. |
123
- | Example | Concrete starting conditions, an input or action, and the exact `expected result`. |
194
+ | Part | Content |
195
+ | ----------------- | ---------------------------------------------------------------------------------- |
196
+ | `Probe` | Starting conditions and the action or observation that checks the behavior. |
197
+ | `Expected result` | The measurable result the `probe` observes. |
198
+ | Example | Concrete starting conditions, an input or action, and the exact `expected result`. |
124
199
 
125
200
  ## Escalations
126
201
 
127
- An `escalation` returns an implementation decision or a technical problem to the `owner`.
128
- For instance a technical failure, an undefined behavior, a conflict with the `spec`, or a possible scope change.
202
+ An `escalation` returns an implementation decision or a technical problem to the `owner`. For instance a technical failure, an undefined behavior, a conflict with the
203
+ `spec`, or a possible scope change.
129
204
 
130
205
  The `builder` saves all questions from one `pass` in the `escalations` list of its numbered `handoff`. `Maestro` identifies each question with both report and
131
206
  `escalation` IDs, such as `B1/E1`. See [Escalation references](glossary.md#escalation-references) for their scope.
132
207
 
133
208
  `Maestro` presents each question, evidence, options, consequences, and next steps. The workflow pauses in `escalation-decisions` while the `owner` decides how to proceed.
134
209
 
135
- The `owner` gives `Maestro` an answer and reason for every current question, whether or not the `spec` must change.
136
- The `owner` can select a listed option or give a different decision.
210
+ The `owner` gives `Maestro` an answer and reason for every current question, whether or not the `spec` must change. The `owner` can select a listed option or give a
211
+ different decision.
137
212
 
138
213
  `Maestro` saves all answers in the current `builder` `handoff` before the workflow continues.
139
214
 
140
215
  | `Owner` choice | Result |
141
- |-------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
216
+ | ----------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
142
217
  | Keep the current `spec` | `Maestro` starts another `builder` `run` without renewed approval. |
143
218
  | Change the `spec` | The `owner` and `Maestro` revise the same `spec`. The `owner` reviews it and replies `GREEN FLAG` before another `builder` `run`. |
144
219
 
@@ -149,36 +224,34 @@ The `owner` can select a listed option or give a different decision.
149
224
  Every current `finding` requires an `owner` decision, regardless of severity. `Maestro` explains the issue, evidence, practical effect, and available choices.
150
225
 
151
226
  `Maestro` identifies each `finding` with its report and `finding` IDs. For example, `V1/F2` means `finding` 2 in `verifier` report `V1.json`. The `finding` is an entry in
152
- that file's `findings` list, not a separate `F2.json` file. `Finding` numbers restart at `F1` in each `verifier` report.
153
- See [Finding references](glossary.md#finding-references) for a worked example.
227
+ that file's `findings` list, not a separate `F2.json` file. `Finding` numbers restart at `F1` in each `verifier` report. See
228
+ [Finding references](glossary.md#finding-references) for a worked example.
154
229
 
155
230
  `Maestro` records `owner` decisions in the same `verifier` report, e.g. decisions about `V1/F2` update `V1.json`, not a new `V2.json`. A new `verifier` result creates the
156
231
  next report (`V2.json`).
157
232
 
158
233
  | Decision | Result |
159
- |---------------|----------------------------------------------------------------------------------------------------------------|
234
+ | ------------- | -------------------------------------------------------------------------------------------------------------- |
160
235
  | `reject` | Records the owner's reason. If every `finding` is rejected, the workflow reaches `simplifier-running`. |
161
236
  | `fix-code` | Keeps the current `spec` and returns to `ready-for-builder` for code fixes when no decision requires revision. |
162
237
  | `revise-spec` | Records the owner's reason and agreed requirement change, then returns to `drafting-spec`. |
163
238
 
164
- `Maestro` saves every current decision together before the phase changes.
165
- If any `finding` requires revision, revision takes priority over code fixes and rejections. See [Spec revision](#spec-revision).
239
+ `Maestro` saves every current decision together before the phase changes. If any `finding` requires revision, revision takes priority over code fixes and rejections. See
240
+ [Spec revision](#spec-revision).
166
241
 
167
- Without revision, any `fix-code` decision requires another `builder` `run`, including when other `findings` are rejected.
168
- After the `builder` completes the fixes, the `verifier` checks the work again.
242
+ Without revision, any `fix-code` decision requires another `builder` `run`, including when other `findings` are rejected. After the `builder` completes the fixes, the
243
+ `verifier` checks the work again.
169
244
 
170
245
  ## Spec revision
171
246
 
172
- For either `escalation` answers or `finding` decisions, `Maestro` records the complete batch before the workflow returns to `drafting-spec`.
173
- This decision does not approve the `spec` or start an agent.
174
- The `owner` and `Maestro` then revise the same `spec` together in `drafting-spec`.
247
+ For either `escalation` answers or `finding` decisions, `Maestro` records the complete batch before the workflow returns to `drafting-spec`. This decision does not
248
+ approve the `spec` or start an agent. The `owner` and `Maestro` then revise the same `spec` together in `drafting-spec`.
175
249
 
176
- The `owner` reviews the changes and replies `GREEN FLAG` again.
177
- `Maestro` records that renewed approval separately, moves to `ready-for-builder`, and starts another `builder` `run`.
178
- Approval is permitted only in `drafting-spec`, not directly from either decision phase.
250
+ The `owner` reviews the complete revised set of `proposal.md`, `spec.md`, and `design.md` when present and replies `GREEN FLAG` once again. `Maestro` records that renewed
251
+ approval separately, moves to `ready-for-builder`, and starts another `builder` `run`. Approval is permitted only in `drafting-spec`, not directly from either decision
252
+ phase.
179
253
 
180
- The revised `spec` controls subsequent work.
181
- Earlier `escalations`, `findings`, and their decisions remain historical context.
254
+ The revised `spec` controls subsequent work. Earlier `escalations`, `findings`, and their decisions remain historical context.
182
255
 
183
256
  ## Verification boundary
184
257
 
@@ -189,25 +262,23 @@ Cleanup relies on the `verifier`. If cleanup cannot finish safely, the `verifier
189
262
 
190
263
  ## Simplification
191
264
 
192
- After a successful verification, Maestro starts the `simplifier`.
193
- The `simplifier` runs only if Git is available, if not, a warning is displayed: `Simplifier skipped: Git repository unavailable.`
265
+ After a successful verification, Maestro starts the `simplifier`. The `simplifier` runs only if Git is available, if not, a warning is displayed:
266
+ `Simplifier skipped: Git repository unavailable.`
194
267
 
195
268
  The `simplifier` starts from all staged, unstaged, and untracked code changes, including pre-existing changes. It preserves observable behavior and introduces no new
196
- check failures.
197
- If no code needs refactoring, the `simplifier` does not make any change.
269
+ check failures. If no code needs refactoring, the `simplifier` does not make any change.
198
270
 
199
271
  ## Workflow completion
200
272
 
201
- The workflow ends at `candidate-ready`.
202
- `Maestro` summarizes the changes, verification results, rejected `findings` and reasons, relevant `builder` notes from the saved `artifacts`, and simplifier's summary and
203
- notes
273
+ The workflow ends at `candidate-ready`. `Maestro` summarizes the changes, verification results, rejected `findings` and reasons, relevant `builder` notes from the saved
274
+ `artifacts`, and simplifier's summary and notes
204
275
 
205
276
  The `owner` performs the final review and controls any later Git use, pull request, or merge. Changes after completion are outside the completed verification.
206
277
 
207
278
  ## Stored artifacts
208
279
 
209
- An `artifact` is a saved workflow file. `Maestro` creates the `spec` directory with `spec.md`, `workflow.json`, and an empty `prototypes/` directory. `Builder`,
210
- `verifier`, and `simplifier` `handoff` directories appear when those results are saved.
280
+ An `artifact` is a saved workflow file. `Maestro` creates the `spec` directory with `proposal.md`, `spec.md`, `workflow.json`, and an empty `prototypes/` directory.
281
+ `design.md` is created during drafting only when needed. `Builder`, `verifier`, and `simplifier` `handoff` directories appear when those results are saved.
211
282
 
212
283
  The agents submit results through `Maestro` tools instead of writing the reports directly. A successful submission saves the result and updates the phase in
213
284
  `workflow.json` before the agent returns.
@@ -220,7 +291,7 @@ outcome, including `escalation`, creates the next `B` report. Revising the same
220
291
  For example, a repair cycle with successful `builder` results produces these files:
221
292
 
222
293
  | Step | Action | Report saved or updated |
223
- |------|-------------------------------------------------------------------------|---------------------------------------------------------------------------------|
294
+ | ---- | ----------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
224
295
  | 1 | The `builder` completes the implementation. | Creates `handoffs/builder/B1.json`. |
225
296
  | 2 | The `verifier` checks it and reports `findings`. | Creates `handoffs/verifier/V1.json`. |
226
297
  | 3 | The `owner` decides every `finding` and requests a code fix. | Updates decisions in the existing `V1.json`. |
@@ -230,8 +301,8 @@ For example, a repair cycle with successful `builder` results produces these fil
230
301
 
231
302
  If the first `builder` `run` escalates, it creates `B1.json` with its questions. `Owner` answers update `B1.json`. The next saved `builder` result creates `B2.json`.
232
303
 
233
- A `builder` report has `status: done` or `status: escalation`. A `done` report requires every recorded `probe` to pass and an empty `escalations` list.
234
- An `escalation` retains actual `probe` results: `passed`, `failed`, or `not-run`.
304
+ A `builder` report has `status: done` or `status: escalation`. A `done` report requires every recorded `probe` to pass and an empty `escalations` list. An `escalation`
305
+ retains actual `probe` results: `passed`, `failed`, or `not-run`.
235
306
 
236
307
  Execution errors or missing or invalid saved results stop the workflow. See [Limitations](#limitations).
237
308
 
@@ -239,7 +310,9 @@ The default layout after multiple `runs` is:
239
310
 
240
311
  ```text
241
312
  .specs/<spec-id>/
313
+ ├── proposal.md
242
314
  ├── spec.md
315
+ ├── design.md # only when needed
243
316
  ├── workflow.json
244
317
  ├── handoffs/
245
318
  │ ├── builder/
@@ -260,17 +333,17 @@ available as context, not as proof for the current `run`. `Owner` decisions upda
260
333
 
261
334
  ### No small models
262
335
 
263
- The `owner` must not use small models with a `low` thinking level for this workflow. These combinations cannot reliably follow the workflow rules.
264
- One example is `gpt-luna-6` with `thinking: "low"`.
336
+ The `owner` must not use small models with a `low` thinking level for this workflow. These combinations cannot reliably follow the workflow rules. One example is
337
+ `gpt-luna-6` with `thinking: "low"`.
265
338
 
266
339
  Moreover, the workflow works well with a defined harness: tests, lint for code rules, anti-slop checks for unwanted patterns, and `AGENTS.md`. `Maestro` does not supply
267
340
  these project-specific checks.
268
341
 
269
342
  ### No automatic rollback
270
343
 
271
- Launch errors, delegation failures, timeouts, interruptions, cancellations, and missing or invalid `handoffs` stop the workflow without a recovery transition.
272
- If a `run` saves no completed transition, its saved running phase remains unchanged. Partial protocol writes require manual `owner` follow-up.
273
- `Maestro` provides no automatic rollback, repair, or recovery for these errors. The files that remain are available for `owner` inspection.
344
+ Launch errors, delegation failures, timeouts, interruptions, cancellations, and missing or invalid `handoffs` stop the workflow without a recovery transition. If a `run`
345
+ saves no completed transition, its saved running phase remains unchanged. Partial protocol writes require manual `owner` follow-up. `Maestro` provides no automatic
346
+ rollback, repair, or recovery for these errors. The files that remain are available for `owner` inspection.
274
347
 
275
348
  ### No reconciliation
276
349
 
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
7
+
7
8
  import { registerRecordBuilderHandoffTool } from '#tools/child/record-builder-handoff.ts';
8
9
  import { registerRecordSimplifierHandoffTool } from '#tools/child/record-simplifier-handoff.ts';
9
10
  import { registerRecordVerifierHandoffTool } from '#tools/child/record-verifier-handoff.ts';
@@ -4,19 +4,14 @@
4
4
  */
5
5
 
6
6
  import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
7
+
7
8
  import { loadConfiguration } from '#config/loadConfiguration.ts';
8
9
  import { assertEnvironment } from '#maestro/checks/assertEnvironment.ts';
9
10
  import { getMaestroInstructions } from '#maestro/instructions/getMaestroInstructions.ts';
10
11
  import maestroSessionState from '#maestro/session/MaestroSessionState.ts';
11
12
  import { refreshMaestroStatus } from '#maestro/status/refreshMaestroStatus.ts';
12
- import {
13
- CREATE_SPEC_TOOL,
14
- registerCreateSpecTool,
15
- } from '#tools/main/create-spec.ts';
16
- import {
17
- MARK_SPEC_READY_TOOL,
18
- registerMarkSpecReadyTool,
19
- } from '#tools/main/mark-spec-ready.ts';
13
+ import { CREATE_SPEC_TOOL, registerCreateSpecTool } from '#tools/main/create-spec.ts';
14
+ import { MARK_SPEC_READY_TOOL, registerMarkSpecReadyTool } from '#tools/main/mark-spec-ready.ts';
20
15
  import {
21
16
  RESOLVE_ESCALATIONS_TOOL,
22
17
  registerResolveEscalationsTool,
@@ -25,18 +20,9 @@ import {
25
20
  RESOLVE_FINDINGS_TOOL,
26
21
  registerResolveFindingsTool,
27
22
  } from '#tools/main/resolve-findings.ts';
28
- import {
29
- RUN_BUILDER_TOOL,
30
- registerRunBuilderTool,
31
- } from '#tools/main/run-builder.ts';
32
- import {
33
- RUN_SIMPLIFIER_TOOL,
34
- registerRunSimplifierTool,
35
- } from '#tools/main/run-simplifier.ts';
36
- import {
37
- RUN_VERIFIER_TOOL,
38
- registerRunVerifierTool,
39
- } from '#tools/main/run-verifier.ts';
23
+ import { RUN_BUILDER_TOOL, registerRunBuilderTool } from '#tools/main/run-builder.ts';
24
+ import { RUN_SIMPLIFIER_TOOL, registerRunSimplifierTool } from '#tools/main/run-simplifier.ts';
25
+ import { RUN_VERIFIER_TOOL, registerRunVerifierTool } from '#tools/main/run-verifier.ts';
40
26
 
41
27
  const MAIN_TOOL_NAMES: readonly string[] = [
42
28
  CREATE_SPEC_TOOL.NAME,
@@ -58,14 +44,10 @@ export default (pi: ExtensionAPI): void => {
58
44
  registerRunSimplifierTool(pi);
59
45
 
60
46
  const syncMainTools = (): void => {
61
- const foreignTools = pi
62
- .getActiveTools()
63
- .filter((name) => !MAIN_TOOL_NAMES.includes(name));
47
+ const foreignTools = pi.getActiveTools().filter((name) => !MAIN_TOOL_NAMES.includes(name));
64
48
 
65
49
  pi.setActiveTools(
66
- maestroSessionState.isActive()
67
- ? [...foreignTools, ...MAIN_TOOL_NAMES]
68
- : foreignTools,
50
+ maestroSessionState.isActive() ? [...foreignTools, ...MAIN_TOOL_NAMES] : foreignTools,
69
51
  );
70
52
  };
71
53
 
@@ -118,10 +100,7 @@ export default (pi: ExtensionAPI): void => {
118
100
  'info',
119
101
  );
120
102
  } catch (error) {
121
- context.ui.notify(
122
- error instanceof Error ? error.message : String(error),
123
- 'error',
124
- );
103
+ context.ui.notify(error instanceof Error ? error.message : String(error), 'error');
125
104
 
126
105
  return;
127
106
  }
package/package.json CHANGED
@@ -1,30 +1,23 @@
1
1
  {
2
2
  "name": "@emiliosp/pi-maestro",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "A spec-driven multiagent development workflow for Pi.",
5
- "license": "MIT",
6
- "type": "module",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/emiliosp/pi-maestro.git"
10
- },
11
- "homepage": "https://github.com/emiliosp/pi-maestro#readme",
12
- "bugs": {
13
- "url": "https://github.com/emiliosp/pi-maestro/issues"
14
- },
15
5
  "keywords": [
16
- "pi-package",
6
+ "orchestration",
17
7
  "pi",
18
8
  "pi-coding-agent",
19
- "workflow",
9
+ "pi-package",
20
10
  "subagents",
21
- "orchestration"
22
- ],
23
- "os": [
24
- "darwin"
11
+ "workflow"
25
12
  ],
26
- "engines": {
27
- "node": ">=26.0.0"
13
+ "homepage": "https://github.com/emiliosp/pi-maestro#readme",
14
+ "bugs": {
15
+ "url": "https://github.com/emiliosp/pi-maestro/issues"
16
+ },
17
+ "license": "MIT",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/emiliosp/pi-maestro.git"
28
21
  },
29
22
  "files": [
30
23
  "extensions/",
@@ -41,6 +34,10 @@
41
34
  "README.md",
42
35
  "LICENSE"
43
36
  ],
37
+ "os": [
38
+ "darwin"
39
+ ],
40
+ "type": "module",
44
41
  "imports": {
45
42
  "#config/*": "./src/config/*",
46
43
  "#specs/*": "./src/specs/*",
@@ -53,41 +50,46 @@
53
50
  "#ids/*": "./src/ids/*",
54
51
  "#*": "./*"
55
52
  },
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
56
56
  "scripts": {
57
57
  "typecheck": "tsc --noEmit",
58
58
  "test": "vitest run --coverage --config vitest.config.ts",
59
- "check": "npm run lint:fix && npm run typecheck && npm test",
59
+ "check": "npm run fmt && npm run lint && npm run typecheck && npm test",
60
60
  "prepublishOnly": "npm run check",
61
61
  "publish:npm": "npm publish --access public",
62
- "lint": "biome check .",
63
- "lint:anti-slop": "oxlint --fix",
64
- "lint:fix": "biome check --write . && npm run lint:anti-slop"
62
+ "fmt": "oxfmt",
63
+ "lint": "oxlint --fix"
65
64
  },
66
65
  "dependencies": {
67
66
  "pi-subagents": "0.78.0"
68
67
  },
69
- "bundleDependencies": [
70
- "pi-subagents"
71
- ],
72
- "peerDependencies": {
73
- "@earendil-works/pi-ai": "*",
74
- "@earendil-works/pi-coding-agent": "*",
75
- "typebox": "*"
76
- },
77
68
  "devDependencies": {
78
- "@biomejs/biome": "2.5.15",
79
69
  "@earendil-works/pi-agent-core": "1.0.3",
80
70
  "@earendil-works/pi-tui": "1.0.3",
81
- "@vitest/coverage-v8": "5.0.3",
82
71
  "@types/node": "26.6.4",
72
+ "@vitest/coverage-v8": "5.0.3",
73
+ "oxfmt": "0.73.0",
83
74
  "oxlint": "1.87.0",
84
- "oxlint-anti-slop": "0.3.6",
75
+ "oxlint-anti-slop": "0.3.8",
85
76
  "typebox": "1.3.35",
86
77
  "typescript": "7.0.2",
87
78
  "vitest": "5.0.3"
88
79
  },
89
- "publishConfig": {
90
- "access": "public"
80
+ "peerDependencies": {
81
+ "@earendil-works/pi-ai": "*",
82
+ "@earendil-works/pi-coding-agent": "*",
83
+ "typebox": "*"
84
+ },
85
+ "bundleDependencies": [
86
+ "pi-subagents"
87
+ ],
88
+ "engines": {
89
+ "node": ">=26.0.0"
90
+ },
91
+ "allowScripts": {
92
+ "fsevents@2.3.3": true
91
93
  },
92
94
  "pi": {
93
95
  "extensions": [
@@ -98,8 +100,5 @@
98
100
  "./agents"
99
101
  ]
100
102
  }
101
- },
102
- "allowScripts": {
103
- "fsevents@2.3.3": true
104
103
  }
105
104
  }