@emiliosp/pi-maestro 0.21.0 → 0.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +55 -114
  3. package/agents/builder.md +7 -7
  4. package/agents/maestro.md +62 -45
  5. package/agents/simplifier.md +6 -5
  6. package/agents/verifier.md +13 -13
  7. package/docs/adr/0001-keep-the-workflow-independent-of-git.md +25 -0
  8. package/docs/adr/0002-store-escalation-decisions-in-builder-handoffs.md +24 -0
  9. package/docs/adr/0003-route-builder-failures-through-owner-escalations.md +23 -0
  10. package/docs/adr/0004-require-git-only-for-the-simplifier.md +35 -0
  11. package/docs/adr/0005-approve-a-specification-document-set-as-one-contract.md +32 -0
  12. package/docs/adr/0006-maintain-the-roadmap-in-linear.md +25 -0
  13. package/docs/adr/0007-maintain-the-roadmap-in-the-repository.md +27 -0
  14. package/docs/adr/0008-use-pis-registry-for-model-availability.md +23 -0
  15. package/docs/adr/0009-select-optional-phases-in-the-transition-table.md +24 -0
  16. package/docs/adr/0010-use-the-pi-sdk-for-sequential-agent-delegation.md +109 -0
  17. package/docs/adr/0011-separate-initial-setup-ui-from-configuration-rules.md +25 -0
  18. package/docs/adr/0012-filter-main-maestro-registrations-after-native-discovery.md +21 -0
  19. package/docs/adr/README.md +21 -0
  20. package/docs/configuration.md +33 -12
  21. package/docs/glossary.md +38 -49
  22. package/docs/inspiration.md +32 -0
  23. package/docs/roadmap/README.md +42 -0
  24. package/docs/roadmap/maestro-10-improve-status-presentation-and-activation-feedback.md +18 -0
  25. package/docs/roadmap/maestro-11-introduce-maestro-at-activation.md +19 -0
  26. package/docs/roadmap/maestro-12-verify-code-quality-against-agentsmd-instructions.md +21 -0
  27. package/docs/roadmap/maestro-13-check-subagent-extensions-at-activation.md +21 -0
  28. package/docs/roadmap/maestro-14-rename-the-test-support-directory.md +16 -0
  29. package/docs/roadmap/maestro-15-match-handoff-criteria-to-the-approved-spec.md +19 -0
  30. package/docs/roadmap/maestro-16-route-finding-driven-spec-revisions-through-drafting-spec.md +19 -0
  31. package/docs/roadmap/maestro-17-keep-acceptance-criterion-numbering-continuous.md +19 -0
  32. package/docs/roadmap/maestro-18-record-escalation-resolutions-when-the-spec-changes.md +18 -0
  33. package/docs/roadmap/maestro-19-guide-initial-configuration.md +22 -0
  34. package/docs/roadmap/maestro-20-rename-the-npm-package.md +17 -0
  35. package/docs/roadmap/maestro-21-label-acceptance-criterion-coverage.md +18 -0
  36. package/docs/roadmap/maestro-22-avoid-acceptance-criteria-already-covered-by-tests.md +16 -0
  37. package/docs/roadmap/maestro-23-change-agent-models-before-a-builder-run.md +14 -0
  38. package/docs/roadmap/maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent.md +23 -0
  39. package/docs/roadmap/maestro-25-define-workflow-reconciliation.md +19 -0
  40. package/docs/roadmap/maestro-26-exit-maestro-mode-automatically-at-workflow-completion.md +18 -0
  41. package/docs/roadmap/maestro-27-make-all-implementation-phases-optional.md +26 -0
  42. package/docs/roadmap/maestro-28-add-maestro-role-instructions-alongside-the-other-agents.md +14 -0
  43. package/docs/roadmap/maestro-6-display-specs-in-a-browser.md +14 -0
  44. package/docs/roadmap/maestro-7-route-builder-failures-through-owner-escalations.md +19 -0
  45. package/docs/roadmap/maestro-8-store-escalations-and-owner-decisions-in-builder-handoffs.md +19 -0
  46. package/docs/roadmap/maestro-9-format-glossary-terms-consistently.md +14 -0
  47. package/docs/roadmap/maestro-free-1-require-pi-150.md +16 -0
  48. package/docs/roadmap/maestro-free-2-remove-maestro-run-timeouts.md +18 -0
  49. package/docs/roadmap/maestro-free-3-run-the-builder-through-the-pi-sdk.md +31 -0
  50. package/docs/roadmap/maestro-free-4-run-the-verifier-through-the-pi-sdk.md +22 -0
  51. package/docs/roadmap/maestro-free-5-run-the-simplifier-through-the-pi-sdk.md +22 -0
  52. package/docs/roadmap/maestro-free-6-show-sdk-agent-activity-through-pi.md +21 -0
  53. package/docs/roadmap/maestro-free-7-remove-the-pi-subagents-dependency.md +21 -0
  54. package/docs/roadmap/maestro-free-pre-3-implement-internal-sdk-delegation.md +37 -0
  55. package/docs/subagent-integration.md +9 -29
  56. package/docs/workflow.md +62 -246
  57. package/extensions/maestro.ts +96 -19
  58. package/package.json +2 -6
  59. package/src/MaestroPaths.ts +9 -0
  60. package/src/config/assertConfiguration.ts +23 -21
  61. package/src/config/defaults.ts +2 -1
  62. package/src/config/loadConfiguration.ts +3 -2
  63. package/src/config/saveConfiguration.ts +38 -14
  64. package/src/config/schema.ts +13 -0
  65. package/src/maestro/checks/assertEnvironment.ts +8 -33
  66. package/src/maestro/selectAgentModels.ts +70 -0
  67. package/src/maestro/setupInitialConfiguration.ts +26 -0
  68. package/src/maestro/status/formatMaestroStatus.ts +3 -0
  69. package/src/score/collectWorkflowEvidence.ts +170 -0
  70. package/src/score/parseClassifierScores.ts +51 -0
  71. package/src/score/questions.json +24 -0
  72. package/src/score/requestEvaluation.ts +54 -0
  73. package/src/score/scoreWorkflow.ts +100 -0
  74. package/src/tools/child/record-builder-handoff.ts +1 -0
  75. package/src/tools/child/record-simplifier-handoff.ts +2 -1
  76. package/src/tools/child/record-verifier-handoff.ts +1 -0
  77. package/src/tools/main/create-spec.ts +1 -0
  78. package/src/tools/main/mark-spec-ready.ts +1 -0
  79. package/src/tools/main/resolve-escalations.ts +1 -0
  80. package/src/tools/main/resolve-findings.ts +6 -1
  81. package/src/tools/main/run-builder.ts +8 -1
  82. package/src/tools/main/run-simplifier.ts +26 -6
  83. package/src/tools/main/run-verifier.ts +8 -1
  84. package/src/tools/main/score-workflow.ts +43 -0
  85. package/src/ui/selectModel.ts +23 -15
  86. package/src/ui/showAgentRolesSetupMenu.ts +65 -0
  87. package/src/workflow/spec/markSpecReady.ts +13 -3
  88. package/src/workflow/state/schema.ts +3 -0
  89. package/src/workflow/transitions.ts +9 -2
  90. package/templates/spec.md +1 -1
  91. package/ADR.md +0 -457
  92. package/ROADMAP.md +0 -641
  93. package/src/maestro/setupConfiguration.ts +0 -50
  94. package/src/ui/selectSpec.ts +0 -14
  95. package/src/ui/showSetupMenu.ts +0 -44
  96. package/src/ui/showSpecMenu.ts +0 -36
  97. /package/{MISSION.md → docs/MISSION.md} +0 -0
  98. /package/{TECH_STACK.md → docs/TECH_STACK.md} +0 -0
