@emiliosp/pi-maestro 0.10.1 → 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 (75) hide show
  1. package/ADR.md +94 -18
  2. package/CHANGELOG.md +87 -33
  3. package/MISSION.md +4 -4
  4. package/README.md +66 -22
  5. package/ROADMAP.md +141 -112
  6. package/TECH_STACK.md +12 -11
  7. package/agents/builder.md +53 -57
  8. package/agents/simplifier.md +232 -0
  9. package/agents/verifier.md +52 -79
  10. package/docs/configuration.md +27 -16
  11. package/docs/glossary.md +47 -39
  12. package/docs/subagent-integration.md +22 -13
  13. package/docs/workflow.md +207 -103
  14. package/extensions/maestro-subagent.ts +4 -1
  15. package/extensions/maestro.ts +15 -26
  16. package/package.json +38 -39
  17. package/src/MaestroPaths.ts +26 -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 +56 -0
  21. package/src/artifacts/simplifier-handoff/readSimplifierHandoff.ts +29 -0
  22. package/src/artifacts/simplifier-handoff/schema.ts +27 -0
  23. package/src/artifacts/verifier-handoff/assertVerifierHandoff.ts +4 -10
  24. package/src/artifacts/verifier-handoff/schema.ts +3 -6
  25. package/src/artifacts/verifier-handoff/writeVerifierHandoff.ts +1 -3
  26. package/src/config/assertConfiguration.ts +4 -7
  27. package/src/config/defaults.ts +8 -5
  28. package/src/config/loadConfiguration.ts +5 -11
  29. package/src/config/schema.ts +4 -2
  30. package/src/ids/createSpecId.ts +1 -2
  31. package/src/ids/isValidSpecId.ts +1 -2
  32. package/src/maestro/checks/assertEnvironment.ts +21 -48
  33. package/src/maestro/instructions/getMaestroInstructions.ts +59 -30
  34. package/src/maestro/status/formatMaestroStatus.ts +7 -13
  35. package/src/maestro/status/refreshMaestroStatus.ts +3 -7
  36. package/src/specs/create.ts +14 -4
  37. package/src/specs/template.ts +10 -14
  38. package/src/tools/child/record-builder-handoff.ts +1 -0
  39. package/src/tools/child/record-simplifier-handoff.ts +73 -0
  40. package/src/tools/child/record-verifier-handoff.ts +2 -3
  41. package/src/tools/child/utils/resolveWorkflowContext.ts +1 -4
  42. package/src/tools/main/create-spec.ts +3 -2
  43. package/src/tools/main/mark-spec-ready.ts +2 -1
  44. package/src/tools/main/resolve-escalations.ts +1 -0
  45. package/src/tools/main/resolve-findings.ts +7 -21
  46. package/src/tools/main/run-builder.ts +37 -57
  47. package/src/tools/main/run-simplifier.ts +172 -0
  48. package/src/tools/main/run-verifier.ts +34 -58
  49. package/src/tools/utils/pi-subagent-delegation.ts +13 -22
  50. package/src/tools/utils/resolveToolRunContext.ts +2 -3
  51. package/src/utils/is-errno-exception.ts +1 -3
  52. package/src/utils/path-exists.ts +1 -0
  53. package/src/utils/path-strictly-within.ts +3 -6
  54. package/src/utils/path-within-or-equal.ts +1 -4
  55. package/src/utils/read-json.ts +1 -4
  56. package/src/utils/write-json.ts +1 -4
  57. package/src/workflow/builder/completeBuilderPass.ts +3 -2
  58. package/src/workflow/builder/prepareBuilderRun.ts +3 -8
  59. package/src/workflow/builder/resolveEscalations.ts +2 -6
  60. package/src/workflow/builder/utils/getWorkflowEventByBuilderHandoff.ts +1 -3
  61. package/src/workflow/roles.ts +2 -1
  62. package/src/workflow/simplifier/completeSimplifierPass.ts +56 -0
  63. package/src/workflow/spec/markSpecReady.ts +10 -4
  64. package/src/workflow/state/readWorkflowState.ts +2 -7
  65. package/src/workflow/state/schema.ts +9 -10
  66. package/src/workflow/state/writeWorkflowState.ts +1 -4
  67. package/src/workflow/transitions.ts +12 -12
  68. package/src/workflow/utils/assertSpecAcceptanceCriteria.ts +2 -1
  69. package/src/workflow/utils/getAgentRole.ts +6 -4
  70. package/src/workflow/verifier/completeVerifierPass.ts +1 -0
  71. package/src/workflow/verifier/resolveFindings.ts +9 -29
  72. package/src/workflow/verifier/utils/getWorkflowEventByVerifierHandoff.ts +5 -20
  73. package/templates/design.md +20 -0
  74. package/templates/proposal.md +23 -0
  75. package/templates/spec.md +21 -50
