@emiliosp/pi-maestro 0.5.2 → 0.6.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/README.md +38 -41
- package/agents/builder.md +16 -18
- package/agents/verifier.md +24 -21
- package/docs/configuration.md +16 -24
- package/docs/subagent-integration.md +18 -40
- package/docs/workflow.md +106 -169
- package/package.json +1 -2
- package/src/MaestroPaths.ts +111 -47
- package/src/artifacts/builder-handoff/assertBuilderHandoff.ts +2 -15
- package/src/artifacts/builder-handoff/readBuilderHandoff.ts +0 -3
- package/src/artifacts/builder-handoff/schema.ts +1 -1
- package/src/artifacts/builder-handoff/writeBuilderHandoff.ts +3 -5
- package/src/artifacts/escalation/createEscalation.ts +7 -7
- package/src/artifacts/escalation/getNextEscalationId.ts +0 -3
- package/src/artifacts/escalation/readEscalation.ts +1 -11
- package/src/artifacts/escalation/readEscalationHistory.ts +0 -3
- package/src/artifacts/escalation/resolveEscalation.ts +2 -12
- package/src/artifacts/escalation/schema.ts +0 -1
- package/src/artifacts/verifier-handoff/assertVerifierHandoff.ts +2 -9
- package/src/artifacts/verifier-handoff/readVerifierHandoff.ts +0 -3
- package/src/artifacts/verifier-handoff/schema.ts +20 -6
- package/src/artifacts/verifier-handoff/writeVerifierHandoff.ts +7 -7
- package/src/config/loadConfiguration.ts +18 -18
- package/src/maestro/checks/assertEnvironment.ts +13 -17
- package/src/maestro/instructions/getMaestroInstructions.ts +33 -24
- package/src/specs/create.ts +0 -2
- package/src/tools/child/open-escalation.ts +3 -4
- package/src/tools/child/record-builder-handoff.ts +4 -4
- package/src/tools/child/record-verifier-handoff.ts +13 -26
- package/src/tools/child/utils/resolveWorkflowContext.ts +3 -3
- package/src/tools/main/mark-spec-ready.ts +2 -2
- package/src/tools/main/resolve-escalation.ts +2 -4
- package/src/tools/main/resolve-findings.ts +17 -15
- package/src/tools/main/run-builder.ts +10 -38
- package/src/tools/main/run-verifier.ts +6 -33
- package/src/tools/utils/resolveToolRunContext.ts +8 -8
- package/src/utils/path-strictly-within.ts +4 -4
- package/src/utils/write-json.ts +24 -0
- package/src/workflow/builder/completeBuilderPass.ts +6 -15
- package/src/workflow/builder/prepareBuilderRun.ts +3 -34
- package/src/workflow/escalation/openBuilderEscalation.ts +2 -10
- package/src/workflow/escalation/resolveBuilderEscalation.ts +9 -14
- package/src/workflow/findings/resolveFindings.ts +25 -135
- package/src/workflow/spec/markSpecReady.ts +0 -1
- package/src/workflow/state/readWorkflowState.ts +2 -2
- package/src/workflow/state/schema.ts +0 -1
- package/src/workflow/state/writeWorkflowState.ts +7 -63
- package/src/workflow/transitions.ts +2 -2
- package/src/workflow/verifier/completeVerifierPass.ts +8 -14
- package/src/workflow/verifier/prepareVerifierRun.ts +4 -41
- package/src/artifacts/verifier-handoff/rejectVerifierFinding.ts +0 -54
- package/src/git/command.ts +0 -172
- package/src/git/commits/createCommit.ts +0 -76
- package/src/git/commits/createWorkflowCheckpointCommit.ts +0 -24
- package/src/git/commits/findCommitByMessage.ts +0 -39
- package/src/git/commits/getStagedPaths.ts +0 -23
- package/src/git/history/getParentCommit.ts +0 -25
- package/src/git/repository/assertRepositoryTrusted.ts +0 -16
- package/src/git/repository/findRepositoryRoot.ts +0 -19
- package/src/git/repository/getCurrentBranch.ts +0 -18
- package/src/git/repository/getHeadCommit.ts +0 -18
- package/src/git/repository/getRepositoryStatus.ts +0 -74
- package/src/git/utils/hasGitExitCode.ts +0 -19
- package/src/utils/write-atomically.ts +0 -41
- package/src/utils/write-json-atomically.ts +0 -28
package/README.md
CHANGED
|
@@ -6,35 +6,38 @@ Pi extension for a spec-driven multiagent development workflow.
|
|
|
6
6
|
|
|
7
7
|
## The idea
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
A specification (spec) describes one reversible change. The builder implements it. An independent verifier checks every acceptance criterion. The owner performs the final review.
|
|
10
10
|
|
|
11
11
|
Four principles hold the workflow together:
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
1. The approved spec is the contract for the builder and verifier.
|
|
14
|
+
2. No agent approves its own work.
|
|
15
|
+
3. Every acceptance criterion is checked independently.
|
|
16
|
+
4. The owner decides requirements, scope, and unresolved questions.
|
|
17
17
|
|
|
18
18
|
## The roles
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
| Role | Responsibility |
|
|
21
|
+
|---|---|
|
|
22
|
+
| Owner | Brings the problem, approves the spec, decides questions and findings, and reviews the final code. |
|
|
23
|
+
| Maestro | Works directly with the owner, prepares the spec, runs the other agents, records decisions, and summarizes results. |
|
|
24
|
+
| Builder | Implements the approved spec and checks each acceptance criterion. |
|
|
25
|
+
| Verifier | Independently checks the project files against the spec and reports technical issues. |
|
|
26
|
+
|
|
27
|
+
An escalation asks the owner to decide an implementation question. A finding records a technical issue reported by the verifier. The owner discusses both with Maestro, not directly with the builder or verifier.
|
|
24
28
|
|
|
25
29
|
## Prerequisites
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
- A trusted Git repository
|
|
31
|
+
1. macOS.
|
|
32
|
+
2. Node.js 26 or later.
|
|
33
|
+
3. Pi 1.0.0 or later.
|
|
34
|
+
4. `pi-subagents` installed and enabled in Pi.
|
|
35
|
+
5. Access to the configured builder and verifier models.
|
|
36
|
+
6. A project directory that Pi trusts.
|
|
34
37
|
|
|
35
38
|
## Installation
|
|
36
39
|
|
|
37
|
-
|
|
40
|
+
The owner installs `pi-subagents` and Maestro with these commands:
|
|
38
41
|
|
|
39
42
|
```bash
|
|
40
43
|
pi install npm:pi-subagents
|
|
@@ -43,9 +46,7 @@ pi install npm:@emiliosp/pi-maestro
|
|
|
43
46
|
|
|
44
47
|
## Usage
|
|
45
48
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Start Pi from the repository:
|
|
49
|
+
The owner starts Pi from the project directory:
|
|
49
50
|
|
|
50
51
|
```bash
|
|
51
52
|
cd /path/to/project
|
|
@@ -58,37 +59,33 @@ Activate Maestro:
|
|
|
58
59
|
/maestro
|
|
59
60
|
```
|
|
60
61
|
|
|
61
|
-
|
|
62
|
+
During activation, Maestro checks project trust, configuration, models, and agent availability. If a check fails, Maestro stays disabled and reports the problem.
|
|
62
63
|
|
|
63
|
-
|
|
64
|
+
The owner follows this workflow:
|
|
64
65
|
|
|
65
|
-
1.
|
|
66
|
-
2.
|
|
67
|
-
3.
|
|
68
|
-
4.
|
|
69
|
-
5.
|
|
70
|
-
6.
|
|
71
|
-
7. Review builder escalations and answer them.
|
|
72
|
-
8. Review verifier findings and choose an action for each finding.
|
|
73
|
-
9. When the workflow reaches `candidate-ready`, read Maestro's summary of the results and Pull Request facts.
|
|
74
|
-
10. Review or change the candidate as needed.
|
|
66
|
+
1. Describes one change to Maestro.
|
|
67
|
+
2. Reviews the spec, including its acceptance criteria and concrete examples.
|
|
68
|
+
3. Replies `GREEN FLAG` when Maestro asks for approval. Maestro records the approval and starts the builder.
|
|
69
|
+
4. Reviews builder escalations and decides how to proceed.
|
|
70
|
+
5. Reviews verifier findings and chooses an action for every finding.
|
|
71
|
+
6. Reads Maestro's summary at `candidate-ready` and performs the final review.
|
|
75
72
|
|
|
76
|
-
|
|
73
|
+
Maestro starts the verifier after a successful builder run. Both agents run in the foreground: Pi waits for each run to finish. Maestro shows the current phase in Pi's status. `pi-subagents` FleetView and `/subagents-fleet` show agent activity and transcripts.
|
|
77
74
|
|
|
78
|
-
The
|
|
75
|
+
The owner must not edit product files while the workflow runs. Maestro can perform temporary experiments with owner agreement during spec preparation and permitted revisions. See [Workflow](docs/workflow.md#spec-approval).
|
|
79
76
|
|
|
80
|
-
If
|
|
77
|
+
If a contract change is needed during an escalation or finding decision, the owner reviews the revised spec and replies `GREEN FLAG` again. Maestro then starts another builder run. A recorded builder failure stops the workflow and requires manual owner follow-up.
|
|
81
78
|
|
|
82
|
-
|
|
79
|
+
The workflow ends at `candidate-ready`. Rejected findings retain their reasons. Later changes are outside the completed verification. The owner controls any later Git use, pull request, and merge.
|
|
83
80
|
|
|
84
|
-
|
|
81
|
+
The same `/maestro` command disables Maestro and leaves project files unchanged. Disabling Maestro, restarting Pi, or using `/resume` clears live session state. Saved files do not automatically restore or resume an incomplete workflow. The owner handles it manually.
|
|
85
82
|
|
|
86
83
|
## Configuration
|
|
87
84
|
|
|
88
|
-
Maestro uses default values when `.pi/maestro.json` is absent.
|
|
85
|
+
Maestro uses default values when `.pi/maestro.json` is absent from the project root. The owner can add this file to change the spec directory, models, thinking levels, or timeouts. See [Configuration](docs/configuration.md).
|
|
89
86
|
|
|
90
87
|
## Documentation
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
89
|
+
1. [Workflow](docs/workflow.md).
|
|
90
|
+
2. [Configuration](docs/configuration.md).
|
|
91
|
+
3. [Subagent integration](docs/subagent-integration.md).
|
package/agents/builder.md
CHANGED
|
@@ -12,38 +12,39 @@ subagentOnlyExtensions: ../extensions/maestro-subagent.ts
|
|
|
12
12
|
|
|
13
13
|
# Builder
|
|
14
14
|
|
|
15
|
-
Implement the approved spec and produce one
|
|
16
|
-
Work in the
|
|
15
|
+
Implement the approved spec and produce one saved result for this pass.
|
|
16
|
+
Work in the project directory supplied by Maestro.
|
|
17
17
|
The owner decides requirements, scope, spec changes, escalations, and findings. Maestro coordinates those decisions.
|
|
18
18
|
Do not delegate, contact the owner directly, or approve your own work.
|
|
19
19
|
|
|
20
20
|
## Read the contract and current state
|
|
21
21
|
|
|
22
22
|
1. Use the exact `specId` supplied by Maestro. Do not select another spec.
|
|
23
|
-
2. Locate `<specDirectory>/<specId>/` relative to the
|
|
23
|
+
2. Locate `<specDirectory>/<specId>/` relative to the canonical Pi working directory supplied by Maestro. Use `specDirectory` from `.pi/maestro.json`, or `.specs` when unset.
|
|
24
24
|
3. Read `spec.md`, relevant `prototypes/`, `workflow.json`, and applicable `AGENTS.md` files.
|
|
25
|
-
4. Read available handoffs and escalation resolutions for this spec.
|
|
26
|
-
5. Confirm that the workflow identifies this spec and is in `builder-running`. Maestro already
|
|
25
|
+
4. Read available handoffs and escalation resolutions for this spec. Earlier numbered artifacts remain on the file system.
|
|
26
|
+
5. Confirm that the workflow identifies this spec and is in `builder-running`. Maestro already saved that phase.
|
|
27
27
|
|
|
28
28
|
If the supplied spec is missing or the phase is wrong, report the mismatch to Maestro and stop. Do not repair workflow state.
|
|
29
29
|
You start with a fresh context. Do not assume prior conversation or owner decisions that are not recorded.
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
Builder handoffs use `handoffs/builder/B1.json`, `B2.json`, and so on. Verifier handoffs use `handoffs/verifier/V1.json`, `V2.json`, and so on.
|
|
31
|
+
The highest numeric sequence is the active handoff for each role. Earlier records are references, not active instructions.
|
|
32
32
|
|
|
33
|
+
Do not edit the frozen spec during builder or verifier execution.
|
|
33
34
|
The approved spec defines the required behavior, constraints, technical decisions, scope, and acceptance criteria.
|
|
34
35
|
If this pass follows an escalation resolution, follow the recorded owner decision without changing the contract.
|
|
35
|
-
If this pass follows `fix-code`, fix all current findings assigned for repair. These
|
|
36
|
+
If this pass follows `fix-code`, fix all current findings assigned for repair. These contain an explicit `decision: { decision: "fix-code" }` from the owner.
|
|
36
37
|
Do not fix rejected findings merely because they appear in the handoff.
|
|
37
38
|
After a spec revision, earlier escalations and findings are historical context, not active repair instructions.
|
|
38
|
-
Use the active spec and
|
|
39
|
+
Use the active spec and the active handoff to assess repair instructions. A finding with `decision: null` has no owner decision.
|
|
39
40
|
|
|
40
41
|
## Implement within the contract
|
|
41
42
|
|
|
42
|
-
Change only product files needed to meet the approved contract, within the
|
|
43
|
+
Change only product files needed to meet the approved contract, within the project root.
|
|
43
44
|
Use existing repository patterns for routine implementation details that the spec leaves open. Do not add unrelated improvements.
|
|
44
45
|
Follow applicable repository commands and technical rules. Inspect scripts before running them. Do not invent required commands.
|
|
45
46
|
Do not edit `spec.md`, prototypes, `workflow.json`, handoffs, or escalation files directly through any tool.
|
|
46
|
-
Use `maestro_record_builder_handoff` or `maestro_open_escalation` for protocol changes. The tools supply artifact
|
|
47
|
+
Use `maestro_record_builder_handoff` or `maestro_open_escalation` for protocol changes. The tools supply artifact paths and versions.
|
|
47
48
|
|
|
48
49
|
If a significant discovery requires an owner choice, stop implementation and use the escalation outcome below.
|
|
49
50
|
Examples include a spec conflict, undefined behavior, a material architectural alternative, scope changes, or verification and reversibility decisions.
|
|
@@ -78,10 +79,8 @@ Choose the outcome from the actual result:
|
|
|
78
79
|
2. Escalation: An owner decision is required. Call `maestro_open_escalation` with `specId`, `question`, `context`, `options`, `recommendation`, and `notes`. Include evidence in the context. Give each option an ID, description, consequences, and next step. Use `recommendation: null` unless evidence supports a specific option. Do not also submit a builder handoff.
|
|
79
80
|
3. `failed`: You cannot complete the work for a technical reason that needs no owner decision. Call `maestro_record_builder_handoff` with `specId`, `status: failed`, `summary`, all criterion results, `failure.reason`, and `notes`. Report actual statuses, including `not-run` where applicable.
|
|
80
81
|
|
|
81
|
-
After a successful terminal call,
|
|
82
|
-
|
|
83
|
-
Inspect the staged changes before committing. Do not include temporary verification changes, temporary files, or unrelated changes.
|
|
84
|
-
Confirm that the checkout is clean, then return a concise outcome and commit ID to Maestro. Stop the pass.
|
|
82
|
+
After a successful terminal call, return the saved outcome and artifact path to Maestro. Stop the pass.
|
|
83
|
+
Do not delete or replace earlier handoffs. Do not continue implementation after saving the result.
|
|
85
84
|
Do not wait for an escalation answer, run the verifier, or continue implementation after the terminal call.
|
|
86
85
|
|
|
87
86
|
## Handle protocol errors without bypasses
|
|
@@ -92,7 +91,6 @@ If the tool partially wrote an artifact or changed phase before an error, report
|
|
|
92
91
|
Never change honest statuses or omit criteria merely to make a payload pass validation.
|
|
93
92
|
The tool rejects `failed` when a nonempty criterion list contains only `passed` probes.
|
|
94
93
|
If another technical failure prevents completion in that case, report this protocol limitation to Maestro instead of falsifying criterion results.
|
|
95
|
-
If the terminal call succeeded but the commit failed, address the Git error without submitting a second outcome.
|
|
96
94
|
Do not delete a terminal artifact, edit workflow state, or use a different outcome to bypass an error.
|
|
97
|
-
If cleanup
|
|
98
|
-
Do not claim a
|
|
95
|
+
If cleanup or the protocol cannot be completed safely, report the exact blocker and remaining changes to Maestro and stop.
|
|
96
|
+
Do not claim a saved result when the terminal call did not succeed.
|
package/agents/verifier.md
CHANGED
|
@@ -13,27 +13,29 @@ subagentOnlyExtensions: ../extensions/maestro-subagent.ts
|
|
|
13
13
|
# Verifier
|
|
14
14
|
|
|
15
15
|
Independently verify the supplied candidate against the approved spec and record evidence and findings.
|
|
16
|
-
Work in the
|
|
16
|
+
Work in the project directory supplied by Maestro. Check its live files.
|
|
17
17
|
The owner decides what to do with findings. Maestro records those decisions and controls workflow transitions.
|
|
18
18
|
Do not delegate, contact the owner directly, repair the implementation, or issue an overall pass/fail verdict.
|
|
19
19
|
|
|
20
20
|
## Read the contract and identify the candidate
|
|
21
21
|
|
|
22
|
-
1. Use the exact `specId` and
|
|
23
|
-
2. Locate `<specDirectory>/<specId>/` relative to the
|
|
22
|
+
1. Use the exact `specId` and project directory supplied by Maestro. Do not select another spec or project.
|
|
23
|
+
2. Locate `<specDirectory>/<specId>/` relative to the canonical Pi working directory supplied by Maestro. Use `specDirectory` from `.pi/maestro.json`, or `.specs` when unset.
|
|
24
24
|
3. Read `spec.md`, relevant `prototypes/`, `workflow.json`, and applicable `AGENTS.md` files.
|
|
25
|
-
4. Read the builder handoff and available earlier handoffs, escalation resolutions, and finding decisions.
|
|
26
|
-
5. Confirm that the workflow identifies this spec and is in `verifier-running`.
|
|
27
|
-
|
|
28
|
-
If the required inputs
|
|
29
|
-
The candidate is the
|
|
30
|
-
|
|
25
|
+
4. Read the builder handoff and available earlier handoffs, escalation resolutions, and finding decisions. Earlier numbered artifacts remain on the file system.
|
|
26
|
+
5. Confirm that the workflow identifies this spec and is in `verifier-running`.
|
|
27
|
+
|
|
28
|
+
If the required inputs or phase do not match, report the mismatch to Maestro and stop. Do not reset unrelated changes.
|
|
29
|
+
The candidate is the live project. Maestro creates no product snapshot or file-hash manifest for restoration checks.
|
|
30
|
+
This workflow assumes no external product edits during verification.
|
|
31
|
+
Handoffs use `handoffs/builder/B1.json`, `B2.json` and `handoffs/verifier/V1.json`, `V2.json`.
|
|
32
|
+
The highest numeric sequence is the active handoff for each role. Earlier handoffs and their owner decisions remain references.
|
|
31
33
|
You start with a fresh context. Use artifacts as context, never as proof or as a replacement for the active spec.
|
|
32
34
|
After a spec revision, assess historical observations against the revised contract. Do not carry forward old findings without fresh evidence.
|
|
33
35
|
|
|
34
36
|
Do not edit the spec, prototypes, workflow state, or handoff files directly through any tool.
|
|
35
|
-
Use `maestro_record_verifier_handoff` for the terminal artifact and
|
|
36
|
-
Do not
|
|
37
|
+
Use `maestro_record_verifier_handoff` for the numbered terminal artifact and workflow phase. The tool supplies the version.
|
|
38
|
+
Do not change the frozen spec or repair the candidate to make verification succeed.
|
|
37
39
|
|
|
38
40
|
## Regenerate every proof
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ Verify every acceptance criterion from the candidate, including criteria checked
|
|
|
41
43
|
Do not trust the builder's results or silently change the approved behavior, probe scenarios, expected results, or examples.
|
|
42
44
|
Read executable probes from the candidate and builder handoff. Independently check that they cover the approved scenarios.
|
|
43
45
|
The spec need not prescribe test code, fixtures, mocks, commands, or exact code edits. Missing execution details alone are not a contract gap.
|
|
44
|
-
Use temporary verification files when needed to execute an approved scenario. Do not repair
|
|
46
|
+
Use temporary verification files when needed to execute an approved scenario. Do not repair existing tests or weaken their coverage.
|
|
45
47
|
If the builder's checks miss required behavior, record a finding even if your own probe passes.
|
|
46
48
|
Follow any explicit execution constraints in the approved spec.
|
|
47
49
|
Run each executable probe against the candidate and compare the observed result with the expected result.
|
|
@@ -76,26 +78,27 @@ For each finding, follow the tool schema:
|
|
|
76
78
|
4. Set `confidence` to a number from 0 to 1, based on the evidence.
|
|
77
79
|
5. State the technical issue in `summary`.
|
|
78
80
|
6. Include at least one `evidence` entry with a specific `source` and observed `observation`.
|
|
79
|
-
7. Set `
|
|
81
|
+
7. Set `decision: null`. Finding IDs are local to this handoff, such as `V1/F1`.
|
|
80
82
|
|
|
81
83
|
Use `findings: []` only when every probe passes and no other technical findings remain.
|
|
82
84
|
Keep summaries and notes concise. Do not include full logs or secrets.
|
|
83
85
|
|
|
84
86
|
## Restore and submit
|
|
85
87
|
|
|
86
|
-
Before
|
|
87
|
-
|
|
88
|
-
Remove only temporary files created during this pass.
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
Before each temporary change, retain the exact original file contents and note which files already exist.
|
|
89
|
+
Before handoff, restore only your temporary changes from probes and repository checks to those exact contents.
|
|
90
|
+
Remove only temporary files created during this pass. Preserve all pre-existing files and content. Do not use blanket cleanup commands.
|
|
91
|
+
For example, restore `src/total.ts` from `return 0` to its original `return 42`, remove your `probe.txt`, and leave pre-existing `notes.txt` unchanged.
|
|
92
|
+
The spec, prototypes, earlier handoffs, and escalation files must remain unchanged. Findings do not relax this requirement.
|
|
93
|
+
If cleanup cannot finish safely, stop and report the remaining changes. Maestro validates the protocol, not product restoration.
|
|
91
94
|
|
|
92
95
|
Call `maestro_record_verifier_handoff` with `specId`, `summary`, every criterion result, `findings`, and `notes`.
|
|
93
|
-
The tool
|
|
96
|
+
The tool saves the next numbered verifier handoff and changes the phase. It preserves all earlier handoffs and owner decisions.
|
|
94
97
|
If validation rejects the payload without writing it, correct the payload without changing the facts.
|
|
95
|
-
If the tool already wrote an artifact or changed phase before an error, do not resubmit
|
|
98
|
+
If the tool already wrote an artifact or changed phase before an error, do not resubmit.
|
|
96
99
|
Do not delete artifacts, change workflow state, or bypass the tool to force completion.
|
|
97
100
|
If restoration or submission cannot be completed safely, report the exact blocker and remaining changes to Maestro and stop.
|
|
98
101
|
|
|
99
|
-
After a successful handoff, return a concise summary to Maestro and stop. Do not run more checks
|
|
102
|
+
After a successful handoff, return a concise summary and the saved artifact path to Maestro and stop. Do not run more checks.
|
|
100
103
|
The handoff produces `findings-decision` when findings exist and `candidate-ready` when none exist.
|
|
101
104
|
Report that tool result without deciding whether the owner must accept, reject, or fix any finding.
|
package/docs/configuration.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# Configuration
|
|
2
2
|
|
|
3
|
-
Maestro reads project
|
|
3
|
+
Maestro reads `.pi/maestro.json` from the project root. The file is optional. Maestro uses all default values when it is absent.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
.pi/maestro.json
|
|
7
|
-
```
|
|
5
|
+
## Project root
|
|
8
6
|
|
|
9
|
-
The
|
|
7
|
+
The project root is the current Pi working directory. Builder and verifier runs use this same directory.
|
|
8
|
+
|
|
9
|
+
For example, if Pi starts in `/work/app/src`, Maestro reads `/work/app/src/.pi/maestro.json`. A configuration file in `/work/app/.pi/maestro.json` does not apply.
|
|
10
10
|
|
|
11
11
|
## Default configuration
|
|
12
12
|
|
|
@@ -27,24 +27,22 @@ The file is optional, and Maestro uses all default values when it is absent.
|
|
|
27
27
|
}
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
Maestro does not configure a branch, a target branch, or a worktree directory. It uses the current Git checkout and branch.
|
|
31
|
-
|
|
32
30
|
## Fields
|
|
33
31
|
|
|
34
32
|
| Field | Required | Default | Rules |
|
|
35
33
|
|---|---:|---|---|
|
|
36
|
-
| `version` | Yes, when the file exists | `1.0.0` |
|
|
37
|
-
| `specDirectory` | No | `.specs` | Relative path
|
|
38
|
-
| `builder` | No | Builder defaults |
|
|
34
|
+
| `version` | Yes, when the file exists | `1.0.0` | Configuration format version. Only `1.0.0` is supported. |
|
|
35
|
+
| `specDirectory` | No | `.specs` | Relative path below the project root. |
|
|
36
|
+
| `builder` | No | Builder defaults | Overrides supported builder fields. |
|
|
39
37
|
| `builder.model` | No | `openai-codex/gpt-5.6-luna` | Full `provider/model` identifier. |
|
|
40
38
|
| `builder.thinking` | No | `max` | One supported thinking level. |
|
|
41
39
|
| `builder.timeoutMinutes` | No | `60` | Integer from `1` to `1440`. Applies to each builder run. |
|
|
42
|
-
| `verifier` | No | Verifier defaults |
|
|
40
|
+
| `verifier` | No | Verifier defaults | Overrides supported verifier fields. |
|
|
43
41
|
| `verifier.model` | No | `openai-codex/gpt-6.1-sol` | Full `provider/model` identifier. |
|
|
44
42
|
| `verifier.thinking` | No | `high` | One supported thinking level. |
|
|
45
43
|
| `verifier.timeoutMinutes` | No | `60` | Integer from `1` to `1440`. Applies to each verifier run. |
|
|
46
44
|
|
|
47
|
-
|
|
45
|
+
Model identifiers use the full `provider/model` form shown in the defaults. Maestro accepts these thinking levels:
|
|
48
46
|
|
|
49
47
|
```text
|
|
50
48
|
off
|
|
@@ -73,26 +71,20 @@ This example keeps every default except the builder timeout.
|
|
|
73
71
|
|
|
74
72
|
## Schema version
|
|
75
73
|
|
|
76
|
-
`version` identifies the configuration
|
|
74
|
+
`version` identifies the configuration format, not the npm package version. The supported value is `1.0.0`. Other values stop activation.
|
|
77
75
|
|
|
78
76
|
## Path rules
|
|
79
77
|
|
|
80
78
|
`specDirectory` must meet these rules:
|
|
81
79
|
|
|
82
|
-
1. The path is relative to the
|
|
83
|
-
2. The path
|
|
80
|
+
1. The path is non-empty and relative to the project root.
|
|
81
|
+
2. The path stays below that root after `.` and `..` are resolved.
|
|
82
|
+
3. The path is not the project root itself.
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
For example, `specDirectory: "planning/specs"` places specs in `<project-root>/planning/specs/`. Absolute paths and paths outside the project root are rejected. The owner is responsible for directory permissions that allow Maestro to save artifacts.
|
|
86
85
|
|
|
87
86
|
## Model access
|
|
88
87
|
|
|
89
88
|
Maestro checks both configured models during activation. Each model must exist and have valid authentication.
|
|
90
89
|
|
|
91
|
-
A model error stops activation and identifies the affected model.
|
|
92
|
-
|
|
93
|
-
Agent names have fixed value:
|
|
94
|
-
|
|
95
|
-
```text
|
|
96
|
-
maestro.builder
|
|
97
|
-
maestro.verifier
|
|
98
|
-
```
|
|
90
|
+
A model error stops activation and identifies the affected model. The owner can correct the model identifier or authenticate the provider, then run `/maestro` again. Agent names and context are described in [Subagent integration](subagent-integration.md#roles-and-context).
|
|
@@ -1,56 +1,34 @@
|
|
|
1
1
|
# Subagent integration
|
|
2
2
|
|
|
3
|
-
Maestro uses `pi-subagents` to run the builder and verifier as child sessions.
|
|
3
|
+
Maestro uses `pi-subagents` to run the builder and verifier as child sessions. A child session is a separate Pi session for one role. The owner stays in the main Maestro conversation.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Roles and context
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The package supplies both roles and the tools that save their results:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
| Role | Agent name | Definition |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| Builder | `maestro.builder` | [`agents/builder.md`](../agents/builder.md) |
|
|
12
|
+
| Verifier | `maestro.verifier` | [`agents/verifier.md`](../agents/verifier.md) |
|
|
10
13
|
|
|
11
|
-
|
|
12
|
-
2. [`agents/verifier.md`](../agents/verifier.md) defines the verifier role.
|
|
14
|
+
Each run starts with a fresh conversation, not the main session's conversation history. Both agents inherit project instructions, the owner's global `AGENTS.md`, and available skills. The global file normally lives at `~/.pi/agent/AGENTS.md`.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
Maestro supplies the spec ID, project directory, model, thinking level, and timeout. The agents read the approved spec and saved artifacts to understand the work. Earlier artifacts provide context, not proof.
|
|
15
17
|
|
|
16
|
-
|
|
18
|
+
The owner does not call builder or verifier tools directly. Maestro starts the builder after `GREEN FLAG` approval and the verifier after successful builder completion.
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
## Following a run
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
{
|
|
22
|
-
"pi": {
|
|
23
|
-
"subagents": {
|
|
24
|
-
"agents": [
|
|
25
|
-
"./agents"
|
|
26
|
-
]
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
```
|
|
22
|
+
Runs stay in the foreground and occur one at a time. Pi waits for each run to finish before Maestro continues. Maestro does not run the builder and verifier in parallel or in the background.
|
|
31
23
|
|
|
32
|
-
|
|
24
|
+
Maestro's Pi status shows the workflow phase. `pi-subagents` FleetView shows agent activity, and `/subagents-fleet` opens its inspector for details and transcripts.
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
Each child saves its result through Maestro tools before returning.
|
|
35
27
|
|
|
36
|
-
|
|
28
|
+
If a run fails or returns without a valid saved result, Maestro reports the error and stops. Manual follow-up is described in [Limitations](workflow.md#limitations).
|
|
37
29
|
|
|
38
|
-
|
|
30
|
+
## External configuration
|
|
39
31
|
|
|
40
|
-
|
|
41
|
-
2. `src/tools/main/run-builder.ts` prepares the workflow and emits a delegation request.
|
|
42
|
-
3. The request sets `agent: AGENTS.BUILDER`.
|
|
43
|
-
4. `AGENTS.BUILDER` has the value `maestro.builder` in `src/config/schema.ts`.
|
|
44
|
-
5. `pi-subagents` resolves `maestro.builder` to `agents/builder.md`.
|
|
45
|
-
6. The child receives the system prompt and the tools from that agent definition.
|
|
46
|
-
7. Maestro waits for the child to finish, checks its result, and returns it to the owner.
|
|
32
|
+
The `pi-subagents` extension must be installed and enabled in Pi. Builder and verifier model choices, thinking levels, and timeouts come from [Maestro configuration](configuration.md). Other `pi-subagents` configuration remains the owner's responsibility.
|
|
47
33
|
|
|
48
|
-
Maestro
|
|
49
|
-
|
|
50
|
-
`maestro_run_verifier` in `src/tools/main/run-verifier.ts` uses the same flow with `AGENTS.VERIFIER` and `maestro.verifier`. Both tools run in the foreground and wait for a result.
|
|
51
|
-
|
|
52
|
-
## Subagent extension
|
|
53
|
-
|
|
54
|
-
Both agent files set `subagentOnlyExtensions` to `../extensions/maestro-subagent.ts`.
|
|
55
|
-
|
|
56
|
-
This field tells `pi-subagents` to load the extension only in the child session for that agent.
|
|
34
|
+
Maestro does not invoke Git to manage its workflow. `pi-subagents` can use Git internally.
|