@emiliosp/pi-maestro 0.14.0 → 0.15.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 (35) hide show
  1. package/ADR.md +28 -0
  2. package/CHANGELOG.md +8 -0
  3. package/README.md +31 -17
  4. package/ROADMAP.md +25 -17
  5. package/agents/simplifier.md +2 -1
  6. package/agents/verifier.md +2 -1
  7. package/docs/configuration.md +31 -2
  8. package/docs/glossary.md +1 -1
  9. package/docs/subagent-integration.md +6 -4
  10. package/docs/workflow.md +32 -23
  11. package/extensions/maestro.ts +11 -13
  12. package/package.json +1 -1
  13. package/src/config/defaults.ts +3 -0
  14. package/src/config/schema.ts +2 -0
  15. package/src/maestro/checks/assertEnvironment.ts +24 -9
  16. package/src/maestro/instructions/getMaestroInstructions.ts +19 -11
  17. package/src/tools/child/record-builder-handoff.ts +2 -6
  18. package/src/tools/child/record-simplifier-handoff.ts +2 -1
  19. package/src/tools/child/record-verifier-handoff.ts +2 -6
  20. package/src/tools/child/utils/resolveWorkflowContext.ts +2 -2
  21. package/src/tools/main/mark-spec-ready.ts +8 -3
  22. package/src/tools/main/resolve-escalations.ts +2 -1
  23. package/src/tools/main/resolve-findings.ts +6 -6
  24. package/src/tools/main/run-builder.ts +45 -12
  25. package/src/tools/main/run-simplifier.ts +1 -0
  26. package/src/tools/main/run-verifier.ts +17 -5
  27. package/src/workflow/builder/completeBuilderPass.ts +4 -0
  28. package/src/workflow/builder/prepareBuilderRun.ts +7 -1
  29. package/src/workflow/builder/resolveEscalations.ts +4 -0
  30. package/src/workflow/simplifier/completeSimplifierPass.ts +4 -0
  31. package/src/workflow/spec/markSpecReady.ts +4 -0
  32. package/src/workflow/transitions.ts +28 -7
  33. package/src/workflow/verifier/completeVerifierPass.ts +4 -0
  34. package/src/workflow/verifier/prepareVerifierRun.ts +7 -1
  35. package/src/workflow/verifier/resolveFindings.ts +4 -0
package/ADR.md CHANGED
@@ -247,3 +247,31 @@ failures during delegation still use the existing `run` failure path. Workflow r
247
247
 