package/ROADMAP.md CHANGED
@@ -1,66 +1,77 @@
1
1
  # Roadmap
2
2
 
3
- This roadmap records planned outcomes, not permission to implement them. The `owner` selects work and approves its `specification` before implementation starts. Detailed requirements, technical decisions, and `acceptance criteria` belong in that `specification`.
3
+ This roadmap records planned outcomes, not permission to implement them. The `owner` selects work and approves its `specification` before implementation starts. Detailed
4
+ requirements, technical decisions, and `acceptance criteria` belong in that `specification`.
4
5
 
5
- "Now" is the current priority. "Next" follows it. “Later” contains uncommitted ideas with no promised order or date.
6
+ "Now" is the current priority. "Next" follows it. "Later" contains uncommitted ideas with no promised order or date.
6
7
 
7
8
  Item identifiers remain stable when priorities change. The `owner` approves changes to priorities and scope.
8
9
 
9
10
  ## Overview
10
11
 
11
- | ID | Title | Status | Summary |
12
- |---|---|---|---|
13
- | R-01 | [Improve status presentation and activation feedback](#r-01-improve-status-presentation-and-activation-feedback) | Completed | Show clearer status and configured agent details without adding model context. |
14
- | R-02 | [Store escalations and owner decisions in builder handoffs](#r-02-store-escalations-and-owner-decisions-in-builder-handoffs) | Completed | Keep `escalation` questions and `owner` answers together in numbered `builder` `handoffs`. |
15
- | R-03 | [Route builder failures through owner escalations](#r-03-route-builder-failures-through-owner-escalations) | Completed | Route reportable `builder` problems through `owner` `escalations` instead of a terminal failure phase. |
16
- | R-12 | [Format glossary terms consistently](#r-12-format-glossary-terms-consistently) | Completed | Apply glossary formatting across documentation and record its exclusions. |
17
- | R-14 | [Introduce Maestro at activation](#r-14-introduce-maestro-at-activation) | Completed | Introduce `Maestro` at activation and load relevant documentation only when needed. |
18
- | R-15 | [Rename the test support directory](#r-15-rename-the-test-support-directory) | Completed | Rename `test/` to `tests/` and update affected references. |
19
- | R-16 | [Verify code quality against AGENTS.md instructions](#r-16-verify-code-quality-against-agentsmd-instructions) | Completed | Require the `verifier` to review affected code against applicable `AGENTS.md` code-quality directives. |
20
- | R-06 | [Check subagent extensions at activation](#r-06-check-subagent-extensions-at-activation) | Completed | Require a successful parent `pi-subagents` availability reply before activation. |
21
- | R-05 | [Keep acceptance criterion numbering continuous](#r-05-keep-acceptance-criterion-numbering-continuous) | Completed | Reject gaps in `acceptance criterion` numbering before approving a `spec`. |
22
- | R-10 | [Match handoff criteria to the approved spec](#r-10-match-handoff-criteria-to-the-approved-spec) | Completed | Require every approved `spec` criterion ID in each submitted `builder` and `verifier` `handoff`. |
23
- | R-17 | [Record escalation resolutions when the spec changes](#r-17-record-escalation-resolutions-when-the-spec-changes) | Completed | Save all current `escalation` answers before changing phase, including when the `spec` requires revision. |
24
- | R-20 | [Route finding-driven spec revisions through drafting-spec](#r-20-route-finding-driven-spec-revisions-through-drafting-spec) | Completed | Record `finding` decisions before `spec` revision and require renewed `GREEN FLAG` before another `builder` `run`. |
25
- | R-18 | [Label acceptance criterion coverage](#r-18-label-acceptance-criterion-coverage) | Completed | Label each `acceptance criterion` as success, failure, or unchanged behavior. |
26
- | R-19 | [Avoid acceptance criteria already covered by tests](#r-19-avoid-acceptance-criteria-already-covered-by-tests) | Completed | Omit `acceptance criteria` whose exact scenarios already have test coverage. |
27
- | R-04 | [Rename the npm package](#r-04-rename-the-npm-package) | Later | Rename `@emiliosp/pi-maestro` to `pi-maestro-sdd` with compatibility decisions defined in the `spec`. |
28
- | R-07 | [Guide initial configuration](#r-07-guide-initial-configuration) | Later | Help the `owner` create valid `Maestro` configuration through an interview. |
29
- | R-08 | [Change agent models before a builder run](#r-08-change-agent-models-before-a-builder-run) | Later | Let the `owner` change `builder` and `verifier` models before subsequent `runs`. |
30
- | R-09 | [Define workflow reconciliation](#r-09-define-workflow-reconciliation) | Later | Define how `Maestro` can reconcile saved `artifacts` and workflow state. |
31
- | R-21 | [Add a simplifier with one clear purpose per agent](#r-21-add-a-simplifier-with-one-clear-purpose-per-agent) | Later | Add a simplifier after successful verification to reduce complexity without changing behavior. |
12
+ | ID | Title | Status | Summary |
13
+ | ---- | ---------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------ |
14
+ | R-01 | [Improve status presentation and activation feedback](#r-01-improve-status-presentation-and-activation-feedback) | Completed | Show clearer status and configured agent details without adding model context. |
15
+ | R-02 | [Store escalations and owner decisions in builder handoffs](#r-02-store-escalations-and-owner-decisions-in-builder-handoffs) | Completed | Keep `escalation` questions and `owner` answers together in numbered `builder` `handoffs`. |
16
+ | R-03 | [Route builder failures through owner escalations](#r-03-route-builder-failures-through-owner-escalations) | Completed | Route reportable `builder` problems through `owner` `escalations` instead of a terminal failure phase. |
17
+ | R-12 | [Format glossary terms consistently](#r-12-format-glossary-terms-consistently) | Completed | Apply glossary formatting across documentation and record its exclusions. |
18
+ | R-14 | [Introduce Maestro at activation](#r-14-introduce-maestro-at-activation) | Completed | Introduce `Maestro` at activation and load relevant documentation only when needed. |
19
+ | R-15 | [Rename the test support directory](#r-15-rename-the-test-support-directory) | Completed | Rename `test/` to `tests/` and update affected references. |
20
+ | R-16 | [Verify code quality against AGENTS.md instructions](#r-16-verify-code-quality-against-agentsmd-instructions) | Completed | Require the `verifier` to review affected code against applicable `AGENTS.md` code-quality directives. |
21
+ | R-06 | [Check subagent extensions at activation](#r-06-check-subagent-extensions-at-activation) | Completed | Require a successful parent `pi-subagents` availability reply before activation. |
22
+ | R-05 | [Keep acceptance criterion numbering continuous](#r-05-keep-acceptance-criterion-numbering-continuous) | Completed | Reject gaps in `acceptance criterion` numbering before approving a `spec`. |
23
+ | R-10 | [Match handoff criteria to the approved spec](#r-10-match-handoff-criteria-to-the-approved-spec) | Completed | Require every approved `spec` criterion ID in each submitted `builder` and `verifier` `handoff`. |
24
+ | R-17 | [Record escalation resolutions when the spec changes](#r-17-record-escalation-resolutions-when-the-spec-changes) | Completed | Save all current `escalation` answers before changing phase, including when the `spec` requires revision. |
25
+ | R-20 | [Route finding-driven spec revisions through drafting-spec](#r-20-route-finding-driven-spec-revisions-through-drafting-spec) | Completed | Record `finding` decisions before `spec` revision and require renewed `GREEN FLAG` before another `builder` `run`. |
26
+ | R-18 | [Label acceptance criterion coverage](#r-18-label-acceptance-criterion-coverage) | Completed | Label each `acceptance criterion` as success, failure, or unchanged behavior. |
27
+ | R-19 | [Avoid acceptance criteria already covered by tests](#r-19-avoid-acceptance-criteria-already-covered-by-tests) | Completed | Omit `acceptance criteria` whose exact scenarios already have test coverage. |
28
+ | R-04 | [Rename the npm package](#r-04-rename-the-npm-package) | Later | Rename `@emiliosp/pi-maestro` to `pi-maestro-sdd` with compatibility decisions defined in the `spec`. |
29
+ | R-07 | [Guide initial configuration](#r-07-guide-initial-configuration) | Later | Help the `owner` create valid `Maestro` configuration through an interview. |
30
+ | R-08 | [Change agent models before a builder run](#r-08-change-agent-models-before-a-builder-run) | Later | Let the `owner` change `builder` and `verifier` models before subsequent `runs`. |
31
+ | R-09 | [Define workflow reconciliation](#r-09-define-workflow-reconciliation) | Later | Define how `Maestro` can reconcile saved `artifacts` and workflow state. |
32
+ | R-21 | [Add a simplifier with one clear purpose per agent](#r-21-add-a-simplifier-with-one-clear-purpose-per-agent) | Implemented | Run the `simplifier` after accepted verification, with a Git-only file scope and separate report. |
32
33
 
33
34
  ## Completed
34
35
 
35
36
  ### R-01: Improve status presentation and activation feedback
36
37
 
37
- The status bar uses phase icons, theme colors, and shortened `spec` IDs. Successful activation shows the configured `builder` and `verifier` settings without adding the notice to session history or model context. All 12 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
38
+ The status bar uses phase icons, theme colors, and shortened `spec` IDs. Successful activation shows the configured `builder` and `verifier` settings without adding the
39
+ notice to session history or model context. All 12 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
38
40
 
39
41
  #### Evidence
40
42
 
41
- [Specification](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/spec.md), [verifier report](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/handoffs/verifier/V1.json), and [merged PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
43
+ [Specification](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/spec.md),
44
+ [verifier report](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/handoffs/verifier/V1.json), and
45
+ [merged PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
42
46
 
43
47
  ### R-02: Store escalations and owner decisions in builder handoffs
44
48
 
45
- Numbered `builder` `handoffs` contain multiple `escalation` questions and their `owner` resolutions. The `owner` resolves all current questions in one batch. Earlier `handoffs` remain available as history. All 10 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
49
+ Numbered `builder` `handoffs` contain multiple `escalation` questions and their `owner` resolutions. The `owner` resolves all current questions in one batch. Earlier
50
+ `handoffs` remain available as history. All 10 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
46
51
 
47
52
  #### Evidence
48
53
 
49
- [Specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md), [verifier report](.specs/20261008-132344-store-escalations-in-builder-handoffs/handoffs/verifier/V1.json), and [merged PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
54
+ [Specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md),
55
+ [verifier report](.specs/20261008-132344-store-escalations-in-builder-handoffs/handoffs/verifier/V1.json), and
56
+ [merged PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
50
57
 
51
58
  ### R-03: Route builder failures through owner escalations
52
59
 
53
- Released in `0.9.0`. The `builder` reports only `done` or `escalation`. Reportable technical problems use the existing `owner` `escalation` process. Individual `probe` results retain `failed`. Execution errors and missing or invalid saved results still stop the workflow without automatic recovery.
60
+ Released in `0.9.0`. The `builder` reports only `done` or `escalation`. Reportable technical problems use the existing `owner` `escalation` process. Individual `probe`
61
+ results retain `failed`. Execution errors and missing or invalid saved results still stop the workflow without automatic recovery.
54
62
 
55
63
  All 8 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
56
64
 
57
65
  #### Evidence
58
66
 
59
- [Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md), [verifier report](.specs/20261013-101454-route-builder-failures-through-owner-escalations/handoffs/verifier/V1.json), and [merged PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
67
+ [Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md),
68
+ [verifier report](.specs/20261013-101454-route-builder-failures-through-owner-escalations/handoffs/verifier/V1.json), and
69
+ [merged PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
60
70
 
61
71
  ### R-12: Format glossary terms consistently
62
72
 
63
- Applied glossary formatting across the documentation and recorded its exclusions in `AGENTS.md` and the documentation audit skill. The approved change document uses the term `spec`. The `owner` confirmed completion.
73
+ Applied glossary formatting across the documentation and recorded its exclusions in `AGENTS.md` and the documentation audit skill. The approved change document uses the
74
+ term `spec`. The `owner` confirmed completion.
64
75
 
65
76
  #### Evidence
66
77
 
@@ -68,168 +79,208 @@ Applied glossary formatting across the documentation and recorded its exclusions
68
79
 
69
80
  ### R-14: Introduce Maestro at activation
70
81
 
71
- 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 and does not add session history or start a model request.
82
+ 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
83
+ and does not add session history or start a model request.
72
84
 
73
- Active instructions identify absolute paths to the installed README and documentation directory. `Maestro` reads relevant documentation on demand without automatically loading its contents.
85
+ Active instructions identify absolute paths to the installed README and documentation directory. `Maestro` reads relevant documentation on demand without automatically
86
+ loading its contents.
74
87
 
75
88
  All 6 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
76
89
 
77
90
  #### Evidence
78
91
 
79
- [Specification](.specs/20261013-171954-introduce-maestro-at-activation/spec.md), [verifier report](.specs/20261013-171954-introduce-maestro-at-activation/handoffs/verifier/V1.json), and [merged PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
92
+ [Specification](.specs/20261013-171954-introduce-maestro-at-activation/spec.md),
93
+ [verifier report](.specs/20261013-171954-introduce-maestro-at-activation/handoffs/verifier/V1.json), and [merged PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
80
94
 
81
95
  ### R-15: Rename the test support directory
82
96
 
83
- Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture paths, lint configuration, and project instructions. This follows the global instruction to keep fixtures under `tests/fixtures`. Source tests remain next to their source files. Historical `handoffs` retain their recorded paths.
97
+ Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture paths, lint configuration, and project instructions. This follows the global instruction to
98
+ keep fixtures under `tests/fixtures`. Source tests remain next to their source files. Historical `handoffs` retain their recorded paths.
84
99
 
85
100
  #### Evidence
86
101
 
87
- [Test support](tests/support/), [fixtures](tests/fixtures/), and [lint configuration](biome.json).
102
+ [Test support](tests/support/), [fixtures](tests/fixtures/), and [lint configuration](.oxlintrc.json).
88
103
 
89
104
  ### R-16: Verify code quality against AGENTS.md instructions
90
105
 
91
- 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. All existing duties remain unchanged, including independent verification of every `acceptance criterion`.
106
+ 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.
107
+ All existing duties remain unchanged, including independent verification of every `acceptance criterion`.
92
108
 
93
- Instruction-violation `findings` identify the instruction file, quote the rule, and explain the violating code through existing evidence fields. Missing files or code-quality directives cause only the added review to be skipped. Personal style preferences are not requirements.
109
+ Instruction-violation `findings` identify the instruction file, quote the rule, and explain the violating code through existing evidence fields. Missing files or
110
+ code-quality directives cause only the added review to be skipped. Personal style preferences are not requirements.
94
111
 
95
- All 5 `acceptance criteria` passed through independent inspection of the written guidance, with no `verifier` `findings`. No additional model trials were performed. The saved workflow reached `candidate-ready`.
112
+ All 5 `acceptance criteria` passed through independent inspection of the written guidance, with no `verifier` `findings`. No additional model trials were performed. The
113
+ saved workflow reached `candidate-ready`.
96
114
 
97
115
  #### Evidence
98
116
 
99
- [Specification](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/spec.md), [verifier report](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/handoffs/verifier/V1.json), and [merged PR #34](https://github.com/emilioSp/pi-maestro/pull/34).
117
+ [Specification](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/spec.md),
118
+ [verifier report](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/handoffs/verifier/V1.json), and
119
+ [merged PR #34](https://github.com/emilioSp/pi-maestro/pull/34).
100
120
 
101
121
  ### R-06: Check subagent extensions at activation
102
122
 
103
- 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 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 extension availability, not child execution readiness.
123
+ 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
124
+ 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
125
+ extension availability, not child execution readiness.
104
126
 
105
127
  All 7 `acceptance criteria` passed using controlled replies and code inspection, with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
106
128
 
107
- 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 verification.
129
+ 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
130
+ verification.
108
131
 
109
132
  #### Evidence
110
133
 
111
- [Specification](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/spec.md), [verifier report](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/handoffs/verifier/V1.json), and [merged PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
134
+ [Specification](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/spec.md),
135
+ [verifier report](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/handoffs/verifier/V1.json), and
136
+ [merged PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
112
137
 
113
138
  ### R-05: Keep acceptance criterion numbering continuous
114
139
 
115
- 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 files unchanged.
140
+ 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
141
+ files unchanged.
116
142
 
117
- `Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner` approval is required.
143
+ `Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner`
144
+ approval is required.
118
145
 
119
146
  All 3 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
120
147
 
121
148
  #### Evidence
122
149
 
123
- [Specification](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/spec.md), [verifier report](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/handoffs/verifier/V1.json), and [merged PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
150
+ [Specification](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/spec.md),
151
+ [verifier report](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/handoffs/verifier/V1.json), and
152
+ [merged PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
124
153
 
125
154
  ### R-10: Match handoff criteria to the approved spec
126
155
 
127
- 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 saving a report or changing phase. Extra report IDs remain allowed. Existing report validation is unchanged, and no new check rejects duplicate `spec` IDs.
156
+ 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
157
+ saving a report or changing phase. Extra report IDs remain allowed. Existing report validation is unchanged, and no new check rejects duplicate `spec` IDs.
128
158
 
129
159
  Both `acceptance criteria` passed independent verification with no `findings`. The saved workflow reached `candidate-ready`.
130
160
 
131
- 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 role. These changes are outside the completed independent verification. The final `npm run check` passed all 227 tests and coverage thresholds.
161
+ 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
162
+ role. These changes are outside the completed independent verification. The final `npm run check` passed all 227 tests and coverage thresholds.
132
163
 
133
164
  #### Evidence
134
165
 
135
- [Specification](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md), [verifier report](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/handoffs/verifier/V1.json), and [merged PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
166
+ [Specification](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md),
167
+ [verifier report](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/handoffs/verifier/V1.json), and
168
+ [merged PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
136
169
 
137
170
  ### R-17: Record escalation resolutions when the spec changes
138
171
 
139
172
  #### Objective
140
173
 
141
- Save every current `escalation` answer in the original `builder` `handoff`, whether the `spec` stays unchanged or requires revision.
142
- Each `resolution` records the owner's chosen solution and reason. A decision requiring revision also identifies the `escalation` and describes the agreed `spec` change.
174
+ Save every current `escalation` answer in the original `builder` `handoff`, whether the `spec` stays unchanged or requires revision. Each `resolution` records the owner's
175
+ chosen solution and reason. A decision requiring revision also identifies the `escalation` and describes the agreed `spec` change.
143
176
 
144
177
  #### Agreed flow
145
178
 
146
179
  `Maestro` records the complete decision batch through `maestro_resolve_escalations` before changing phase.
147
180
 
148
- | Decision | Next phase and action |
149
- |---|---|
150
- | No `spec` change | `escalation-decisions` → `ready-for-builder`. The `builder` continues under the approved `spec`, without renewed approval. |
151
- | `Spec` change required | `escalation-decisions` → `drafting-spec`. The `owner` and `Maestro` revise and review the same `spec`. |
152
- | Revised `spec` receives renewed `GREEN FLAG` | `drafting-spec` → `ready-for-builder` through separate `maestro_mark_spec_ready` approval. |
181
+ | Decision | Next phase and action |
182
+ | -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
183
+ | No `spec` change | `escalation-decisions` → `ready-for-builder`. The `builder` continues under the approved `spec`, without renewed approval. |
184
+ | `Spec` change required | `escalation-decisions` → `drafting-spec`. The `owner` and `Maestro` revise and review the same `spec`. |
185
+ | Revised `spec` receives renewed `GREEN FLAG` | `drafting-spec` → `ready-for-builder` through separate `maestro_mark_spec_ready` approval. |
153
186
 
154
187
  Direct `spec` approval from `escalation-decisions` is rejected. Recording answers does not move to `ready-for-verifier`; that phase requires a completed `builder` `pass`.
155
188
 
156
189
  #### Implementation boundaries
157
190
 
158
- Reuse the existing resolution operation and `handoff` fields. Do not add a parallel decision store, tool, or workflow phase.
159
- Define both resolution transitions explicitly in `src/workflow/transitions.ts` and apply them through `transitionWorkflow`. Direct phase assignment elsewhere is banned.
160
- Preserve initial `spec` approval, `verifier` `finding` decisions, existing batch validation, and historical `handoffs`.
191
+ Reuse the existing resolution operation and `handoff` fields. Do not add a parallel decision store, tool, or workflow phase. Define both resolution transitions explicitly
192
+ in `src/workflow/transitions.ts` and apply them through `transitionWorkflow`. Direct phase assignment elsewhere is banned. Preserve initial `spec` approval, `verifier`
193
+ `finding` decisions, existing batch validation, and historical `handoffs`.
161
194
 
162
195
  #### Completed when
163
196
 
164
- Saved `resolutions`, workflow phases, tool results, agent instructions, and human documentation follow the agreed flow.
165
- Verification checks both observable behavior and use of the central transition definitions for each resolution branch. Passing behavior tests alone is not enough.
166
- The new `spec` includes coverage labels and omits `acceptance criteria` already covered by tests of the same scenario.
197
+ Saved `resolutions`, workflow phases, tool results, agent instructions, and human documentation follow the agreed flow. Verification checks both observable behavior and
198
+ 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
199
+ `acceptance criteria` already covered by tests of the same scenario.
167
200
 
168
201
  ### R-20: Route finding-driven spec revisions through drafting-spec
169
202
 
170
- Implemented the approved revision route. `Maestro` records every current `finding` decision before returning to `drafting-spec` when revision is required.
171
- The `owner` reviews the same revised `spec` and gives renewed `GREEN FLAG` before separate approval and another `builder` `run`.
172
- Revision takes priority in mixed batches. Direct approval from `finding-decisions` is rejected.
203
+ Implemented the approved revision route. `Maestro` records every current `finding` decision before returning to `drafting-spec` when revision is required. The `owner`
204
+ reviews the same revised `spec` and gives renewed `GREEN FLAG` before separate approval and another `builder` `run`. Revision takes priority in mixed batches. Direct
205
+ approval from `finding-decisions` is rejected.
173
206
 
174
- Later event naming cleanup identifies `builder` and `owner` actions explicitly. Both revision routes use `OWNER_REQUEST_SPEC_REVISION` without changing the phase flow. Batch resolution uses `RESOLVE_ESCALATIONS`, and the status label refers to `escalations` in the plural. The saved decision phases are named `escalation-decisions` and `finding-decisions`.
207
+ Later event naming cleanup identifies `builder` and `owner` actions explicitly. Both revision routes use `OWNER_REQUEST_SPEC_REVISION` without changing the phase flow.
208
+ Batch resolution uses `RESOLVE_ESCALATIONS`, and the status label refers to `escalations` in the plural. The saved decision phases are named `escalation-decisions` and
209
+ `finding-decisions`.
175
210
 
176
211
  #### Evidence
177
212
 
178
- [Specification](.specs/20261015-154812-route-finding-driven-spec-revisions-through-drafting-spec/spec.md) and [resolution integration tests](src/tools/main/resolve-findings.integration.test.ts).
213
+ [Specification](.specs/20261015-154812-route-finding-driven-spec-revisions-through-drafting-spec/spec.md) and
214
+ [resolution integration tests](src/tools/main/resolve-findings.integration.test.ts).
179
215
 
180
216
  ### R-18: Label acceptance criterion coverage
181
217
 
182
- Implemented with R-19 as one task, as selected by the `owner`.
183
- The `spec` template and `Maestro` guidance require one `Coverage` label per `acceptance criterion`:
218
+ Implemented with R-19 as one task, as selected by the `owner`. The `spec` template and `Maestro` guidance require one `Coverage` label per `acceptance criterion`:
184
219
 
185
- | Label | Purpose |
186
- |---|---|
187
- | `success` | A valid action produces the required result. |
188
- | `failure` | An invalid action is correctly rejected. |
189
- | `unchanged` | The change preserves existing behavior. |
220
+ | Label | Purpose |
221
+ | ----------- | -------------------------------------------- |
222
+ | `success` | A valid action produces the required result. |
223
+ | `failure` | An invalid action is correctly rejected. |
224
+ | `unchanged` | The change preserves existing behavior. |
190
225
 
191
- Use `unchanged` when the criterion explicitly checks behavior that the change must preserve.
192
- Labels describe scenarios, not test outcomes. A `failure` scenario passes when the invalid action is correctly rejected.
193
- A `spec` does not need all three categories.
194
- `Maestro` includes labels when presenting criteria to the `owner` and checks them against scenarios and `expected results` during review.
195
- Approval validation and `handoff` formats remain unchanged.
226
+ Use `unchanged` when the criterion explicitly checks behavior that the change must preserve. Labels describe scenarios, not test outcomes. A `failure` scenario passes
227
+ 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
228
+ them against scenarios and `expected results` during review. Approval validation and `handoff` formats remain unchanged.
196
229
 
197
- The existing creation integration test now checks that the generated `spec` includes the coverage field.
198
- The final `npm run check` passed all 238 tests and coverage thresholds. No model trials were performed.
230
+ 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
231
+ thresholds. No model trials were performed.
199
232
 
200
233
  #### Evidence
201
234
 
202
- [Spec template](templates/spec.md), [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [creation integration test](src/specs/create.integration.test.ts), and [workflow documentation](docs/workflow.md#acceptance-criteria).
235
+ [Spec template](templates/spec.md), [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts),
236
+ [creation integration test](src/specs/create.integration.test.ts), and [workflow documentation](docs/workflow.md#acceptance-criteria).
203
237
 
204
238
  ### R-19: Avoid acceptance criteria already covered by tests
205
239
 
206
- Implemented with R-18. `Maestro` inspects existing tests before writing `acceptance criteria`.
207
- It omits a criterion only when a test covers the same starting conditions, action, and `expected result`.
208
- Partial or uncertain coverage does not justify omission. Similar tests do not count.
240
+ Implemented with R-18. `Maestro` inspects existing tests before writing `acceptance criteria`. It omits a criterion only when a test covers the same starting conditions,
241
+ action, and `expected result`. Partial or uncertain coverage does not justify omission. Similar tests do not count.
209
242
 
210
- During `spec` review, `Maestro` removes criteria whose exact scenarios already have test coverage.
211
- It keeps numbering continuous from `AC1` and updates affected references. Required behavior remains documented in the requirements and constraints.
212
- The same rules apply during `spec` revisions. No automatic approval check was added.
243
+ During `spec` review, `Maestro` removes criteria whose exact scenarios already have test coverage. It keeps numbering continuous from `AC1` and updates affected
244
+ references. Required behavior remains documented in the requirements and constraints. The same rules apply during `spec` revisions. No automatic approval check was added.
213
245
 
214
246
  Verification consisted of inspecting the written guidance and running `npm run check`. No model trials were performed.
215
247
 
216
248
  #### Evidence
217
249
 
218
- [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [spec template](templates/spec.md), and [workflow documentation](docs/workflow.md#acceptance-criteria).
250
+ [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [spec template](templates/spec.md), and
251
+ [workflow documentation](docs/workflow.md#acceptance-criteria).
219
252
 
220
253
  ## Now
221
254
 
255
+ ### R-21: Add a simplifier with one clear purpose per agent
256
+
257
+ Implemented under the [specification](.specs/20261016-090319-add-a-dedicated-simplifier-after-verification/spec.md). Independent review is pending. The `builder`
258
+ implements the approved `spec`. The `verifier` checks its `acceptance criteria`. The `simplifier` refactors accepted code for clarity. The extra code-quality review
259
+ introduced in R-16 is removed from the verifier's instructions.
260
+
261
+ Successful verification and rejection of all current `findings` save `simplifier-running`. `Maestro` calls `maestro_run_simplifier` without another approval or
262
+ verification cycle. Only that tool checks Git readiness. If Git is unavailable, it warns and saves `candidate-ready` without delegation or a `simplifier` `handoff`.
263
+
264
+ The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files. It preserves observable behavior and the accepted
265
+ check baseline. Rejected `findings` remain rejected, not passed. Required caller updates can include initially unchanged files. Unrelated refactoring, index changes, and
266
+ automatic commits are excluded.
267
+
268
+ 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
269
+ refactoring is required when selected code is already clear. Maestro's final summary separates this report from independent `verifier` evidence.
270
+
222
271
  ## Next
223
272
 
224
273
  ## Later
225
274
 
226
- These items need scope review before `specification` approval. Existing behavior must be checked before adding new code. Dependencies between these items are not yet agreed.
275
+ These items need scope review before `specification` approval. Existing behavior must be checked before adding new code. Dependencies between these items are not yet
276
+ agreed.
227
277
 
228
278
  ### R-04: Rename the npm package
229
279
 
230
280
  #### Objective
231
281
 
232
- 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 workflow.
282
+ 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
283
+ workflow.
233
284
 
234
285
  Compatibility with installations under the old name must be decided in the `specification`. No `specification` is approved yet.
235
286
 
@@ -266,25 +317,3 @@ Explore how `Maestro` can reconcile saved `artifacts` and workflow state. The re
266
317
  #### Completed when
267
318
 
268
319
  Not yet defined. The `owner` must define the intended outcome, recovery boundaries, and completion condition before this item can move forward.
269
-
270
- ### R-21: Add a simplifier with one clear purpose per agent
271
-
272
- #### Objective
273
-
274
- Each agent has exactly one purpose. The `builder` implements the approved `spec`. The `verifier` independently checks its `acceptance criteria`. The simplifier refactors verified code.
275
-
276
- Add the simplifier after the `verifier`. It receives code built by the `builder` only after verification confirms that all checks defined in the `acceptance criteria` pass.
277
-
278
- The simplifier reduces complexity while preserving exact behavior. The goal is code that is easier to read, understand, modify, and debug, not fewer lines.
279
- Every simplification must pass this test: "Would a new team member understand this faster than the original?"
280
-
281
- #### Scope boundaries
282
-
283
- Remove the "Review code quality" section from `agents/verifier.md`. This replaces the additional review introduced in R-16, not independent verification of `acceptance criteria`.
284
-
285
- The simplifier's detailed instructions will be defined during `spec` preparation. This roadmap item does not define them.
286
-
287
- #### Completed when
288
-
289
- The workflow includes the simplifier after successful verification. Agent instructions keep implementation, verification, and simplification as separate responsibilities.
290
- The simplifier preserves exact behavior and follows the instructions agreed in the approved `spec`.
package/TECH_STACK.md CHANGED
@@ -1,14 +1,15 @@
1
1
  # Tech stack
2
2
 
3
- `Maestro` is a source-only TypeScript package that uses ECMAScript modules (ESM). Pi loads the TypeScript source directly. The package has no build step or compiled `dist/` directory.
3
+ `Maestro` is a source-only TypeScript package that uses ECMAScript modules (ESM). Pi loads the TypeScript source directly. The package has no build step or compiled
4
+ `dist/` directory.
4
5
 
5
- | Technology | Use |
6
- |---|---|
7
- | TypeScript | Application code and static type checks with `tsc --noEmit`. |
8
- | Node.js | Runtime. |
9
- | Pi | Extension host, agent APIs, and terminal interface. |
10
- | `pi-subagents` | `Builder` and `verifier` execution and activity tracking. |
11
- | TypeBox | Schemas and runtime validation for configuration, workflow state, tool inputs, and agent reports. |
12
- | Vitest with coverage | Unit tests, integration tests, and code coverage. |
13
- | Biome | Formatting and lint checks. |
14
- | Oxlint with `oxlint-anti-slop` | Additional lint and anti-slop checks. |
6
+ | Technology | Use |
7
+ | ------------------------------ | ------------------------------------------------------------------------------------------------- |
8
+ | TypeScript | Application code and static type checks with `tsc --noEmit`. |
9
+ | Node.js | Runtime. |
10
+ | Pi | Extension host, agent APIs, and terminal interface. |
11
+ | `pi-subagents` | `Builder`, `verifier`, and `simplifier` execution and activity tracking. |
12
+ | TypeBox | Schemas and runtime validation for configuration, workflow state, tool inputs, and agent reports. |
13
+ | Vitest with coverage | Unit tests, integration tests, and code coverage. |
14
+ | Oxfmt | Formatting |
15
+ | Oxlint with `oxlint-anti-slop` | Linting and additional anti-slop checks. |