@@ -0,0 +1,23 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-003'
4
+ title: 'Route builder failures through owner escalations'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ The `owner` must decide how work continues after a reportable technical problem. The workflow also needs a simpler model with two `builder` outcomes.
11
+
12
+ ## Decision
13
+
14
+ The `builder` reports only `done` or `escalation`. Reportable technical failures use the existing `escalation` process. The `owner` decides how to proceed instead of
15
+ reaching a terminal failure phase.
16
+
17
+ ## Consequences
18
+
19
+ Reuse the existing tools, numbered `handoffs`, and batch decisions. Individual `probe` results retain `failed` as a valid value.
20
+
21
+ Execution and protocol errors without a valid saved result still stop the workflow. This decision adds no automatic recovery.
22
+
23
+ This breaking MVP change has no migrations, compatibility readers, deprecated aliases, or dedicated legacy-format tests.
@@ -0,0 +1,35 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-004'
4
+ title: 'Require Git only for the simplifier'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Supersedes [ADR-001](0001-keep-the-workflow-independent-of-git.md).
11
+
12
+ The `simplifier` needs a list of changed code files. Git can supply that list without adding file tracking to `builder` `handoffs`.
13
+
14
+ ## Decision
15
+
16
+ Only the `simplifier` requires Git and a Git repository to discover changed files. It has no non-Git fallback.
17
+
18
+ The Git readiness decision belongs only inside `maestro_run_simplifier`, before delegation. The tool checks readiness with `git rev-parse --is-inside-work-tree` in the
19
+ project directory. Only a successful result of `true` enables simplification.
20
+
21
+ Activation, `spec` preparation, `builder` execution, `verifier` completion, and `finding` resolution do not check Git readiness. Both `simplifier` entry routes save
22
+ `simplifier-running` before `Maestro` calls `maestro_run_simplifier`.
23
+
24
+ `Maestro` does not create automatic commits or Git checkpoints. The `owner` retains control of commits, pull requests, and merging.
25
+
26
+ ## Consequences
27
+
28
+ If Git readiness cannot be confirmed, `maestro_run_simplifier` reports a warning and skips delegation. The workflow moves from `simplifier-running` to `candidate-ready`
29
+ without an error. The skip transition is defined in `src/workflow/transitions.ts` and applied through `transitionWorkflow`.
30
+
31
+ Activation does not predict whether simplification will be skipped. The same readiness decision applies after successful verification and after the `owner` rejects all
32
+ current `findings`. Rejected `findings` retain their reasons and do not become passed verification.
33
+
34
+ The `simplifier` uses Git to select all staged, unstaged, and untracked code changes, including pre-existing changes. There is no spec-specific starting commit or
35
+ `builder` file list. Required caller updates can include initially unchanged files.
@@ -0,0 +1,32 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-005'
4
+ title: 'Approve a specification document set as one contract'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Combining motivation, behavior, and technical decisions in one `spec.md` made the document difficult to navigate. The `owner` selected separate documents by purpose, with
11
+ `acceptance criteria` next to their requirements rather than collected at the end.
12
+
13
+ ## Decision
14
+
15
+ Each new `spec` has required `proposal.md` for motivation and scope and `spec.md` for behavior and `acceptance criteria`. `Maestro` creates `design.md` only when
16
+ significant approved technical decisions need recording. Routine implementation choices remain with the `builder`.
17
+
18
+ One `GREEN FLAG` approves all present documents together. The entire set and its prototypes remain frozen during agent execution. Revision uses the existing
19
+ `drafting-spec` flow and renewed approval of the complete set. No per-document approval or new workflow phase is introduced.
20
+
21
+ Requirements keep level-three `REQ` headings. Their `acceptance criteria` use level-four AC headings. Relevant standalone regression criteria use level-three AC headings
22
+ under an optional `Regression checks` section, without a requirement or `Delta` field. All criteria share continuous numbering across the document. Shared criteria are
23
+ defined once and linked from other requirements.
24
+
25
+ ## Consequences
26
+
27
+ Creation saves the proposal and behavioral `spec`, returns their paths and the optional design path, and leaves design creation to drafting. Approval requires the
28
+ proposal. All three agent roles read every present document and must not create or modify a design after approval.
29
+
30
+ Freezing continues to rely on agent instructions, without a file-hash manifest or file locks. Saved workflow and `handoff` formats are unchanged. Level-three standalone
31
+ regression AC headings and nested level-four headings are both recognized. Historical `specs` are not migrated; older drafts need manual `owner` handling before new
32
+ approval.
@@ -0,0 +1,25 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-006'
4
+ title: 'Maintain the roadmap in Linear'
5
+ status: superseded
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Superseded by [ADR-007](0007-maintain-the-roadmap-in-the-repository.md).
11
+
12
+ The `owner` moved roadmap items from the repository to Linear, selected the dedicated `MAESTRO` team, and requested removal of the local roadmap file and redundant
13
+ identifiers. This moves the source of truth for planning outside Git.
14
+
15
+ ## Decision
16
+
17
+ Maintain the roadmap only in [Linear](https://linear.app/emilio-spatola/team/MAESTRO/overview), using Linear issue identifiers. Keep the roadmap location and maintenance
18
+ instructions in `AGENTS.md`, without a local copy of the issue list.
19
+
20
+ Approved `specifications`, verification evidence, the changelog, and architectural decisions remain in the repository.
21
+
22
+ ## Consequences
23
+
24
+ Reading or updating current roadmap state requires Linear access. Git history remains evidence of earlier plans, not the current roadmap. Imported issues retain
25
+ commit-pinned links to repository evidence. Removing the local roadmap also removes it from the published package.
@@ -0,0 +1,27 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-007'
4
+ title: 'Maintain the roadmap in the repository'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Supersedes [ADR-006](0006-maintain-the-roadmap-in-linear.md).
11
+
12
+ The `owner` reported excessive token use when accessing Linear and requested restoration of the Markdown roadmap. The `owner` also explicitly prohibited changes to the
13
+ Linear project.
14
+
15
+ ## Decision
16
+
17
+ Maintain the roadmap under `docs/roadmap/` as the source of truth. Restore project items from Linear through read-only access, preserving existing `MAESTRO` identifiers,
18
+ scope, and evidence. Do not transfer Linear onboarding or test issues.
19
+
20
+ Keep Linear unchanged as historical reference. Routine roadmap reading and maintenance use local files, not MCP.
21
+
22
+ ## Consequences
23
+
24
+ Planning no longer requires Linear access. Repository instructions, documentation audit guidance, links, and published package contents refer to the local roadmap. Later
25
+ roadmap changes do not need synchronization with Linear.
26
+
27
+ Conflicting imported status and acceptance evidence remain explicit rather than being treated as proof of final `owner` acceptance.
@@ -0,0 +1,23 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-008'
4
+ title: "Use Pi's registry for model availability"
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Maestro's model format regex rejected OpenRouter IDs containing additional slashes. The `owner` selected Pi as the source of truth for models and explicitly retained the
11
+ activation availability check because it uses Pi's registry.
12
+
13
+ ## Decision
14
+
15
+ Treat configured models as strings without a separate format regex. During activation, match each complete `provider/model` identifier against
16
+ `context.modelRegistry.getAvailable()`, preserving slashes inside model IDs. Pass the configured identifier unchanged through `pi-subagents`.
17
+
18
+ Keep Maestro's configuration structure, version, path, thinking-level, and timeout validation.
19
+
20
+ ## Consequences
21
+
22
+ A model absent from Pi's available registry prevents activation. `Maestro` maintains no separate model catalog or authentication check. Provider or authentication
23
+ failures during delegation still use the existing `run` failure path. Workflow recovery and phase transitions remain unchanged.
@@ -0,0 +1,24 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-009'
4
+ title: 'Select optional phases in the transition table'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ The `owner` selected configuration flags to support workflows with only an approved `spec` and independently optional later agents without a separate phase-selection
11
+ interface.
12
+
13
+ ## Decision
14
+
15
+ Each agent has a `required` boolean that defaults to `true`. Disabling `builder` skips all agents. Otherwise `verifier` and `simplifier` can be disabled independently.
16
+ Flags are set before activation and stay unchanged during the workflow. Keep existing configuration reads, without caching or runtime controls.
17
+
18
+ Keep destination selection in `src/workflow/transitions.ts`. A transition destination is either a fixed phase or a pure function of resolved configuration. Callers pass
19
+ configuration to `transitionWorkflow` and save its returned state. No new workflow states, events, or persisted selection fields are needed.
20
+
21
+ ## Consequences
22
+
23
+ Approval can finish at `candidate-ready` without agent execution. Agent and model availability checks apply only to selected phases; activation with only an approved
24
+ `spec` needs no `pi-subagents` ping. Final summaries identify skipped work, without claiming implementation or independent verification occurred.
@@ -0,0 +1,109 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-010'
4
+ title: 'Use the Pi SDK for sequential agent delegation'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Main-extension pre-load exclusion is superseded by [ADR-012](0012-filter-main-maestro-registrations-after-native-discovery.md).
11
+
12
+ `Maestro` currently depends on `pi-subagents` to execute the `builder`, `verifier`, and `simplifier`. Its delegation needs are limited: only one workflow and one child
13
+ agent execute at a time, and `Maestro` waits for each child to finish. `Maestro` already owns workflow transitions, role instructions, saved `handoffs`, and result
14
+ validation.
15
+
16
+ The `owner` wants to remove the `pi-subagents` dependency without building a general-purpose delegation framework. Pi provides `createAgentSession()` for direct SDK
17
+ integration and `RpcClient` for subprocess control. Separate conversations do not require separate processes.
18
+
19
+ ## Decision
20
+
21
+ 1. Replace `pi-subagents` delegation with direct use of the Pi SDK through `createAgentSession()`, rather than RPC subprocesses.
22
+ 2. Preserve sequential execution: one workflow at a time, one child agent at a time, with `Maestro` waiting for completion.
23
+ 3. Use task-and-handoff communication, not a live supervisor dialogue. `Maestro` assigns the task; the child works, saves its `handoff`, and finishes.
24
+ 4. When an `owner` decision is needed, the `builder` saves an `escalation` and ends its `run`. `Maestro` discusses it with the `owner` and records the decisions through
25
+ the existing workflow. Any subsequent `builder` `run` starts a fresh conversation and reads the saved decisions.
26
+ 5. Child sessions must have access to the same working tools available to `Maestro`, plus the tools needed to save their own `handoffs`. Do not load the main `Maestro`
27
+ extension into child sessions. Tools supplied by other extensions may remain available even if they support delegation; role instructions forbid using them to
28
+ delegate. This is a tool-access requirement, not merely an extension-loading policy.
29
+ 6. Automatically load enabled global and project extensions, excluding the main `Maestro` extension. Provide the corresponding working-tool environment through Pi's
30
+ native APIs and configuration, including separate Pi support such as MCP and `codemode` where needed. Loading the same extensions alone does not reproduce every CLI
31
+ capability. Compatibility of arbitrary extensions, tools, and model providers is outside Maestro's responsibility; do not add custom compatibility checks or adapters.
32
+ 7. All three child roles receive the owner's global instruction file, normally `~/.pi/agent/AGENTS.md`, preserving the current `inheritGlobalContext: true` behavior.
33
+ These instructions are not the parent's conversation history.
34
+ 8. All three child roles automatically receive project instructions discovered by Pi, such as applicable `AGENTS.md` files, preserving the current
35
+ `inheritProjectContext: true` behavior. These instructions supplement global instructions and role-specific guidance.
36
+ 9. All three child roles can discover and use available skills, preserving the current `inheritSkills: true` behavior. Expose the skill catalog without loading every
37
+ skill's full contents into the conversation. Skills remain subject to the child's role boundaries and permitted tools; they do not authorize delegation or workflow
38
+ management.
39
+ 10. During a child `run`, report the role, elapsed time, current tool, and recent normal assistant text through Pi's standard tool-progress updates (`onUpdate`). Use Pi's
40
+ built-in presentation, including its default layout, truncation, and expansion behavior. Do not build a custom renderer or implement a fixed visible-line count or
41
+ terminal-height adaptation. Update progress in place instead of appending intermediate messages to the main conversation. Do not include internal reasoning or full
42
+ command output. Continue reporting activity when the child produces no text; do not prompt it to generate artificial progress messages.
43
+ 11. Intermediate activity text is UI-only and must not enter the main model's context. `Maestro` continues to receive the existing workflow result. Pi's display limits do
44
+ not truncate the saved child conversation. The five-, ten-, and twenty-line alternatives are superseded by the decision to use Pi's standard presentation.
45
+ 12. Persist child conversations using Pi's native session format, rather than a custom transcript format. Saved sessions remain available after execution for diagnosis,
46
+ including unsuccessful executions. Each child `run` starts a new conversation; persistence does not introduce automatic session reuse or workflow recovery.
47
+ 13. At child completion or failure, show the `owner` the path to its saved Pi session file, when one exists. The `owner` can inspect the file directly or use Pi's native
48
+ HTML export with `pi --export <session-file> conversation.html`. Do not build a transcript inspector inside `Maestro`. Reading or exporting a transcript does not
49
+ resume child execution.
50
+ 14. Do not impose an automatic child `run` timeout in `Maestro`. Remove `builder.timeoutMinutes`, `verifier.timeoutMinutes`, and `simplifier.timeoutMinutes` from
51
+ `.pi/maestro.json` configuration support, including schema validation, defaults, launch inputs, and configuration documentation. A child continues until it finishes,
52
+ fails, or is manually interrupted. This removes the workflow-level deadline, not the elapsed-time progress display or timeouts internal to Pi and its tools.
53
+ 15. Remove `timeoutMinutes` from the configuration schemas and retain `additionalProperties: false`. Existing TypeBox-based validation rejects configuration files that
54
+ still contain the field. Do not add a migration, ignored legacy fields, or special compatibility handling. The `owner` removes obsolete fields manually.
55
+ 16. Preserve the existing execution-error policy. Launch failures, failed child executions, and missing or invalid `handoffs` stop the workflow and report the error.
56
+ `Maestro` does not automatically start another child session to retry, repair saved state, or roll back files. Preserve the remaining project files and saved workflow
57
+ state for manual `owner` follow-up, including partial protocol writes. Errors do not introduce recovery transitions or synthetic `escalations`.
58
+ 17. Propagate manual cancellation of the main tool to its active child through `session.abort()` and await the interruption before releasing the child session. Do not
59
+ send a final model prompt asking the child to finish, and do not generate a synthetic `handoff`. Leave project files and saved workflow state unchanged by cleanup.
60
+ Close child sessions and release progress subscriptions and session resources on completion, failure, or cancellation. Do not start another child while the previous
61
+ child remains active.
62
+ 18. Store child sessions in a `subagents/` subdirectory of Pi's normal project session directory, normally `~/.pi/agent/sessions/--<project-path>--/subagents/`. Resolve
63
+ the parent directory through Pi's session-directory API rather than reimplementing project-path encoding. Use Pi's native `SessionManager` with this directory. Do not
64
+ create a `subagents/` directory inside the project repository.
65
+ 19. Require Pi 1.5.0 or later for the SDK-based implementation. Update the declared Pi requirement and align implementation verification with this baseline. Do not add
66
+ compatibility fallbacks for earlier Pi versions. This minimum is a scope choice, not a claim that all earlier versions lack the required APIs.
67
+ 20. Do not build an additional tool allowlist or exclusion list to prevent child delegation. Children may have delegation tools available, but their role instructions
68
+ forbid using them. This deliberately relies on instruction compliance rather than technical removal of delegation capabilities. The main `Maestro` extension remains
69
+ excluded.
70
+ 21. Leave compatibility of external integrations to Pi and the `owner`. Do not add a preflight that compares parent and child tool availability, extension health checks,
71
+ special adapters, or a fallback system for incompatible integrations. This scope boundary does not suppress errors actually reported during launch or execution; those
72
+ follow the existing stop-and-report policy.
73
+
74
+ ## Consequences
75
+
76
+ The replacement does not need supervisor request routing or a mechanism that makes the main model answer a child while waiting for it. Saved `handoffs` remain the
77
+ communication boundary for completed work and `escalations`.
78
+
79
+ SDK sessions share a Node.js process. Separate conversation histories do not isolate module-level mutable state or project files. Child resource loading must account for
80
+ this distinction.
81
+
82
+ Automatic extension loading intentionally differs from the current foreground behavior of `pi-subagents` 0.78.0, which does not automatically load the parent's global and
83
+ project extensions. Shared working-tool access is provided through Pi's native environment, not an independent compatibility guarantee for every integration. The
84
+ replacement must use Pi's tool activation and support such as MCP and `codemode`, rather than assuming the SDK supplies the CLI's capabilities by default. There is no
85
+ custom parity check, health gate, or adapter layer for third-party integrations. Children do not inherit the parent's conversation, but they share the process and may
86
+ interact with process-wide mutable state. Loaded extensions can create additional connections, timers, and process-wide effects. Excluding the main `Maestro` extension
87
+ does not establish compatibility with every other extension or remove delegation tools supplied by other extensions. `Maestro` launches its own children sequentially;
88
+ compliance with the broader no-delegation rule relies on child instructions. A child that ignores those instructions could launch other agents. This accepted limitation
89
+ avoids maintaining tool classifications and exclusion lists and does not claim a sandbox; even ordinary shell access can launch processes.
90
+
91
+ Pi's standard tool-progress presentation replaces FleetView's live activity display, not its full transcript inspector. `Maestro` owns the progress data, not a new
92
+ rendering system or a guaranteed panel size. Displaying text already produced by the child requires no additional model generation and does not add that text to the main
93
+ model's context. Full transcript inspection uses saved session files and Pi's existing export capability rather than a replacement inspector. The main tool must connect
94
+ cancellation to the child SDK session and perform session cleanup; selecting the SDK alone does not wire these operations together.
95
+
96
+ Native session files retain child messages, tool calls, and tool results beyond the lifetime of the child session. They may contain project data present in those messages
97
+ and results. Persistence is separate from the live progress display and does not add the transcript to the main model's context. The dedicated `subagents/` subdirectory
98
+ keeps child session files separate from the main session files without adding transcript files to the project repository or introducing a custom storage format.
99
+
100
+ Removing the configured deadline simplifies child execution but permits indefinitely running work until manual interruption. This is a breaking configuration change:
101
+ files that still contain `timeoutMinutes` fail existing configuration validation until the `owner` removes the obsolete fields. Document the removal without adding legacy
102
+ compatibility code.
103
+
104
+ Manual cancellation uses Pi's in-process cancellation lifecycle, not termination of a separate operating-system process. It does not undo completed writes or introduce a
105
+ final model turn. `Maestro` uses Pi's cancellation and cleanup lifecycle; behavior of third-party integrations remains outside its compatibility contract.
106
+
107
+ The Pi minimum increases from the currently documented 1.0.0 to 1.5.0. Earlier hosts are outside the new compatibility contract. At decision time, the project has Pi
108
+ 1.0.3 installed locally and the active harness uses Pi 1.5.0; the implementation must be verified against the selected baseline rather than treating the older local
109
+ installation as sufficient verification. This ADR changes no installed dependencies.
@@ -0,0 +1,25 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-011'
4
+ title: 'Separate initial setup UI from configuration rules'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Initial configuration needs searchable model selection without access to Pi's private session runtime. The `owner` selected public Pi components and strict separation
11
+ between graphical controls and configuration rules.
12
+
13
+ ## Decision
14
+
15
+ Use `ctx.ui.select()` for short choices and compose public `Input`, `SelectList`, and Pi filtering through `ctx.ui.custom()` for model selection. Keep graphical modules
16
+ in `src/ui/`, configuration rules and persistence in `src/config/`, and coordination in `src/maestro/setupConfiguration.ts`.
17
+
18
+ Keep completed role selections in memory for one command. Replace a role only after both nested choices finish. Configuration rules derive explicit phase flags from those
19
+ completed selections; confirmation is the only persistence boundary. Thinking choices preserve Pi's supported-level order and start at its first level for both initial
20
+ selections and replacements, without preferring `off`.
21
+
22
+ ## Consequences
23
+
24
+ Setup needs no private runtime access, separate model runtime, new dependency, or persistent draft. UI components receive supplied choices rather than deciding model
25
+ requirements or phase rules. Initial setup is limited to interactive terminal mode.
@@ -0,0 +1,21 @@
1
+ ---
2
+ type: ADR
3
+ id: 'ADR-012'
4
+ title: 'Filter main Maestro registrations after native discovery'
5
+ status: active
6
+ ---
7
+
8
+ ## Context
9
+
10
+ Supersedes only the pre-load exclusion constraint in [ADR-010](0010-use-the-pi-sdk-for-sequential-agent-delegation.md).
11
+
12
+ Child preparation duplicated Pi's package discovery to exclude the main `Maestro` extension before initialization.
13
+
14
+ ## Decision
15
+
16
+ Use Pi's native discovery and configured selection. Filter the loaded main `Maestro` extension through `extensionsOverride` before constructing the child session.
17
+
18
+ ## Consequences
19
+
20
+ Main-extension initialization may register tools, commands, and handlers, but must not mutate parent state or start resources before filtering. SDK sessions share a
21
+ process; filtering removes registrations from the child runtime, not initialization side effects.
@@ -0,0 +1,21 @@
1
+ # Architecture decision records
2
+
3
+ These records explain architectural choices, their context, and consequences. Each decision has its own file; existing IDs remain stable. Records preserve the context at
4
+ decision time, so later decisions may replace part or all of an earlier choice.
5
+
6
+ | ID | Decision | Status |
7
+ | ------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------- |
8
+ | ADR-001 | [Keep the workflow independent of Git](0001-keep-the-workflow-independent-of-git.md) | Superseded |
9
+ | ADR-002 | [Store escalation decisions in builder handoffs](0002-store-escalation-decisions-in-builder-handoffs.md) | Active |
10
+ | ADR-003 | [Route builder failures through owner escalations](0003-route-builder-failures-through-owner-escalations.md) | Active |
11
+ | ADR-004 | [Require Git only for the simplifier](0004-require-git-only-for-the-simplifier.md) | Active |
12
+ | ADR-005 | [Approve a specification document set as one contract](0005-approve-a-specification-document-set-as-one-contract.md) | Active |
13
+ | ADR-006 | [Maintain the roadmap in Linear](0006-maintain-the-roadmap-in-linear.md) | Superseded |
14
+ | ADR-007 | [Maintain the roadmap in the repository](0007-maintain-the-roadmap-in-the-repository.md) | Active |
15
+ | ADR-008 | [Use Pi's registry for model availability](0008-use-pis-registry-for-model-availability.md) | Active |
16
+ | ADR-009 | [Select optional phases in the transition table](0009-select-optional-phases-in-the-transition-table.md) | Active |
17
+ | ADR-010 | [Use the Pi SDK for sequential agent delegation](0010-use-the-pi-sdk-for-sequential-agent-delegation.md) | Active |
18
+ | ADR-011 | [Separate initial setup UI from configuration rules](0011-separate-initial-setup-ui-from-configuration-rules.md) | Active |
19
+ | ADR-012 | [Filter main Maestro registrations after native discovery](0012-filter-main-maestro-registrations-after-native-discovery.md) | Active |
20
+
21
+ When a decision is replaced, add a new record and link both records. Requirements and planned work belong in the [roadmap](../roadmap/README.md).
@@ -10,8 +10,13 @@ For example, if Pi starts in `/work/app/src`, `Maestro` reads `/work/app/src/.pi
10
10
 
11
11
  ## Initial setup
12
12
 
13
- The `owner` runs `/maestro` in Pi's interactive terminal and follows the guided setup to select models and thinking levels for `builder`, `verifier`, and `simplifier`,
14
- then confirms to save the configuration and activate `Maestro`.
13
+ The `owner` runs `/maestro` in Pi's interactive terminal and follows the guided setup to select models and thinking levels for `builder`, `verifier`, and `simplifier`.
14
+ The `scorer` appears in the same menu and offers available Pi classifiers only, without a thinking-level prompt. Selecting a classifier enables scoring; leaving it
15
+ unselected keeps scoring disabled. Confirmation saves the choices in `.pi/maestro.json`.
16
+
17
+ ## Agent models
18
+
19
+ Before starting or restarting a `spec`, the `owner` can choose "Agent models" in `/maestro` to change or clear any role's model.
15
20
 
16
21
  ## Example configuration
17
22
 
@@ -35,6 +40,10 @@ This is an explicit all-agent configuration, not a set of model defaults. The `o
35
40
  "required": true,
36
41
  "model": "openai-codex/gpt-6.1-sol",
37
42
  "thinking": "high"
43
+ },
44
+ "scorer": {
45
+ "required": true,
46
+ "model": "openrouter/typesafe/jev-1.14"
38
47
  }
39
48
  }
