@emiliosp/pi-maestro 0.9.3 → 0.9.5
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 +12 -0
- package/ROADMAP.md +33 -54
- package/package.json +1 -1
- package/src/maestro/instructions/getMaestroInstructions.ts +9 -0
- package/src/workflow/builder/completeBuilderPass.ts +7 -1
- package/src/workflow/spec/markSpecReady.ts +11 -0
- package/src/workflow/utils/assertSpecAcceptanceCriteria.ts +24 -0
- package/src/workflow/verifier/completeVerifierPass.ts +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file summarizes meaningful changes to the codebase, including behavior, data formats, architecture, and development tools. Git tags identify version boundaries; GitHub Releases are not required. Version-only changes and routine maintenance are omitted.
|
|
4
4
|
|
|
5
|
+
## 0.9.4
|
|
6
|
+
|
|
7
|
+
1. Added numbering validation to `spec` approval. Matched `acceptance criterion` headings must start at `AC1` and continue without gaps. See [PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
|
|
8
|
+
2. Invalid numbering rejects approval before saving the workflow and leaves all saved files unchanged. No matching headings still permits approval.
|
|
9
|
+
3. Added `Maestro` guidance to correct only numbering and affected references, then retry with the existing `GREEN FLAG`. No additional `owner` approval is required before starting the `builder`.
|
|
10
|
+
|
|
11
|
+
## 0.9.3
|
|
12
|
+
|
|
13
|
+
1. Added a parent `pi-subagents` availability check during activation. A matching successful version 1 `ping` reply is required within 2000 ms. See [PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
|
|
14
|
+
2. Failed or invalid replies, emission errors, and timeouts prevent activation. The error includes "Maestro flow requires pi-subagents installed in the Pi environment." The check makes no automatic retry.
|
|
15
|
+
3. Preserved existing activation checks, UI-only notices, and unchanged session history. The availability check starts no agent, makes no model request, and does not run when turning `Maestro` off.
|
|
16
|
+
|
|
5
17
|
## 0.9.2
|
|
6
18
|
|
|
7
19
|
1. Added code-quality review to `verifier` guidance for code affected by the approved change when applicable `AGENTS.md` directives exist. See [PR #34](https://github.com/emilioSp/pi-maestro/pull/34). All existing verification duties remain unchanged.
|
package/ROADMAP.md
CHANGED
|
@@ -74,26 +74,51 @@ All 5 `acceptance criteria` passed through independent inspection of the written
|
|
|
74
74
|
|
|
75
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), and [merged PR #34](https://github.com/emilioSp/pi-maestro/pull/34).
|
|
76
76
|
|
|
77
|
+
### R-06: Check subagent extensions at activation
|
|
78
|
+
|
|
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 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 extension availability, not child execution readiness.
|
|
80
|
+
|
|
81
|
+
All 7 `acceptance criteria` passed using controlled replies and code inspection, with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
82
|
+
|
|
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 verification.
|
|
84
|
+
|
|
85
|
+
#### Evidence
|
|
86
|
+
|
|
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), and [merged PR #35](https://github.com/emilioSp/pi-maestro/pull/35).
|
|
88
|
+
|
|
89
|
+
### R-05: Keep acceptance criterion numbering continuous
|
|
90
|
+
|
|
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 files unchanged.
|
|
92
|
+
|
|
93
|
+
`Maestro` corrects numbering and affected references without changing criterion order or requirements, then retries with the existing `GREEN FLAG`. No additional `owner` approval is required.
|
|
94
|
+
|
|
95
|
+
All 3 `acceptance criteria` passed with no `verifier` `findings`. The saved workflow reached `candidate-ready`.
|
|
96
|
+
|
|
97
|
+
#### Evidence
|
|
98
|
+
|
|
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), and [merged PR #36](https://github.com/emilioSp/pi-maestro/pull/36).
|
|
100
|
+
|
|
77
101
|
## Now
|
|
78
102
|
|
|
79
|
-
### R-
|
|
103
|
+
### R-10: Match handoff criteria to the approved spec
|
|
80
104
|
|
|
81
105
|
#### Objective
|
|
82
106
|
|
|
83
|
-
|
|
107
|
+
Prevent `builder` and `verifier` reports from omitting or adding `acceptance criteria`. Each report must contain exactly the criterion IDs in the approved `spec`, with no duplicates in either place. Existing duplicate checks in reports do not establish this match.
|
|
84
108
|
|
|
85
|
-
|
|
109
|
+
The `specification` must define the criterion heading format used to extract IDs. For example, a heading can use `### AC1: ...`.
|
|
86
110
|
|
|
87
|
-
|
|
111
|
+
#### Completed when
|
|
88
112
|
|
|
89
|
-
|
|
113
|
+
Both `handoff` submissions reject missing, extra, or duplicate criterion IDs before saving a report or changing phase.
|
|
90
114
|
|
|
91
|
-
|
|
115
|
+
#### Implementation status
|
|
92
116
|
|
|
93
|
-
|
|
117
|
+
The [approved specification](.specs/20261013-211629-match-handoff-criteria-to-the-approved-spec/spec.md) limits this change to missing IDs. The implementation rejects missing `spec` IDs before saving either `handoff` or changing phase. Extra report IDs remain allowed. No new check rejects duplicate IDs in the `spec`.
|
|
94
118
|
|
|
95
|
-
|
|
119
|
+
Both `acceptance criteria` passed independent verification with no `findings`. The saved workflow reached `candidate-ready`. The broader exact-match objective remains outside this approved scope.
|
|
96
120
|
|
|
121
|
+
Later changes requested by the `owner` extract the shared presence check into one utility and cover extraction with unit tests. One missing-ID integration test remains per role to check rejection before saving. These changes are outside the completed independent verification.
|
|
97
122
|
|
|
98
123
|
## Next
|
|
99
124
|
|
|
@@ -113,16 +138,6 @@ Compatibility with installations under the old name must be decided in the `spec
|
|
|
113
138
|
|
|
114
139
|
Package metadata and installation documentation use the new name. The package is available under that name.
|
|
115
140
|
|
|
116
|
-
### R-05: Keep acceptance criterion numbering continuous
|
|
117
|
-
|
|
118
|
-
#### Objective
|
|
119
|
-
|
|
120
|
-
When criteria are removed during `spec` preparation or revision, renumber the remaining criteria without gaps. Numbering starts at `AC1` and continues through the final criterion.
|
|
121
|
-
|
|
122
|
-
#### Completed when
|
|
123
|
-
|
|
124
|
-
The `spec` and its current references use consistent numbering.
|
|
125
|
-
|
|
126
141
|
### R-07: Guide initial configuration
|
|
127
142
|
|
|
128
143
|
#### Objective
|
|
@@ -152,39 +167,3 @@ Explore how `Maestro` can reconcile saved `artifacts` and workflow state. The re
|
|
|
152
167
|
#### Completed when
|
|
153
168
|
|
|
154
169
|
Not yet defined. The `owner` must define the intended outcome, recovery boundaries, and completion condition before this item can move forward.
|
|
155
|
-
|
|
156
|
-
### R-10: Match handoff criteria to the approved spec
|
|
157
|
-
|
|
158
|
-
#### Objective
|
|
159
|
-
|
|
160
|
-
Prevent `builder` and `verifier` reports from omitting or adding `acceptance criteria`. Each report must contain exactly the criterion IDs in the approved `spec`, with no duplicates in either place. Existing duplicate checks in reports do not establish this match.
|
|
161
|
-
|
|
162
|
-
The `specification` must define the criterion heading format used to extract IDs. For example, a heading can use `### AC1: ...`.
|
|
163
|
-
|
|
164
|
-
#### Completed when
|
|
165
|
-
|
|
166
|
-
Both `handoff` submissions reject missing, extra, or duplicate criterion IDs before saving a report or changing phase.
|
|
167
|
-
|
|
168
|
-
### R-11: Reduce temporary verifier changes
|
|
169
|
-
|
|
170
|
-
#### Objective
|
|
171
|
-
|
|
172
|
-
Reduce the risk that verification changes the `candidate`. Existing instructions already require exact restoration, cleanup, and reporting of unresolved restoration problems. Refine the remaining guidance rather than duplicate those rules.
|
|
173
|
-
|
|
174
|
-
Prefer checks that leave existing files unchanged and use separate temporary files when possible. Change an existing file only when a criterion requires it. Retain its exact contents and restore it immediately after each `probe`, including failed `probes`. Prefer check-only commands over commands that apply automatic fixes.
|
|
175
|
-
|
|
176
|
-
`Maestro` currently has no file-hash restoration check. Adding one requires a separate scope decision.
|
|
177
|
-
|
|
178
|
-
#### Completed when
|
|
179
|
-
|
|
180
|
-
`Verifier` instructions cover these limits and require restoration and temporary-file cleanup before `handoff`. If restoration fails, the `verifier` must stop and report affected paths and remaining changes.
|
|
181
|
-
|
|
182
|
-
### R-13: Show when Maestro is working
|
|
183
|
-
|
|
184
|
-
#### Objective
|
|
185
|
-
|
|
186
|
-
Show an activity indicator in Pi's status bar while progress does not require an `owner` decision. A spinner is one option, not an agreed implementation.
|
|
187
|
-
|
|
188
|
-
#### Completed when
|
|
189
|
-
|
|
190
|
-
The status clearly distinguishes work in progress from a request for `owner` action.
|
package/package.json
CHANGED
|
@@ -54,6 +54,14 @@ Wait for each tool result before taking the next workflow action. Do not launch
|
|
|
54
54
|
10. On approval, freeze the spec as the contract. Call maestro_mark_spec_ready with the active specId.
|
|
55
55
|
11. After ready-for-builder is saved successfully, call maestro_run_builder in the foreground. Do not request a separate start approval.
|
|
56
56
|
|
|
57
|
+
If maestro_mark_spec_ready fails with "Fix acceptance criterion ordering in spec.md." after GREEN FLAG, keep the current phase unchanged.
|
|
58
|
+
In drafting-spec, escalation-decision, or findings-decision, correct only numbering and affected references in the current spec.md.
|
|
59
|
+
Do not change criterion order or requirements.
|
|
60
|
+
For example, change headings AC1 and AC3 to AC1 and AC2, and change the affected AC3 references to AC2.
|
|
61
|
+
Retry maestro_mark_spec_ready with the active specId using the existing GREEN FLAG. Do not request another approval.
|
|
62
|
+
After the transition succeeds, call maestro_run_builder in the foreground.
|
|
63
|
+
This edit exception applies only to failed numbering validation. It does not apply after successful approval or during agent runs.
|
|
64
|
+
|
|
57
65
|
Write spec.md for the owner. Keep detail proportional to the change and state each requirement once.
|
|
58
66
|
Use the template topics as guidance. Omit empty subsections instead of filling them with Not applicable.
|
|
59
67
|
Keep behavior, scope, constraints, and approved architectural decisions in the spec. Leave routine implementation choices to the builder.
|
|
@@ -74,6 +82,7 @@ In spec.md, keep only a brief reason, essential references, and unresolved limit
|
|
|
74
82
|
### Spec edits, checks, and experiments
|
|
75
83
|
|
|
76
84
|
Edit the active spec.md and its prototypes/ directory only in drafting-spec or during owner-directed contract revisions in decision phases.
|
|
85
|
+
The numbering-only recovery procedure above also permits spec.md corrections after failed numbering validation in those phases.
|
|
77
86
|
The decision phases are escalation-decision and findings-decision. Do not edit the spec or prototypes in other phases.
|
|
78
87
|
The approved spec is frozen. Never change it during builder or verifier execution.
|
|
79
88
|
Use any available tool for these permitted edits. Do not change other workflow artifacts.
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Used: When the builder reports done or escalation through the child tool.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { mkdir } from 'node:fs/promises';
|
|
6
|
+
import { mkdir, readFile } from 'node:fs/promises';
|
|
7
7
|
import { Value } from 'typebox/value';
|
|
8
8
|
import { assertBuilderHandoff } from '#artifacts/builder-handoff/assertBuilderHandoff.ts';
|
|
9
9
|
import {
|
|
@@ -19,6 +19,7 @@ import { readWorkflowState } from '#workflow/state/readWorkflowState.ts';
|
|
|
19
19
|
import { WORKFLOW_PHASES, type WorkflowState } from '#workflow/state/schema.ts';
|
|
20
20
|
import { writeWorkflowState } from '#workflow/state/writeWorkflowState.ts';
|
|
21
21
|
import { transitionWorkflow } from '#workflow/transitions.ts';
|
|
22
|
+
import { assertSpecAcceptanceCriteria } from '#workflow/utils/assertSpecAcceptanceCriteria.ts';
|
|
22
23
|
|
|
23
24
|
export type CompletedBuilderPass = {
|
|
24
25
|
handoff: BuilderHandoff;
|
|
@@ -76,6 +77,11 @@ export const completeBuilderPass = async ({
|
|
|
76
77
|
assertBuilderHandoff(handoffInput);
|
|
77
78
|
const { handoff } = handoffInput;
|
|
78
79
|
|
|
80
|
+
assertSpecAcceptanceCriteria({
|
|
81
|
+
markdown: await readFile(paths.getSpecFilePath(specId), 'utf8'),
|
|
82
|
+
criterionIds: new Set(handoff.acceptanceCriteria.map(({ id }) => id)),
|
|
83
|
+
});
|
|
84
|
+
|
|
79
85
|
const nextState = transitionWorkflow({
|
|
80
86
|
state: currentState,
|
|
81
87
|
event: getWorkflowEventByBuilderHandoff(handoff),
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Used: When the owner approves the spec content.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
+
import { readFile } from 'node:fs/promises';
|
|
6
7
|
import type { MaestroPaths } from '#MaestroPaths.ts';
|
|
7
8
|
import { pathExists } from '#utils/path-exists.ts';
|
|
8
9
|
import { readWorkflowState } from '#workflow/state/readWorkflowState.ts';
|
|
@@ -10,6 +11,14 @@ import { WORKFLOW_EVENTS, type WorkflowState } from '#workflow/state/schema.ts';
|
|
|
10
11
|
import { writeWorkflowState } from '#workflow/state/writeWorkflowState.ts';
|
|
11
12
|
import { transitionWorkflow } from '#workflow/transitions.ts';
|
|
12
13
|
|
|
14
|
+
function assertAcceptanceCriterionOrdering(markdown: string): void {
|
|
15
|
+
const criteria = [...markdown.matchAll(/^### AC(\d+):/gm)];
|
|
16
|
+
|
|
17
|
+
if (criteria.some((match, index) => Number(match[1]) !== index + 1)) {
|
|
18
|
+
throw new Error('Fix acceptance criterion ordering in spec.md.');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
type MarkSpecReadyInput = {
|
|
14
23
|
paths: MaestroPaths;
|
|
15
24
|
specId: string;
|
|
@@ -51,6 +60,8 @@ export const markSpecReady = async ({
|
|
|
51
60
|
event: WORKFLOW_EVENTS.MARK_SPEC_READY,
|
|
52
61
|
});
|
|
53
62
|
|
|
63
|
+
assertAcceptanceCriterionOrdering(await readFile(specFilePath, 'utf8'));
|
|
64
|
+
|
|
54
65
|
await writeWorkflowState({
|
|
55
66
|
path: workflowPath,
|
|
56
67
|
state,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Objective: Require every spec criterion ID in a handoff.
|
|
3
|
+
* Used: Before builder and verifier submissions save their reports.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type AssertSpecAcceptanceCriteriaInput = {
|
|
7
|
+
markdown: string;
|
|
8
|
+
criterionIds: Set<string>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function assertSpecAcceptanceCriteria({
|
|
12
|
+
markdown,
|
|
13
|
+
criterionIds,
|
|
14
|
+
}: AssertSpecAcceptanceCriteriaInput): void {
|
|
15
|
+
const missingIds = [...markdown.matchAll(/^### AC(\d+):/gm)]
|
|
16
|
+
.map((match) => `AC${match[1]}`)
|
|
17
|
+
.filter((id) => !criterionIds.has(id));
|
|
18
|
+
|
|
19
|
+
if (missingIds.length > 0) {
|
|
20
|
+
throw new Error(
|
|
21
|
+
`Handoff is missing acceptance criterion IDs from spec.md: ${missingIds.join(', ')}.`,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Used: When the verifier submits its terminal handoff.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { mkdir } from 'node:fs/promises';
|
|
6
|
+
import { mkdir, readFile } from 'node:fs/promises';
|
|
7
7
|
import { assertVerifierHandoff } from '#artifacts/verifier-handoff/assertVerifierHandoff.ts';
|
|
8
8
|
import type { VerifierHandoff } from '#artifacts/verifier-handoff/schema.ts';
|
|
9
9
|
import { writeVerifierHandoff } from '#artifacts/verifier-handoff/writeVerifierHandoff.ts';
|
|
@@ -12,6 +12,7 @@ import { readWorkflowState } from '#workflow/state/readWorkflowState.ts';
|
|
|
12
12
|
import { WORKFLOW_PHASES, type WorkflowState } from '#workflow/state/schema.ts';
|
|
13
13
|
import { writeWorkflowState } from '#workflow/state/writeWorkflowState.ts';
|
|
14
14
|
import { transitionWorkflow } from '#workflow/transitions.ts';
|
|
15
|
+
import { assertSpecAcceptanceCriteria } from '#workflow/utils/assertSpecAcceptanceCriteria.ts';
|
|
15
16
|
import { getWorkflowEventByVerifierHandoff } from '#workflow/verifier/utils/getWorkflowEventByVerifierHandoff.ts';
|
|
16
17
|
|
|
17
18
|
export type CompletedVerifierPass = {
|
|
@@ -56,6 +57,11 @@ export const completeVerifierPass = async ({
|
|
|
56
57
|
assertVerifierHandoff(handoffInput);
|
|
57
58
|
const { handoff } = handoffInput;
|
|
58
59
|
|
|
60
|
+
assertSpecAcceptanceCriteria({
|
|
61
|
+
markdown: await readFile(paths.getSpecFilePath(specId), 'utf8'),
|
|
62
|
+
criterionIds: new Set(handoff.acceptanceCriteria.map(({ id }) => id)),
|
|
63
|
+
});
|
|
64
|
+
|
|
59
65
|
const nextState = transitionWorkflow({
|
|
60
66
|
state: currentState,
|
|
61
67
|
event: getWorkflowEventByVerifierHandoff(handoff),
|