@emiliosp/pi-maestro 0.10.0 → 0.11.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 +53 -9
- package/CHANGELOG.md +79 -36
- package/MISSION.md +4 -2
- package/README.md +31 -15
- package/ROADMAP.md +150 -61
- package/TECH_STACK.md +12 -11
- package/agents/simplifier.md +214 -0
- package/agents/verifier.md +1 -16
- package/docs/configuration.md +27 -16
- package/docs/glossary.md +41 -36
- package/docs/subagent-integration.md +23 -13
- package/docs/workflow.md +103 -71
- package/extensions/maestro-subagent.ts +3 -1
- package/extensions/maestro.ts +10 -0
- package/package.json +1 -1
- package/src/MaestroPaths.ts +8 -32
- package/src/artifacts/builder-handoff/assertBuilderHandoff.ts +23 -29
- package/src/artifacts/simplifier-handoff/assertSimplifierHandoff.ts +56 -0
- package/src/artifacts/simplifier-handoff/readSimplifierHandoff.ts +29 -0
- package/src/artifacts/simplifier-handoff/schema.ts +26 -0
- package/src/artifacts/verifier-handoff/assertVerifierHandoff.ts +14 -18
- package/src/config/assertConfiguration.ts +1 -1
- package/src/config/defaults.ts +7 -0
- package/src/config/loadConfiguration.ts +21 -50
- package/src/config/schema.ts +3 -0
- package/src/maestro/checks/assertEnvironment.ts +7 -3
- package/src/maestro/instructions/getMaestroInstructions.ts +27 -9
- package/src/maestro/status/formatMaestroStatus.ts +3 -0
- package/src/specs/create.ts +7 -24
- package/src/tools/child/record-simplifier-handoff.ts +73 -0
- package/src/tools/main/resolve-findings.ts +4 -3
- package/src/tools/main/run-builder.ts +38 -48
- package/src/tools/main/run-simplifier.ts +182 -0
- package/src/tools/main/run-verifier.ts +14 -25
- package/src/utils/path-within-or-equal.ts +3 -4
- package/src/workflow/builder/resolveEscalations.ts +43 -27
- package/src/workflow/roles.ts +2 -1
- package/src/workflow/simplifier/completeSimplifierPass.ts +57 -0
- package/src/workflow/state/schema.ts +4 -0
- package/src/workflow/transitions.ts +13 -6
- package/src/workflow/utils/getAgentRole.ts +5 -1
- package/src/workflow/verifier/resolveFindings.ts +53 -87
- package/templates/spec.md +9 -5
package/ROADMAP.md
CHANGED
|
@@ -1,42 +1,74 @@
|
|
|
1
1
|
# Roadmap
|
|
2
2
|
|
|
3
|
-
This roadmap records planned outcomes, not permission to implement them. The `owner` selects work and approves its `specification` before implementation starts. Detailed
|
|
3
|
+
This roadmap records planned outcomes, not permission to implement them. The `owner` selects work and approves its `specification` before implementation starts. Detailed
|
|
4
|
+
requirements, technical decisions, and `acceptance criteria` belong in that `specification`.
|
|
4
5
|
|
|
5
|
-
"Now" is the current priority. "Next" follows it.
|
|
6
|
+
"Now" is the current priority. "Next" follows it. "Later" contains uncommitted ideas with no promised order or date.
|
|
6
7
|
|
|
7
8
|
Item identifiers remain stable when priorities change. The `owner` approves changes to priorities and scope.
|
|
8
9
|
|
|
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
|
+
|
|
9
34
|
## Completed
|
|
10
35
|
|
|
11
36
|
### R-01: Improve status presentation and activation feedback
|
|
12
37
|
|
|
13
|
-
The status bar uses phase icons, theme colors, and shortened `spec` IDs. Successful activation shows the configured `builder` and `verifier` settings without adding the
|
|
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`.
|
|
14
40
|
|
|
15
41
|
#### Evidence
|
|
16
42
|
|
|
17
|
-
[Specification](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/spec.md), [verifier report](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/handoffs/verifier/V1.json),
|
|
43
|
+
[Specification](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/spec.md), [verifier report](.specs/20261007-170438-update-maestro-status-bar-with-agent-models-theme-colors-and-phase-icons/handoffs/verifier/V1.json),
|
|
44
|
+
and [merged PR #26](https://github.com/emilioSp/pi-maestro/pull/26).
|
|
18
45
|
|
|
19
46
|
### R-02: Store escalations and owner decisions in builder handoffs
|
|
20
47
|
|
|
21
|
-
Numbered `builder` `handoffs` contain multiple `escalation` questions and their `owner` resolutions. The `owner` resolves all current questions in one batch. Earlier
|
|
48
|
+
Numbered `builder` `handoffs` contain multiple `escalation` questions and their `owner` resolutions. The `owner` resolves all current questions in one batch. Earlier
|
|
49
|
+
`handoffs` remain available as history. All 10 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
22
50
|
|
|
23
51
|
#### Evidence
|
|
24
52
|
|
|
25
|
-
[Specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md), [verifier report](.specs/20261008-132344-store-escalations-in-builder-handoffs/handoffs/verifier/V1.json),
|
|
53
|
+
[Specification](.specs/20261008-132344-store-escalations-in-builder-handoffs/spec.md), [verifier report](.specs/20261008-132344-store-escalations-in-builder-handoffs/handoffs/verifier/V1.json),
|
|
54
|
+
and [merged PR #27](https://github.com/emilioSp/pi-maestro/pull/27).
|
|
26
55
|
|
|
27
56
|
### R-03: Route builder failures through owner escalations
|
|
28
57
|
|
|
29
|
-
Released in `0.9.0`. The `builder` reports only `done` or `escalation`. Reportable technical problems use the existing `owner` `escalation` process. Individual `probe`
|
|
58
|
+
Released in `0.9.0`. The `builder` reports only `done` or `escalation`. Reportable technical problems use the existing `owner` `escalation` process. Individual `probe`
|
|
59
|
+
results retain `failed`. Execution errors and missing or invalid saved results still stop the workflow without automatic recovery.
|
|
30
60
|
|
|
31
61
|
All 8 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
32
62
|
|
|
33
63
|
#### Evidence
|
|
34
64
|
|
|
35
|
-
[Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md), [verifier report](.specs/20261013-101454-route-builder-failures-through-owner-escalations/handoffs/verifier/V1.json),
|
|
65
|
+
[Specification](.specs/20261013-101454-route-builder-failures-through-owner-escalations/spec.md), [verifier report](.specs/20261013-101454-route-builder-failures-through-owner-escalations/handoffs/verifier/V1.json),
|
|
66
|
+
and [merged PR #32](https://github.com/emilioSp/pi-maestro/pull/32).
|
|
36
67
|
|
|
37
68
|
### R-12: Format glossary terms consistently
|
|
38
69
|
|
|
39
|
-
Applied glossary formatting across the documentation and recorded its exclusions in `AGENTS.md` and the documentation audit skill. The approved change document uses the
|
|
70
|
+
Applied glossary formatting across the documentation and recorded its exclusions in `AGENTS.md` and the documentation audit skill. The approved change document uses the
|
|
71
|
+
term `spec`. The `owner` confirmed completion.
|
|
40
72
|
|
|
41
73
|
#### Evidence
|
|
42
74
|
|
|
@@ -44,19 +76,23 @@ Applied glossary formatting across the documentation and recorded its exclusions
|
|
|
44
76
|
|
|
45
77
|
### R-14: Introduce Maestro at activation
|
|
46
78
|
|
|
47
|
-
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
|
|
79
|
+
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
|
|
80
|
+
and does not add session history or start a model request.
|
|
48
81
|
|
|
49
|
-
Active instructions identify absolute paths to the installed README and documentation directory. `Maestro` reads relevant documentation on demand without automatically
|
|
82
|
+
Active instructions identify absolute paths to the installed README and documentation directory. `Maestro` reads relevant documentation on demand without automatically
|
|
83
|
+
loading its contents.
|
|
50
84
|
|
|
51
85
|
All 6 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
52
86
|
|
|
53
87
|
#### Evidence
|
|
54
88
|
|
|
55
|
-
[Specification](.specs/20261013-171954-introduce-maestro-at-activation/spec.md), [verifier report](.specs/20261013-171954-introduce-maestro-at-activation/handoffs/verifier/V1.json),
|
|
89
|
+
[Specification](.specs/20261013-171954-introduce-maestro-at-activation/spec.md), [verifier report](.specs/20261013-171954-introduce-maestro-at-activation/handoffs/verifier/V1.json),
|
|
90
|
+
and [merged PR #33](https://github.com/emilioSp/pi-maestro/pull/33).
|
|
56
91
|
|
|
57
92
|
### R-15: Rename the test support directory
|
|
58
93
|
|
|
59
|
-
Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture paths, lint configuration, and project instructions. This follows the global instruction to
|
|
94
|
+
Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture paths, lint configuration, and project instructions. This follows the global instruction to
|
|
95
|
+
keep fixtures under `tests/fixtures`. Source tests remain next to their source files. Historical `handoffs` retain their recorded paths.
|
|
60
96
|
|
|
61
97
|
#### Evidence
|
|
62
98
|
|
|
@@ -64,51 +100,65 @@ Renamed `test/` to `tests/` at the owner's request. Updated imports, fixture pat
|
|
|
64
100
|
|
|
65
101
|
### R-16: Verify code quality against AGENTS.md instructions
|
|
66
102
|
|
|
67
|
-
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.
|
|
103
|
+
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.
|
|
104
|
+
All existing duties remain unchanged, including independent verification of every `acceptance criterion`.
|
|
68
105
|
|
|
69
|
-
Instruction-violation `findings` identify the instruction file, quote the rule, and explain the violating code through existing evidence fields. Missing files or
|
|
106
|
+
Instruction-violation `findings` identify the instruction file, quote the rule, and explain the violating code through existing evidence fields. Missing files or
|
|
107
|
+
code-quality directives cause only the added review to be skipped. Personal style preferences are not requirements.
|
|
70
108
|
|
|
71
|
-
All 5 `acceptance criteria` passed through independent inspection of the written guidance, with no `verifier` `findings`. No additional model trials were performed. The
|
|
109
|
+
All 5 `acceptance criteria` passed through independent inspection of the written guidance, with no `verifier` `findings`. No additional model trials were performed. The
|
|
110
|
+
saved workflow reached `candidate-ready`.
|
|
72
111
|
|
|
73
112
|
#### Evidence
|
|
74
113
|
|
|
75
|
-
[Specification](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/spec.md), [verifier report](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/handoffs/verifier/V1.json),
|
|
114
|
+
[Specification](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/spec.md), [verifier report](.specs/20261013-185941-verify-code-quality-against-agents-md-instructions/handoffs/verifier/V1.json),
|
|
115
|
+
and [merged PR #34](https://github.com/emilioSp/pi-maestro/pull/34).
|
|
76
116
|
|
|
77
117
|
### R-06: Check subagent extensions at activation
|
|
78
118
|
|
|
79
|
-
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
|
|
119
|
+
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
|
|
120
|
+
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
|
|
121
|
+
extension availability, not child execution readiness.
|
|
80
122
|
|
|
81
123
|
All 7 `acceptance criteria` passed using controlled replies and code inspection, with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
82
124
|
|
|
83
|
-
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
|
|
125
|
+
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
|
|
126
|
+
verification.
|
|
84
127
|
|
|
85
128
|
#### Evidence
|
|
86
129
|
|
|
87
|
-
[Specification](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/spec.md), [verifier report](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/handoffs/verifier/V1.json),
|
|
130
|
+
[Specification](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/spec.md), [verifier report](.specs/20261013-194407-check-pi-subagents-availability-with-ping-at-activation/handoffs/verifier/V1.json),
|
|
131
|
+
and [merged PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
|
|
88
132
|
|
|
89
133
|
### R-05: Keep acceptance criterion numbering continuous
|
|
90
134
|
|
|
91
|
-
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
|
|
135
|
+
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
|
|
136
|
+
files unchanged.
|
|
92
137
|
|
|
93
|
-
`Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner`
|
|
138
|
+
`Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner`
|
|
139
|
+
approval is required.
|
|
94
140
|
|
|
95
141
|
All 3 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
96
142
|
|
|
97
143
|
#### Evidence
|
|
98
144
|
|
|
99
|
-
[Specification](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/spec.md), [verifier report](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/handoffs/verifier/V1.json),
|
|
145
|
+
[Specification](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/spec.md), [verifier report](.specs/20261013-202811-check-acceptance-criterion-numbering-before-builder-execution/handoffs/verifier/V1.json),
|
|
146
|
+
and [merged PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
|
|
100
147
|
|
|
101
148
|
### R-10: Match handoff criteria to the approved spec
|
|
102
149
|
|
|
103
|
-
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
|
|
150
|
+
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
|
|
151
|
+
saving a report or changing phase. Extra report IDs remain allowed. Existing report validation is unchanged, and no new check rejects duplicate `spec` IDs.
|
|
104
152
|
|
|
105
153
|
Both `acceptance criteria` passed independent verification with no `findings`. The saved workflow reached `candidate-ready`.
|
|
106
154
|
|
|
107
|
-
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
|
|
155
|
+
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
|
|
156
|
+
role. These changes are outside the completed independent verification. The final `npm run check` passed all 227 tests and coverage thresholds.
|
|
108
157
|
|
|
109
158
|
#### Evidence
|
|
110
159
|
|
|
111
|
-
[Specification](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md), [verifier report](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/handoffs/verifier/V1.json),
|
|
160
|
+
[Specification](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md), [verifier report](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/handoffs/verifier/V1.json),
|
|
161
|
+
and [merged PR #37](https://github.com/emilioSp/pi-maestro/pull/37).
|
|
112
162
|
|
|
113
163
|
### R-17: Record escalation resolutions when the spec changes
|
|
114
164
|
|
|
@@ -121,11 +171,11 @@ Each `resolution` records the owner's chosen solution and reason. A decision req
|
|
|
121
171
|
|
|
122
172
|
`Maestro` records the complete decision batch through `maestro_resolve_escalations` before changing phase.
|
|
123
173
|
|
|
124
|
-
| Decision
|
|
125
|
-
|
|
126
|
-
| No `spec` change
|
|
127
|
-
| `Spec` change required
|
|
128
|
-
| Revised `spec` receives renewed `GREEN FLAG` | `drafting-spec` → `ready-for-builder` through separate `maestro_mark_spec_ready` approval.
|
|
174
|
+
| Decision | Next phase and action |
|
|
175
|
+
|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|
|
|
176
|
+
| No `spec` change | `escalation-decisions` → `ready-for-builder`. The `builder` continues under the approved `spec`, without renewed approval. |
|
|
177
|
+
| `Spec` change required | `escalation-decisions` → `drafting-spec`. The `owner` and `Maestro` revise and review the same `spec`. |
|
|
178
|
+
| Revised `spec` receives renewed `GREEN FLAG` | `drafting-spec` → `ready-for-builder` through separate `maestro_mark_spec_ready` approval. |
|
|
129
179
|
|
|
130
180
|
Direct `spec` approval from `escalation-decisions` is rejected. Recording answers does not move to `ready-for-verifier`; that phase requires a completed `builder` `pass`.
|
|
131
181
|
|
|
@@ -147,25 +197,90 @@ Implemented the approved revision route. `Maestro` records every current `findin
|
|
|
147
197
|
The `owner` reviews the same revised `spec` and gives renewed `GREEN FLAG` before separate approval and another `builder` `run`.
|
|
148
198
|
Revision takes priority in mixed batches. Direct approval from `finding-decisions` is rejected.
|
|
149
199
|
|
|
150
|
-
Later event naming cleanup identifies `builder` and `owner` actions explicitly. Both revision routes use `OWNER_REQUEST_SPEC_REVISION` without changing the phase flow.
|
|
200
|
+
Later event naming cleanup identifies `builder` and `owner` actions explicitly. Both revision routes use `OWNER_REQUEST_SPEC_REVISION` without changing the phase flow.
|
|
201
|
+
Batch resolution uses `RESOLVE_ESCALATIONS`, and the status label refers to `escalations` in the plural. The saved decision phases are named `escalation-decisions` and
|
|
202
|
+
`finding-decisions`.
|
|
203
|
+
|
|
204
|
+
#### Evidence
|
|
205
|
+
|
|
206
|
+
[Specification](.specs/20261015-154812-route-finding-driven-spec-revisions-through-drafting-spec/spec.md)
|
|
207
|
+
and [resolution integration tests](src/tools/main/resolve-findings.integration.test.ts).
|
|
208
|
+
|
|
209
|
+
### R-18: Label acceptance criterion coverage
|
|
210
|
+
|
|
211
|
+
Implemented with R-19 as one task, as selected by the `owner`.
|
|
212
|
+
The `spec` template and `Maestro` guidance require one `Coverage` label per `acceptance criterion`:
|
|
213
|
+
|
|
214
|
+
| Label | Purpose |
|
|
215
|
+
|-------------|----------------------------------------------|
|
|
216
|
+
| `success` | A valid action produces the required result. |
|
|
217
|
+
| `failure` | An invalid action is correctly rejected. |
|
|
218
|
+
| `unchanged` | The change preserves existing behavior. |
|
|
219
|
+
|
|
220
|
+
Use `unchanged` when the criterion explicitly checks behavior that the change must preserve.
|
|
221
|
+
Labels describe scenarios, not test outcomes. A `failure` scenario passes when the invalid action is correctly rejected.
|
|
222
|
+
A `spec` does not need all three categories.
|
|
223
|
+
`Maestro` includes labels when presenting criteria to the `owner` and checks them against scenarios and `expected results` during review.
|
|
224
|
+
Approval validation and `handoff` formats remain unchanged.
|
|
225
|
+
|
|
226
|
+
The existing creation integration test now checks that the generated `spec` includes the coverage field.
|
|
227
|
+
The final `npm run check` passed all 238 tests and coverage thresholds. No model trials were performed.
|
|
151
228
|
|
|
152
229
|
#### Evidence
|
|
153
230
|
|
|
154
|
-
[
|
|
231
|
+
[Spec template](templates/spec.md), [Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [creation integration test](src/specs/create.integration.test.ts),
|
|
232
|
+
and [workflow documentation](docs/workflow.md#acceptance-criteria).
|
|
233
|
+
|
|
234
|
+
### R-19: Avoid acceptance criteria already covered by tests
|
|
235
|
+
|
|
236
|
+
Implemented with R-18. `Maestro` inspects existing tests before writing `acceptance criteria`.
|
|
237
|
+
It omits a criterion only when a test covers the same starting conditions, action, and `expected result`.
|
|
238
|
+
Partial or uncertain coverage does not justify omission. Similar tests do not count.
|
|
239
|
+
|
|
240
|
+
During `spec` review, `Maestro` removes criteria whose exact scenarios already have test coverage.
|
|
241
|
+
It keeps numbering continuous from `AC1` and updates affected references. Required behavior remains documented in the requirements and constraints.
|
|
242
|
+
The same rules apply during `spec` revisions. No automatic approval check was added.
|
|
243
|
+
|
|
244
|
+
Verification consisted of inspecting the written guidance and running `npm run check`. No model trials were performed.
|
|
245
|
+
|
|
246
|
+
#### Evidence
|
|
247
|
+
|
|
248
|
+
[Maestro guidance](src/maestro/instructions/getMaestroInstructions.ts), [spec template](templates/spec.md),
|
|
249
|
+
and [workflow documentation](docs/workflow.md#acceptance-criteria).
|
|
155
250
|
|
|
156
251
|
## Now
|
|
157
252
|
|
|
253
|
+
### R-21: Add a simplifier with one clear purpose per agent
|
|
254
|
+
|
|
255
|
+
Implemented under the [specification](.specs/20261016-090319-add-a-dedicated-simplifier-after-verification/spec.md). Independent review is pending.
|
|
256
|
+
The `builder` implements the approved `spec`. The `verifier` checks its `acceptance criteria`. The `simplifier` refactors accepted code for clarity.
|
|
257
|
+
The extra code-quality review introduced in R-16 is removed from the verifier's instructions.
|
|
258
|
+
|
|
259
|
+
Successful verification and rejection of all current `findings` save `simplifier-running`.
|
|
260
|
+
`Maestro` calls `maestro_run_simplifier` without another approval or verification cycle.
|
|
261
|
+
Only that tool checks Git readiness. If Git is unavailable, it warns and saves `candidate-ready` without delegation or a `simplifier` `handoff`.
|
|
262
|
+
|
|
263
|
+
The `simplifier` selects all uncommitted code changes, including pre-existing staged, unstaged, and untracked files.
|
|
264
|
+
It preserves observable behavior and the accepted check baseline. Rejected `findings` remain rejected, not passed.
|
|
265
|
+
Required caller updates can include initially unchanged files. Unrelated refactoring, index changes, and automatic commits are excluded.
|
|
266
|
+
|
|
267
|
+
A completed `pass` saves the fixed, unnumbered `handoffs/simplifier/S.json`, then saves `candidate-ready`.
|
|
268
|
+
The report contains refactored files, a summary, and notes. No refactoring is required when selected code is already clear.
|
|
269
|
+
Maestro's final summary separates this report from independent `verifier` evidence.
|
|
270
|
+
|
|
158
271
|
## Next
|
|
159
272
|
|
|
160
273
|
## Later
|
|
161
274
|
|
|
162
|
-
These items need scope review before `specification` approval. Existing behavior must be checked before adding new code. Dependencies between these items are not yet
|
|
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.
|
|
163
277
|
|
|
164
278
|
### R-04: Rename the npm package
|
|
165
279
|
|
|
166
280
|
#### Objective
|
|
167
281
|
|
|
168
|
-
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
|
|
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.
|
|
169
284
|
|
|
170
285
|
Compatibility with installations under the old name must be decided in the `specification`. No `specification` is approved yet.
|
|
171
286
|
|
|
@@ -202,29 +317,3 @@ Explore how `Maestro` can reconcile saved `artifacts` and workflow state. The re
|
|
|
202
317
|
#### Completed when
|
|
203
318
|
|
|
204
319
|
Not yet defined. The `owner` must define the intended outcome, recovery boundaries, and completion condition before this item can move forward.
|
|
205
|
-
|
|
206
|
-
### R-18: Label acceptance criterion coverage
|
|
207
|
-
|
|
208
|
-
#### Objective
|
|
209
|
-
|
|
210
|
-
Label each `acceptance criterion` in a `spec` as success, failure, or keep current behavior unchanged.
|
|
211
|
-
The label makes the purpose of its `probe` clear. Failure means an invalid action is correctly rejected.
|
|
212
|
-
|
|
213
|
-
#### Completed when
|
|
214
|
-
|
|
215
|
-
The `spec` template and `Maestro` guidance require a coverage label for every `acceptance criterion`.
|
|
216
|
-
Each label matches the scenario and `expected result`. A `spec` does not need all three categories when they do not apply.
|
|
217
|
-
|
|
218
|
-
### R-19: Avoid acceptance criteria already covered by tests
|
|
219
|
-
|
|
220
|
-
#### Objective
|
|
221
|
-
|
|
222
|
-
Do not add an `acceptance criterion` when an existing test already covers the same starting conditions, action, and `expected result`.
|
|
223
|
-
|
|
224
|
-
Similar tests do not count if they miss the proposed scenario.
|
|
225
|
-
|
|
226
|
-
#### Completed when
|
|
227
|
-
|
|
228
|
-
`Maestro` guidance requires inspection of existing tests before adding `acceptance criteria`.
|
|
229
|
-
During `spec` review, `Maestro` removes criteria already covered by tests and keeps numbering continuous.
|
|
230
|
-
Required behavior remains documented in the `spec`.
|
package/TECH_STACK.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# Tech stack
|
|
2
2
|
|
|
3
|
-
`Maestro` is a source-only TypeScript package that uses ECMAScript modules (ESM). Pi loads the TypeScript source directly. The package has no build step or compiled
|
|
3
|
+
`Maestro` is a source-only TypeScript package that uses ECMAScript modules (ESM). Pi loads the TypeScript source directly. The package has no build step or compiled
|
|
4
|
+
`dist/` directory.
|
|
4
5
|
|
|
5
|
-
| Technology
|
|
6
|
-
|
|
7
|
-
| TypeScript
|
|
8
|
-
| Node.js
|
|
9
|
-
| Pi
|
|
10
|
-
| `pi-subagents`
|
|
11
|
-
| TypeBox
|
|
12
|
-
| Vitest with coverage
|
|
13
|
-
| Biome
|
|
14
|
-
| Oxlint with `oxlint-anti-slop` | Additional lint and anti-slop checks.
|
|
6
|
+
| Technology | Use |
|
|
7
|
+
|--------------------------------|---------------------------------------------------------------------------------------------------|
|
|
8
|
+
| TypeScript | Application code and static type checks with `tsc --noEmit`. |
|
|
9
|
+
| Node.js | Runtime. |
|
|
10
|
+
| Pi | Extension host, agent APIs, and terminal interface. |
|
|
11
|
+
| `pi-subagents` | `Builder`, `verifier`, and `simplifier` execution and activity tracking. |
|
|
12
|
+
| TypeBox | Schemas and runtime validation for configuration, workflow state, tool inputs, and agent reports. |
|
|
13
|
+
| Vitest with coverage | Unit tests, integration tests, and code coverage. |
|
|
14
|
+
| Biome | Formatting and lint checks. |
|
|
15
|
+
| Oxlint with `oxlint-anti-slop` | Additional lint and anti-slop checks. |
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: simplifier
|
|
3
|
+
package: maestro
|
|
4
|
+
description: Refactors accepted Maestro code for clarity without changing behavior.
|
|
5
|
+
systemPromptMode: replace
|
|
6
|
+
inheritProjectContext: true
|
|
7
|
+
inheritGlobalContext: true
|
|
8
|
+
inheritSkills: true
|
|
9
|
+
subagentOnlyExtensions: ../extensions/maestro-subagent.ts
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Simplifier
|
|
13
|
+
|
|
14
|
+
Refactor accepted code for clarity. Work only in the canonical project directory supplied by Maestro.
|
|
15
|
+
Communicate with Maestro, never directly with the owner. Do not delegate, approve work, implement new behavior, or raise findings or escalations.
|
|
16
|
+
|
|
17
|
+
## Read the accepted contract
|
|
18
|
+
|
|
19
|
+
1. Use the exact project directory and `specId` supplied by Maestro. Use `specDirectory` from `.pi/maestro.json`, or `.specs` when unset.
|
|
20
|
+
2. Read `<specDirectory>/<specId>/spec.md`, relevant prototypes, `workflow.json`, and applicable `AGENTS.md` files.
|
|
21
|
+
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 active instructions.
|
|
22
|
+
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 repair protocol state.
|
|
23
|
+
|
|
24
|
+
You start with a fresh context. The accepted behavior includes existing failures explicitly accepted through rejected verifier findings. For example, if V1/F1 reports an existing failing translation check and the owner rejects it as "Outside approved scope", that failure can remain. Do not fix F1, change its test to pass, or introduce another check failure. Rejected findings do not become passed verification.
|
|
25
|
+
Preserve the accepted baseline and introduce no new check failures. Do not repair rejected findings or modify existing tests to make checks pass.
|
|
26
|
+
Do not edit the frozen spec, prototypes, workflow state, or earlier handoffs through any tool. Record your result only through `maestro_record_simplifier_handoff`.
|
|
27
|
+
|
|
28
|
+
## Discover the file scope
|
|
29
|
+
|
|
30
|
+
Use `git status --porcelain=v1 -z --untracked-files=all -- .` to discover all current uncommitted code changes within the project directory, including pre-existing staged, unstaged, and untracked files. Paths are repository-relative: convert them to project-relative paths if the project directory is a repository subdirectory. Parse the NUL-separated output safely, including paths with spaces and both paths in rename or copy records. Read the selected files' diffs and current contents. Deleted files offer no live code to refactor.
|
|
31
|
+
Committed changes alone do not select files. There is no starting commit, builder file list, or non-Git fallback.
|
|
32
|
+
Required caller updates may include initially unchanged code files. Exclude unrelated refactoring.
|
|
33
|
+
Do not reset pre-existing changes or modify the Git index or history. Do not create commits or checkpoints.
|
|
34
|
+
If the selected code is already clear or no code files are selected, no refactoring is required.
|
|
35
|
+
|
|
36
|
+
## Checks and result
|
|
37
|
+
|
|
38
|
+
Inspect repository scripts before running checks. Follow applicable project conventions and required commands. Compare check results with the accepted baseline, not an invented all-green baseline. Undo your own simplifications if they introduce failures or make code harder to understand or review. Preserve all pre-existing content and changes.
|
|
39
|
+
Remove temporary files and restore only temporary verification changes before recording the result. Keep successful refactoring.
|
|
40
|
+
Call `maestro_record_simplifier_handoff` exactly once with `specId`, `refactoredFiles`, `summary`, and `notes`.
|
|
41
|
+
List only files actually refactored by this agent, including required caller updates. Use project-relative paths within the project root. Reviewed files left unchanged are not refactored files. An empty array is valid.
|
|
42
|
+
The tool supplies version `1.0.0`, saves the fixed unnumbered `handoffs/simplifier/S.json`, then applies `SIMPLIFIER_DONE` to save `candidate-ready`. Do not add acceptance results, findings, escalations, status, or sequence numbers.
|
|
43
|
+
After success, return the saved summary and artifact path to Maestro and stop. Do not run another verifier pass.
|
|
44
|
+
If execution, checks, or cleanup prevent safe completion, report the exact problem to Maestro and stop without manufacturing a successful result. An explicitly accepted existing failure alone does not prevent completion.
|
|
45
|
+
If submission fails, inspect the error, workflow, and artifacts. Correct a validation rejection only when nothing was written. If an artifact or phase was partially written, report it and stop without retrying, deleting the artifact, or changing protocol files.
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
Simplify code by reducing complexity while preserving exact behavior. The goal is not fewer lines — it's code that is easier to read, understand, modify, and debug. Every simplification must pass a simple test: "Would a new team member understand this faster than the original?"
|
|
50
|
+
|
|
51
|
+
## The Five Principles
|
|
52
|
+
|
|
53
|
+
### 1. Preserve Behavior Exactly
|
|
54
|
+
|
|
55
|
+
Don't change what the code does — only how it expresses it. All inputs, outputs, side effects, error behavior, and edge cases must remain identical. If you're not sure a simplification preserves behavior, don't make it.
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
ASK BEFORE EVERY CHANGE:
|
|
59
|
+
→ Does this produce the same output for every input?
|
|
60
|
+
→ Does this maintain the same error behavior?
|
|
61
|
+
→ Does this preserve the same side effects and ordering?
|
|
62
|
+
→ Do checks preserve the accepted baseline without test modification or new failures?
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Follow Project Conventions
|
|
66
|
+
|
|
67
|
+
Simplification means making code more consistent with the codebase, not imposing external preferences. Before simplifying:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
1. Read AGENTS.md / project conventions
|
|
71
|
+
2. Study how neighboring code handles similar patterns
|
|
72
|
+
3. Match the project's style for:
|
|
73
|
+
- Import ordering and module system
|
|
74
|
+
- Function declaration style
|
|
75
|
+
- Naming conventions
|
|
76
|
+
- Error handling patterns
|
|
77
|
+
- Type annotation depth
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Simplification that breaks project consistency is not simplification — it's churn.
|
|
81
|
+
|
|
82
|
+
### 3. Prefer Clarity Over Cleverness
|
|
83
|
+
|
|
84
|
+
Explicit code is better than compact code when the compact version requires a mental pause to parse.
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
// UNCLEAR: Dense ternary chain
|
|
88
|
+
const label = isNew ? 'New' : isUpdated ? 'Updated' : isArchived ? 'Archived' : 'Active';
|
|
89
|
+
|
|
90
|
+
// CLEAR: Readable mapping
|
|
91
|
+
function getStatusLabel(item: Item): string {
|
|
92
|
+
if (item.isNew) return 'New';
|
|
93
|
+
if (item.isUpdated) return 'Updated';
|
|
94
|
+
if (item.isArchived) return 'Archived';
|
|
95
|
+
return 'Active';
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
// UNCLEAR: Chained reduces with inline logic
|
|
101
|
+
const result = items.reduce((acc, item) => ({
|
|
102
|
+
...acc,
|
|
103
|
+
[item.id]: { ...acc[item.id], count: (acc[item.id]?.count ?? 0) + 1 }
|
|
104
|
+
}), {});
|
|
105
|
+
|
|
106
|
+
// CLEAR: Named intermediate step
|
|
107
|
+
const countById = new Map<string, number>();
|
|
108
|
+
for (const item of items) {
|
|
109
|
+
countById.set(item.id, (countById.get(item.id) ?? 0) + 1);
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
This object-to-Map example is one internal refactoring, not permission to change observable behavior. Update affected internal callers in the same refactoring: replace `result.a.count` with `result.get("a")` (using the Map as `result`). Keep observable inputs, outputs, side effects, ordering, errors, and edge cases identical. Do not use this change if the object itself is an observable output that must remain unchanged.
|
|
114
|
+
|
|
115
|
+
### 4. Maintain Balance
|
|
116
|
+
|
|
117
|
+
Simplification has a failure mode: over-simplification. Watch for these traps:
|
|
118
|
+
|
|
119
|
+
- **Inlining too aggressively** — removing a helper that gave a concept a name makes the call site harder to read
|
|
120
|
+
- **Combining unrelated logic** — two simple functions merged into one complex function is not simpler
|
|
121
|
+
- **Removing "unnecessary" abstraction** — some abstractions exist for extensibility or testability, not complexity
|
|
122
|
+
- **Optimizing for line count** — fewer lines is not the goal; easier comprehension is
|
|
123
|
+
|
|
124
|
+
### 5. Scope to What Changed
|
|
125
|
+
|
|
126
|
+
Default to simplifying recently modified code. Avoid drive-by refactors of unrelated code unless explicitly asked to broaden scope. Unscoped simplification creates noise in diffs and risks unintended regressions.
|
|
127
|
+
|
|
128
|
+
## The Simplification Process
|
|
129
|
+
|
|
130
|
+
### Step 1: Understand Before Touching (Chesterton's Fence)
|
|
131
|
+
|
|
132
|
+
Before changing or removing anything, understand why it exists. This is Chesterton's Fence: if you see a fence across a road and don't understand why it's there, don't tear it down. First understand the reason, then decide if the reason still applies.
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
BEFORE SIMPLIFYING, ANSWER:
|
|
136
|
+
- What is this code's responsibility?
|
|
137
|
+
- What calls it? What does it call?
|
|
138
|
+
- What are the edge cases and error paths?
|
|
139
|
+
- Are there tests that define the expected behavior?
|
|
140
|
+
- Why might it have been written this way? (Performance? Platform constraint? Historical reason?)
|
|
141
|
+
- Check history in project constitution and changelog: what was the original context for this code?
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
If you can't answer these, you're not ready to simplify. Read more context first.
|
|
145
|
+
|
|
146
|
+
### Step 2: Identify Simplification Opportunities
|
|
147
|
+
|
|
148
|
+
Scan for these patterns — each one is a concrete signal, not a vague smell:
|
|
149
|
+
|
|
150
|
+
**Structural complexity:**
|
|
151
|
+
|
|
152
|
+
| Pattern | Signal | Simplification |
|
|
153
|
+
|---------|--------|----------------|
|
|
154
|
+
| Deep nesting (3+ levels) | Hard to follow control flow | Extract conditions into guard clauses or helper functions |
|
|
155
|
+
| Long functions (50+ lines) | Multiple responsibilities | Split into focused functions with descriptive names |
|
|
156
|
+
| Nested ternaries | Requires mental stack to parse | Replace with if/else chains, switch, or lookup objects |
|
|
157
|
+
| Boolean parameter flags | `doThing(true, false, true)` | Replace with options objects or separate functions |
|
|
158
|
+
| Repeated conditionals | Same `if` check in multiple places | Extract to a well-named predicate function |
|
|
159
|
+
|
|
160
|
+
**Naming and readability:**
|
|
161
|
+
|
|
162
|
+
| Pattern | Signal | Simplification |
|
|
163
|
+
|---------|--------|----------------|
|
|
164
|
+
| Generic names | `data`, `result`, `temp`, `val`, `item` | Rename to describe the content: `userProfile`, `validationErrors` |
|
|
165
|
+
| Abbreviated names | `usr`, `cfg`, `btn`, `evt` | Use full words unless the abbreviation is universal (`id`, `url`, `api`) |
|
|
166
|
+
| Misleading names | Function named `get` that also mutates state | Rename to reflect actual behavior |
|
|
167
|
+
| Comments explaining "what" | `// increment counter` above `count++` | Delete the comment — the code is clear enough |
|
|
168
|
+
| Comments explaining "why" | `// Retry because the API is flaky under load` | Keep these — they carry intent the code can't express |
|
|
169
|
+
|
|
170
|
+
**Redundancy:**
|
|
171
|
+
|
|
172
|
+
| Pattern | Signal | Simplification |
|
|
173
|
+
|---------|--------|----------------|
|
|
174
|
+
| Duplicated logic | Same 5+ lines in multiple places | Extract to a shared function |
|
|
175
|
+
| Dead code | Unreachable branches, unused variables, commented-out blocks | Remove (after confirming it's truly dead) |
|
|
176
|
+
| Unnecessary abstractions | Wrapper that adds no value | Inline the wrapper, call the underlying function directly |
|
|
177
|
+
| Over-engineered patterns | Factory-for-a-factory, strategy-with-one-strategy | Replace with the simple direct approach |
|
|
178
|
+
| Redundant type assertions | Casting to a type that's already inferred | Remove the assertion |
|
|
179
|
+
|
|
180
|
+
### Step 3: Verify the Result
|
|
181
|
+
|
|
182
|
+
After all simplifications, step back and evaluate the whole:
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
COMPARE BEFORE AND AFTER:
|
|
186
|
+
- Is the simplified version genuinely easier to understand?
|
|
187
|
+
- Did you introduce any new patterns inconsistent with the codebase?
|
|
188
|
+
- Is the diff clean and reviewable?
|
|
189
|
+
- Would a teammate approve this change?
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
If the "simplified" version is harder to understand or review, revert. Not every simplification attempt succeeds.
|
|
193
|
+
|
|
194
|
+
## Common Rationalizations
|
|
195
|
+
|
|
196
|
+
| Rationalization | Reality |
|
|
197
|
+
|---|---|
|
|
198
|
+
| "It's working, no need to touch it" | Working code that's hard to read will be hard to fix when it breaks. Simplifying now saves time on every future change. |
|
|
199
|
+
| "Fewer lines is always simpler" | A 1-line nested ternary is not simpler than a 5-line if/else. Simplicity is about comprehension speed, not line count. |
|
|
200
|
+
| "I'll just quickly simplify this unrelated code too" | Unscoped simplification creates noisy diffs and risks regressions in code you didn't intend to change. Stay focused. |
|
|
201
|
+
| "The types make it self-documenting" | Types document structure, not intent. A well-named function explains *why* better than a type signature explains *what*. |
|
|
202
|
+
| "This abstraction might be useful later" | Don't preserve speculative abstractions. If it's not used now, it's complexity without value. Remove it and re-add when needed. |
|
|
203
|
+
| "The original author must have had a reason" | Maybe. Check git blame — apply Chesterton's Fence. But accumulated complexity often has no reason; it's just the residue of iteration under pressure. |
|
|
204
|
+
| "I'll refactor while adding this feature" | Separate refactoring from feature work. Mixed changes are harder to review, revert, and understand in history. |
|
|
205
|
+
|
|
206
|
+
## Red Flags
|
|
207
|
+
|
|
208
|
+
- Simplification that requires modifying tests to pass (you likely changed behavior)
|
|
209
|
+
- "Simplified" code that is longer and harder to follow than the original
|
|
210
|
+
- Renaming things to match your preferences rather than project conventions and AGENTS.md
|
|
211
|
+
- Removing error handling because "it makes the code cleaner"
|
|
212
|
+
- Simplifying code you don't fully understand
|
|
213
|
+
- Batching many simplifications into one large, hard-to-review commit
|
|
214
|
+
- Refactoring code outside the scope of the current task without being asked
|
package/agents/verifier.md
CHANGED
|
@@ -63,21 +63,6 @@ Use `probeStatus: passed` when the observed result matches the expected result.
|
|
|
63
63
|
Use `failed` for an observed probe failure and `not-run` for an unexecuted probe.
|
|
64
64
|
Include every spec criterion once. Never omit unrun criteria or fabricate evidence.
|
|
65
65
|
|
|
66
|
-
## Review code quality
|
|
67
|
-
|
|
68
|
-
If applicable `AGENTS.md` files contain code-quality directives, review affected code against those directives.
|
|
69
|
-
Review only code affected by the approved change. Do not audit unrelated project code.
|
|
70
|
-
This review supplements all existing duties. Independently verify every acceptance criterion even when this review finds instruction violations.
|
|
71
|
-
Do not treat personal style preferences as requirements or report findings based only on those preferences.
|
|
72
|
-
|
|
73
|
-
For each instruction violation, use the existing finding evidence fields:
|
|
74
|
-
|
|
75
|
-
1. Identify the applicable `AGENTS.md` file in `evidence.source` and quote the violated instruction exactly in `evidence.observation`.
|
|
76
|
-
2. Identify the violating code in `evidence.source` and explain how it violates that instruction in `evidence.observation`.
|
|
77
|
-
|
|
78
|
-
If no applicable `AGENTS.md` files exist, or they contain no code-quality directives, skip only this added review.
|
|
79
|
-
Missing files or directives are not errors or findings. Do not invent directives or require those files to be created.
|
|
80
|
-
|
|
81
66
|
## Record findings, not decisions
|
|
82
67
|
|
|
83
68
|
Record technical issues supported by fresh evidence. Do not add requirements, style preferences, or unrelated improvements.
|
|
@@ -115,5 +100,5 @@ Do not delete artifacts, change workflow state, or bypass the tool to force comp
|
|
|
115
100
|
If restoration or submission cannot be completed safely, report the exact blocker and remaining changes to Maestro and stop.
|
|
116
101
|
|
|
117
102
|
After a successful handoff, return a concise summary and the saved artifact path to Maestro and stop. Do not run more checks.
|
|
118
|
-
The handoff produces `finding-decisions` when findings exist and `
|
|
103
|
+
The handoff produces `finding-decisions` when findings exist and `simplifier-running` when none exist.
|
|
119
104
|
Report that tool result without deciding whether the owner must accept, reject, or fix any finding.
|