40
49
  ```
@@ -54,9 +63,12 @@ This is an explicit all-agent configuration, not a set of model defaults. The `o
54
63
  | `verifier.model` | For enabled execution | None | Model string passed unchanged to Pi. |
55
64
  | `verifier.thinking` | No | `medium` | One supported thinking level. |
56
65
  | `simplifier` | No | `Simplifier` defaults | Overrides supported `simplifier` fields. |
57
- | `simplifier.required` | No | `true` | Boolean selecting the `simplifier` phase. |
66
+ | `simplifier.required` | No | `false` | Boolean selecting the `simplifier` phase. |
58
67
  | `simplifier.model` | For enabled execution | None | Model string passed unchanged to Pi. |
59
68
  | `simplifier.thinking` | No | `high` | One supported thinking level. |
69
+ | `scorer` | No | Disabled | Overrides supported `scorer` fields. |
70
+ | `scorer.required` | No | `false` | Boolean selecting workflow scoring. |
71
+ | `scorer.model` | When scoring is enabled | None | Full Pi classifier identifier; no default or fallback. |
60
72
 
61
73
  Model values use the full `provider/model` identifier supplied by Pi's model registry, such as `openrouter/~openai/gpt-mini-latest`. Model IDs may contain additional
62
74
  slashes. `Maestro` does not apply a separate format rule; it matches the complete identifier against Pi's available models and uses it unchanged for SDK execution.