248
248
  [Configuration](docs/configuration.md#model-access), [activation checks](src/maestro/checks/assertEnvironment.ts), and
249
249
  [delegation](src/tools/utils/pi-subagent-delegation.ts).
250
+
251
+ ## ADR-009: Select optional phases in the transition table
252
+
253
+ ### Status
254
+
255
+ Accepted. Implemented under MAESTRO-27.
256
+
257
+ ### Context
258
+
259
+ The `owner` selected configuration flags to support workflows with only an approved `spec` and independently optional later agents without a separate phase-selection
260
+ interface.
261
+
262
+ ### Decision
263
+
264
+ Each agent has a `required` boolean that defaults to `true`. Disabling `builder` skips all agents. Otherwise `verifier` and `simplifier` can be disabled independently.
265
+ Flags are set before activation and stay unchanged during the workflow. Keep existing configuration reads, without caching or runtime controls.
266
+
267
+ Keep destination selection in `src/workflow/transitions.ts`. A transition destination is either a fixed phase or a pure function of resolved configuration. Callers pass
268
+ configuration to `transitionWorkflow` and save its returned state. No new workflow states, events, or persisted selection fields are needed.
269
+
270
+ ### Consequences
271
+
272
+ Approval can finish at `candidate-ready` without agent execution. Agent and model availability checks apply only to selected phases; activation with only an approved
273
+ `spec` needs no `pi-subagents` ping. Final summaries identify skipped work, without claiming implementation or independent verification occurred.
274
+
275
+ ### Evidence
276
+
277
+ [Approved design](.specs/20261103-161424-maestro-27-make-implementation-phases-optional/design.md) and [phase selection](docs/configuration.md#phase-selection).
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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.15.0
7
+
8
+ 1. Added per-agent `required` booleans in `.pi/maestro.json`, all defaulting to `true`. Disabling `builder` completes the workflow at `spec` approval without agents;
9
+ otherwise `verifier` and `simplifier` can be disabled independently. See [PR #45](https://github.com/emilioSp/pi-maestro/pull/45).
10
+ 2. Limited activation checks and displayed agent details to enabled phases. With `builder` disabled, activation requires no agents, models, or `pi-subagents` ping.
11
+ 3. Updated workflow transitions, tool messages, agent guidance, and documentation for optional phases. Final-summary guidance identifies skipped work without claiming
12
+ implementation, independent verification, or simplification occurred.
13
+
6
14
  ## 0.14.0
7
15
 
8
16
  1. Removed Maestro's model format regex while retaining activation checks against Pi's available model registry. Complete identifiers, including
package/README.md CHANGED
@@ -2,23 +2,34 @@
2
2
 
3
3
  [![Coverage](https://img.shields.io/codecov/c/github/emiliosp/pi-maestro?logo=codecov)](https://codecov.io/gh/emiliosp/pi-maestro)
4
4
 
5
- Pi extension for a spec-driven multiagent development workflow.
5
+ Pi extension for writing a `spec` and optionally implementing it through a spec-driven multiagent workflow.
6
6
 
7
7
  ![Maestro workflow](docs/maestro.png)
8
8
 
9
9
  ## The idea
10
10
 
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.
11
+ `Maestro` has two goals:
12
+
13
+ 1. Help the `owner` write and approve a `specification` (`spec`) for one reversible change.
14
+ 2. Implement the approved `spec` through a multiagent workflow.
15
+
16
+ The `owner` can use `Maestro` only to write and approve a `spec`, leaving implementation to another workflow, or to write the `spec` and implement it within `Maestro`.
17
+ `Spec` preparation and approval are required. The entire implementation stage is optional, and each of its phases is optional too:
18
+
19
+ 1. The `builder` implements the approved `spec`.
20
+ 2. The independent `verifier` checks every `acceptance criterion`.
21
+ 3. The `simplifier` refactors accepted code without changing behavior.
22
+
23
+ Disabling the `builder` skips the entire implementation stage. With the `builder` enabled, the `verifier` and `simplifier` can be disabled independently. All three are
24
+ enabled by default. See [Phase selection](docs/configuration.md#phase-selection).
25
+
26
+ The `owner` performs the final review.
16
27
 
17
28
  Five principles hold the workflow together:
18
29
 
19
30
  1. The approved `spec` defines the required work for the `builder` and `verifier`.
20
31
  2. No agent approves its own work.
21
- 3. Every `acceptance criterion` is checked independently.
32
+ 3. When enabled, the `verifier` checks every `acceptance criterion` independently.
22
33
  4. The `owner` decides requirements, scope, and unresolved questions.
23
34
  5. Each agent has one and only one role. Specific and with clear instruction.
24
35
 
@@ -73,8 +84,8 @@ An `escalation` asks the `owner` to decide an implementation question. A `findin
73
84
  1. macOS.
74
85
  2. Node.js 26 or later.
75
86
  3. Pi 1.0.0 or later.
76
- 4. `pi-subagents` installed and enabled in Pi.
77
- 5. Access to the configured `builder`, `verifier`, and `simplifier` models.
87
+ 4. `pi-subagents` installed and enabled in Pi when `builder` is enabled.
88
+ 5. Access to the models for enabled agents.
78
89
  6. A project directory that Pi trusts.
79
90
 
80
91
  ## Installation
@@ -101,20 +112,20 @@ Activate `Maestro`:
101
112
  /maestro
102
113
  ```
103
114
 
104
- During activation, `Maestro` checks project trust, configuration, models, and agent availability. Model availability comes from Pi's model registry. If a check fails,
105
- `Maestro` stays disabled and reports the problem.
115
+ During activation, `Maestro` checks project trust, configuration, and enabled agent and model availability. With `builder` disabled, only project trust and configuration
116
+ are checked. Model availability comes from Pi's model registry. If a check fails, `Maestro` stays disabled and reports the problem.
106
117
 
107
118
  The `owner` follows this workflow:
108
119
 
109
120
  1. Describes one change to `Maestro`.
110
121
  2. Reviews the `spec`, including its `acceptance criteria` and concrete examples.
111
- 3. Replies `GREEN FLAG` when `Maestro` asks for approval. `Maestro` records the approval and starts the `builder`.
122
+ 3. Replies `GREEN FLAG` when `Maestro` asks for approval. `Maestro` records the approval and starts the selected phases.
112
123
  4. Reviews every current `builder` `escalation` and gives `Maestro` an answer and reason for each question.
113
124
  5. Reviews `verifier` `findings` and chooses an action for every `finding`.
114
125
  6. Reads Maestro's summary at `candidate-ready` and performs the final review.
115
126
 
116
- `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
117
- current phase in Pi's status, while `pi-subagents` FleetView and `/subagents-fleet` show agent activity and transcripts.
127
+ `Maestro` starts the `verifier`, when enabled, after a successful `builder` `run`. Selected agents run in the foreground: Pi waits for each `run` to finish and `Maestro`
128
+ shows the current phase in Pi's status, while `pi-subagents` FleetView and `/subagents-fleet` show agent activity and transcripts.
118
129
 
119
130
  The `owner` must not edit product files while the workflow runs. `Maestro` can perform temporary experiments with `owner` agreement during `spec` preparation and
120
131
  permitted revisions. See [Workflow](docs/workflow.md#spec-approval).
@@ -126,8 +137,9 @@ changing phase.
126
137
  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
127
138
  `spec` and replies `GREEN FLAG` again. `Maestro` records renewed approval separately before another `builder` `run`.
128
139
 
129
- After successful verification or rejection of all `findings`, `Maestro` starts the `simplifier`. Only this step requires Git. If Git readiness cannot be confirmed,
130
- `Maestro` warns and skips simplification. The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files.
140
+ When enabled, `Maestro` starts the `simplifier` after successful verification, rejection of all `findings`, or `builder` completion with verification disabled. Only this
141
+ step requires Git. If Git readiness cannot be confirmed, `Maestro` warns and skips simplification. The `simplifier` selects all uncommitted code changes, including
142
+ pre-existing staged, unstaged, and untracked files.
131
143
 
132
144
  The workflow ends at `candidate-ready`. Rejected `findings` retain their reasons and accepted failures can remain. Maestro's summary separates independent verification
133
145
  from the later simplifier's report. After the final summary finishes successfully, `Maestro` automatically turns off. The `owner` controls later review, commits, pull
@@ -139,7 +151,9 @@ files do not automatically restore or resume an incomplete workflow. The `owner`
139
151
  ## Configuration
140
152
 
141
153
  `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
142
- levels, or timeouts. See [Configuration](docs/configuration.md).
154
+ levels, timeouts, or selected phases. Each agent has a `required` boolean that defaults to `true`. Set flags before activation and keep configuration unchanged during the
155
+ workflow. With `builder.required: false`, approval finishes with only an approved `spec` for implementation elsewhere. Otherwise `verifier` and `simplifier` can be
156
+ disabled independently. Skipped work is identified in the final summary and is not claimed as completed. See [Configuration](docs/configuration.md#phase-selection).
143
157
 
144
158
  ## Documentation
145
159
 
package/ROADMAP.md CHANGED
@@ -32,8 +32,8 @@ reaching `candidate-ready`. Linear onboarding and test issues are not project ro
32
32
  | MAESTRO-23 | [Change agent models before a builder run](#maestro-23-change-agent-models-before-a-builder-run) | Backlog |
33
33
  | MAESTRO-24 | [Add a simplifier with one clear purpose per agent](#maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent) | Completed |
34
34
  | MAESTRO-25 | [Define workflow reconciliation](#maestro-25-define-workflow-reconciliation) | Backlog |
35
- | MAESTRO-26 | [Exit Maestro mode automatically at workflow completion](#maestro-26-exit-maestro-mode-automatically-at-workflow-completion) | Implemented, acceptance not confirmed |
36
- | MAESTRO-27 | [Make verifier and simplifier phases optional](#maestro-27-make-verifier-and-simplifier-phases-optional) | Backlog |
35
+ | MAESTRO-26 | [Exit Maestro mode automatically at workflow completion](#maestro-26-exit-maestro-mode-automatically-at-workflow-completion) | Completed |
36
+ | MAESTRO-27 | [Make all implementation phases optional](#maestro-27-make-all-implementation-phases-optional) | Implemented, acceptance not confirmed |
37
37
 
38
38
  ## Backlog
39
39
 
@@ -90,34 +90,42 @@ Explore how `Maestro` can reconcile saved `artifacts` and workflow state. The re
90
90
 
91
91
  Not yet defined. The `owner` must define the intended outcome, recovery boundaries, and completion condition before this item can move forward.
92
92
 
93
- ### MAESTRO-27: Make verifier and simplifier phases optional
93
+ ## Implemented, acceptance not confirmed
94
+
95
+ ### MAESTRO-27: Make all implementation phases optional
94
96
 
95
97
  #### Objective
96
98
 
97
- Make the `builder` the only required agent phase. Let the `owner` independently enable or disable the `verifier` and `simplifier` phases.
99
+ Make the entire implementation stage optional, including the `builder`, `verifier`, and `simplifier` phases. Let the `owner` use `Maestro` only to prepare and approve a
100
+ `spec`, leaving implementation to another workflow.
98
101
 
99
- This request concerns agent execution phases, not removal of `spec` preparation or approval.
102
+ When implementation runs in `Maestro`, the `owner` can still independently enable or disable the `verifier` and `simplifier` phases. `Spec` preparation and approval
103
+ remain required.
100
104
 
101
105
  #### Completed when
102
106
 
103
- 1. The `builder` remains mandatory.
104
- 2. The `owner` can select any of these combinations: `builder` only; `builder` and `verifier`; `builder` and `simplifier`; or all three.
105
- 3. Disabled phases are not delegated and do not block workflow completion.
106
- 4. The workflow reaches `candidate-ready` after the selected phases complete and any required `owner` decisions are resolved.
107
- 5. The final summary clearly identifies skipped phases and does not describe skipped verification as passed.
107
+ 1. The `owner` can complete a workflow with only an approved `spec`, without running the `builder`, `verifier`, or `simplifier`.
108
+ 2. Implementation can be performed through another workflow using the approved `spec`, without requiring further execution in `Maestro`.
109
+ 3. The existing requested combinations remain available: `builder` only; `builder` and `verifier`; `builder` and `simplifier`; or all three.
110
+ 4. Disabled phases are not delegated and do not block workflow completion.
111
+ 5. The workflow reaches `candidate-ready` after `spec` approval when no agent phases are selected, or after the selected phases complete and any required `owner`
112
+ decisions are resolved.
113
+ 6. The final summary clearly identifies skipped phases and does not claim that skipped implementation or verification has been completed.
114
+
115
+ #### Implementation and evidence
108
116
 
109
- #### Decisions to define in the spec
117
+ Implemented under the [specification](.specs/20261103-161424-maestro-27-make-implementation-phases-optional/spec.md), awaiting `owner` acceptance. Each agent's `required`
118
+ boolean in `.pi/maestro.json` defaults to `true`. Flags are set before activation and remain unchanged during the workflow. Disabling `builder` skips all three agents;
119
+ otherwise `verifier` and `simplifier` are independently optional. `Spec` preparation and approval remain required. The activation notice lists only enabled agents and no
120
+ agents when `builder` is disabled.
110
121
 
111
- 1. Where and when phase selection is configured.
112
- 2. Default selections.
113
- 3. Whether selections can change after a workflow starts.
122
+ The [README](README.md#the-idea) presents the two uses of `Maestro`: writing and approving a `spec` only, or also implementing it through optional agent phases.
114
123
 
115
124
  #### Context
116
125
 
117
126
  [MAESTRO-24](#maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent) introduced the `simplifier`. Its existing Git-unavailable skip is not an explicit `owner`
118
- choice. This issue adds independent optionality for both post-`builder` agent phases.
119
-
120
- ## Implemented, acceptance not confirmed
127
+ choice. This item originally made only the post-`builder` phases optional. The `owner` expanded the scope to include the `builder`, so `Maestro` can also be used solely
128
+ for writing and approving a `spec`.
121
129
 
122
130
  ### MAESTRO-26: Exit Maestro mode automatically at workflow completion
123
131
 
@@ -21,7 +21,8 @@ delegate, approve work, implement new behavior, or raise findings or escalations
21
21
  files. The present documents form one approved contract: motivation and scope in the proposal, behavior and all acceptance criteria, including standalone regressions,
22
22
  in the spec, technical decisions in the optional design.
23
23
  3. Read relevant builder and verifier handoffs and embedded owner decisions. The highest numeric B or V sequence is active; earlier numbered handoffs are context, not
24
- active instructions.
24
+ active instructions. When verification is disabled, no verifier handoff is required; use the builder report and its check baseline, without claiming independent
25
+ verification.
25
26
  4. Confirm that the saved workflow identifies this spec and is in `simplifier-running`. If inputs or phase do not match, report the mismatch to Maestro and stop. Do not
26
27
  repair protocol state.
27
28
 
@@ -89,4 +89,5 @@ facts. If the tool already wrote an artifact or changed phase before an error, d
89
89
  force completion. If restoration or submission cannot be completed safely, report the exact blocker and remaining changes to Maestro and stop.
90
90
 
91
91
  After a successful handoff, return a concise summary and the saved artifact path to Maestro and stop. Do not run more checks. The handoff produces `finding-decisions`
92
- when findings exist and `simplifier-running` when none exist. Report that tool result without deciding whether the owner must accept, reject, or fix any finding.
92
+ when findings exist. With no findings, it produces `simplifier-running` when simplification is enabled, otherwise `candidate-ready`. Report that tool result without
93
+ deciding whether the owner must accept, reject, or fix any finding.
@@ -15,16 +15,19 @@ For example, if Pi starts in `/work/app/src`, `Maestro` reads `/work/app/src/.pi
15
15
  "version": "1.0.0",
16
16
  "specDirectory": ".specs",
17
17
  "builder": {
18
+ "required": true,
18
19
  "model": "openai-codex/gpt-5.6-luna",
19
20
  "thinking": "max",
20
21
  "timeoutMinutes": 60
21
22
  },
22
23
  "simplifier": {
24
+ "required": true,
23
25
  "model": "openai-codex/gpt-6.1-sol",
24
26
  "thinking": "high",
25
27
  "timeoutMinutes": 60
26
28
  },
27
29
  "verifier": {
30
+ "required": true,
28
31
  "model": "openai-codex/gpt-6.1-sol",
29
32
  "thinking": "high",
30
33
  "timeoutMinutes": 60
@@ -39,14 +42,17 @@ For example, if Pi starts in `/work/app/src`, `Maestro` reads `/work/app/src/.pi
39
42
  | `version` | Yes, when the file exists | `1.0.0` | Configuration format version. Only `1.0.0` is supported. |
40
43
  | `specDirectory` | No | `.specs` | Relative path below the project root. |
41
44
  | `builder` | No | `Builder` defaults | Overrides supported `builder` fields. |
45
+ | `builder.required` | No | `true` | Boolean selecting the `builder` phase. |
42
46
  | `builder.model` | No | `openai-codex/gpt-5.6-luna` | Model string passed unchanged to Pi. |
43
47
  | `builder.thinking` | No | `max` | One supported thinking level. |
44
48
  | `builder.timeoutMinutes` | No | `60` | Integer from `1` to `1440`. Applies to each `builder` `run`. |
45
49
  | `verifier` | No | `Verifier` defaults | Overrides supported `verifier` fields. |
50
+ | `verifier.required` | No | `true` | Boolean selecting the `verifier` phase. |
46
51
  | `verifier.model` | No | `openai-codex/gpt-6.1-sol` | Model string passed unchanged to Pi. |
47
52
  | `verifier.thinking` | No | `high` | One supported thinking level. |
48
53
  | `verifier.timeoutMinutes` | No | `60` | Integer from `1` to `1440`. Applies to each `verifier` `run`. |
49
54
  | `simplifier` | No | `Simplifier` defaults | Overrides supported `simplifier` fields. |
55
+ | `simplifier.required` | No | `true` | Boolean selecting the `simplifier` phase. |
50
56
  | `simplifier.model` | No | `openai-codex/gpt-6.1-sol` | Model string passed unchanged to Pi. |
51
57
  | `simplifier.thinking` | No | `high` | One supported thinking level. |
52
58
  | `simplifier.timeoutMinutes` | No | `60` | Integer from `1` to `1440`. Applies to each `simplifier` `run`. |
@@ -81,6 +87,25 @@ Only `version` is required when the file exists. Each other field overrides its
81
87
 
82
88
  This example keeps every default except the `builder` timeout.
83
89
 
90
+ ## Phase selection
91
+
92
+ Set each agent's `required` boolean before activation and leave configuration unchanged until the workflow completes. Omitted flags default to `true`, even when an agent
93
+ section or the entire file is absent. Strings, numbers, and `null` are invalid.
94
+
95
+ With `builder.required: false`, approval completes the workflow with an approved `spec` and no agent execution, regardless of the other flags. The approved `spec` can be
96
+ used for implementation in another workflow. With `builder` enabled, `verifier` and `simplifier` can each be disabled independently. Neither runs without `builder`.
97
+
98
+ | `builder.required` | `verifier.required` | `simplifier.required` | Selected phases after approval |
99
+ | ------------------ | ------------------- | --------------------- | ------------------------------ |
100
+ | `false` | Any | Any | None; approved `spec` only |
101
+ | `true` | `false` | `false` | `Builder` only |
102
+ | `true` | `true` | `false` | `Builder`, then `verifier` |
103
+ | `true` | `false` | `true` | `Builder`, then `simplifier` |
104
+ | `true` | `true` | `true` | All three, in order |
105
+
106
+ Disabled phases do not require agent or model availability and produce no `handoff`. The final summary identifies skipped work rather than claiming it was performed.
107
+ Enabled simplification can still be skipped if Git is unavailable.
108
+
84
109
  ## Schema version
85
110
 
86
111
  `version` identifies the configuration format, not the npm package version. The supported value is `1.0.0`. Other values stop activation.
@@ -98,8 +123,12 @@ For example, `specDirectory: "planning/specs"` places `specs` in `<project-root>
98
123
 
99
124
  ## Model access
100
125
 
101
- During activation, `Maestro` checks all three configured models against `context.modelRegistry.getAvailable()`. Pi's registry is the source of truth for model
102
- availability; `Maestro` does not maintain a separate model list or authentication check. A missing model stops activation and identifies the full configured identifier.
126
+ During activation, `Maestro` checks only enabled agents and their configured models against `context.modelRegistry.getAvailable()`. Pi's registry is the source of truth
127
+ for model availability; `Maestro` does not maintain a separate model list or authentication check. A missing enabled model stops activation and identifies the full
128
+ configured identifier.
129
+
130
+ With `builder` disabled, activation checks only project trust and configuration, with no agent checks, model lookup, or `pi-subagents` ping. With `builder` enabled, the
131
+ availability ping remains required.
103
132
 
104
133
  The `owner` can correct the identifier or authenticate the provider in Pi, then retry `/maestro`. Authentication or provider errors during delegation still appear as
105
134
  `run` failures. Agent names and context are described in [Subagent integration](subagent-integration.md#roles-and-context).
package/docs/glossary.md CHANGED
@@ -20,7 +20,7 @@
20
20
  | `Candidate` | The project files created by agents after a workflow `run` |
21
21
  | `Finding` | A technical issue that the `verifier` records for an `owner` decision. |
22
22
  | `Escalation` | An implementation question or reportable technical problem that the `builder` records in its `handoff` for an `owner` decision. |
23
- | `GREEN FLAG` | The owner's explicit reply that approves the current `spec` and starts the `builder`. |
23
+ | `GREEN FLAG` | The owner's explicit reply that approves the current `spec` and proceeds through the selected phases. |
24
24
  | `fix-code` | An `owner` decision that requests code fixes without changing the approved `spec`. |
25
25
  | `revise-spec` | An `owner` decision that records a reason and agreed requirement change, then returns to `drafting-spec` for revision and renewed approval. |
26
26
  | `reject` | An `owner` decision that declines a `finding` and records a reason. It does not mean that verification passed. |
@@ -19,8 +19,9 @@ and available skills. The global file normally lives at `~/.pi/agent/AGENTS.md`.
19
19
  `Maestro` supplies the `spec` ID, project directory, model, thinking level, and timeout. The agents read all approved documents (`proposal.md`, `spec.md`, and `design.md`
20
20
  when present) and saved `artifacts` to understand the work. Earlier `artifacts` provide context, not proof.
21
21
 
22
- The `owner` does not call agent tools directly. `Maestro` starts the `builder` after `GREEN FLAG` approval. The `verifier` starts after successful `builder` completion,
23
- and the `simplifier` follows successful `verifier` completion.
22
+ The `owner` does not call agent tools directly. `Maestro` starts the enabled `builder` after `GREEN FLAG` approval. The enabled `verifier` starts after successful
23
+ `builder` completion. The enabled `simplifier` follows the selected preceding phases. Disabled agents are not delegated. See
24
+ [Phase selection](configuration.md#phase-selection).
24
25
 
25
26
  ## Following a run
26
27
 
@@ -36,8 +37,9 @@ If a `run` fails or returns without a valid saved result, `Maestro` reports the
36
37
 
37
38
  ## External configuration
38
39
 
39
- The `pi-subagents` extension must be installed and enabled in Pi. `Builder`, `verifier`, and `simplifier` model choices, thinking levels, and timeouts come from
40
- [Maestro configuration](configuration.md). Other `pi-subagents` configuration remains the owner's responsibility.
40
+ The `pi-subagents` extension must be installed and enabled in Pi when `builder` is enabled. Workflows with only an approved `spec` need no agent availability or ping.
41
+ `Builder`, `verifier`, and `simplifier` model choices, thinking levels, and timeouts come from [Maestro configuration](configuration.md). Other `pi-subagents`
42
+ configuration remains the owner's responsibility.
41
43
 
42
44
  Only `maestro_run_simplifier` checks Git readiness, with `git rev-parse --is-inside-work-tree`. If readiness cannot be confirmed, it warns and completes without
43
45
  delegation. The `simplifier` uses Git to select all uncommitted code changes. `Maestro` does not change the Git index or create commits or checkpoints.
package/docs/workflow.md CHANGED
@@ -41,7 +41,14 @@ independently and which issues it found.
41
41
 
42
42
  ## Main flow
43
43
 
44
- The green arrows and lines show the path without `escalations` or `findings`.
44
+ The diagram shows the default flow with all three agents enabled. The green arrows and lines show the path without `escalations` or `findings`.
45
+
46
+ The `owner` selects phases through each agent's `required` boolean before activation and leaves configuration unchanged during the workflow. All flags default to `true`.
47
+ See [Phase selection](configuration.md#phase-selection).
48
+
49
+ With `builder` disabled, approval moves directly to `candidate-ready` and all agents are skipped. Otherwise, after `builder` completion, disabled verification is
50
+ bypassed: the workflow enters `simplifier-running` if simplification is enabled, or `candidate-ready` otherwise. Successful verification and rejection of all current
51
+ `findings` also move directly to `candidate-ready` when simplification is disabled. Skipped agents are not delegated and need no `handoffs`.
45
52
 
46
53
  ```mermaid
47
54
  flowchart TD
@@ -84,17 +91,17 @@ alone does not establish a completed action.
84
91
 
85
92
  The default path is `.specs/<spec-id>/workflow.json`. The `spec` directory is [configurable](configuration.md).
86
93
 
87
- | Phase | Meaning |
88
- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
89
- | `drafting-spec` | The `owner` and `Maestro` prepare the initial `spec` or revise it after recorded `escalation` answers or `finding` decisions. |
90
- | `ready-for-builder` | The approved `spec` or recorded `owner` decisions permit a `builder` `run`. |
91
- | `builder-running` | A `builder` `run` is active. |
92
- | `escalation-decisions` | The `owner` must decide how to handle every `escalation` question. |
93
- | `ready-for-verifier` | The `builder` completed the work and the `verifier` can start. |
94
- | `verifier-running` | A `verifier` `run` is active. |
95
- | `finding-decisions` | The `owner` must decide how to handle every current `finding`. |
96
- | `simplifier-running` | Verification succeeded or the `owner` rejected all current `findings`. The `simplifier` can run or skip if Git is unavailable. |
97
- | `candidate-ready` | Simplification completed. The workflow is complete. |
94
+ | Phase | Meaning |
95
+ | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
96
+ | `drafting-spec` | The `owner` and `Maestro` prepare the initial `spec` or revise it after recorded `escalation` answers or `finding` decisions. |
97
+ | `ready-for-builder` | The approved `spec` or recorded `owner` decisions permit a `builder` `run`. |
98
+ | `builder-running` | A `builder` `run` is active. |
99
+ | `escalation-decisions` | The `owner` must decide how to handle every `escalation` question. |
100
+ | `ready-for-verifier` | The `builder` completed the work and the `verifier` can start. |
101
+ | `verifier-running` | A `verifier` `run` is active. |
102
+ | `finding-decisions` | The `owner` must decide how to handle every current `finding`. |
103
+ | `simplifier-running` | Selected preceding phases finished. The enabled `simplifier` can run or skip if Git is unavailable. |
104
+ | `candidate-ready` | The selected phases completed or were skipped. The workflow is complete. |
98
105
 
99
106
  ## Specification documents
100
107
 
@@ -112,9 +119,9 @@ For the initial `spec`:
112
119
 
113
120
  1. `Maestro` creates `proposal.md`, `spec.md`, and `workflow.json` in `drafting-spec`, then prepares the documents with the `owner`. It adds `design.md` only when needed.
114
121
  2. The `owner` reviews the complete document set: motivation, scope, requirements, `acceptance criteria`, and any approved technical decisions.
115
- 3. `Maestro` asks the `owner` to inspect `proposal.md`, `spec.md`, and `design.md` when present and reply `GREEN FLAG` once to approve the entire set and start the
116
- `builder`.
117
- 4. After that reply, `Maestro` saves `ready-for-builder` and starts the `builder` in the foreground.
122
+ 3. `Maestro` asks the `owner` to inspect `proposal.md`, `spec.md`, and `design.md` when present and reply `GREEN FLAG` once to approve the entire set and proceed through
123
+ the selected phases.
124
+ 4. After that reply, `Maestro` saves `ready-for-builder` and starts the enabled `builder` in the foreground, or saves `candidate-ready` with all agents skipped.
118
125
 
119
126
  Approval freezes all present `spec` documents and visual prototypes together. None may change during `builder`, `verifier`, or `simplifier` execution. See
120
127
  [Spec revision](#spec-revision) for permitted revisions.
@@ -230,11 +237,11 @@ that file's `findings` list, not a separate `F2.json` file. `Finding` numbers re
230
237
  `Maestro` records `owner` decisions in the same `verifier` report, e.g. decisions about `V1/F2` update `V1.json`, not a new `V2.json`. A new `verifier` result creates the
231
238
  next report (`V2.json`).
232
239
 
233
- | Decision | Result |
234
- | ------------- | -------------------------------------------------------------------------------------------------------------- |
235
- | `reject` | Records the owner's reason. If every `finding` is rejected, the workflow reaches `simplifier-running`. |
236
- | `fix-code` | Keeps the current `spec` and returns to `ready-for-builder` for code fixes when no decision requires revision. |
237
- | `revise-spec` | Records the owner's reason and agreed requirement change, then returns to `drafting-spec`. |
240
+ | Decision | Result |
241
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
242
+ | `reject` | Records the owner's reason. If every `finding` is rejected, the workflow reaches `simplifier-running` when enabled, otherwise `candidate-ready`. |
243
+ | `fix-code` | Keeps the current `spec` and returns to `ready-for-builder` for code fixes when no decision requires revision. |
244
+ | `revise-spec` | Records the owner's reason and agreed requirement change, then returns to `drafting-spec`. |
238
245
 
239
246
  `Maestro` saves every current decision together before the phase changes. If any `finding` requires revision, revision takes priority over code fixes and rejections. See
240
247
  [Spec revision](#spec-revision).
@@ -262,8 +269,8 @@ Cleanup relies on the `verifier`. If cleanup cannot finish safely, the `verifier
262
269
 
263
270
  ## Simplification
264
271
 
265
- After a successful verification, Maestro starts the `simplifier`. The `simplifier` runs only if Git is available, if not, a warning is displayed:
266
- `Simplifier skipped: Git repository unavailable.`
272
+ When enabled, `Maestro` starts the `simplifier` after successful verification, rejection of all `findings`, or `builder` completion with verification disabled. The
273
+ `simplifier` runs only if Git is available, if not, a warning is displayed: `Simplifier skipped: Git repository unavailable.`
267
274
 
268
275
  The `simplifier` starts from all staged, unstaged, and untracked code changes, including pre-existing changes. It preserves observable behavior and introduces no new
269
276
  check failures. If no code needs refactoring, the `simplifier` does not make any change.
@@ -271,7 +278,9 @@ check failures. If no code needs refactoring, the `simplifier` does not make any
271
278
  ## Workflow completion
272
279
 
273
280
  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.
281
+ `artifacts`, and simplifier's summary and notes, only for phases that ran. It identifies every skipped phase and its reason. An approved `spec` alone does not mean code
282
+ was implemented or verified. `Builder` checks and the simplifier's report are not independent verification when `verifier` is disabled. The `owner` can use an approved
283
+ `spec` for implementation in another workflow without further `Maestro` execution.
275
284
 
276
285
  `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
286
  later Git use, pull request, or merge. Changes after completion are outside the completed verification.
@@ -87,29 +87,27 @@ export default (pi: ExtensionAPI): void => {
87
87
  try {
88
88
  await assertEnvironment({ context, piEventsBus: pi.events });
89
89
  const config = await loadConfiguration(context.cwd);
90
+ const isImplementationEnabled = config.builder.required;
90
91
 
91
92
  maestroSessionState.activate();
92
93
  syncMainTools();
93
94
  await refreshMaestroStatus(context);
94
95
 
95
- // Introduce Maestro and show configured agents only in the UI.
96
+ // Introduce Maestro and show enabled agents only in the UI.
96
97
  context.ui.notify(
97
98
  [
98
99
  context.ui.theme.fg('muted', 'Maestro active'),
99
100
  'Maestro helps the owner define a spec, then coordinates implementation and independent verification.',
100
101
  'Ask how Maestro works for a short explanation.',
101
- context.ui.theme.fg(
102
- 'accent',
103
- `Builder (${config.builder.model} ${config.builder.thinking})`,
104
- ),
105
- context.ui.theme.fg(
106
- 'accent',
107
- `Verifier (${config.verifier.model} ${config.verifier.thinking})`,
108
- ),
109
- context.ui.theme.fg(
110
- 'accent',
111
- `Simplifier (${config.simplifier.model} ${config.simplifier.thinking})`,
112
- ),
102
+ ...[
103
+ { label: 'Builder', settings: config.builder },
104
+ { label: 'Verifier', settings: config.verifier },
105
+ { label: 'Simplifier', settings: config.simplifier },
106
+ ]
107
+ .filter(({ settings }) => isImplementationEnabled && settings.required)
108
+ .map(({ label, settings }) =>
109
+ context.ui.theme.fg('accent', `${label} (${settings.model} ${settings.thinking})`),
110
+ ),
113
111
  ].join('\n'),
114
112
  'info',
115
113
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emiliosp/pi-maestro",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "A spec-driven multiagent development workflow for Pi.",
5
5
  "keywords": [
6
6
  "orchestration",
@@ -31,16 +31,19 @@ export const DEFAULT_CONFIG: MaestroConfig = {
31
31
  version: DEFAULT_CONFIG_VERSION,
32
32
  specDirectory: DEFAULT_SPEC_DIRECTORY,
33
33
  builder: {
34
+ required: true,
34
35
  model: DEFAULT_BUILDER_MODEL,
35
36
  thinking: DEFAULT_BUILDER_THINKING,
36
37
  timeoutMinutes: DEFAULT_TIMEOUT_MINUTES,
37
38
  },
38
39
  simplifier: {
40
+ required: true,
39
41
  model: DEFAULT_SIMPLIFIER_MODEL,
40
42
  thinking: THINKING_LEVELS.HIGH,
41
43
  timeoutMinutes: DEFAULT_TIMEOUT_MINUTES,
42
44
  },
43
45
  verifier: {
46
+ required: true,
44
47
  model: DEFAULT_VERIFIER_MODEL,
45
48
  thinking: DEFAULT_VERIFIER_THINKING,
46
49
  timeoutMinutes: DEFAULT_TIMEOUT_MINUTES,
@@ -41,6 +41,7 @@ export const ThinkingSchema = Type.Union([
41
41
 
42
42
  export const PartialAgentConfigSchema = Type.Object(
43
43
  {
44
+ required: Type.Optional(Type.Boolean()),
44
45
  model: Type.Optional(Type.String()),
45
46
  thinking: Type.Optional(ThinkingSchema),
46
47
  timeoutMinutes: Type.Optional(
@@ -66,6 +67,7 @@ export const MaestroConfigInputSchema = Type.Object(
66
67
 
67
68
  export const ResolvedAgentConfigSchema = Type.Object(
68
69
  {
70
+ required: Type.Boolean(),
69
71
  model: Type.String(),
70
72
  thinking: ThinkingSchema,
71
73
  timeoutMinutes: Type.Integer({
@@ -50,21 +50,29 @@ const getActivationConfiguration = async (
50
50
 
51
51
  type AssertModelsAvailableInput = {
52
52
  context: ExtensionContext;
53
- config: Awaited<ReturnType<typeof loadConfiguration>>;
53
+ models: string[];
54
54
  };
55
55
 
56
- function assertModelsAvailable({ context, config }: AssertModelsAvailableInput): void {
56
+ function assertModelsAvailable({ context, models }: AssertModelsAvailableInput): void {
57
57
  const availableModels = context.modelRegistry.getAvailable();
58
58
 
59
- for (const model of [config.builder.model, config.verifier.model, config.simplifier.model]) {
59
+ for (const model of models) {
60
60
  if (!availableModels.some((entry) => `${entry.provider}/${entry.id}` === model)) {
61
61
  throw new Error(`Configured model is not available: "${model}".`);
62
62
  }
63
63
  }
64
64
  }
65
65
 
66
- async function assertAgentsAvailable(projectRoot: string): Promise<void> {
67
- for (const agent of [AGENTS.BUILDER, AGENTS.VERIFIER, AGENTS.SIMPLIFIER]) {
66
+ type AssertAgentsAvailableInput = {
67
+ projectRoot: string;
68
+ agents: string[];
69
+ };
70
+
71
+ async function assertAgentsAvailable({
72
+ projectRoot,
73
+ agents,
74
+ }: AssertAgentsAvailableInput): Promise<void> {
75
+ for (const agent of agents) {
68
76
  const result = await resolveSubagentLaunchContract({
69
77
  agent,
70
78
  cwd: projectRoot,
@@ -138,18 +146,25 @@ export async function assertEnvironment({
138
146
  piEventsBus,
139
147
  }: AssertEnvironmentInput): Promise<void> {
140
148
  const projectRoot = await getProjectRoot(context);
149
+ const config = await getActivationConfiguration(projectRoot);
150
+
151
+ if (!config.builder.required) return;
152
+
153
+ const enabledAgents = [
154
+ { agent: AGENTS.BUILDER, settings: config.builder },
155
+ { agent: AGENTS.VERIFIER, settings: config.verifier },
156
+ { agent: AGENTS.SIMPLIFIER, settings: config.simplifier },
157
+ ].filter(({ settings }) => settings.required);
141
158
 
142
159
  try {
143
- await assertAgentsAvailable(projectRoot);
160
+ await assertAgentsAvailable({ projectRoot, agents: enabledAgents.map(({ agent }) => agent) });
144
161
  } catch (error) {
145
162
  throw new Error(
146
163
  `Builder, verifier, or simplifier agent check failed: ${getErrorMessage(error)}`,
147
164
  );
148
165
  }
149
166
 
150
- const config = await getActivationConfiguration(projectRoot);
151
-
152
- assertModelsAvailable({ context, config });
167
+ assertModelsAvailable({ context, models: enabledAgents.map(({ settings }) => settings.model) });
153
168
 
154
169
  try {
155
170
  await assertSubagentsRespond(piEventsBus);