@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/ADR.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Architecture decision records
2
2
 
3
- An Architecture Decision Record (ADR) explains an important architectural choice, its context, and its consequences.
4
- This file contains one numbered record per decision.
3
+ An Architecture Decision Record (ADR) explains an important architectural choice, its context, and its consequences. This file contains one numbered record per decision.
5
4
 
6
5
  Requirements and routine project rules belong in the [roadmap](ROADMAP.md) or other relevant documentation.
7
6
 
@@ -11,11 +10,12 @@ When a new decision replaces an accepted decision, add a new record, mark the ea
11
10
 
12
11
  ### Status
13
12
 
14
- Accepted. Recorded date: 2026-10-07. Implemented in `0.6.0`.
13
+ Superseded by [ADR-004](#adr-004-require-git-only-for-the-simplifier). Recorded date: 2026-10-07. Implemented in `0.6.0`.
15
14
 
16
15
  ### Context
17
16
 
18
- The previous workflow required Git and used checkpoints and automatic commits. The recorded reason for removing that approach was to simplify the project. Other evaluated alternatives were not recorded.
17
+ The previous workflow required Git and used checkpoints and automatic commits. The recorded reason for removing that approach was to simplify the project. Other evaluated
18
+ alternatives were not recorded.
19
19
 
20
20
  ### Decision
21
21
 
@@ -25,11 +25,13 @@ The `verifier` checks live project files. The `owner` controls later Git use, pu
25
25
 
26
26
  ### Consequences
27
27
 
28
- Workflow execution no longer depends on Git. Revision and commit fields were removed without migration or compatibility readers. Interrupted and older workflows require manual `owner` handling.
28
+ Workflow execution no longer depends on Git. Revision and commit fields were removed without migration or compatibility readers. Interrupted and older workflows require
29
+ manual `owner` handling.
29
30
 
30
31
  ### Evidence
31
32
 
32
- [Commit deae41c](https://github.com/emilioSp/pi-maestro/commit/deae41ce66a3f2c76859209c44165e7ddd0f3a72), [Changelog 0.6.0](CHANGELOG.md#060), and [workflow completion](docs/workflow.md#workflow-completion).
33
+ [Commit deae41c](https://github.com/emilioSp/pi-maestro/commit/deae41ce66a3f2c76859209c44165e7ddd0f3a72), [Changelog 0.6.0](CHANGELOG.md#060), and
34
+ [workflow completion](docs/workflow.md#workflow-completion).
33
35
 
34
36
  ## ADR-002: Store escalation decisions in builder handoffs
35
37
 
@@ -39,7 +41,8 @@ Accepted. Recorded date: 2026-10-08. Implemented in `0.7.0`.
39
41
 
40
42
  ### Context
41
43
 
42
- The previous approach stored `escalations` in standalone files and used singular resolution tools. The recorded reason for replacing it was to use the same storage, local ID, and batch decision model as `verifier` `findings`. Other evaluated alternatives were not recorded.
44
+ The previous approach stored `escalations` in standalone files and used singular resolution tools. The recorded reason for replacing it was to use the same storage, local
45
+ ID, and batch decision model as `verifier` `findings`. Other evaluated alternatives were not recorded.
43
46
 
44
47
  ### Decision
45
48
 
@@ -55,7 +58,8 @@ There are no migration procedures, fallback readers, or deprecated aliases. `Art
55
58
 
56
59
  ### Evidence
57
60
 
58
- [Repository-only specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md), [Commit dda6eb5](https://github.com/emilioSp/pi-maestro/commit/dda6eb5b3ab76ba175112c3c565c70be747d7344), and [escalation workflow](docs/workflow.md#escalations).
61
+ [Repository-only specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md),
62
+ [Commit dda6eb5](https://github.com/emilioSp/pi-maestro/commit/dda6eb5b3ab76ba175112c3c565c70be747d7344), and [escalation workflow](docs/workflow.md#escalations).
59
63
 
60
64
  ## ADR-003: Route builder failures through owner escalations
61
65
 
@@ -65,25 +69,97 @@ Accepted. Implemented.
65
69
 
66
70
  ### Context
67
71
 
68
- The `owner` must decide how work continues after a reportable technical problem.
69
- The workflow also needs a simpler model with two `builder` outcomes.
72
+ The `owner` must decide how work continues after a reportable technical problem. The workflow also needs a simpler model with two `builder` outcomes.
70
73
 
71
74
  ### Decision
72
75
 
73
- The `builder` reports only `done` or `escalation`.
74
- Reportable technical failures use the existing `escalation` process.
75
- The `owner` decides how to proceed instead of reaching a terminal failure phase.
76
+ The `builder` reports only `done` or `escalation`. Reportable technical failures use the existing `escalation` process. The `owner` decides how to proceed instead of
77
+ reaching a terminal failure phase.
76
78
 
77
79
  ### Consequences
78
80
 
79
- Reuse the existing tools, numbered `handoffs`, and batch decisions.
80
- Individual `probe` results retain `failed` as a valid value.
81
+ Reuse the existing tools, numbered `handoffs`, and batch decisions. Individual `probe` results retain `failed` as a valid value.
81
82
 
82
- Execution and protocol errors without a valid saved result still stop the workflow.
83
- This decision adds no automatic recovery.
83
+ Execution and protocol errors without a valid saved result still stop the workflow. This decision adds no automatic recovery.
84
84
 
85
85
  This breaking MVP change has no migrations, compatibility readers, deprecated aliases, or dedicated legacy-format tests.
86
86
 
87
87
  ### Evidence
88
88
 
89
- [Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md) and [R-03](ROADMAP.md#r-03-route-builder-failures-through-owner-escalations).
89
+ [Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md) and
90
+ [R-03](ROADMAP.md#r-03-route-builder-failures-through-owner-escalations).
91
+
92
+ ## ADR-004: Require Git only for the simplifier
93
+
94
+ ### Status
95
+
96
+ Accepted. Implemented through R-21. Supersedes [ADR-001](#adr-001-keep-the-workflow-independent-of-git).
97
+
98
+ ### Context
99
+
100
+ The `simplifier` needs a list of changed code files. Git can supply that list without adding file tracking to `builder` `handoffs`.
101
+
102
+ ### Decision
103
+
104
+ Only the `simplifier` requires Git and a Git repository to discover changed files. It has no non-Git fallback.
105
+
106
+ The Git readiness decision belongs only inside `maestro_run_simplifier`, before delegation. The tool checks readiness with `git rev-parse --is-inside-work-tree` in the
107
+ project directory. Only a successful result of `true` enables simplification.
108
+
109
+ Activation, `spec` preparation, `builder` execution, `verifier` completion, and `finding` resolution do not check Git readiness. Both `simplifier` entry routes save
110
+ `simplifier-running` before `Maestro` calls `maestro_run_simplifier`.
111
+
112
+ `Maestro` does not create automatic commits or Git checkpoints. The `owner` retains control of commits, pull requests, and merging.
113
+
114
+ ### Consequences
115
+
116
+ If Git readiness cannot be confirmed, `maestro_run_simplifier` reports a warning and skips delegation. The workflow moves from `simplifier-running` to `candidate-ready`
117
+ without an error. The skip transition is defined in `src/workflow/transitions.ts` and applied through `transitionWorkflow`.
118
+
119
+ Activation does not predict whether simplification will be skipped. The same readiness decision applies after successful verification and after the `owner` rejects all
120
+ current `findings`. Rejected `findings` retain their reasons and do not become passed verification.
121
+
122
+ The `simplifier` uses Git to select all staged, unstaged, and untracked code changes, including pre-existing changes. There is no spec-specific starting commit or
123
+ `builder` file list. Required caller updates can include initially unchanged files.
124
+
125
+ ### Evidence
126
+
127
+ [R-21](ROADMAP.md#r-21-add-a-simplifier-with-one-clear-purpose-per-agent) and the
128
+ [specification](.specs/20261016-090319-add-a-dedicated-simplifier-after-verification/spec.md).
129
+
130
+ ## ADR-005: Approve a specification document set as one contract
131
+
132
+ ### Status
133
+
134
+ Accepted. Implemented.
135
+
136
+ ### Context
137
+
138
+ Combining motivation, behavior, and technical decisions in one `spec.md` made the document difficult to navigate. The `owner` selected separate documents by purpose, with
139
+ `acceptance criteria` next to their requirements rather than collected at the end.
140
+
141
+ ### Decision
142
+
143
+ Each new `spec` has required `proposal.md` for motivation and scope and `spec.md` for behavior and `acceptance criteria`. `Maestro` creates `design.md` only when
144
+ significant approved technical decisions need recording. Routine implementation choices remain with the `builder`.
145
+
146
+ One `GREEN FLAG` approves all present documents together. The entire set and its prototypes remain frozen during agent execution. Revision uses the existing
147
+ `drafting-spec` flow and renewed approval of the complete set. No per-document approval or new workflow phase is introduced.
148
+
149
+ Requirements keep level-three `REQ` headings. Their `acceptance criteria` use level-four AC headings. Relevant standalone regression criteria use level-three AC headings
150
+ under an optional `Regression checks` section, without a requirement or `Delta` field. All criteria share continuous numbering across the document. Shared criteria are
151
+ defined once and linked from other requirements.
152
+
153
+ ### Consequences
154
+
155
+ Creation saves the proposal and behavioral `spec`, returns their paths and the optional design path, and leaves design creation to drafting. Approval requires the
156
+ proposal. All three agent roles read every present document and must not create or modify a design after approval.
157
+
158
+ Freezing continues to rely on agent instructions, without a file-hash manifest or file locks. Saved workflow and `handoff` formats are unchanged. Level-three standalone
159
+ regression AC headings and nested level-four headings are both recognized. Historical `specs` are not migrated; older drafts need manual `owner` handling before new
160
+ approval.
161
+
162
+ ### Evidence
163
+
164
+ [Document workflow](docs/workflow.md#specification-documents), [creation](src/specs/create.ts), [approval](src/workflow/spec/markSpecReady.ts), and
165
+ [templates](templates/).
package/CHANGELOG.md CHANGED
@@ -1,55 +1,91 @@
1
1
  # Changelog
2
2
 
3
- This file summarizes meaningful changes to the codebase, including behavior, data formats, architecture, and development tools. Git tags identify version boundaries; GitHub Releases are not required. Version-only changes and routine maintenance are omitted.
3
+ This file summarizes meaningful changes to the codebase, including behavior, data formats, architecture, and development tools. Git tags identify version boundaries;
4
+ GitHub Releases are not required.
4
5
 
5
- ## Unreleased
6
+ ## 0.12.0
7
+
8
+ 1. Added stable `REQ` identifiers and a `Verified by` field to the `spec` template and `Maestro` guidance. Each requirement links to its `acceptance criteria` or exact
9
+ existing test scenarios. Review checks complete coverage and current links, including during revisions. Approval validation and `handoff` formats remain unchanged.
10
+ 2. Added per-requirement `Delta` labels: `added`, `modified`, and `removed`. Modified or removed behavior can include a brief, evidence-based `Before` description when
11
+ useful. Requirements state the complete required outcome; unchanged behavior remains implicit. Approval validation and `handoff` formats remain unchanged.
12
+ 3. Split new `specs` into required `proposal.md` and `spec.md`, with optional `design.md`. One `GREEN FLAG` approves and freezes the present document set; all agent roles
13
+ read it. Creation returns the new document paths; approval requires the proposal. Historical documents are not migrated.
14
+ 4. Placed requirement-associated `acceptance criteria` under their requirements as level-four headings. Relevant standalone regression criteria use level-three headings
15
+ under optional `Regression checks`, without inventing unchanged requirements. Both forms share global numbering and are required in `handoffs`. Workflow phases and
16
+ saved report formats remain unchanged.
17
+ 5. Removed the `Coverage` classification field from current `acceptance criteria`. Each criterion retains its `probe`, `expected result`, and example. Standalone
18
+ regression checks remain identified by their section; validation and report formats are unchanged.
19
+
20
+ ## 0.11.0
21
+
22
+ 1. Added the `simplifier` after successful verification or rejection of all current `findings`, without another approval or verification cycle.
23
+ 2. Added Git-only readiness and file discovery for simplification. If Git is unavailable, the workflow warns and completes without delegation.
24
+ 3. Added independent `simplifier` configuration, activation checks and presentation, running status, and the fixed `handoffs/simplifier/S.json` result.
25
+ 4. Removed the extra code-quality review from the verifier's instructions. The `simplifier` preserves accepted behavior without introducing check failures.
26
+
27
+ ## 0.10.1
6
28
 
7
29
  1. Added `success`, `failure`, and `unchanged` coverage labels to the `spec` template and `Maestro` guidance. Approval validation and `handoff` formats remain unchanged.
8
- 2. Required `Maestro` to inspect existing tests before writing `acceptance criteria` and remove criteria whose exact scenarios already have coverage. Requirements remain documented in the `spec`.
30
+ 2. Required `Maestro` to inspect existing tests before writing `acceptance criteria` and remove criteria whose exact scenarios already have coverage. Requirements remain
31
+ documented in the `spec`.
9
32
 
10
33
  ## 0.10.0
11
34
 
12
- 1. Saved complete `owner` decision batches in their original `handoffs` before changing phase, including when the `spec` requires revision. See [PR #38](https://github.com/emilioSp/pi-maestro/pull/38).
35
+ 1. Saved complete `owner` decision batches in their original `handoffs` before changing phase, including when the `spec` requires revision. See
36
+ [PR #38](https://github.com/emilioSp/pi-maestro/pull/38).
13
37
  2. Added `revise-spec` decisions for `verifier` `findings`, with the owner's reason and agreed requirement change. Revision takes priority over code fixes and rejections.
14
- 3. Unified both revision paths through `drafting-spec`, with renewed `GREEN FLAG` before separate approval and another `builder` `run`. Approval is allowed only from `drafting-spec`.
38
+ 3. Unified both revision paths through `drafting-spec`, with renewed `GREEN FLAG` before separate approval and another `builder` `run`. Approval is allowed only from
39
+ `drafting-spec`.
15
40
  4. Renamed workflow events to identify `builder` and `owner` actions. Both revision paths share `OWNER_REQUEST_SPEC_REVISION`.
16
41
  5. Breaking: supply the required boolean `specChangeRequired` when calling `maestro_resolve_escalations`.
17
- 6. Breaking: saved decision phases are now `escalation-decisions` and `finding-decisions`. Existing workflows using older names require manual `owner` handling. No automatic migration is provided.
42
+ 6. Breaking: saved decision phases are now `escalation-decisions` and `finding-decisions`. Existing workflows using older names require manual `owner` handling. No
43
+ automatic migration is provided.
18
44
 
19
45
  ## 0.9.5
20
46
 
21
- 1. Added a shared check that requires every approved `spec` criterion ID in `builder` and `verifier` `handoffs`. See [PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
47
+ 1. Added a shared check that requires every approved `spec` criterion ID in `builder` and `verifier` `handoffs`. See
48
+ [PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
22
49
  2. Missing IDs reject submission before saving a report or changing phase. Extra report IDs remain allowed, and existing report validation is unchanged.
23
50
  3. Reused the raw heading rule `^### AC(\d+):`, including leading zeros and matching lines inside code blocks. No matching headings impose no new restriction.
24
51
  4. Added unit tests for extraction and one missing-ID integration test per role.
25
52
 
26
53
  ## 0.9.4
27
54
 
28
- 1. Added numbering validation to `spec` approval. Matched `acceptance criterion` headings must start at `AC1` and continue without gaps. See [PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
55
+ 1. Added numbering validation to `spec` approval. Matched `acceptance criterion` headings must start at `AC1` and continue without gaps. See
56
+ [PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
29
57
  2. Invalid numbering rejects approval before saving the workflow and leaves all saved files unchanged. No matching headings still permits approval.
30
- 3. Added `Maestro` guidance to correct only numbering and affected references, then retry with the existing `GREEN FLAG`. No additional `owner` approval is required before starting the `builder`.
58
+ 3. Added `Maestro` guidance to correct only numbering and affected references, then retry with the existing `GREEN FLAG`. No additional `owner` approval is required
59
+ before starting the `builder`.
31
60
 
32
61
  ## 0.9.3
33
62
 
34
- 1. Added a parent `pi-subagents` availability check during activation. A matching successful version 1 `ping` reply is required within 2000 ms. See [PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
35
- 2. Failed or invalid replies, emission errors, and timeouts prevent activation. The error includes "Maestro flow requires pi-subagents installed in the Pi environment." The check makes no automatic retry.
36
- 3. Preserved existing activation checks, UI-only notices, and unchanged session history. The availability check starts no agent, makes no model request, and does not run when turning `Maestro` off.
63
+ 1. Added a parent `pi-subagents` availability check during activation. A matching successful version 1 `ping` reply is required within 2000 ms. See
64
+ [PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
65
+ 2. Failed or invalid replies, emission errors, and timeouts prevent activation. The error includes "Maestro flow requires pi-subagents installed in the Pi environment."
66
+ The check makes no automatic retry.
67
+ 3. Preserved existing activation checks, UI-only notices, and unchanged session history. The availability check starts no agent, makes no model request, and does not run
68
+ when turning `Maestro` off.
37
69
 
38
70
  ## 0.9.2
39
71
 
40
- 1. Added code-quality review to `verifier` guidance for code affected by the approved change when applicable `AGENTS.md` directives exist. See [PR #34](https://github.com/emilioSp/pi-maestro/pull/34). All existing verification duties remain unchanged.
72
+ 1. Added code-quality review to `verifier` guidance for code affected by the approved change when applicable `AGENTS.md` directives exist. See
73
+ [PR #34](https://github.com/emilioSp/pi-maestro/pull/34). All existing verification duties remain unchanged.
41
74
  2. Required instruction-violation `findings` to identify the instruction file, quote the rule, and explain the violating code through existing evidence fields.
42
75
  3. Skip only the added review when files or code-quality directives are absent. Missing directives and personal style preferences do not produce `findings`.
43
76
 
44
77
  ## 0.9.1
45
78
 
46
- 1. Added a brief introduction and an invitation to ask how `Maestro` works to the successful activation notice. See [PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
79
+ 1. Added a brief introduction and an invitation to ask how `Maestro` works to the successful activation notice. See
80
+ [PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
47
81
  2. Preserved the configured agent details and UI-only activation. Activation does not add session history or start a model request.
48
- 3. Added absolute paths to the installed README and documentation directory in active instructions. `Maestro` reads relevant documentation on demand without automatically loading its contents.
82
+ 3. Added absolute paths to the installed README and documentation directory in active instructions. `Maestro` reads relevant documentation on demand without automatically
83
+ loading its contents.
49
84
 
50
85
  ## 0.9.0
51
86
 
52
- 1. Breaking: `builder` reports now support only `done` and `escalation`. Reportable technical problems use the existing `owner` `escalation` process. See [PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
87
+ 1. Breaking: `builder` reports now support only `done` and `escalation`. Reportable technical problems use the existing `owner` `escalation` process. See
88
+ [PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
53
89
  2. Removed the terminal `builder` failure phase and event. Execution errors and missing or invalid saved results still stop the workflow without automatic recovery.
54
90
  3. No migrations, compatibility readers, or deprecated aliases are provided. `Artifact` versions remain `1.0.0`.
55
91
 
@@ -60,39 +96,47 @@ This file summarizes meaningful changes to the codebase, including behavior, dat
60
96
 
61
97
  ## 0.7.3
62
98
 
63
- 1. Added Oxlint rules for `given ... when ... then ...` test titles, `const` usage, unnecessary `else` branches, type aliases, and ESM imports. See [PR #31](https://github.com/emilioSp/pi-maestro/pull/31).
99
+ 1. Added Oxlint rules for `given ... when ... then ...` test titles, `const` usage, unnecessary `else` branches, type aliases, and ESM imports. See
100
+ [PR #31](https://github.com/emilioSp/pi-maestro/pull/31).
64
101
  2. Updated `oxlint-anti-slop` from `0.3.3` to `0.3.6`.
65
102
  3. Updated 106 test titles to match the naming rule without changing test logic.
66
103
 
67
104
  ## 0.7.2
68
105
 
69
106
  1. Renamed the constitution files to `MISSION.md`, `TECH_STACK.md`, `ROADMAP.md`, and `CHANGELOG.md`. Updated their links, package file list, and audit references.
70
- 2. Applied consistent inline code formatting to glossary terms across the documentation. Recorded the formatting rule and its exclusions in `AGENTS.md` and the documentation audit skill.
107
+ 2. Applied consistent inline code formatting to glossary terms across the documentation. Recorded the formatting rule and its exclusions in `AGENTS.md` and the
108
+ documentation audit skill.
71
109
  3. Used `spec` consistently for the approved change document and removed the redundant glossary entry.
72
110
 
73
111
  ## 0.7.1
74
112
 
75
- 1. Documented the project mission, current tech stack, `owner` responsibilities, roadmap, and codebase change history. See [PR #30](https://github.com/emilioSp/pi-maestro/pull/30).
113
+ 1. Documented the project mission, current tech stack, `owner` responsibilities, roadmap, and codebase change history. See
114
+ [PR #30](https://github.com/emilioSp/pi-maestro/pull/30).
76
115
  2. Replaced `TODO.md` with the roadmap and included the four project constitution documents in the npm package.
77
116
  3. Updated documentation audits to compare all current documentation and the project constitution with the working tree without requesting a comparison baseline.
78
117
 
79
118
  ## 0.7.0
80
119
 
81
- 1. Stored multiple `escalation` questions and `owner` resolutions inside numbered `builder` `handoffs`. Earlier `handoffs` remain available as history. See [PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
82
- 2. Breaking: replaced `maestro_open_escalation` and `maestro_resolve_escalation` with `maestro_record_builder_handoff` and `maestro_resolve_escalations`. Done `handoffs` require `escalations: []`. Standalone `escalation` storage was removed without migration or compatibility readers. `Artifact` versions remain `1.0.0`.
120
+ 1. Stored multiple `escalation` questions and `owner` resolutions inside numbered `builder` `handoffs`. Earlier `handoffs` remain available as history. See
121
+ [PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
122
+ 2. Breaking: replaced `maestro_open_escalation` and `maestro_resolve_escalation` with `maestro_record_builder_handoff` and `maestro_resolve_escalations`. Done `handoffs`
123
+ require `escalations: []`. Standalone `escalation` storage was removed without migration or compatibility readers. `Artifact` versions remain `1.0.0`.
83
124
  3. Added LCOV coverage reports and Codecov uploads from CI. See [PR #28](https://github.com/emilioSp/pi-maestro/pull/28).
84
125
 
85
126
  Reload `Maestro` extensions before starting new workflows so sessions use the updated tools.
86
127
 
87
128
  ## 0.6.2
88
129
 
89
- Added phase icons, theme colors, and display-only shortening of long `spec` IDs. Successful activation shows the configured agent settings in a UI-only notice, outside session history and model context. See [PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
130
+ Added phase icons, theme colors, and display-only shortening of long `spec` IDs. Successful activation shows the configured agent settings in a UI-only notice, outside
131
+ session history and model context. See [PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
90
132
 
91
133
  ## 0.6.0
92
134
 
93
- 1. Removed Git requirements, checkpoints, and automatic commits from the workflow. `Maestro` uses Pi's project directory and saved workflow phase. See [PR #25](https://github.com/emilioSp/pi-maestro/pull/25).
135
+ 1. Removed Git requirements, checkpoints, and automatic commits from the workflow. `Maestro` uses Pi's project directory and saved workflow phase. See
136
+ [PR #25](https://github.com/emilioSp/pi-maestro/pull/25).
94
137
  2. Retained numbered `builder` and `verifier` `handoffs` and explicit `owner` `finding` decisions. Removed workflow revision counters and writer locks.
95
- 3. Breaking: changed `artifact` formats, `handoff` paths, and tool results without migration or compatibility readers. Removed revision and commit fields. `Artifact` versions remain `1.0.0`. Interrupted and older workflows require manual `owner` handling.
138
+ 3. Breaking: changed `artifact` formats, `handoff` paths, and tool results without migration or compatibility readers. Removed revision and commit fields. `Artifact`
139
+ versions remain `1.0.0`. Interrupted and older workflows require manual `owner` handling.
96
140
 
97
141
  ## 0.5.2
98
142
 
@@ -100,21 +144,25 @@ Reverted the `spec` question-dependency instructions introduced in `0.5.1`. See
100
144
 
101
145
  ## 0.5.1
102
146
 
103
- Added instructions to resolve prerequisite decisions before asking dependent `spec` questions and to review unresolved decisions before approval. These instructions were reverted in `0.5.2`.
147
+ Added instructions to resolve prerequisite decisions before asking dependent `spec` questions and to review unresolved decisions before approval. These instructions were
148
+ reverted in `0.5.2`.
104
149
 
105
150
  ## 0.5.0
106
151
 
107
- Removed breakage checks from `specs`, `handoffs`, validation, and agent instructions. Breakage checks temporarily introduced faults to test error detection. `Acceptance criteria` retain `probes`, `expected results`, and concrete examples. See [PR #24](https://github.com/emilioSp/pi-maestro/pull/24).
152
+ Removed breakage checks from `specs`, `handoffs`, validation, and agent instructions. Breakage checks temporarily introduced faults to test error detection.
153
+ `Acceptance criteria` retain `probes`, `expected results`, and concrete examples. See [PR #24](https://github.com/emilioSp/pi-maestro/pull/24).
108
154
 
109
155
  Breaking: `handoffs` no longer accept `breakageStatus`. Older `handoffs` containing that field must be regenerated. `Artifact` versions remain `1.0.0`.
110
156
 
111
157
  ## 0.4.5
112
158
 
113
- Required a concrete example in every `acceptance criterion`, both in the `spec` and when presenting it to the `owner`. Examples identify starting conditions, an action, and the expected observable result.
159
+ Required a concrete example in every `acceptance criterion`, both in the `spec` and when presenting it to the `owner`. Examples identify starting conditions, an action,
160
+ and the expected observable result.
114
161
 
115
162
  ## 0.4.4
116
163
 
117
- Expanded Maestro's explanations of `findings` and `escalations` with code evidence, concrete examples, available choices, and their consequences. The `owner` retains control of each decision.
164
+ Expanded Maestro's explanations of `findings` and `escalations` with code evidence, concrete examples, available choices, and their consequences. The `owner` retains
165
+ control of each decision.
118
166
 
119
167
  ## 0.4.3
120
168
 
@@ -122,7 +170,8 @@ Removed explicit `builder` and `verifier` tool allowlists and enabled inherited
122
170
 
123
171
  ## 0.4.2
124
172
 
125
- Made breakage checks optional when the approved `spec` did not require them. Required acceptance `probes` remained mandatory. Breakage checks were later removed in `0.5.0`. See [PR #23](https://github.com/emilioSp/pi-maestro/pull/23).
173
+ Made breakage checks optional when the approved `spec` did not require them. Required acceptance `probes` remained mandatory. Breakage checks were later removed in
174
+ `0.5.0`. See [PR #23](https://github.com/emilioSp/pi-maestro/pull/23).
126
175
 
127
176
  ## 0.4.1
128
177
 
@@ -136,7 +185,8 @@ Enabled inheritance of global instructions for `builder` and `verifier` agents,
136
185
 
137
186
  ## 0.3.0
138
187
 
139
- Clarified `Maestro`, `builder`, and `verifier` responsibilities, `spec` and prototype revisions, permitted experiments, evidence requirements, and cleanup. See [PR #21](https://github.com/emilioSp/pi-maestro/pull/21).
188
+ Clarified `Maestro`, `builder`, and `verifier` responsibilities, `spec` and prototype revisions, permitted experiments, evidence requirements, and cleanup. See
189
+ [PR #21](https://github.com/emilioSp/pi-maestro/pull/21).
140
190
 
141
191
  ## 0.2.0
142
192
 
@@ -144,10 +194,14 @@ Moved TypeBox to peer dependencies and loosened Pi peer dependency version const
144
194
 
145
195
  ## 0.1.2
146
196
 
147
- Pinned `verifier` comparisons to a fixed `candidate` checkpoint rather than the current HEAD's parent. This checkpoint mechanism was later removed in `0.4.0`. See [PR #20](https://github.com/emilioSp/pi-maestro/pull/20).
197
+ Pinned `verifier` comparisons to a fixed `candidate` checkpoint rather than the current HEAD's parent. This checkpoint mechanism was later removed in `0.4.0`. See
198
+ [PR #20](https://github.com/emilioSp/pi-maestro/pull/20).
148
199
 
149
- Breaking: renamed `maestro_launch_builder` and `maestro_launch_verifier` to `maestro_run_builder` and `maestro_run_verifier`. Renamed the corresponding workflow events from `launch-*` to `run-*`.
200
+ Breaking: renamed `maestro_launch_builder` and `maestro_launch_verifier` to `maestro_run_builder` and `maestro_run_verifier`. Renamed the corresponding workflow events
201
+ from `launch-*` to `run-*`.
150
202
 
151
203
  ## 0.1.1
152
204
 
153
- First tagged baseline with `/maestro`, `spec` creation and approval, and foreground `builder` and `verifier` `runs`. The `owner` decides `escalation` questions and `verifier` `findings`. The workflow ends at `candidate-ready`, leaving final review to the `owner`. See [PR #14](https://github.com/emilioSp/pi-maestro/pull/14) and [PR #13](https://github.com/emilioSp/pi-maestro/pull/13).
205
+ First tagged baseline with `/maestro`, `spec` creation and approval, and foreground `builder` and `verifier` `runs`. The `owner` decides `escalation` questions and
206
+ `verifier` `findings`. The workflow ends at `candidate-ready`, leaving final review to the `owner`. See [PR #14](https://github.com/emilioSp/pi-maestro/pull/14) and
207
+ [PR #13](https://github.com/emilioSp/pi-maestro/pull/13).
package/MISSION.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Mission
2
2
 
3
- `Maestro` uses spec-driven development to improve quality when coding with agents. It guides the `owner` to define requirements and think through a feature before writing code.
4
- It provides a clear path from an approved `spec` to verified code and manages agent coordination for the `owner`.
3
+ `Maestro` uses spec-driven development to improve quality when coding with agents. It guides the `owner` to define requirements and think through a feature before writing
4
+ code. It provides a clear path from an approved `spec` to verified code and manages agent coordination for the `owner`.
5
5
 
6
- The `owner` remains responsible for final code review, pull requests, and merging. The `owner` also provides and maintains the project's development checks and instructions, including linters, tests, anti-slop checks, and `AGENTS.md`.
7
- `Maestro` and its agents use these checks and instructions.
6
+ The `owner` remains responsible for final code review, pull requests, and merging. The `owner` also provides and maintains the project's development checks and
7
+ instructions, including linters, tests, anti-slop checks, and `AGENTS.md`. `Maestro` and its agents use these checks and instructions.
package/README.md CHANGED
@@ -8,7 +8,11 @@ Pi extension for a spec-driven multiagent development workflow.
8
8
 
9
9
  ## The idea
10
10
 
11
- A `specification` (`spec`) describes one reversible change. The `builder` implements it. An independent `verifier` checks every `acceptance criterion`. The `owner` performs the final review.
11
+ - A `specification` (`spec`) describes one reversible change.
12
+ - The `builder` implements it.
13
+ - An independent `verifier` checks every `acceptance criterion`.
14
+ - A `simplifier` then refactors accepted code without changing behavior.
15
+ - The `owner` performs the final review.
12
16
 
13
17
  Five principles hold the workflow together:
14
18
 
@@ -18,16 +22,51 @@ Five principles hold the workflow together:
18
22
  4. The `owner` decides requirements, scope, and unresolved questions.
19
23
  5. Each agent has one and only one role. Specific and with clear instruction.
20
24
 
25
+ ## Inspirations
26
+
27
+ Pi Maestro is inspired by concepts from [OpenSpec](https://github.com/Fission-AI/OpenSpec) and [GitHub Spec Kit](https://github.com/github/spec-kit). It adapts those
28
+ concepts to a sequential multiagent workflow in Pi.
29
+
30
+ The following official sources document the conceptual references. The links point to fixed revisions so the cited content remains inspectable.
31
+
32
+ 1. **The `specification` drives the code.** [Spec Kit's philosophy][spec-kit-philosophy] treats the `specification` as the primary `artifact` and code as its expression.
33
+ In `Maestro`, the approved `spec` defines a working contract for the `builder` and `verifier`.
34
+ 2. **Describe behavior, not routine implementation choices.** [OpenSpec's schema][openspec-schema] defines a `specification` as a behavior contract, not an implementation
35
+ plan. `Maestro` records required behavior, constraints, and approved architectural decisions in the `spec`, leaving routine implementation choices to the `builder`.
36
+ 3. **Use concrete, testable scenarios.** [OpenSpec's schema][openspec-schema] pairs requirements with scenarios; [Spec Kit's template][spec-kit-template] uses
37
+ Given/When/Then acceptance scenarios. Each `Maestro` `acceptance criterion` includes a `probe`, an `expected result`, and a concrete example.
38
+ 4. **Clarify requirements progressively.** [Spec Kit's clarify command][spec-kit-clarify] asks one question at a time and integrates accepted answers into the
39
+ `specification`. `Maestro` likewise asks one focused question, waits for the owner's answer, and updates the `spec` before asking the next question.
40
+ 5. **Review requirements separately from testing code.** [Spec Kit's checklist command][spec-kit-checklist] evaluates requirements for completeness, clarity, consistency,
41
+ and measurability, not implementation correctness. Before approval, `Maestro` reviews the `spec` for consistency, missing decisions, measurable outcomes, and
42
+ reproducible scenarios. The later `verifier` checks the implementation independently.
43
+ 6. **Separate motivation, behavior, and design.** [OpenSpec's schema][openspec-schema] separates these concerns and calls for `design.md` only when significant technical
44
+ decisions need recording, including reasons, alternatives, and risks.
45
+ 7. **Make requirement changes explicit.** [OpenSpec's schema][openspec-schema] distinguishes added, modified, removed, and renamed requirements. `Maestro` adapts this
46
+ concept with one `Delta` field per requirement: `added`, `modified`, or `removed`. Each requirement states the complete required outcome.
47
+ 8. **Make requirement coverage traceable.** [Spec Kit's analyze command][spec-kit-analyze] maps requirements to implementation tasks and identifies coverage gaps.
48
+ `Maestro` applies a related principle to verification: each requirement has a `Verified by` field linking to its `acceptance criteria`, existing tests covering exact
49
+ scenarios, or both. The mapping connects requirements to verification.
50
+
51
+ [openspec-schema]: https://github.com/Fission-AI/OpenSpec/blob/6d04a1b58dedc95729d34e4f223d9d483aae210a/schemas/spec-driven/schema.yaml
52
+ [spec-kit-philosophy]: https://github.com/github/spec-kit/blob/222a973f8b8794366680c043fb935a31f71902af/spec-driven.md
53
+ [spec-kit-template]: https://github.com/github/spec-kit/blob/222a973f8b8794366680c043fb935a31f71902af/templates/spec-template.md
54
+ [spec-kit-clarify]: https://github.com/github/spec-kit/blob/222a973f8b8794366680c043fb935a31f71902af/templates/commands/clarify.md
55
+ [spec-kit-checklist]: https://github.com/github/spec-kit/blob/222a973f8b8794366680c043fb935a31f71902af/templates/commands/checklist.md
56
+ [spec-kit-analyze]: https://github.com/github/spec-kit/blob/222a973f8b8794366680c043fb935a31f71902af/templates/commands/analyze.md
57
+
21
58
  ## The roles
22
59
 
23
- | Role | Responsibility |
24
- |---|---|
25
- | `Owner` | Brings the problem, approves the `spec`, decides questions and `findings`, and reviews the final code. |
26
- | `Maestro` | Works directly with the `owner`, prepares the `spec`, runs the other agents, records decisions, and summarizes results. |
27
- | `Builder` | Implements the approved `spec` and checks each `acceptance criterion`. |
28
- | `Verifier` | Independently checks the project files against the `spec` and reports technical issues. |
60
+ | Role | Responsibility |
61
+ | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
62
+ | `Owner` | Brings the problem, approves the `spec`, decides questions and `findings`, and reviews the final code. |
63
+ | `Maestro` | Works directly with the `owner`, prepares the `spec`, runs the other agents, records decisions, and summarizes results. |
64
+ | `Builder` | Implements the approved `spec` and checks each `acceptance criterion`. |
65
+ | `Verifier` | Independently checks the project files against the `spec` and reports technical issues. |
66
+ | `Simplifier` | Refactors accepted code for clarity without changing behavior or introducing check failures. |
29
67
 
30
- An `escalation` asks the `owner` to decide an implementation question. A `finding` records a technical issue reported by the `verifier`. The `owner` discusses both with `Maestro`, not directly with the `builder` or `verifier`.
68
+ An `escalation` asks the `owner` to decide an implementation question. A `finding` records a technical issue reported by the `verifier`. The `owner` discusses both with
69
+ `Maestro`, not directly with the `builder` or `verifier`.
31
70
 
32
71
  ## Prerequisites
33
72
 
@@ -35,7 +74,7 @@ An `escalation` asks the `owner` to decide an implementation question. A `findin
35
74
  2. Node.js 26 or later.
36
75
  3. Pi 1.0.0 or later.
37
76
  4. `pi-subagents` installed and enabled in Pi.
38
- 5. Access to the configured `builder` and `verifier` models.
77
+ 5. Access to the configured `builder`, `verifier`, and `simplifier` models.
39
78
  6. A project directory that Pi trusts.
40
79
 
41
80
  ## Installation
@@ -73,27 +112,32 @@ The `owner` follows this workflow:
73
112
  5. Reviews `verifier` `findings` and chooses an action for every `finding`.
74
113
  6. Reads Maestro's summary at `candidate-ready` and performs the final review.
75
114
 
76
- `Maestro` starts the `verifier` after a successful `builder` `run`.
77
- Both agents run in the foreground: Pi waits for each `run` to finish and `Maestro` shows the current phase in Pi's status, while `pi-subagents` FleetView and `/subagents-fleet` show agent activity and transcripts.
115
+ `Maestro` starts the `verifier` after a successful `builder` `run`. All three agents run in the foreground: Pi waits for each `run` to finish and `Maestro` shows the
116
+ current phase in Pi's status, while `pi-subagents` FleetView and `/subagents-fleet` show agent activity and transcripts.
117
+
118
+ The `owner` must not edit product files while the workflow runs. `Maestro` can perform temporary experiments with `owner` agreement during `spec` preparation and
119
+ permitted revisions. See [Workflow](docs/workflow.md#spec-approval).
78
120
 
79
- The `owner` must not edit product files while the workflow runs.
80
- `Maestro` can perform temporary experiments with `owner` agreement during `spec` preparation and permitted revisions. See [Workflow](docs/workflow.md#spec-approval).
121
+ An `escalation` asks the `owner` to decide an implementation question, and a `finding` records a technical issue reported by the `verifier`. The `owner` discusses both
122
+ with `Maestro`, never directly with the `builder` or `verifier`. `Maestro` records all current `escalation` answers or `finding` decisions in the active `handoff` before
123
+ changing phase.
81
124
 
82
- An `escalation` asks the `owner` to decide an implementation question, and a `finding` records a technical issue reported by the `verifier`. The `owner` discusses both with `Maestro`, never directly with the `builder` or `verifier`.
83
- `Maestro` records all current `escalation` answers or `finding` decisions in the active `handoff` before changing phase.
125
+ If any decision requires a `spec` change, the workflow returns to `drafting-spec` before the `owner` and `Maestro` revise the same `spec`. The `owner` reviews the revised
126
+ `spec` and replies `GREEN FLAG` again. `Maestro` records renewed approval separately before another `builder` `run`.
84
127
 
85
- If any decision requires a `spec` change, the workflow returns to `drafting-spec` before the `owner` and `Maestro` revise the same `spec`.
86
- The `owner` reviews the revised `spec` and replies `GREEN FLAG` again.
87
- `Maestro` records renewed approval separately before another `builder` `run`.
128
+ After successful verification or rejection of all `findings`, `Maestro` starts the `simplifier`. Only this step requires Git. If Git readiness cannot be confirmed,
129
+ `Maestro` warns and skips simplification. The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files.
88
130
 
89
- The workflow ends at `candidate-ready`. Rejected `findings` retain their reasons. Later changes are outside the completed verification. The `owner` controls any later Git use, pull request, and merge.
131
+ The workflow ends at `candidate-ready`. Rejected `findings` retain their reasons and accepted failures can remain. Maestro's summary separates independent verification
132
+ from the later simplifier's report. The `owner` controls later review, commits, pull requests, and merging.
90
133
 
91
- The same `/maestro` command disables `Maestro` and leaves project files unchanged. Disabling `Maestro`, restarting Pi, or using `/resume` clears live session state.
92
- Saved files do not automatically restore or resume an incomplete workflow. The `owner` handles it manually.
134
+ The same `/maestro` command disables `Maestro` and leaves project files unchanged. Disabling `Maestro`, restarting Pi, or using `/resume` clears live session state. Saved
135
+ files do not automatically restore or resume an incomplete workflow. The `owner` handles it manually.
93
136
 
94
137
  ## Configuration
95
138
 
96
- `Maestro` uses default values when `.pi/maestro.json` is absent from the project root. The `owner` can add this file to change the `spec` directory, models, thinking levels, or timeouts. See [Configuration](docs/configuration.md).
139
+ `Maestro` uses default values when `.pi/maestro.json` is absent from the project root. The `owner` can add this file to change the `spec` directory, models, thinking
140
+ levels, or timeouts. See [Configuration](docs/configuration.md).
97
141
 
98
142
  ## Documentation
99
143