@@ -101,11 +113,12 @@ directory is `.specs` because `specDirectory` is omitted.
101
113
 
102
114
  ## Phase selection
103
115
 
104
- Set each agent's `required` boolean before activation and leave configuration unchanged until the workflow completes. Omitted flags default to `true`, even when an agent
105
- section is absent. Strings, numbers, and `null` are invalid.
116
+ Set each phase's `required` boolean before activation and leave configuration unchanged until the workflow completes. Omitted flags default to `true` for `builder` and
117
+ `verifier`, and `false` for `simplifier` and `scorer`, including when their sections are absent. Strings, numbers, and `null` are invalid.
106
118
 
107
119
  With `builder.required: false`, approval completes the workflow with an approved `spec` and no agent execution, regardless of the other flags. The approved `spec` can be
108
- used for implementation in another workflow. With `builder` enabled, `verifier` and `simplifier` can each be disabled independently. Neither runs without `builder`.
120
+ used for implementation in another workflow. With `builder` enabled, `verifier`, `simplifier`, and `scorer` can each be disabled independently. None runs without
121
+ `builder`. The table below shows agent execution; enabled scoring follows the last selected implementation phase.
109
122
 
110
123
  | `builder.required` | `verifier.required` | `simplifier.required` | Selected phases after approval |
