@emiliosp/pi-maestro 0.21.0 → 0.23.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/CHANGELOG.md +5 -0
- package/README.md +42 -79
- package/agents/builder.md +7 -7
- package/agents/maestro.md +62 -45
- package/agents/simplifier.md +6 -5
- package/agents/verifier.md +13 -13
- package/docs/adr/0001-keep-the-workflow-independent-of-git.md +25 -0
- package/docs/adr/0002-store-escalation-decisions-in-builder-handoffs.md +24 -0
- package/docs/adr/0003-route-builder-failures-through-owner-escalations.md +23 -0
- package/docs/adr/0004-require-git-only-for-the-simplifier.md +35 -0
- package/docs/adr/0005-approve-a-specification-document-set-as-one-contract.md +32 -0
- package/docs/adr/0006-maintain-the-roadmap-in-linear.md +25 -0
- package/docs/adr/0007-maintain-the-roadmap-in-the-repository.md +27 -0
- package/docs/adr/0008-use-pis-registry-for-model-availability.md +23 -0
- package/docs/adr/0009-select-optional-phases-in-the-transition-table.md +24 -0
- package/docs/adr/0010-use-the-pi-sdk-for-sequential-agent-delegation.md +109 -0
- package/docs/adr/0011-separate-initial-setup-ui-from-configuration-rules.md +25 -0
- package/docs/adr/0012-filter-main-maestro-registrations-after-native-discovery.md +21 -0
- package/docs/adr/README.md +21 -0
- package/docs/configuration.md +33 -12
- package/docs/glossary.md +38 -49
- package/docs/inspiration.md +32 -0
- package/docs/roadmap/README.md +42 -0
- package/docs/roadmap/maestro-10-improve-status-presentation-and-activation-feedback.md +18 -0
- package/docs/roadmap/maestro-11-introduce-maestro-at-activation.md +19 -0
- package/docs/roadmap/maestro-12-verify-code-quality-against-agentsmd-instructions.md +21 -0
- package/docs/roadmap/maestro-13-check-subagent-extensions-at-activation.md +21 -0
- package/docs/roadmap/maestro-14-rename-the-test-support-directory.md +16 -0
- package/docs/roadmap/maestro-15-match-handoff-criteria-to-the-approved-spec.md +19 -0
- package/docs/roadmap/maestro-16-route-finding-driven-spec-revisions-through-drafting-spec.md +19 -0
- package/docs/roadmap/maestro-17-keep-acceptance-criterion-numbering-continuous.md +19 -0
- package/docs/roadmap/maestro-18-record-escalation-resolutions-when-the-spec-changes.md +18 -0
- package/docs/roadmap/maestro-19-guide-initial-configuration.md +22 -0
- package/docs/roadmap/maestro-20-rename-the-npm-package.md +17 -0
- package/docs/roadmap/maestro-21-label-acceptance-criterion-coverage.md +18 -0
- package/docs/roadmap/maestro-22-avoid-acceptance-criteria-already-covered-by-tests.md +16 -0
- package/docs/roadmap/maestro-23-change-agent-models-before-a-builder-run.md +14 -0
- package/docs/roadmap/maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent.md +23 -0
- package/docs/roadmap/maestro-25-define-workflow-reconciliation.md +19 -0
- package/docs/roadmap/maestro-26-exit-maestro-mode-automatically-at-workflow-completion.md +18 -0
- package/docs/roadmap/maestro-27-make-all-implementation-phases-optional.md +26 -0
- package/docs/roadmap/maestro-28-add-maestro-role-instructions-alongside-the-other-agents.md +14 -0
- package/docs/roadmap/maestro-6-display-specs-in-a-browser.md +14 -0
- package/docs/roadmap/maestro-7-route-builder-failures-through-owner-escalations.md +19 -0
- package/docs/roadmap/maestro-8-store-escalations-and-owner-decisions-in-builder-handoffs.md +19 -0
- package/docs/roadmap/maestro-9-format-glossary-terms-consistently.md +14 -0
- package/docs/roadmap/maestro-free-1-require-pi-150.md +16 -0
- package/docs/roadmap/maestro-free-2-remove-maestro-run-timeouts.md +18 -0
- package/docs/roadmap/maestro-free-3-run-the-builder-through-the-pi-sdk.md +31 -0
- package/docs/roadmap/maestro-free-4-run-the-verifier-through-the-pi-sdk.md +22 -0
- package/docs/roadmap/maestro-free-5-run-the-simplifier-through-the-pi-sdk.md +22 -0
- package/docs/roadmap/maestro-free-6-show-sdk-agent-activity-through-pi.md +21 -0
- package/docs/roadmap/maestro-free-7-remove-the-pi-subagents-dependency.md +21 -0
- package/docs/roadmap/maestro-free-pre-3-implement-internal-sdk-delegation.md +37 -0
- package/docs/subagent-integration.md +9 -29
- package/docs/workflow.md +62 -246
- package/extensions/maestro.ts +96 -19
- package/package.json +2 -6
- package/src/MaestroPaths.ts +9 -0
- package/src/config/assertConfiguration.ts +23 -21
- package/src/config/defaults.ts +2 -1
- package/src/config/loadConfiguration.ts +3 -2
- package/src/config/saveConfiguration.ts +38 -14
- package/src/config/schema.ts +13 -0
- package/src/maestro/checks/assertEnvironment.ts +8 -33
- package/src/maestro/selectAgentModels.ts +70 -0
- package/src/maestro/setupInitialConfiguration.ts +26 -0
- package/src/maestro/status/formatMaestroStatus.ts +3 -0
- package/src/score/collectWorkflowEvidence.ts +170 -0
- package/src/score/parseClassifierScores.ts +51 -0
- package/src/score/questions.json +24 -0
- package/src/score/requestEvaluation.ts +54 -0
- package/src/score/scoreWorkflow.ts +100 -0
- package/src/tools/child/record-builder-handoff.ts +1 -0
- package/src/tools/child/record-simplifier-handoff.ts +2 -1
- package/src/tools/child/record-verifier-handoff.ts +1 -0
- package/src/tools/main/create-spec.ts +1 -0
- package/src/tools/main/mark-spec-ready.ts +1 -0
- package/src/tools/main/resolve-escalations.ts +1 -0
- package/src/tools/main/resolve-findings.ts +6 -1
- package/src/tools/main/run-builder.ts +8 -1
- package/src/tools/main/run-simplifier.ts +26 -6
- package/src/tools/main/run-verifier.ts +8 -1
- package/src/tools/main/score-workflow.ts +43 -0
- package/src/ui/selectModel.ts +23 -15
- package/src/ui/showAgentRolesSetupMenu.ts +65 -0
- package/src/workflow/spec/markSpecReady.ts +13 -3
- package/src/workflow/state/schema.ts +3 -0
- package/src/workflow/transitions.ts +9 -2
- package/templates/spec.md +1 -1
- package/ADR.md +0 -457
- package/ROADMAP.md +0 -641
- package/src/maestro/setupConfiguration.ts +0 -50
- package/src/ui/selectSpec.ts +0 -14
- package/src/ui/showSetupMenu.ts +0 -44
- package/src/ui/showSpecMenu.ts +0 -36
- /package/{MISSION.md → docs/MISSION.md} +0 -0
- /package/{TECH_STACK.md → docs/TECH_STACK.md} +0 -0
package/ADR.md
DELETED
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
# Architecture decision records
|
|
2
|
-
|
|
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
|
-
|
|
5
|
-
Requirements and routine project rules belong in the [roadmap](ROADMAP.md) or other relevant documentation.
|
|
6
|
-
|
|
7
|
-
When a new decision replaces an accepted decision, add a new record, mark the earlier record as superseded, and link both records.
|
|
8
|
-
|
|
9
|
-
## ADR-001: Keep the workflow independent of Git
|
|
10
|
-
|
|
11
|
-
### Status
|
|
12
|
-
|
|
13
|
-
Superseded by [ADR-004](#adr-004-require-git-only-for-the-simplifier). Recorded date: 2026-10-07. Implemented in `0.6.0`.
|
|
14
|
-
|
|
15
|
-
### Context
|
|
16
|
-
|
|
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
|
-
|
|
20
|
-
### Decision
|
|
21
|
-
|
|
22
|
-
`Maestro` uses the Pi project directory and saved workflow phase. It does not require Git or create automatic commits.
|
|
23
|
-
|
|
24
|
-
The `verifier` checks live project files. The `owner` controls later Git use, pull requests, and merging.
|
|
25
|
-
|
|
26
|
-
### Consequences
|
|
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
|
|
29
|
-
manual `owner` handling.
|
|
30
|
-
|
|
31
|
-
### Evidence
|
|
32
|
-
|
|
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).
|
|
35
|
-
|
|
36
|
-
## ADR-002: Store escalation decisions in builder handoffs
|
|
37
|
-
|
|
38
|
-
### Status
|
|
39
|
-
|
|
40
|
-
Accepted. Recorded date: 2026-10-08. Implemented in `0.7.0`.
|
|
41
|
-
|
|
42
|
-
### Context
|
|
43
|
-
|
|
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.
|
|
46
|
-
|
|
47
|
-
### Decision
|
|
48
|
-
|
|
49
|
-
Numbered `builder` `handoffs` contain `escalation` questions and their `owner` resolutions. One call records all current answers. No parallel storage model is needed.
|
|
50
|
-
|
|
51
|
-
IDs restart at `E1` in each `handoff`. References include both IDs, such as `B1/E1`. Answers update only the active handoff's resolution fields.
|
|
52
|
-
|
|
53
|
-
### Consequences
|
|
54
|
-
|
|
55
|
-
Standalone `escalation` storage and singular resolution tools were removed. Questions and decisions remain together in each numbered `builder` `handoff`.
|
|
56
|
-
|
|
57
|
-
There are no migration procedures, fallback readers, or deprecated aliases. `Artifact` versions remain `1.0.0` despite the breaking change.
|
|
58
|
-
|
|
59
|
-
### Evidence
|
|
60
|
-
|
|
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).
|
|
63
|
-
|
|
64
|
-
## ADR-003: Route builder failures through owner escalations
|
|
65
|
-
|
|
66
|
-
### Status
|
|
67
|
-
|
|
68
|
-
Accepted. Implemented.
|
|
69
|
-
|
|
70
|
-
### Context
|
|
71
|
-
|
|
72
|
-
The `owner` must decide how work continues after a reportable technical problem. The workflow also needs a simpler model with two `builder` outcomes.
|
|
73
|
-
|
|
74
|
-
### Decision
|
|
75
|
-
|
|
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.
|
|
78
|
-
|
|
79
|
-
### Consequences
|
|
80
|
-
|
|
81
|
-
Reuse the existing tools, numbered `handoffs`, and batch decisions. Individual `probe` results retain `failed` as a valid value.
|
|
82
|
-
|
|
83
|
-
Execution and protocol errors without a valid saved result still stop the workflow. This decision adds no automatic recovery.
|
|
84
|
-
|
|
85
|
-
This breaking MVP change has no migrations, compatibility readers, deprecated aliases, or dedicated legacy-format tests.
|
|
86
|
-
|
|
87
|
-
### Evidence
|
|
88
|
-
|
|
89
|
-
[Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md) and
|
|
90
|
-
[MAESTRO-7](https://linear.app/emilio-spatola/issue/MAESTRO-7/route-builder-failures-through-owner-escalations).
|
|
91
|
-
|
|
92
|
-
## ADR-004: Require Git only for the simplifier
|
|
93
|
-
|
|
94
|
-
### Status
|
|
95
|
-
|
|
96
|
-
Accepted. Implemented through MAESTRO-24. 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
|
-
[MAESTRO-24](https://linear.app/emilio-spatola/issue/MAESTRO-24/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/).
|
|
166
|
-
|
|
167
|
-
## ADR-006: Maintain the roadmap in Linear
|
|
168
|
-
|
|
169
|
-
### Status
|
|
170
|
-
|
|
171
|
-
Superseded by [ADR-007](#adr-007-maintain-the-roadmap-in-the-repository).
|
|
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).
|
|
193
|
-
|
|
194
|
-
## ADR-007: Maintain the roadmap in the repository
|
|
195
|
-
|
|
196
|
-
### Status
|
|
197
|
-
|
|
198
|
-
Accepted. Supersedes [ADR-006](#adr-006-maintain-the-roadmap-in-linear).
|
|
199
|
-
|
|
200
|
-
### Context
|
|
201
|
-
|
|
202
|
-
The `owner` reported excessive token use when accessing Linear and requested restoration of the Markdown roadmap. The `owner` also explicitly prohibited changes to the
|
|
203
|
-
Linear project.
|
|
204
|
-
|
|
205
|
-
### Decision
|
|
206
|
-
|
|
207
|
-
Maintain the roadmap in `ROADMAP.md` as the source of truth. Restore project items from Linear through read-only access, preserving existing `MAESTRO` identifiers, scope,
|
|
208
|
-
and evidence. Do not transfer Linear onboarding or test issues.
|
|
209
|
-
|
|
210
|
-
Keep Linear unchanged as historical reference. Routine roadmap reading and maintenance use local files, not MCP.
|
|
211
|
-
|
|
212
|
-
### Consequences
|
|
213
|
-
|
|
214
|
-
Planning no longer requires Linear access. Repository instructions, documentation audit guidance, links, and published package contents refer to the local roadmap. Later
|
|
215
|
-
roadmap changes do not need synchronization with Linear.
|
|
216
|
-
|
|
217
|
-
Conflicting imported status and acceptance evidence remain explicit rather than being treated as proof of final `owner` acceptance.
|
|
218
|
-
|
|
219
|
-
### Evidence
|
|
220
|
-
|
|
221
|
-
[Roadmap](ROADMAP.md) and [repository instructions](AGENTS.md).
|
|
222
|
-
|
|
223
|
-
## ADR-008: Use Pi's registry for model availability
|
|
224
|
-
|
|
225
|
-
### Status
|
|
226
|
-
|
|
227
|
-
Accepted. Implemented.
|
|
228
|
-
|
|
229
|
-
### Context
|
|
230
|
-
|
|
231
|
-
Maestro's model format regex rejected OpenRouter IDs containing additional slashes. The `owner` selected Pi as the source of truth for models and explicitly retained the
|
|
232
|
-
activation availability check because it uses Pi's registry.
|
|
233
|
-
|
|
234
|
-
### Decision
|
|
235
|
-
|
|
236
|
-
Treat configured models as strings without a separate format regex. During activation, match each complete `provider/model` identifier against
|
|
237
|
-
`context.modelRegistry.getAvailable()`, preserving slashes inside model IDs. Pass the configured identifier unchanged through `pi-subagents`.
|
|
238
|
-
|
|
239
|
-
Keep Maestro's configuration structure, version, path, thinking-level, and timeout validation.
|
|
240
|
-
|
|
241
|
-
### Consequences
|
|
242
|
-
|
|
243
|
-
A model absent from Pi's available registry prevents activation. `Maestro` maintains no separate model catalog or authentication check. Provider or authentication
|
|
244
|
-
failures during delegation still use the existing `run` failure path. Workflow recovery and phase transitions remain unchanged.
|
|
245
|
-
|
|
246
|
-
### Evidence
|
|
247
|
-
|
|
248
|
-
[Configuration](docs/configuration.md#model-access), [activation checks](src/maestro/checks/assertEnvironment.ts), and
|
|
249
|
-
[delegation](https://github.com/emilioSp/pi-maestro/blob/9d020b9177e93333736ade265db5e332fbb2a291/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).
|
|
278
|
-
|
|
279
|
-
## ADR-010: Use the Pi SDK for sequential agent delegation
|
|
280
|
-
|
|
281
|
-
### Status
|
|
282
|
-
|
|
283
|
-
Design decisions confirmed by the `owner`. Implemented. Main-extension pre-load exclusion is superseded by
|
|
284
|
-
[ADR-012](#adr-012-filter-main-maestro-registrations-after-native-discovery).
|
|
285
|
-
|
|
286
|
-
### Context
|
|
287
|
-
|
|
288
|
-
`Maestro` currently depends on `pi-subagents` to execute the `builder`, `verifier`, and `simplifier`. Its delegation needs are limited: only one workflow and one child
|
|
289
|
-
agent execute at a time, and `Maestro` waits for each child to finish. `Maestro` already owns workflow transitions, role instructions, saved `handoffs`, and result
|
|
290
|
-
validation.
|
|
291
|
-
|
|
292
|
-
The `owner` wants to remove the `pi-subagents` dependency without building a general-purpose delegation framework. Pi provides `createAgentSession()` for direct SDK
|
|
293
|
-
integration and `RpcClient` for subprocess control. Separate conversations do not require separate processes.
|
|
294
|
-
|
|
295
|
-
### Decision
|
|
296
|
-
|
|
297
|
-
1. Replace `pi-subagents` delegation with direct use of the Pi SDK through `createAgentSession()`, rather than RPC subprocesses.
|
|
298
|
-
2. Preserve sequential execution: one workflow at a time, one child agent at a time, with `Maestro` waiting for completion.
|
|
299
|
-
3. Use task-and-handoff communication, not a live supervisor dialogue. `Maestro` assigns the task; the child works, saves its `handoff`, and finishes.
|
|
300
|
-
4. When an `owner` decision is needed, the `builder` saves an `escalation` and ends its `run`. `Maestro` discusses it with the `owner` and records the decisions through
|
|
301
|
-
the existing workflow. Any subsequent `builder` `run` starts a fresh conversation and reads the saved decisions.
|
|
302
|
-
5. Child sessions must have access to the same working tools available to `Maestro`, plus the tools needed to save their own `handoffs`. Do not load the main `Maestro`
|
|
303
|
-
extension into child sessions. Tools supplied by other extensions may remain available even if they support delegation; role instructions forbid using them to
|
|
304
|
-
delegate. This is a tool-access requirement, not merely an extension-loading policy.
|
|
305
|
-
6. Automatically load enabled global and project extensions, excluding the main `Maestro` extension. Provide the corresponding working-tool environment through Pi's
|
|
306
|
-
native APIs and configuration, including separate Pi support such as MCP and `codemode` where needed. Loading the same extensions alone does not reproduce every CLI
|
|
307
|
-
capability. Compatibility of arbitrary extensions, tools, and model providers is outside Maestro's responsibility; do not add custom compatibility checks or adapters.
|
|
308
|
-
7. All three child roles receive the owner's global instruction file, normally `~/.pi/agent/AGENTS.md`, preserving the current `inheritGlobalContext: true` behavior.
|
|
309
|
-
These instructions are not the parent's conversation history.
|
|
310
|
-
8. All three child roles automatically receive project instructions discovered by Pi, such as applicable `AGENTS.md` files, preserving the current
|
|
311
|
-
`inheritProjectContext: true` behavior. These instructions supplement global instructions and role-specific guidance.
|
|
312
|
-
9. All three child roles can discover and use available skills, preserving the current `inheritSkills: true` behavior. Expose the skill catalog without loading every
|
|
313
|
-
skill's full contents into the conversation. Skills remain subject to the child's role boundaries and permitted tools; they do not authorize delegation or workflow
|
|
314
|
-
management.
|
|
315
|
-
10. During a child `run`, report the role, elapsed time, current tool, and recent normal assistant text through Pi's standard tool-progress updates (`onUpdate`). Use Pi's
|
|
316
|
-
built-in presentation, including its default layout, truncation, and expansion behavior. Do not build a custom renderer or implement a fixed visible-line count or
|
|
317
|
-
terminal-height adaptation. Update progress in place instead of appending intermediate messages to the main conversation. Do not include internal reasoning or full
|
|
318
|
-
command output. Continue reporting activity when the child produces no text; do not prompt it to generate artificial progress messages.
|
|
319
|
-
11. Intermediate activity text is UI-only and must not enter the main model's context. `Maestro` continues to receive the existing workflow result. Pi's display limits do
|
|
320
|
-
not truncate the saved child conversation. The five-, ten-, and twenty-line alternatives are superseded by the decision to use Pi's standard presentation.
|
|
321
|
-
12. Persist child conversations using Pi's native session format, rather than a custom transcript format. Saved sessions remain available after execution for diagnosis,
|
|
322
|
-
including unsuccessful executions. Each child `run` starts a new conversation; persistence does not introduce automatic session reuse or workflow recovery.
|
|
323
|
-
13. At child completion or failure, show the `owner` the path to its saved Pi session file, when one exists. The `owner` can inspect the file directly or use Pi's native
|
|
324
|
-
HTML export with `pi --export <session-file> conversation.html`. Do not build a transcript inspector inside `Maestro`. Reading or exporting a transcript does not
|
|
325
|
-
resume child execution.
|
|
326
|
-
14. Do not impose an automatic child `run` timeout in `Maestro`. Remove `builder.timeoutMinutes`, `verifier.timeoutMinutes`, and `simplifier.timeoutMinutes` from
|
|
327
|
-
`.pi/maestro.json` configuration support, including schema validation, defaults, launch inputs, and configuration documentation. A child continues until it finishes,
|
|
328
|
-
fails, or is manually interrupted. This removes the workflow-level deadline, not the elapsed-time progress display or timeouts internal to Pi and its tools.
|
|
329
|
-
15. Remove `timeoutMinutes` from the configuration schemas and retain `additionalProperties: false`. Existing TypeBox-based validation rejects configuration files that
|
|
330
|
-
still contain the field. Do not add a migration, ignored legacy fields, or special compatibility handling. The `owner` removes obsolete fields manually.
|
|
331
|
-
16. Preserve the existing execution-error policy. Launch failures, failed child executions, and missing or invalid `handoffs` stop the workflow and report the error.
|
|
332
|
-
`Maestro` does not automatically start another child session to retry, repair saved state, or roll back files. Preserve the remaining project files and saved workflow
|
|
333
|
-
state for manual `owner` follow-up, including partial protocol writes. Errors do not introduce recovery transitions or synthetic `escalations`.
|
|
334
|
-
17. Propagate manual cancellation of the main tool to its active child through `session.abort()` and await the interruption before releasing the child session. Do not
|
|
335
|
-
send a final model prompt asking the child to finish, and do not generate a synthetic `handoff`. Leave project files and saved workflow state unchanged by cleanup.
|
|
336
|
-
Close child sessions and release progress subscriptions and session resources on completion, failure, or cancellation. Do not start another child while the previous
|
|
337
|
-
child remains active.
|
|
338
|
-
18. Store child sessions in a `subagents/` subdirectory of Pi's normal project session directory, normally `~/.pi/agent/sessions/--<project-path>--/subagents/`. Resolve
|
|
339
|
-
the parent directory through Pi's session-directory API rather than reimplementing project-path encoding. Use Pi's native `SessionManager` with this directory. Do not
|
|
340
|
-
create a `subagents/` directory inside the project repository.
|
|
341
|
-
19. Require Pi 1.5.0 or later for the SDK-based implementation. Update the declared Pi requirement and align implementation verification with this baseline. Do not add
|
|
342
|
-
compatibility fallbacks for earlier Pi versions. This minimum is a scope choice, not a claim that all earlier versions lack the required APIs.
|
|
343
|
-
20. Do not build an additional tool allowlist or exclusion list to prevent child delegation. Children may have delegation tools available, but their role instructions
|
|
344
|
-
forbid using them. This deliberately relies on instruction compliance rather than technical removal of delegation capabilities. The main `Maestro` extension remains
|
|
345
|
-
excluded.
|
|
346
|
-
21. Leave compatibility of external integrations to Pi and the `owner`. Do not add a preflight that compares parent and child tool availability, extension health checks,
|
|
347
|
-
special adapters, or a fallback system for incompatible integrations. This scope boundary does not suppress errors actually reported during launch or execution; those
|
|
348
|
-
follow the existing stop-and-report policy.
|
|
349
|
-
|
|
350
|
-
### Consequences
|
|
351
|
-
|
|
352
|
-
The replacement does not need supervisor request routing or a mechanism that makes the main model answer a child while waiting for it. Saved `handoffs` remain the
|
|
353
|
-
communication boundary for completed work and `escalations`.
|
|
354
|
-
|
|
355
|
-
SDK sessions share a Node.js process. Separate conversation histories do not isolate module-level mutable state or project files. Child resource loading must account for
|
|
356
|
-
this distinction.
|
|
357
|
-
|
|
358
|
-
Automatic extension loading intentionally differs from the current foreground behavior of `pi-subagents` 0.78.0, which does not automatically load the parent's global and
|
|
359
|
-
project extensions. Shared working-tool access is provided through Pi's native environment, not an independent compatibility guarantee for every integration. The
|
|
360
|
-
replacement must use Pi's tool activation and support such as MCP and `codemode`, rather than assuming the SDK supplies the CLI's capabilities by default. There is no
|
|
361
|
-
custom parity check, health gate, or adapter layer for third-party integrations. Children do not inherit the parent's conversation, but they share the process and may
|
|
362
|
-
interact with process-wide mutable state. Loaded extensions can create additional connections, timers, and process-wide effects. Excluding the main `Maestro` extension
|
|
363
|
-
does not establish compatibility with every other extension or remove delegation tools supplied by other extensions. `Maestro` launches its own children sequentially;
|
|
364
|
-
compliance with the broader no-delegation rule relies on child instructions. A child that ignores those instructions could launch other agents. This accepted limitation
|
|
365
|
-
avoids maintaining tool classifications and exclusion lists and does not claim a sandbox; even ordinary shell access can launch processes.
|
|
366
|
-
|
|
367
|
-
Pi's standard tool-progress presentation replaces FleetView's live activity display, not its full transcript inspector. `Maestro` owns the progress data, not a new
|
|
368
|
-
rendering system or a guaranteed panel size. Displaying text already produced by the child requires no additional model generation and does not add that text to the main
|
|
369
|
-
model's context. Full transcript inspection uses saved session files and Pi's existing export capability rather than a replacement inspector. The main tool must connect
|
|
370
|
-
cancellation to the child SDK session and perform session cleanup; selecting the SDK alone does not wire these operations together.
|
|
371
|
-
|
|
372
|
-
Native session files retain child messages, tool calls, and tool results beyond the lifetime of the child session. They may contain project data present in those messages
|
|
373
|
-
and results. Persistence is separate from the live progress display and does not add the transcript to the main model's context. The dedicated `subagents/` subdirectory
|
|
374
|
-
keeps child session files separate from the main session files without adding transcript files to the project repository or introducing a custom storage format.
|
|
375
|
-
|
|
376
|
-
Removing the configured deadline simplifies child execution but permits indefinitely running work until manual interruption. This is a breaking configuration change:
|
|
377
|
-
files that still contain `timeoutMinutes` fail existing configuration validation until the `owner` removes the obsolete fields. Document the removal without adding legacy
|
|
378
|
-
compatibility code.
|
|
379
|
-
|
|
380
|
-
Manual cancellation uses Pi's in-process cancellation lifecycle, not termination of a separate operating-system process. It does not undo completed writes or introduce a
|
|
381
|
-
final model turn. `Maestro` uses Pi's cancellation and cleanup lifecycle; behavior of third-party integrations remains outside its compatibility contract.
|
|
382
|
-
|
|
383
|
-
The Pi minimum increases from the currently documented 1.0.0 to 1.5.0. Earlier hosts are outside the new compatibility contract. At decision time, the project has Pi
|
|
384
|
-
1.0.3 installed locally and the active harness uses Pi 1.5.0; the implementation must be verified against the selected baseline rather than treating the older local
|
|
385
|
-
installation as sufficient verification. This ADR changes no installed dependencies.
|
|
386
|
-
|
|
387
|
-
### Evidence
|
|
388
|
-
|
|
389
|
-
During the architecture discussion, the `owner` selected the SDK and task-and-handoff communication, then clarified the tool-access contract: the same working tools as
|
|
390
|
-
`Maestro`, plus child handoff tools, with the main `Maestro` extension excluded. The `owner` subsequently accepted that delegation tools from other extensions may remain
|
|
391
|
-
available, with their use forbidden by instructions rather than additional tool filters. The `owner` also confirmed that all three roles continue receiving global and
|
|
392
|
-
automatically discovered project instructions, as declared by `inheritGlobalContext: true` and `inheritProjectContext: true` in the existing role definitions. All three
|
|
393
|
-
roles also retain access to the skill catalog and can load relevant skill instructions, consistent with their existing `inheritSkills: true` setting and subject to role
|
|
394
|
-
and tool restrictions. After discussing bounded display sizes, the `owner` selected Pi's standard tool-progress presentation rather than custom rendering, while retaining
|
|
395
|
-
recent assistant text without sending intermediate text to the main model. The `owner` selected persistent transcripts in Pi's native session format, while keeping each
|
|
396
|
-
child conversation fresh. The `owner` chose to receive the saved session path and use direct file inspection or Pi's native HTML export, without a `Maestro` transcript
|
|
397
|
-
inspector. The `owner` chose the simplest execution option: no automatic child deadline, with the timeout settings removed from configuration. The `owner` accepted that
|
|
398
|
-
existing TypeBox-based validation rejects configurations retaining `timeoutMinutes`, without migration or compatibility handling, and confirmed the existing
|
|
399
|
-
execution-error policy: stop and report, retain files, and leave follow-up to the `owner`, without automatic retries, repair, or rollback. The `owner` selected manual
|
|
400
|
-
interruption through `session.abort()` followed by session cleanup, without a final model turn or synthetic `handoff`, and placed saved child sessions in `subagents/`
|
|
401
|
-
beneath Pi's project session directory, not inside the repository. The `owner` chose Pi 1.5.0 as the minimum supported version, without fallbacks for earlier hosts. The
|
|
402
|
-
`owner` explicitly excluded compatibility handling for external integrations from scope; no custom checks, adapters, or reduced-capacity fallback system are required.
|
|
403
|
-
Existing boundaries are described in [subagent integration](docs/subagent-integration.md),
|
|
404
|
-
[delegation](https://github.com/emilioSp/pi-maestro/blob/9d020b9177e93333736ade265db5e332fbb2a291/src/tools/utils/pi-subagent-delegation.ts),
|
|
405
|
-
[builder execution](src/tools/main/run-builder.ts), and the
|
|
406
|
-
[child extension](https://github.com/emilioSp/pi-maestro/blob/9d020b9177e93333736ade265db5e332fbb2a291/extensions/maestro-subagent.ts). These links describe the current
|
|
407
|
-
implementation, not the planned SDK replacement.
|
|
408
|
-
|
|
409
|
-
## ADR-011: Separate initial setup UI from configuration rules
|
|
410
|
-
|
|
411
|
-
### Status
|
|
412
|
-
|
|
413
|
-
Accepted in the approved MAESTRO-19 design. Implemented for verification.
|
|
414
|
-
|
|
415
|
-
### Context
|
|
416
|
-
|
|
417
|
-
Initial configuration needs searchable model selection without access to Pi's private session runtime. The `owner` selected public Pi components and strict separation
|
|
418
|
-
between graphical controls and configuration rules.
|
|
419
|
-
|
|
420
|
-
### Decision
|
|
421
|
-
|
|
422
|
-
Use `ctx.ui.select()` for short choices and compose public `Input`, `SelectList`, and Pi filtering through `ctx.ui.custom()` for model selection. Keep graphical modules
|
|
423
|
-
in `src/ui/`, configuration rules and persistence in `src/config/`, and coordination in `src/maestro/setupConfiguration.ts`.
|
|
424
|
-
|
|
425
|
-
Keep completed role selections in memory for one command. Replace a role only after both nested choices finish. Configuration rules derive explicit phase flags from those
|
|
426
|
-
completed selections; confirmation is the only persistence boundary. Thinking choices preserve Pi's supported-level order and start at its first level for both initial
|
|
427
|
-
selections and replacements, without preferring `off`.
|
|
428
|
-
|
|
429
|
-
### Consequences
|
|
430
|
-
|
|
431
|
-
Setup needs no private runtime access, separate model runtime, new dependency, or persistent draft. UI components receive supplied choices rather than deciding model
|
|
432
|
-
requirements or phase rules. Initial setup is limited to interactive terminal mode.
|
|
433
|
-
|
|
434
|
-
### Evidence
|
|
435
|
-
|
|
436
|
-
[Approved design](.specs/20261108-141712-maestro-19-guide-initial-configuration-with-pi-selectors/design.md) and
|
|
437
|
-
[configuration guidance](docs/configuration.md#initial-setup).
|
|
438
|
-
|
|
439
|
-
## ADR-012: Filter main Maestro registrations after native discovery
|
|
440
|
-
|
|
441
|
-
### Status
|
|
442
|
-
|
|
443
|
-
Accepted in the approved [design](.specs/20261108-222326-simplify-child-extension-loading-with-the-native-pi-filter/design.md). Implemented for review. Supersedes only
|
|
444
|
-
the pre-load exclusion constraint in [ADR-010](#adr-010-use-the-pi-sdk-for-sequential-agent-delegation).
|
|
445
|
-
|
|
446
|
-
### Context
|
|
447
|
-
|
|
448
|
-
Child preparation duplicated Pi's package discovery to exclude the main `Maestro` extension before initialization.
|
|
449
|
-
|
|
450
|
-
### Decision
|
|
451
|
-
|
|
452
|
-
Use Pi's native discovery and configured selection. Filter the loaded main `Maestro` extension through `extensionsOverride` before constructing the child session.
|
|
453
|
-
|
|
454
|
-
### Consequences
|
|
455
|
-
|
|
456
|
-
Main-extension initialization may register tools, commands, and handlers, but must not mutate parent state or start resources before filtering. SDK sessions share a
|
|
457
|
-
process; filtering removes registrations from the child runtime, not initialization side effects.
|