@emiliosp/pi-maestro 0.12.0 → 0.13.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.
package/ADR.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  An Architecture Decision Record (ADR) explains an important architectural choice, its context, and its consequences. This file contains one numbered record per decision.
4
4
 
5
- Requirements and routine project rules belong in the [roadmap](ROADMAP.md) or other relevant documentation.
5
+ Requirements and routine project rules belong in the [roadmap](https://linear.app/emilio-spatola/team/MAESTRO/overview) or other relevant documentation.
6
6
 
7
7
  When a new decision replaces an accepted decision, add a new record, mark the earlier record as superseded, and link both records.
8
8
 
@@ -87,13 +87,13 @@ This breaking MVP change has no migrations, compatibility readers, deprecated al
87
87
  ### Evidence
88
88
 
89
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).
90
+ [MAESTRO-7](https://linear.app/emilio-spatola/issue/MAESTRO-7/route-builder-failures-through-owner-escalations).
91
91
 
92
92
  ## ADR-004: Require Git only for the simplifier
93
93
 
94
94
  ### Status
95
95
 
96
- Accepted. Implemented through R-21. Supersedes [ADR-001](#adr-001-keep-the-workflow-independent-of-git).
96
+ Accepted. Implemented through MAESTRO-24. Supersedes [ADR-001](#adr-001-keep-the-workflow-independent-of-git).
97
97
 
98
98
  ### Context
99
99
 
@@ -124,7 +124,7 @@ The `simplifier` uses Git to select all staged, unstaged, and untracked code cha
124
124
 
125
125
  ### Evidence
126
126
 
127
- [R-21](ROADMAP.md#r-21-add-a-simplifier-with-one-clear-purpose-per-agent) and the
127
+ [MAESTRO-24](https://linear.app/emilio-spatola/issue/MAESTRO-24/add-a-simplifier-with-one-clear-purpose-per-agent) and the
128
128
  [specification](.specs/20261016-090319-add-a-dedicated-simplifier-after-verification/spec.md).
129
129
 
130
130
  ## ADR-005: Approve a specification document set as one contract
@@ -163,3 +163,30 @@ approval.
163
163
 
164
164
  [Document workflow](docs/workflow.md#specification-documents), [creation](src/specs/create.ts), [approval](src/workflow/spec/markSpecReady.ts), and
165
165
  [templates](templates/).
166
+
167
+ ## ADR-006: Maintain the roadmap in Linear
168
+
169
+ ### Status
170
+
171
+ Accepted. Implemented.
172
+
173
+ ### Context
174
+
175
+ The `owner` moved roadmap items from the repository to Linear, selected the dedicated `MAESTRO` team, and requested removal of the local roadmap file and redundant
176
+ identifiers. This moves the source of truth for planning outside Git.
177
+
178
+ ### Decision
179
+
180
+ Maintain the roadmap only in [Linear](https://linear.app/emilio-spatola/team/MAESTRO/overview), using Linear issue identifiers. Keep the roadmap location and maintenance
181
+ instructions in `AGENTS.md`, without a local copy of the issue list.
182
+
183
+ Approved `specifications`, verification evidence, the changelog, and architectural decisions remain in the repository.
184
+
185
+ ### Consequences
186
+
187
+ Reading or updating current roadmap state requires Linear access. Git history remains evidence of earlier plans, not the current roadmap. Imported issues retain
188
+ commit-pinned links to repository evidence. Removing the local roadmap also removes it from the published package.
189
+
190
+ ### Evidence
191
+
192
+ [Linear roadmap](https://linear.app/emilio-spatola/team/MAESTRO/overview) and [repository instructions](AGENTS.md).
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  This file summarizes meaningful changes to the codebase, including behavior, data formats, architecture, and development tools. Git tags identify version boundaries;
4
4
  GitHub Releases are not required.
5
5
 
6
+ ## 0.13.0
7
+
8
+ 1. Automatically turn off `Maestro` after successfully delivering the final summary of a completed workflow, including when Git is unavailable and simplification is
9
+ skipped. Clear live tools, status, instructions, and active `spec` selection while preserving saved workflow files and other extensions. See
10
+ [MAESTRO-26](https://linear.app/emilio-spatola/issue/MAESTRO-26).
11
+
6
12
  ## 0.12.0
7
13
 
8
14
  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
package/README.md CHANGED
@@ -129,7 +129,8 @@ After successful verification or rejection of all `findings`, `Maestro` starts t
129
129
  `Maestro` warns and skips simplification. The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files.
130
130
 
131
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.
132
+ from the later simplifier's report. After the final summary finishes successfully, `Maestro` automatically turns off. The `owner` controls later review, commits, pull
133
+ requests, and merging.
133
134
 
134
135
  The same `/maestro` command disables `Maestro` and leaves project files unchanged. Disabling `Maestro`, restarting Pi, or using `/resume` clears live session state. Saved
135
136
  files do not automatically restore or resume an incomplete workflow. The `owner` handles it manually.
@@ -152,6 +153,6 @@ The reading order is:
152
153
 
153
154
  1. [Mission](MISSION.md): purpose, scope, and `owner` responsibilities.
154
155
  2. [Tech stack](TECH_STACK.md): runtime technologies and development tools.
155
- 3. [Roadmap](ROADMAP.md): completed outcomes and planned priorities.
156
+ 3. [Roadmap](https://linear.app/emilio-spatola/team/MAESTRO/overview): completed outcomes and planned priorities maintained in Linear.
156
157
  4. [Changelog](CHANGELOG.md): meaningful codebase changes and breaking changes.
157
158
  5. [Architecture decision records](ADR.md): architectural choices, context, consequences, and evidence.
package/docs/workflow.md CHANGED
@@ -271,9 +271,10 @@ check failures. If no code needs refactoring, the `simplifier` does not make any
271
271
  ## Workflow completion
272
272
 
273
273
  The workflow ends at `candidate-ready`. `Maestro` summarizes the changes, verification results, rejected `findings` and reasons, relevant `builder` notes from the saved
274
- `artifacts`, and simplifier's summary and notes
274
+ `artifacts`, and simplifier's summary and notes.
275
275
 
276
- The `owner` performs the final review and controls any later Git use, pull request, or merge. Changes after completion are outside the completed verification.
276
+ `Maestro` stays active while delivering this final summary, then automatically turns off after successful delivery. The `owner` performs the final review and controls any
277
+ later Git use, pull request, or merge. Changes after completion are outside the completed verification.
277
278
 
278
279
  ## Stored artifacts
279
280
 
@@ -23,6 +23,7 @@ import {
23
23
  import { RUN_BUILDER_TOOL, registerRunBuilderTool } from '#tools/main/run-builder.ts';
24
24
  import { RUN_SIMPLIFIER_TOOL, registerRunSimplifierTool } from '#tools/main/run-simplifier.ts';
25
25
  import { RUN_VERIFIER_TOOL, registerRunVerifierTool } from '#tools/main/run-verifier.ts';
26
+ import { WORKFLOW_PHASES } from '#workflow/state/schema.ts';
26
27
 
27
28
  const MAIN_TOOL_NAMES: readonly string[] = [
28
29
  CREATE_SPEC_TOOL.NAME,
@@ -34,6 +35,19 @@ const MAIN_TOOL_NAMES: readonly string[] = [
34
35
  RUN_SIMPLIFIER_TOOL.NAME,
35
36
  ];
36
37
 
38
+ type CompletedWorkflowResult = {
39
+ specId: string;
40
+ phase: typeof WORKFLOW_PHASES.CANDIDATE_READY;
41
+ };
42
+
43
+ const isCompletedWorkflowResult = (details: unknown): details is CompletedWorkflowResult =>
44
+ typeof details === 'object' &&
45
+ details !== null &&
46
+ 'specId' in details &&
47
+ typeof details.specId === 'string' &&
48
+ 'phase' in details &&
49
+ details.phase === WORKFLOW_PHASES.CANDIDATE_READY;
50
+
37
51
  export default (pi: ExtensionAPI): void => {
38
52
  registerCreateSpecTool(pi);
39
53
  registerMarkSpecReadyTool(pi);
@@ -125,8 +139,45 @@ export default (pi: ExtensionAPI): void => {
125
139
  // Pi fires this after a tool returns, before its result reaches the AI.
126
140
  // Refresh status after main Maestro tools, without changing the tool result.
127
141
  pi.on('tool_result', async (event, context) => {
142
+ if (!event.isError && isCompletedWorkflowResult(event.details)) {
143
+ maestroSessionState.setWaitingForFinalResponseMode(event.details.specId);
144
+ }
145
+
128
146
  if (MAIN_TOOL_NAMES.includes(event.toolName)) {
129
147
  await refreshMaestroStatus(context);
130
148
  }
131
149
  });
150
+
151
+ // Finish at the response boundary, before Pi can process a queued follow-up.
152
+ // Assistant messages that request tools are still preparing the final summary.
153
+ pi.on('message_end', async (event, context) => {
154
+ const message = event.message;
155
+
156
+ if (
157
+ !maestroSessionState.isWaitingForFinalResponse() ||
158
+ message.role !== 'assistant' ||
159
+ message.stopReason === 'toolUse'
160
+ ) {
161
+ return;
162
+ }
163
+
164
+ maestroSessionState.stopWaitingForFinalResponse();
165
+
166
+ if (
167
+ !maestroSessionState.isActive() ||
168
+ context.signal?.aborted ||
169
+ message.stopReason !== 'stop' ||
170
+ !message.content.some((part) => part.type === 'text' && part.text.trim() !== '')
171
+ ) {
172
+ return;
173
+ }
174
+
175
+ maestroSessionState.deactivate();
176
+ syncMainTools();
177
+ await refreshMaestroStatus(context);
178
+ });
179
+
180
+ pi.on('agent_end', () => {
181
+ maestroSessionState.stopWaitingForFinalResponse();
182
+ });
132
183
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emiliosp/pi-maestro",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "description": "A spec-driven multiagent development workflow for Pi.",
5
5
  "keywords": [
6
6
  "orchestration",
@@ -28,7 +28,6 @@
28
28
  "docs/",
29
29
  "MISSION.md",
30
30
  "TECH_STACK.md",
31
- "ROADMAP.md",
32
31
  "CHANGELOG.md",
33
32
  "ADR.md",
34
33
  "README.md",
@@ -218,6 +218,8 @@ Disabling Maestro, restarting Pi, or using /resume clears live state. Do not rec
218
218
  The owner handles execution errors, protocol errors, and interrupted workflows manually.
219
219
 
220
220
  At candidate-ready, the workflow is complete. No final tool call is required.
221
+ Maestro stays active while you deliver the final summary and automatically turns off after the response finishes successfully, including when simplification was skipped.
222
+ Do not ask the owner to toggle /maestro or disable it before delivering the summary. Saved workflow files remain unchanged.
221
223
  You own the final summary. Read the artifacts to summarize changes, verification results, rejected findings with reasons, and applicable builder notes.
222
224
  For completed simplification, read handoffs/simplifier/S.json and report its saved summary and notes as the simplifier's report.
223
225
  For example, summary "Simplified counting" and note "Updated the caller to read the Map." belong to the simplifier, not verifier evidence.
@@ -6,6 +6,7 @@
6
6
  class MaestroSessionState {
7
7
  private active = false;
8
8
  private activeSpecId: string | null = null;
9
+ private waitingForFinalResponse = false;
9
10
 
10
11
  public isActive = (): boolean => this.active;
11
12
 
@@ -23,10 +24,24 @@ class MaestroSessionState {
23
24
 
24
25
  public activate = (): void => {
25
26
  this.active = true;
27
+ this.stopWaitingForFinalResponse();
28
+ };
29
+
30
+ public setWaitingForFinalResponseMode = (specId: string): void => {
31
+ if (this.active && this.activeSpecId === specId) {
32
+ this.waitingForFinalResponse = true;
33
+ }
34
+ };
35
+
36
+ public isWaitingForFinalResponse = (): boolean => this.waitingForFinalResponse;
37
+
38
+ public stopWaitingForFinalResponse = (): void => {
39
+ this.waitingForFinalResponse = false;
26
40
  };
27
41
 
28
42
  public clearActiveSpecId = (): void => {
29
43
  this.activeSpecId = null;
44
+ this.stopWaitingForFinalResponse();
30
45
  };
31
46
 
32
47
  public deactivate = (): void => {
package/ROADMAP.md DELETED
@@ -1,319 +0,0 @@
1
- # Roadmap
2
-
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`.
5
-
6
- "Now" is the current priority. "Next" follows it. "Later" contains uncommitted ideas with no promised order or date.
7
-
8
- Item identifiers remain stable when priorities change. The `owner` approves changes to priorities and scope.
9
-
10
- ## Overview
11
-
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. |
33
-
34
- ## Completed
35
-
36
- ### R-01: Improve status presentation and activation feedback
37
-
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`.
40
-
41
- #### Evidence
42
-
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).
46
-
47
- ### R-02: Store escalations and owner decisions in builder handoffs
48
-
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`.
51
-
52
- #### Evidence
53
-
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).
57
-
58
- ### R-03: Route builder failures through owner escalations
59
-
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.
62
-
63
- All 8 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
64
-
65
- #### Evidence
66
-
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).
70
-
71
- ### R-12: Format glossary terms consistently
72
-
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.
75
-
76
- #### Evidence
77
-
78
- [Glossary](docs/glossary.md) and [workflow documentation](docs/workflow.md).
79
-
80
- ### R-14: Introduce Maestro at activation
81
-
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.
84
-
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.
87
-
88
- All 6 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
89
-
90
- #### Evidence
91
-
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).
94
-
95
- ### R-15: Rename the test support directory
96
-
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.
99
-
100
- #### Evidence
101
-
102
- [Test support](tests/support/), [fixtures](tests/fixtures/), and [lint configuration](.oxlintrc.json).
103
-
104
- ### R-16: Verify code quality against AGENTS.md instructions
105
-
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`.
108
-
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.
111
-
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`.
114
-
115
- #### Evidence
116
-
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).
120
-
121
- ### R-06: Check subagent extensions at activation
122
-
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.
126
-
127
- All 7 `acceptance criteria` passed using controlled replies and code inspection, with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
128
-
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.
131
-
132
- #### Evidence
133
-
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).
137
-
138
- ### R-05: Keep acceptance criterion numbering continuous
139
-
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.
142
-
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.
145
-
146
- All 3 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
147
-
148
- #### Evidence
149
-
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).
153
-
154
- ### R-10: Match handoff criteria to the approved spec
155
-
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.
158
-
159
- Both `acceptance criteria` passed independent verification with no `findings`. The saved workflow reached `candidate-ready`.
160
-
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.
163
-
164
- #### Evidence
165
-
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).
169
-
170
- ### R-17: Record escalation resolutions when the spec changes
171
-
172
- #### Objective
173
-
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.
176
-
177
- #### Agreed flow
178
-
179
- `Maestro` records the complete decision batch through `maestro_resolve_escalations` before changing phase.
180
-
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. |
186
-
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`.
188
-
189
- #### Implementation boundaries
190
-
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`.
194
-
195
- #### Completed when
196
-
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.
200
-
201
- ### R-20: Route finding-driven spec revisions through drafting-spec
202
-
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.
206
-
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`.
210
-
211
- #### Evidence
212
-
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).
215
-
216
- ### R-18: Label acceptance criterion coverage
217
-
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`:
219
-
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. |
225
-
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.
229
-
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.
232
-
233
- #### Evidence
234
-
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).
237
-
238
- ### R-19: Avoid acceptance criteria already covered by tests
239
-
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.
242
-
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.
245
-
246
- Verification consisted of inspecting the written guidance and running `npm run check`. No model trials were performed.
247
-
248
- #### Evidence
249
-
250
- [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [spec template](templates/spec.md), and
251
- [workflow documentation](docs/workflow.md#acceptance-criteria).
252
-
253
- ## Now
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
-
271
- ## Next
272
-
273
- ## Later
274
-
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.
277
-
278
- ### R-04: Rename the npm package
279
-
280
- #### Objective
281
-
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.
284
-
285
- Compatibility with installations under the old name must be decided in the `specification`. No `specification` is approved yet.
286
-
287
- #### Completed when
288
-
289
- Package metadata and installation documentation use the new name. The package is available under that name.
290
-
291
- ### R-07: Guide initial configuration
292
-
293
- #### Objective
294
-
295
- Help the `owner` create `Maestro` configuration through an interview. `Maestro` asks questions and writes the agreed configuration.
296
-
297
- #### Completed when
298
-
299
- The `owner` can create a valid project configuration without writing the file manually.
300
-
301
- ### R-08: Change agent models before a builder run
302
-
303
- #### Objective
304
-
305
- Let the `owner` change the `builder` and `verifier` models during `spec` preparation and the `ready-for-builder` phase. The selected models apply to subsequent `runs`.
306
-
307
- #### Completed when
308
-
309
- The `owner` can select available models in those phases. `Maestro` uses the selections.
310
-
311
- ### R-09: Define workflow reconciliation
312
-
313
- #### Objective
314
-
315
- Explore how `Maestro` can reconcile saved `artifacts` and workflow state. The recovery scope is not yet defined.
316
-
317
- #### Completed when
318
-
319
- Not yet defined. The `owner` must define the intended outcome, recovery boundaries, and completion condition before this item can move forward.