111
124
  | ------------------ | ------------------- | --------------------- | ------------------------------ |
@@ -118,6 +131,16 @@ used for implementation in another workflow. With `builder` enabled, `verifier`
118
131
  Disabled phases do not require model availability and produce no `handoff`. The final summary identifies skipped work rather than claiming it was performed. Enabled
119
132
  simplification can still be skipped if Git is unavailable.
120
133
 
134
+ ## Scorer
135
+
136
+ The `owner` can choose any available Pi classifier in [Agent models](#agent-models) or during initial setup. The choice is saved as `scorer.model`. The example above uses
137
+ `openrouter/typesafe/jev-1.14`, but no model or provider is required by default.
138
+
139
+ Scoring is disabled when `scorer` is omitted or `scorer.required` is `false`. Enabling it requires an explicit, non-empty model.
140
+
141
+ If the configured classifier is unavailable when scoring runs, evaluation saves a failure and the workflow completes without scores. See
142
+ [Workflow evaluation](workflow.md#workflow-evaluation).
143
+
121
144
  ## Schema version
122
145
 
123
146
  `version` identifies the configuration format, not the npm package version. The supported value is `1.0.0`. Other values stop activation.
@@ -135,11 +158,9 @@ For example, `specDirectory: "planning/specs"` places `specs` in `<project-root>
135
158
 
136
159
  ## Model access
137
160
 
138
- During activation, `Maestro` checks the configured models for enabled agents against Pi's available model registry. Pi's registry is the source of truth for model
139
- availability; `Maestro` does not maintain a separate model list or authentication check. A missing enabled model stops activation and identifies the full configured
140
- identifier.
161
+ An unavailable model for an enabled `builder`, `verifier`, or `simplifier` prevents activation. The `owner` can select a different model in [Agent models](#agent-models)
162
+ or sign in to the provider in Pi. If the `builder` is disabled, no models are needed to start.
141
163
 
142
- With `builder` disabled, activation checks only configuration, without a model lookup.
164
+ If the `scorer` classifier is unavailable at evaluation time, the workflow finishes without scores. See [Scorer](#scorer).
143
165
 
144
- The `owner` can correct the identifier or authenticate the provider in Pi, then retry `/maestro`. Authentication or provider errors during execution still appear as `run`
145
- failures. Agent context are described in [Subagent integration](subagent-integration.md#roles-and-context).
166
+ See [Subagent integration](subagent-integration.md#roles-and-context) for agent context.
package/docs/glossary.md CHANGED
@@ -2,35 +2,53 @@
2
2
 
3
3
  ## Terms
4
4
 
5
+ ### Roles
6
+
7
+ | Term | Meaning |
8
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------- |
9
+ | `Owner` | The person who approves the `spec`, decides questions and `findings`, and performs the final review. |
10
+ | `Maestro` | The coordinator that prepares the `spec`, runs the agents, and records `owner` decisions. |
11
+ | `Builder` | The agent that implements the approved `spec` and checks every `GIVEN`, `WHEN`, and `THEN` scenario. |
12
+ | `Verifier` | The independent agent that checks the implementation and reports technical issues. |
13
+ | `Simplifier` | The agent that refactors accepted code for clarity without changing behavior or introducing check failures. |
14
+ | `Scorer` | The optional classifier invoked by `Maestro` to score workflow correctness and verification quality against the approved `spec`. |
15
+
16
+ ### Specification
17
+
5
18
  | Term | Meaning |
6
19
  | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
7
- | `Owner` | The person who approves the `spec`, decides questions and `findings`, and performs the final review. |
8
- | `Maestro` | The coordinator that prepares the `spec`, runs the agents, and records `owner` decisions. |
9
- | `Builder` | The agent that implements the approved `spec` and checks every `GIVEN`, `WHEN`, and `THEN` scenario. |
10
- | `Verifier` | The independent agent that checks the implementation and reports technical issues. |
11
- | `Simplifier` | The agent that refactors accepted code for clarity without changing behavior or introducing check failures. |
12
20
  | `Spec` | A `specification` for one change: `proposal.md` for motivation and scope, `spec.md` for behavior and `acceptance criteria`, and optional `design.md` for technical decisions. The present documents are approved and frozen together. |
21
+ | `Delta` | Field under each requirement in `spec.md` that shows whether it adds, modifies, or removes behavior. |
22
+ | `Verified by` | Field under each requirement in `spec.md` that links to the `acceptance criteria` or existing tests that cover it. |
13
23
  | `Acceptance criterion` (`AC`) | One required, observable result defined in the `spec`. |
14
24
  | `GIVEN` | The starting conditions of an `acceptance criterion`. |
15
25
  | `WHEN` | The action or observation that checks the behavior of an `acceptance criterion`. |
16
26
  | `THEN` | The measurable outcome the `WHEN` must produce. |
17
27
  | `Assumption` | A detail the request did not specify or a scope boundary taken as given. A false `assumption` during implementation is an `escalation` trigger. |
18
- | `Artifact` | A saved workflow file, such as a `spec`, or a `handoff` between agents. |
19
- | `Handoff` | A saved agent report. `Builder` and `verifier` reports include `probe` outcomes. A `simplifier` report includes refactored files, a summary, and notes. |
20
- | `Observability` | The owner's ability to inspect workflow progress and reported results. |
21
- | `Run` or `pass` | One agent execution with a fresh conversation. |
22
- | `Candidate` | The project files created by agents after a workflow `run` |
23
- | `Finding` | A technical issue that the `verifier` records for an `owner` decision. |
24
- | `Escalation` | An implementation question or reportable technical problem that the `builder` records in its `handoff` for an `owner` decision. |
25
- | `GREEN FLAG` | The owner's explicit reply that approves the current `spec` and proceeds through the selected phases. |
26
- | `fix-code` | An `owner` decision that requests code fixes without changing the approved `spec`. |
27
- | `revise-spec` | An `owner` decision that records a reason and agreed requirement change, then returns to `drafting-spec` for revision and renewed approval. |
28
- | `reject` | An `owner` decision that declines a `finding` and records a reason. It does not mean that verification passed. |
29
- | `candidate-ready` | The completed workflow phase. Final review remains with the `owner`. |
30
28
 
31
- ## Identifiers and file names
29
+ ### Approval and decisions
30
+
31
+ | Term | Meaning |
32
+ | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | `GREEN FLAG` | The owner's explicit reply that approves the current `spec` and proceeds through the selected phases. |
34
+ | `Escalation` | An implementation question or reportable technical problem that the `builder` records in its `handoff` for an `owner` decision. |
35
+ | `Finding` | A technical issue that the `verifier` records for an `owner` decision. |
36
+ | `fix-code` | An `owner` decision that requests code fixes without changing the approved `spec`. |
37
+ | `revise-spec` | An `owner` decision that records a reason and agreed requirement change, then returns to `drafting-spec` for revision and renewed approval. |
38
+ | `reject` | An `owner` decision that declines a `finding` and records a reason. It does not mean that verification passed. |
32
39
 
33
- An ID is an identifier that names one record. These labels refer to records within one `spec`, not across all workflows.
40
+ ### Runs and results
41
+
42
+ | Term | Meaning |
43
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
44
+ | `Run` or `pass` | One agent execution with a fresh conversation. |
45
+ | `Artifact` | A saved workflow file, such as a `spec`, or a `handoff` between agents. |
46
+ | `Handoff` | A saved agent report. `Builder` and `verifier` reports include `probe` outcomes. A `simplifier` report includes refactored files, a summary, and notes. |
47
+ | `Observability` | The owner's ability to inspect workflow progress and reported results. |
48
+ | `Candidate` | The project files created by agents after a workflow `run` |
49
+ | `candidate-ready` | The completed workflow phase. Final review remains with the `owner`. |
50
+
51
+ ## Identifiers and file names
34
52
 
35
53
  | Label | Meaning | Location or scope |
36
54
  | -------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------- |
@@ -48,33 +66,4 @@ An ID is an identifier that names one record. These labels refer to records with
48
66
  All paths in this table are relative to the `spec` directory unless stated otherwise. The [configuration](configuration.md#path-rules) can change the directory that
49
67
  contains `specs`.
50
68
 
51
- Requirement IDs use the `REQ` prefix. They are unique within the `spec` and remain stable during revisions. Each requirement links to its verification through
52
- `Verified by`. See [Requirement coverage](workflow.md#requirement-coverage).
53
-
54
- The `AC` prefix is the template's naming convention. Criterion IDs must be unique within the `spec`. Reports use the exact IDs from the `spec`, including standalone
55
- regression criteria without a requirement association. `Builder` and `verifier` numbers count saved `handoffs` in separate sequences.
56
-
57
- ## Escalation references
58
-
59
- Read `B1/E1` as "escalation 1 in builder report 1". `B1` selects `handoffs/builder/B1.json`. `E1` selects the entry with `id: "E1"` in its `escalations` list.
60
-
61
- `Escalation` numbers restart at `E1` in each `builder` report. `B1/E1` and `B2/E1` identify different questions, even if they concern the same topic.
62
-
63
- The `owner` discusses every current question with `Maestro`. `Maestro` records all answers and reasons together in that same `builder` report. See
64
- [Escalations](workflow.md#escalations) for the available choices and their effects.
65
-
66
- ## Finding references
67
-
68
- Read `V1/F2` as "finding 2 in verifier report 1". `V1` selects `handoffs/verifier/V1.json`. `F2` selects the entry with `id: "F2"` in its `findings` list.
69
-
70
- `Finding` numbers restart at `F1` in each `verifier` report. `V1/F2` and `V2/F2` identify different records, even if they describe a similar issue.
71
-
72
- For example, a `finding` about a saved title can appear in a `Maestro` message like this:
73
-
74
- > Verifier report 1, finding 2 (`V1/F2`): the title returns to "Draft" after saving "Ready" and reopening the item. Acceptance criterion 1 (`AC1`) requires the saved
75
- > title to remain "Ready".
76
-
77
- In this example, the finding's `acceptanceCriterion: "AC1"` connects the issue to criterion `AC1` in `spec.md`.
78
-
79
- The `owner` discusses the issue with `Maestro`. `Maestro` records the decision in the same `verifier` report. See [Findings](workflow.md#findings) for the available
80
- choices and their effects.
69
+ `Escalation` and `finding` numbers restart in each report: `B1/E1` and `B2/E1` refer to different questions.