@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.
- package/CHANGELOG.md +5 -0
- package/README.md +55 -114
- package/agents/builder.md +7 -7
- package/agents/maestro.md +62 -45
- package/agents/simplifier.md +6 -5
- package/agents/verifier.md +13 -13
- package/docs/adr/0001-keep-the-workflow-independent-of-git.md +25 -0
- package/docs/adr/0002-store-escalation-decisions-in-builder-handoffs.md +24 -0
- package/docs/adr/0003-route-builder-failures-through-owner-escalations.md +23 -0
- package/docs/adr/0004-require-git-only-for-the-simplifier.md +35 -0
- package/docs/adr/0005-approve-a-specification-document-set-as-one-contract.md +32 -0
- package/docs/adr/0006-maintain-the-roadmap-in-linear.md +25 -0
- package/docs/adr/0007-maintain-the-roadmap-in-the-repository.md +27 -0
- package/docs/adr/0008-use-pis-registry-for-model-availability.md +23 -0
- package/docs/adr/0009-select-optional-phases-in-the-transition-table.md +24 -0
- package/docs/adr/0010-use-the-pi-sdk-for-sequential-agent-delegation.md +109 -0
- package/docs/adr/0011-separate-initial-setup-ui-from-configuration-rules.md +25 -0
- package/docs/adr/0012-filter-main-maestro-registrations-after-native-discovery.md +21 -0
- package/docs/adr/README.md +21 -0
- package/docs/configuration.md +33 -12
- package/docs/glossary.md +38 -49
- package/docs/inspiration.md +32 -0
- package/docs/roadmap/README.md +42 -0
- package/docs/roadmap/maestro-10-improve-status-presentation-and-activation-feedback.md +18 -0
- package/docs/roadmap/maestro-11-introduce-maestro-at-activation.md +19 -0
- package/docs/roadmap/maestro-12-verify-code-quality-against-agentsmd-instructions.md +21 -0
- package/docs/roadmap/maestro-13-check-subagent-extensions-at-activation.md +21 -0
- package/docs/roadmap/maestro-14-rename-the-test-support-directory.md +16 -0
- package/docs/roadmap/maestro-15-match-handoff-criteria-to-the-approved-spec.md +19 -0
- package/docs/roadmap/maestro-16-route-finding-driven-spec-revisions-through-drafting-spec.md +19 -0
- package/docs/roadmap/maestro-17-keep-acceptance-criterion-numbering-continuous.md +19 -0
- package/docs/roadmap/maestro-18-record-escalation-resolutions-when-the-spec-changes.md +18 -0
- package/docs/roadmap/maestro-19-guide-initial-configuration.md +22 -0
- package/docs/roadmap/maestro-20-rename-the-npm-package.md +17 -0
- package/docs/roadmap/maestro-21-label-acceptance-criterion-coverage.md +18 -0
- package/docs/roadmap/maestro-22-avoid-acceptance-criteria-already-covered-by-tests.md +16 -0
- package/docs/roadmap/maestro-23-change-agent-models-before-a-builder-run.md +14 -0
- package/docs/roadmap/maestro-24-add-a-simplifier-with-one-clear-purpose-per-agent.md +23 -0
- package/docs/roadmap/maestro-25-define-workflow-reconciliation.md +19 -0
- package/docs/roadmap/maestro-26-exit-maestro-mode-automatically-at-workflow-completion.md +18 -0
- package/docs/roadmap/maestro-27-make-all-implementation-phases-optional.md +26 -0
- package/docs/roadmap/maestro-28-add-maestro-role-instructions-alongside-the-other-agents.md +14 -0
- package/docs/roadmap/maestro-6-display-specs-in-a-browser.md +14 -0
- package/docs/roadmap/maestro-7-route-builder-failures-through-owner-escalations.md +19 -0
- package/docs/roadmap/maestro-8-store-escalations-and-owner-decisions-in-builder-handoffs.md +19 -0
- package/docs/roadmap/maestro-9-format-glossary-terms-consistently.md +14 -0
- package/docs/roadmap/maestro-free-1-require-pi-150.md +16 -0
- package/docs/roadmap/maestro-free-2-remove-maestro-run-timeouts.md +18 -0
- package/docs/roadmap/maestro-free-3-run-the-builder-through-the-pi-sdk.md +31 -0
- package/docs/roadmap/maestro-free-4-run-the-verifier-through-the-pi-sdk.md +22 -0
- package/docs/roadmap/maestro-free-5-run-the-simplifier-through-the-pi-sdk.md +22 -0
- package/docs/roadmap/maestro-free-6-show-sdk-agent-activity-through-pi.md +21 -0
- package/docs/roadmap/maestro-free-7-remove-the-pi-subagents-dependency.md +21 -0
- package/docs/roadmap/maestro-free-pre-3-implement-internal-sdk-delegation.md +37 -0
- package/docs/subagent-integration.md +9 -29
- package/docs/workflow.md +62 -246
- package/extensions/maestro.ts +96 -19
- package/package.json +2 -6
- package/src/MaestroPaths.ts +9 -0
- package/src/config/assertConfiguration.ts +23 -21
- package/src/config/defaults.ts +2 -1
- package/src/config/loadConfiguration.ts +3 -2
- package/src/config/saveConfiguration.ts +38 -14
- package/src/config/schema.ts +13 -0
- package/src/maestro/checks/assertEnvironment.ts +8 -33
- package/src/maestro/selectAgentModels.ts +70 -0
- package/src/maestro/setupInitialConfiguration.ts +26 -0
- package/src/maestro/status/formatMaestroStatus.ts +3 -0
- package/src/score/collectWorkflowEvidence.ts +170 -0
- package/src/score/parseClassifierScores.ts +51 -0
- package/src/score/questions.json +24 -0
- package/src/score/requestEvaluation.ts +54 -0
- package/src/score/scoreWorkflow.ts +100 -0
- package/src/tools/child/record-builder-handoff.ts +1 -0
- package/src/tools/child/record-simplifier-handoff.ts +2 -1
- package/src/tools/child/record-verifier-handoff.ts +1 -0
- package/src/tools/main/create-spec.ts +1 -0
- package/src/tools/main/mark-spec-ready.ts +1 -0
- package/src/tools/main/resolve-escalations.ts +1 -0
- package/src/tools/main/resolve-findings.ts +6 -1
- package/src/tools/main/run-builder.ts +8 -1
- package/src/tools/main/run-simplifier.ts +26 -6
- package/src/tools/main/run-verifier.ts +8 -1
- package/src/tools/main/score-workflow.ts +43 -0
- package/src/ui/selectModel.ts +23 -15
- package/src/ui/showAgentRolesSetupMenu.ts +65 -0
- package/src/workflow/spec/markSpecReady.ts +13 -3
- package/src/workflow/state/schema.ts +3 -0
- package/src/workflow/transitions.ts +9 -2
- package/templates/spec.md +1 -1
- package/ADR.md +0 -457
- package/ROADMAP.md +0 -641
- package/src/maestro/setupConfiguration.ts +0 -50
- package/src/ui/selectSpec.ts +0 -14
- package/src/ui/showSetupMenu.ts +0 -44
- package/src/ui/showSpecMenu.ts +0 -36
- /package/{MISSION.md → docs/MISSION.md} +0 -0
- /package/{TECH_STACK.md → docs/TECH_STACK.md} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Objective: Register the configured-classifier workflow scoring operation for Maestro.
|
|
3
|
+
* Used: After implementation phases finish and before the final summary.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ExtensionAPI } from '@earendil-works/pi-coding-agent';
|
|
7
|
+
import { Type } from 'typebox';
|
|
8
|
+
|
|
9
|
+
import { SPEC_ID_PATTERN } from '#ids/isValidSpecId.ts';
|
|
10
|
+
import { scoreWorkflow } from '#src/score/scoreWorkflow.ts';
|
|
11
|
+
|
|
12
|
+
export const SCORE_WORKFLOW_TOOL = {
|
|
13
|
+
NAME: 'maestro_score_workflow',
|
|
14
|
+
LABEL: 'Score Workflow',
|
|
15
|
+
DESCRIPTION:
|
|
16
|
+
'Evaluate the active implementation in scorer-running with the configured classifier. Collect evidence, save scores or a failure, then reach candidate-ready. Call next without owner approval.',
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export const registerScoreWorkflowTool = (pi: ExtensionAPI): void => {
|
|
20
|
+
pi.registerTool({
|
|
21
|
+
name: SCORE_WORKFLOW_TOOL.NAME,
|
|
22
|
+
label: SCORE_WORKFLOW_TOOL.LABEL,
|
|
23
|
+
description: SCORE_WORKFLOW_TOOL.DESCRIPTION,
|
|
24
|
+
executionMode: 'sequential',
|
|
25
|
+
parameters: Type.Object(
|
|
26
|
+
{ specId: Type.String({ pattern: SPEC_ID_PATTERN.source }) },
|
|
27
|
+
{ additionalProperties: false },
|
|
28
|
+
),
|
|
29
|
+
async execute(_toolCallId, { specId }, signal, _onUpdate, context) {
|
|
30
|
+
const details = await scoreWorkflow({ pi, context, specId, signal });
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
content: [
|
|
34
|
+
{
|
|
35
|
+
type: 'text',
|
|
36
|
+
text: `Workflow evaluation saved. Report this saved outcome, its paths, and separate scores and confidences if successful; a judge score is not proof of correctness.\n${JSON.stringify(details)}`,
|
|
37
|
+
},
|
|
38
|
+
],
|
|
39
|
+
details,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
};
|
package/src/ui/selectModel.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Objective: Show a searchable, bounded picker for supplied model identifiers.
|
|
3
|
-
* Used: When
|
|
3
|
+
* Used: When selecting or clearing an agent's model.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import type { ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
@@ -11,26 +11,34 @@ type SelectModelInput = {
|
|
|
11
11
|
choices: string[];
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const CLEAR_ROLE_ITEM = { value: '', label: 'None — clear this role' };
|
|
15
|
+
|
|
16
|
+
export const selectModel = ({
|
|
17
|
+
ui,
|
|
18
|
+
choices,
|
|
19
|
+
}: SelectModelInput): Promise<string | null | undefined> =>
|
|
20
|
+
ui.custom<string | null | undefined>((tui, theme, keybindings, done) => {
|
|
16
21
|
const input = new Input({ prompt: 'Search: ' });
|
|
17
22
|
const title = new Text('Select model', 0, 0);
|
|
18
23
|
const hint = new Text('Type to search. Up/down navigate, Enter select, Escape cancel.', 0, 0);
|
|
19
24
|
|
|
20
25
|
const createList = (query: string) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const items = fuzzyFilter(choices, query, (value) => value).map((value) => ({
|
|
27
|
+
value,
|
|
28
|
+
label: value,
|
|
29
|
+
}));
|
|
30
|
+
|
|
31
|
+
items.unshift(CLEAR_ROLE_ITEM);
|
|
32
|
+
|
|
33
|
+
const list = new SelectList(items, 10, {
|
|
34
|
+
selectedPrefix: (text) => theme.fg('accent', text),
|
|
35
|
+
selectedText: (text) => theme.fg('accent', text),
|
|
36
|
+
description: (text) => theme.fg('muted', text),
|
|
37
|
+
scrollInfo: (text) => theme.fg('dim', text),
|
|
38
|
+
noMatch: (text) => theme.fg('warning', text),
|
|
39
|
+
});
|
|
32
40
|
|
|
33
|
-
list.onSelect = (
|
|
41
|
+
list.onSelect = (item) => done(item === CLEAR_ROLE_ITEM ? null : item.value);
|
|
34
42
|
list.onCancel = () => done(undefined);
|
|
35
43
|
|
|
36
44
|
return list;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Objective: Display current agent role choices and the confirmation action.
|
|
3
|
+
* Used: Between role edits during first-use setup and agent model changes.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { ExtensionContext } from '@earendil-works/pi-coding-agent';
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
SETUP_ROLES,
|
|
10
|
+
type SetupRole,
|
|
11
|
+
type AgentModelSelections,
|
|
12
|
+
} from '#config/saveConfiguration.ts';
|
|
13
|
+
|
|
14
|
+
export const CONFIRM_SETUP = 'confirm';
|
|
15
|
+
|
|
16
|
+
const CONFIRM_LABEL = 'Confirm';
|
|
17
|
+
|
|
18
|
+
const ROLE_LABELS: Record<SetupRole, string> = {
|
|
19
|
+
builder: 'Builder',
|
|
20
|
+
verifier: 'Verifier',
|
|
21
|
+
simplifier: 'Simplifier',
|
|
22
|
+
scorer: 'Scorer',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type ShowAgentRolesSetupMenuInput = {
|
|
26
|
+
ui: ExtensionContext['ui'];
|
|
27
|
+
roles: SetupRole[];
|
|
28
|
+
currentAgentsConfiguration: AgentModelSelections;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const showAgentRolesSetupMenu = async ({
|
|
32
|
+
ui,
|
|
33
|
+
roles,
|
|
34
|
+
currentAgentsConfiguration,
|
|
35
|
+
}: ShowAgentRolesSetupMenuInput) => {
|
|
36
|
+
const specOnly = currentAgentsConfiguration.builder === undefined;
|
|
37
|
+
|
|
38
|
+
const actions = roles.map((role) => {
|
|
39
|
+
const selection = currentAgentsConfiguration[role];
|
|
40
|
+
|
|
41
|
+
const thinking =
|
|
42
|
+
role === SETUP_ROLES.SCORER ? undefined : currentAgentsConfiguration[role]?.thinking;
|
|
43
|
+
|
|
44
|
+
const thinkingLabel = thinking === undefined ? '' : ` (${thinking})`;
|
|
45
|
+
|
|
46
|
+
const skippedLabel =
|
|
47
|
+
specOnly && role !== SETUP_ROLES.BUILDER ? ' — skipped without a Builder' : '';
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
role,
|
|
51
|
+
label: selection
|
|
52
|
+
? `${ROLE_LABELS[role]}: ${selection.model}${thinkingLabel}${skippedLabel}`
|
|
53
|
+
: `Select ${role}`,
|
|
54
|
+
};
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const choice = await ui.select(specOnly ? 'Maestro setup — spec-only mode' : 'Maestro setup', [
|
|
58
|
+
...actions.map(({ label }) => label),
|
|
59
|
+
CONFIRM_LABEL,
|
|
60
|
+
]);
|
|
61
|
+
|
|
62
|
+
if (choice === CONFIRM_LABEL) return CONFIRM_SETUP;
|
|
63
|
+
|
|
64
|
+
return actions.find(({ label }) => label === choice)?.role;
|
|
65
|
+
};
|
|
@@ -13,14 +13,22 @@ import { WORKFLOW_EVENTS, 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
15
|
|
|
16
|
-
|
|
16
|
+
const assertRequirementOrdering = (markdown: string): void => {
|
|
17
|
+
const requirements = [...markdown.matchAll(/^### REQ(\d+):/gm)];
|
|
18
|
+
|
|
19
|
+
if (requirements.some((match, index) => Number(match[1]) !== index + 1)) {
|
|
20
|
+
throw new Error('Fix requirement ordering in spec.md.');
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const assertAcceptanceCriterionOrdering = (markdown: string): void => {
|
|
17
25
|
// Match standalone ACs (###), including regression checks, and ACs nested under requirements (####).
|
|
18
26
|
const criteria = [...markdown.matchAll(/^#{3,4} AC(\d+):/gm)];
|
|
19
27
|
|
|
20
28
|
if (criteria.some((match, index) => Number(match[1]) !== index + 1)) {
|
|
21
29
|
throw new Error('Fix acceptance criterion ordering in spec.md.');
|
|
22
30
|
}
|
|
23
|
-
}
|
|
31
|
+
};
|
|
24
32
|
|
|
25
33
|
type MarkSpecReadyInput = {
|
|
26
34
|
config: MaestroConfig;
|
|
@@ -70,7 +78,9 @@ export const markSpecReady = async ({
|
|
|
70
78
|
event: WORKFLOW_EVENTS.MARK_SPEC_READY,
|
|
71
79
|
});
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
const markdown = await readFile(specFilePath, 'utf8');
|
|
82
|
+
assertRequirementOrdering(markdown);
|
|
83
|
+
assertAcceptanceCriterionOrdering(markdown);
|
|
74
84
|
|
|
75
85
|
await writeWorkflowState({
|
|
76
86
|
path: workflowPath,
|
|
@@ -19,6 +19,7 @@ export const WORKFLOW_PHASES = {
|
|
|
19
19
|
VERIFIER_RUNNING: 'verifier-running',
|
|
20
20
|
FINDING_DECISIONS: 'finding-decisions',
|
|
21
21
|
SIMPLIFIER_RUNNING: 'simplifier-running',
|
|
22
|
+
SCORER_RUNNING: 'scorer-running',
|
|
22
23
|
CANDIDATE_READY: 'candidate-ready',
|
|
23
24
|
} as const;
|
|
24
25
|
|
|
@@ -33,6 +34,7 @@ export const WORKFLOW_EVENTS = {
|
|
|
33
34
|
RUN_VERIFIER: 'run-verifier',
|
|
34
35
|
VERIFIER_FOUND_FINDINGS: 'verifier-found-findings',
|
|
35
36
|
VERIFIER_DONE: 'verifier-done',
|
|
37
|
+
SCORER_DONE: 'scorer-done',
|
|
36
38
|
SIMPLIFIER_DONE: 'simplifier-done',
|
|
37
39
|
SIMPLIFIER_SKIPPED: 'simplifier-skipped',
|
|
38
40
|
OWNER_REJECT_FINDINGS: 'owner-reject-findings',
|
|
@@ -48,6 +50,7 @@ export const WorkflowPhaseSchema = Type.Union([
|
|
|
48
50
|
Type.Literal(WORKFLOW_PHASES.VERIFIER_RUNNING),
|
|
49
51
|
Type.Literal(WORKFLOW_PHASES.FINDING_DECISIONS),
|
|
50
52
|
Type.Literal(WORKFLOW_PHASES.SIMPLIFIER_RUNNING),
|
|
53
|
+
Type.Literal(WORKFLOW_PHASES.SCORER_RUNNING),
|
|
51
54
|
Type.Literal(WORKFLOW_PHASES.CANDIDATE_READY),
|
|
52
55
|
]);
|
|
53
56
|
|
|
@@ -22,8 +22,11 @@ const hasDynamicDestinationBasedOnConfig = (
|
|
|
22
22
|
destination: WorkflowTransition['to'],
|
|
23
23
|
): destination is (config: MaestroConfig) => WorkflowPhase => typeof destination === 'function';
|
|
24
24
|
|
|
25
|
+
const getScorerDestination = (config: MaestroConfig): WorkflowPhase =>
|
|
26
|
+
config.scorer.required ? WORKFLOW_PHASES.SCORER_RUNNING : WORKFLOW_PHASES.CANDIDATE_READY;
|
|
27
|
+
|
|
25
28
|
const getSimplifierDestination = (config: MaestroConfig): WorkflowPhase =>
|
|
26
|
-
config.simplifier.required ? WORKFLOW_PHASES.SIMPLIFIER_RUNNING :
|
|
29
|
+
config.simplifier.required ? WORKFLOW_PHASES.SIMPLIFIER_RUNNING : getScorerDestination(config);
|
|
27
30
|
|
|
28
31
|
const getSpecReadyDestination = (config: MaestroConfig): WorkflowPhase =>
|
|
29
32
|
config.builder.required ? WORKFLOW_PHASES.READY_FOR_BUILDER : WORKFLOW_PHASES.CANDIDATE_READY;
|
|
@@ -78,10 +81,14 @@ export const WORKFLOW_TRANSITIONS: Record<WorkflowEvent, WorkflowTransition> = {
|
|
|
78
81
|
},
|
|
79
82
|
[WORKFLOW_EVENTS.SIMPLIFIER_DONE]: {
|
|
80
83
|
from: [WORKFLOW_PHASES.SIMPLIFIER_RUNNING],
|
|
81
|
-
to:
|
|
84
|
+
to: getScorerDestination,
|
|
82
85
|
},
|
|
83
86
|
[WORKFLOW_EVENTS.SIMPLIFIER_SKIPPED]: {
|
|
84
87
|
from: [WORKFLOW_PHASES.SIMPLIFIER_RUNNING],
|
|
88
|
+
to: getScorerDestination,
|
|
89
|
+
},
|
|
90
|
+
[WORKFLOW_EVENTS.SCORER_DONE]: {
|
|
91
|
+
from: [WORKFLOW_PHASES.SCORER_RUNNING],
|
|
85
92
|
to: WORKFLOW_PHASES.CANDIDATE_READY,
|
|
86
93
|
},
|
|
87
94
|
[WORKFLOW_EVENTS.OWNER_REQUEST_FIXES]: {
|
package/templates/spec.md
CHANGED
|
@@ -10,7 +10,7 @@ Leave verification methods, test code, fixtures, mocks, and commands to the buil
|
|
|
10
10
|
|
|
11
11
|
## Requirements
|
|
12
12
|
|
|
13
|
-
<Give each requirement its own ### REQ<number>: <Actor> MUST <short capability> heading
|
|
13
|
+
<Give each requirement its own ### REQ<number>: <Actor> MUST <short capability> heading. Number requirements consecutively in document order starting at REQ1. After additions, removals, or merges, renumber requirements to remove gaps and update all affected links and textual references across all specification documents. Document only behavior or constraints this change adds, modifies, or removes, with relevant measurable limits, edge cases, and error handling. Existing behavior must continue working unless explicitly changed or removed; do not list unchanged behavior as requirements. Do not copy repository or agent instructions.>
|
|
14
14
|
|
|
15
15
|
<Give each requirement exactly one Delta value: added, modified, or removed. Keep requirements organized by topic, not by delta category. For modified or removed requirements, add a brief Before description only when useful. Verify the previous behavior from repository evidence; do not invent it or repeat the whole old requirement. State the complete required outcome, including the required absence and any agreed replacement or error behavior for removals. Keep the same pre-change baseline during revisions.>
|
|
16
16
|
|