maestro-flow 0.5.39 → 0.5.41
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/.agents/skills/odyssey-debug/SKILL.md +109 -143
- package/.agents/skills/odyssey-improve/SKILL.md +127 -141
- package/.agents/skills/odyssey-planex/SKILL.md +140 -231
- package/.agents/skills/odyssey-review-test-fix/SKILL.md +136 -90
- package/.agents/skills/odyssey-ui/SKILL.md +123 -143
- package/.agy/skills/odyssey-debug/SKILL.md +109 -143
- package/.agy/skills/odyssey-improve/SKILL.md +127 -141
- package/.agy/skills/odyssey-planex/SKILL.md +140 -231
- package/.agy/skills/odyssey-review-test-fix/SKILL.md +136 -90
- package/.agy/skills/odyssey-ui/SKILL.md +123 -143
- package/.claude/commands/odyssey-debug.md +109 -143
- package/.claude/commands/odyssey-improve.md +127 -141
- package/.claude/commands/odyssey-planex.md +140 -231
- package/.claude/commands/odyssey-review-test-fix.md +136 -90
- package/.claude/commands/odyssey-ui.md +123 -143
- package/.codex/agents/cli-explore-agent.toml +181 -0
- package/.codex/agents/cross-role-reviewer.toml +165 -0
- package/.codex/agents/impeccable-agent.toml +89 -0
- package/.codex/agents/role-design-author.toml +213 -0
- package/.codex/agents/team-worker.toml +4 -7
- package/.codex/agents/ui-design-agent.toml +260 -0
- package/.codex/agents/workflow-analyzer.toml +106 -0
- package/.codex/agents/workflow-codebase-mapper.toml +69 -0
- package/.codex/agents/workflow-collab-planner.toml +140 -0
- package/.codex/agents/workflow-debugger.toml +95 -0
- package/.codex/agents/workflow-executor.toml +124 -0
- package/.codex/agents/workflow-external-researcher.toml +80 -0
- package/.codex/agents/workflow-integration-checker.toml +76 -0
- package/.codex/agents/workflow-nyquist-auditor.toml +77 -0
- package/.codex/agents/workflow-phase-researcher.toml +76 -0
- package/.codex/agents/workflow-plan-checker.toml +93 -0
- package/.codex/agents/workflow-planner.toml +192 -0
- package/.codex/agents/workflow-project-researcher.toml +65 -0
- package/.codex/agents/workflow-research-synthesizer.toml +65 -0
- package/.codex/agents/workflow-reviewer.toml +75 -0
- package/.codex/agents/workflow-roadmapper.toml +75 -0
- package/.codex/agents/workflow-verifier.toml +113 -0
- package/.codex/skills/maestro/SKILL.md +1 -0
- package/.codex/skills/maestro-analyze/SKILL.md +33 -15
- package/.codex/skills/maestro-brainstorm/SKILL.md +13 -10
- package/.codex/skills/maestro-collab/SKILL.md +30 -75
- package/.codex/skills/maestro-execute/SKILL.md +19 -12
- package/.codex/skills/maestro-grill/SKILL.md +12 -11
- package/.codex/skills/maestro-next/SKILL.md +3 -3
- package/.codex/skills/maestro-overlay/SKILL.md +1 -1
- package/.codex/skills/maestro-plan/SKILL.md +17 -8
- package/.codex/skills/maestro-ralph/SKILL.md +3 -0
- package/.codex/skills/maestro-ralph-execute/SKILL.md +1 -0
- package/.codex/skills/maestro-roadmap/SKILL.md +14 -8
- package/.codex/skills/manage-learn/SKILL.md +1 -1
- package/.codex/skills/odyssey-debug/SKILL.md +176 -150
- package/.codex/skills/odyssey-improve/SKILL.md +210 -177
- package/.codex/skills/odyssey-planex/SKILL.md +162 -242
- package/.codex/skills/odyssey-review-test-fix/SKILL.md +96 -90
- package/.codex/skills/odyssey-ui/SKILL.md +211 -179
- package/.codex/skills/quality-review/SKILL.md +17 -10
- package/.codex/skills/team-lifecycle-v4/instructions/agent-instruction.md +6 -12
- package/.codex/skills/team-lifecycle-v4/roles/analyst/role.md +6 -14
- package/.codex/skills/team-lifecycle-v4/roles/executor/commands/implement.md +2 -6
- package/.codex/skills/team-lifecycle-v4/roles/planner/role.md +6 -14
- package/.codex/skills/team-lifecycle-v4/roles/writer/role.md +3 -7
- package/.codex/skills/team-quality-assurance/roles/scout/role.md +2 -5
- package/.codex/skills/team-review/roles/reviewer/role.md +2 -5
- package/.codex/skills/team-review/roles/scanner/role.md +2 -5
- package/.codex/skills/team-tech-debt/roles/executor/role.md +3 -7
- package/.codex/skills/team-tech-debt/roles/scanner/role.md +2 -5
- package/.codex/skills/team-tech-debt/roles/validator/role.md +3 -7
- package/.codex/skills/team-testing/roles/executor/role.md +3 -7
- package/.codex/skills/team-testing/roles/generator/role.md +3 -7
- package/dashboard/dist-server/src/commands/install-backend.js +19 -0
- package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
- package/dashboard/dist-server/src/core/manifest.d.ts +5 -0
- package/dashboard/dist-server/src/core/manifest.js.map +1 -1
- package/dashboard/dist-server/src/core/plugin-bridge.d.ts +59 -0
- package/dashboard/dist-server/src/core/plugin-bridge.js +355 -0
- package/dashboard/dist-server/src/core/plugin-bridge.js.map +1 -0
- package/dashboard/dist-server/src/tools/spec-loader.js +27 -19
- package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
- package/dashboard/dist-server/src/tools/spec-seeds.d.ts +8 -0
- package/dashboard/dist-server/src/tools/spec-seeds.js +114 -0
- package/dashboard/dist-server/src/tools/spec-seeds.js.map +1 -1
- package/dist/src/cli.js +19 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/commands/install-backend.d.ts.map +1 -1
- package/dist/src/commands/install-backend.js +19 -0
- package/dist/src/commands/install-backend.js.map +1 -1
- package/dist/src/commands/install.d.ts.map +1 -1
- package/dist/src/commands/install.js +17 -1
- package/dist/src/commands/install.js.map +1 -1
- package/dist/src/commands/plugin.d.ts +3 -0
- package/dist/src/commands/plugin.d.ts.map +1 -0
- package/dist/src/commands/plugin.js +137 -0
- package/dist/src/commands/plugin.js.map +1 -0
- package/dist/src/commands/spec.d.ts.map +1 -1
- package/dist/src/commands/spec.js +13 -3
- package/dist/src/commands/spec.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +23 -0
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/core/install-executor.d.ts +1 -1
- package/dist/src/core/install-executor.d.ts.map +1 -1
- package/dist/src/core/install-executor.js +27 -0
- package/dist/src/core/install-executor.js.map +1 -1
- package/dist/src/core/install-profile.d.ts +5 -0
- package/dist/src/core/install-profile.d.ts.map +1 -1
- package/dist/src/core/install-profile.js +8 -0
- package/dist/src/core/install-profile.js.map +1 -1
- package/dist/src/core/manifest.d.ts +5 -0
- package/dist/src/core/manifest.d.ts.map +1 -1
- package/dist/src/core/manifest.js.map +1 -1
- package/dist/src/core/plugin-bridge.d.ts +60 -0
- package/dist/src/core/plugin-bridge.d.ts.map +1 -0
- package/dist/src/core/plugin-bridge.js +355 -0
- package/dist/src/core/plugin-bridge.js.map +1 -0
- package/dist/src/tools/spec-init.d.ts +4 -3
- package/dist/src/tools/spec-init.d.ts.map +1 -1
- package/dist/src/tools/spec-init.js +9 -5
- package/dist/src/tools/spec-init.js.map +1 -1
- package/dist/src/tools/spec-loader.d.ts.map +1 -1
- package/dist/src/tools/spec-loader.js +27 -19
- package/dist/src/tools/spec-loader.js.map +1 -1
- package/dist/src/tools/spec-seeds.d.ts +8 -0
- package/dist/src/tools/spec-seeds.d.ts.map +1 -1
- package/dist/src/tools/spec-seeds.js +114 -0
- package/dist/src/tools/spec-seeds.js.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.d.ts.map +1 -1
- package/dist/src/tui/install-ui/InstallFlow.js +43 -14
- package/dist/src/tui/install-ui/InstallFlow.js.map +1 -1
- package/dist/src/tui/install-ui/types.d.ts +2 -0
- package/dist/src/tui/install-ui/types.d.ts.map +1 -1
- package/dist/src/tui/install-ui/types.js.map +1 -1
- package/dist/src/tui/install-ui/useInstallFlowState.d.ts.map +1 -1
- package/dist/src/tui/install-ui/useInstallFlowState.js +13 -1
- package/dist/src/tui/install-ui/useInstallFlowState.js.map +1 -1
- package/dist/src/utils/update-notices.js +11 -0
- package/dist/src/utils/update-notices.js.map +1 -1
- package/package.json +1 -1
- package/workflows/odyssey-base-codex.md +306 -0
- package/workflows/shell-exec-protocol.md +30 -0
|
@@ -35,7 +35,7 @@ $ARGUMENTS -- requirement/idea text or @file reference, plus optional flags.
|
|
|
35
35
|
</context>
|
|
36
36
|
|
|
37
37
|
<interview_protocol>
|
|
38
|
-
Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip when `-y/--yes`, `--revise`, `--review`, `-c
|
|
38
|
+
Interview the user relentlessly until shared understanding is reached. Active only in interactive mode; skip ONLY when `-y/--yes`, `--revise`, `--review`, or `-c` is set. Text requirements always require at least scope + strategy confirmation — never auto-classify input as "specific enough" to skip.
|
|
39
39
|
|
|
40
40
|
- One decision per turn via request_user_input with 2–4 options + a (Recommended) default. The user controls termination — keep interviewing until convergence; they can interrupt naturally at any time.
|
|
41
41
|
- Search-first when uncertain: before asking, resolve via `state.json`, existing `roadmap.md`, `project.md`, `maestro load --type spec`, `maestro search`, `maestro explore` (preferred, fallback Glob/Grep/Read). Never ask what code or memory can verify; never bounce your own ambiguity back to the user — search first, then ask only what truly needs human judgment.
|
|
@@ -73,8 +73,8 @@ Wave 1: 3 analysis rows (parallel). Wave 2: 1 assembly row.
|
|
|
73
73
|
2. **CSV is source of truth**: Master tasks.csv holds all state
|
|
74
74
|
3. **Context propagation**: prev_context from master CSV, not memory
|
|
75
75
|
4. **Discovery board append-only**: Never modify/delete discoveries.ndjson
|
|
76
|
-
5. **Graceful degradation**: Wave 1 fails -> Wave 2 proceeds with seed input only. When degradation activates, flag downstream outputs as LOW CONFIDENCE.
|
|
77
|
-
6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation.
|
|
76
|
+
5. **Graceful degradation**: Wave 1 fails -> Wave 2 proceeds with seed input only. When degradation activates, flag downstream outputs as LOW CONFIDENCE. Record `degradation_event` in discoveries.ndjson. This is a defined degradation path, not a violation of invariant 6.
|
|
77
|
+
6. **Invariant violation = BLOCK** — violating any invariant above blocks the current operation. Defined degradation paths (invariant 5) are not violations.
|
|
78
78
|
7. **Requirement mapping completeness** — every Active requirement from project.md MUST be mapped to exactly one phase. No circular dependencies in phase ordering.
|
|
79
79
|
8. **Artifact verification before completion** — .workflow/roadmap.md MUST exist with Milestone > Phase hierarchy and progress table. Artifact MUST be registered in state.json. If missing: DO NOT report completion.
|
|
80
80
|
</invariants>
|
|
@@ -104,10 +104,13 @@ S_CSV_GEN:
|
|
|
104
104
|
-> S_WAVE_1 DO: generate analysis CSV
|
|
105
105
|
|
|
106
106
|
S_WAVE_1:
|
|
107
|
-
-> S_WAVE_2 DO: A_SPAWN_WAVE_1
|
|
107
|
+
-> S_WAVE_2 WHEN: 1+ completed DO: A_SPAWN_WAVE_1. For failed analysis tasks: exclude from prev_context and append gap_note to W2 instruction listing missing angles.
|
|
108
|
+
-> S_WAVE_1 WHEN: all failed, retry available DO: retry once
|
|
109
|
+
-> S_WAVE_2 WHEN: all failed, retry exhausted DO: proceed with seed input only, flag LOW CONFIDENCE (invariant 5 degradation)
|
|
108
110
|
|
|
109
111
|
S_WAVE_2:
|
|
110
|
-
-> S_AGGREGATE DO: A_SPAWN_WAVE_2
|
|
112
|
+
-> S_AGGREGATE WHEN: completed DO: A_SPAWN_WAVE_2
|
|
113
|
+
-> ERROR WHEN: failed DO: abort "Roadmap generation failed"
|
|
111
114
|
|
|
112
115
|
S_AGGREGATE:
|
|
113
116
|
-> END DO: A_AGGREGATE_RESULTS
|
|
@@ -178,7 +181,7 @@ Assembly agent produces roadmap.md with Milestone > Phase hierarchy (goal, depen
|
|
|
178
181
|
2. Interactive refinement (max 3 rounds, skip if -y): Approve / Refine / Regenerate
|
|
179
182
|
3. Generate context.md (summary + analysis findings + roadmap stats)
|
|
180
183
|
4. Write .workflow/roadmap.md with Milestone > Phase hierarchy
|
|
181
|
-
5. Update state.json milestones + current_milestone
|
|
184
|
+
5. Update state.json milestones + current_milestone + register RDM artifact
|
|
182
185
|
6. **Generate context-package.json** (schema `context-package/1.0`):
|
|
183
186
|
```jsonc
|
|
184
187
|
{
|
|
@@ -194,7 +197,11 @@ Assembly agent produces roadmap.md with Milestone > Phase hierarchy (goal, depen
|
|
|
194
197
|
}
|
|
195
198
|
```
|
|
196
199
|
Register `context_package` path in RDM artifact entry so downstream `--from roadmap:ID` can resolve.
|
|
197
|
-
7. Next-step
|
|
200
|
+
7. **Next-step suggestion** (suggest only, NEVER auto-execute): display the recommended next command. The user decides whether to proceed.
|
|
201
|
+
- Need analysis → `maestro-analyze`
|
|
202
|
+
- Ready to plan → `maestro-plan`
|
|
203
|
+
- UI first → `maestro-impeccable build`
|
|
204
|
+
- Need formal specs → `maestro-blueprint`
|
|
198
205
|
|
|
199
206
|
</actions>
|
|
200
207
|
|
|
@@ -243,4 +250,3 @@ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
|
|
|
243
250
|
```
|
|
244
251
|
Status verdicts: **DONE** (normal), **DONE_WITH_CONCERNS** (caveats; pass `--concerns`), **NEEDS_RETRY** (transient error), **BLOCKED** (hard blocker; pass `--reason`).
|
|
245
252
|
</ralph_completion>
|
|
246
|
-
</output>
|
|
@@ -47,7 +47,7 @@ $manage-learn "\"Zod v4 breaks z.object().strict() API\" --category gotcha --tag
|
|
|
47
47
|
</context>
|
|
48
48
|
|
|
49
49
|
<invariants>
|
|
50
|
-
1. **No LLM or CLI calls**: This skill is pure file I/O — parse, infer, append, confirm. No `
|
|
50
|
+
1. **No LLM or CLI calls**: This skill is pure file I/O — parse, infer, append, confirm. No `shell_exec`, no `spawn_agent`.
|
|
51
51
|
2. **Bootstrap on demand**: Create `.workflow/knowhow/` structure on first use; do not require it to exist.
|
|
52
52
|
3. **Append-only learnings.md**: Never rewrite or delete existing entries.
|
|
53
53
|
4. **Stable INS-ids**: `INS-{8hex}` from `hash(insightText + timestamp)` — same text at different times gets different ids.
|
|
@@ -4,54 +4,41 @@ description: "Long-running debug cycle — archaeology, diagnosis, fix, confirma
|
|
|
4
4
|
argument-hint: "<issue> [--skip-fix] [--skip-generalize] [--auto] [-y] [-c] [--heartbeat]"
|
|
5
5
|
allowed-tools: spawn_agents_on_csv, Read, Write, Edit, Bash, Glob, Grep, request_user_input
|
|
6
6
|
---
|
|
7
|
-
<base>@~/.maestro/workflows/odyssey-base.md</base>
|
|
7
|
+
<base>@~/.maestro/workflows/odyssey-base-codex.md</base>
|
|
8
8
|
|
|
9
9
|
<purpose>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Core philosophy:
|
|
14
|
-
- **Archaeology before hypothesis** — look at what changed before guessing why
|
|
15
|
-
- **Fix one, find many** — a single bug reveals a class of bugs
|
|
16
|
-
- **Decision journal** — human-judgment items recorded, not lost
|
|
17
|
-
- **CLI-assisted review** — delegate for second-opinion analysis
|
|
18
|
-
|
|
19
|
-
**三句哲学约束(穷尽迭代):**
|
|
20
|
-
1. **零遗留** — 根因必须确认到底,修复必须验证通过,泛化必须扫描穷尽
|
|
21
|
-
2. **穷尽迭代** — 假设失败不放弃:扩范围 → 换视角 → 升级工具,直到根因确认或明确 INCONCLUSIVE
|
|
22
|
-
3. **改进即标准** — 修复后重新确认同区域无新问题,泛化发现的同类 bug 全部处理
|
|
10
|
+
archaeology → explore → diagnose → fix & confirm → generalize → discover siblings → persist.
|
|
11
|
+
Exhaustive iteration until root cause confirmed or INCONCLUSIVE.
|
|
23
12
|
</purpose>
|
|
24
13
|
|
|
25
14
|
<boundary>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `
|
|
38
|
-
| `crash` | stack trace → null chain → error propagation | 崩溃/异常 |
|
|
15
|
+
**In scope:** Single bug/issue full loop.
|
|
16
|
+
**Out of scope:** Features → `$odyssey-planex` | Quality review → `$odyssey-review-test-fix` | UI → `$odyssey-ui` | Architecture → `/maestro-plan`
|
|
17
|
+
|
|
18
|
+
**`--template <name>`:**
|
|
19
|
+
|
|
20
|
+
| Template | Strategy | Use case |
|
|
21
|
+
|----------|----------|----------|
|
|
22
|
+
| `performance` | profiling → hot path → allocation → cache | Performance degradation |
|
|
23
|
+
| `memory-leak` | heap snapshot → retention chain → lifecycle | Memory leaks |
|
|
24
|
+
| `race-condition` | timeline → concurrent access → lock analysis | Race conditions |
|
|
25
|
+
| `regression` | git bisect → diff analysis → boundary check | Regressions |
|
|
26
|
+
| `crash` | stack trace → null chain → error propagation | Crashes / exceptions |
|
|
39
27
|
</boundary>
|
|
40
28
|
|
|
41
29
|
<context>
|
|
42
|
-
$ARGUMENTS
|
|
30
|
+
$ARGUMENTS
|
|
43
31
|
|
|
44
|
-
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>`
|
|
32
|
+
**Flags:** `--skip-fix` analysis-only | `--skip-generalize` quick fix | `--template <name>` | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
|
|
45
33
|
|
|
46
|
-
**Session**:
|
|
34
|
+
**Session**: `.workflow/scratch/{YYYYMMDD}-debug-odyssey-{slug}/`
|
|
47
35
|
**Output**: `session.json` | `evidence.ndjson` | `explore.json` | `understanding.md`
|
|
48
36
|
|
|
49
|
-
**session.json
|
|
37
|
+
**session.json — debug-specific fields:**
|
|
50
38
|
```json
|
|
51
39
|
{ "issue": "", "diagnosis_retries": 0, "root_cause": null, "confirmation": null,
|
|
52
|
-
"patterns": [], "generalization_stats": null
|
|
40
|
+
"patterns": [], "generalization_stats": null }
|
|
53
41
|
```
|
|
54
|
-
共有字段(`progress_metrics`, `directions_tried` 等)见 base。
|
|
55
42
|
|
|
56
43
|
**evidence.ndjson phases:** `archaeology|explore|diagnosis|discovery|decision|self-iteration`
|
|
57
44
|
- `archaeology`: `sha`, `author`, `date`, `message`, `relevance`
|
|
@@ -79,27 +66,54 @@ $ARGUMENTS — issue description and optional flags.
|
|
|
79
66
|
4. Hypotheses ← S_DIAGNOSE | 5. Root Cause ← S_DIAGNOSE | 6. Fix & Confirmation ← S_FIX+S_CONFIRM
|
|
80
67
|
7. Generalization ← S_GENERALIZE | 8. Discoveries ← S_DISCOVER | 9. Learnings ← S_RECORD
|
|
81
68
|
|
|
82
|
-
|
|
69
|
+
**Knowledge Persistence categories (§9):**
|
|
83
70
|
|
|
84
|
-
|
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
|
88
|
-
|
|
|
89
|
-
|
|
|
71
|
+
| Category | Content | Follow-up |
|
|
72
|
+
|----------|---------|-----------|
|
|
73
|
+
| Recurring root cause pattern | Type + triggers + fix + detection | `/spec-add debug` |
|
|
74
|
+
| Non-obvious workaround | Problem + steps + why obvious fix fails | `/spec-add learning` |
|
|
75
|
+
| Architecture boundary violation | Violation + correct boundary + verification | `/spec-add arch` |
|
|
76
|
+
| Reusable generalization pattern | Signature + risk + fix template + scope | `/spec-add coding` |
|
|
77
|
+
</context>
|
|
90
78
|
|
|
91
|
-
|
|
79
|
+
<csv_schema>
|
|
80
|
+
### Shared Output Schema (all waves)
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"type": "object",
|
|
84
|
+
"properties": {
|
|
85
|
+
"id": {"type":"string"}, "result_status": {"type":"string","enum":["completed","failed"]},
|
|
86
|
+
"findings": {"type":"string","maxLength":500}, "evidence": {"type":"string"}, "error": {"type":"string"}
|
|
87
|
+
},
|
|
88
|
+
"required": ["id","result_status","findings"]
|
|
89
|
+
}
|
|
90
|
+
```
|
|
92
91
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
**Termination Contract** (embed in every instruction):
|
|
93
|
+
```
|
|
94
|
+
You MUST call report_agent_job_result EXACTLY ONCE before exiting.
|
|
95
|
+
Success → result_status=completed | Failure → result_status=failed with error | Timeout → completed with partial.
|
|
96
|
+
NEVER continue indefinitely. NEVER exit silently. Read-only — do NOT modify source files.
|
|
97
|
+
Do NOT write to tasks.csv, wave-*.csv, results.csv. Do NOT call spawn_agents_on_csv.
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### tasks.csv
|
|
101
|
+
```csv
|
|
102
|
+
id,title,description,task_type,deps,wave,status,findings,evidence,error
|
|
103
|
+
```
|
|
104
|
+
- Wave 1: Archaeology (git-timeline, git-blame) — parallel
|
|
105
|
+
- Wave 2: Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) — parallel, depends on root cause
|
|
106
|
+
- Single-agent stages (explore, diagnose, fix, confirm) remain inline
|
|
107
|
+
</csv_schema>
|
|
108
|
+
|
|
109
|
+
<invariants>
|
|
110
|
+
Base execution_discipline applies. Debug additions:
|
|
111
|
+
1. **Evidence append-only** — never delete or overwrite evidence.ndjson entries
|
|
112
|
+
2. **Phase goal tracking** — mark goal done/failed before transition; no silent skips
|
|
113
|
+
</invariants>
|
|
100
114
|
|
|
101
115
|
<self_iteration>
|
|
102
|
-
|
|
116
|
+
Applies to: **S_ARCHAEOLOGY, S_EXPLORE, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
|
|
103
117
|
</self_iteration>
|
|
104
118
|
|
|
105
119
|
<state_machine>
|
|
@@ -113,14 +127,14 @@ S_INTAKE → S_INTAKE : -c + session found → A_RESUME_SESSION
|
|
|
113
127
|
S_INTAKE → S_ARCHAEOLOGY : issue parsed → A_INTAKE
|
|
114
128
|
S_INTAKE → S_INTAKE : no issue, no session → request_user_input
|
|
115
129
|
|
|
116
|
-
S_ARCHAEOLOGY → S_EXPLORE :
|
|
117
|
-
S_EXPLORE → S_DIAGNOSE :
|
|
130
|
+
S_ARCHAEOLOGY → S_EXPLORE : complete
|
|
131
|
+
S_EXPLORE → S_DIAGNOSE : complete
|
|
118
132
|
|
|
119
|
-
S_DIAGNOSE → S_FIX :
|
|
120
|
-
S_DIAGNOSE → S_GENERALIZE :
|
|
121
|
-
S_DIAGNOSE → S_RECORD :
|
|
133
|
+
S_DIAGNOSE → S_FIX : confirmed, !skip_fix
|
|
134
|
+
S_DIAGNOSE → S_GENERALIZE : confirmed, skip_fix, !skip_generalize
|
|
135
|
+
S_DIAGNOSE → S_RECORD : confirmed, skip_fix, skip_generalize
|
|
122
136
|
S_DIAGNOSE → S_DIAGNOSE : all hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
|
|
123
|
-
S_DIAGNOSE → S_RECORD : retries >= 3 →
|
|
137
|
+
S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
|
|
124
138
|
|
|
125
139
|
S_FIX → S_CONFIRM : fix implemented
|
|
126
140
|
S_CONFIRM → S_GENERALIZE : confirmed, !skip_generalize
|
|
@@ -130,140 +144,151 @@ S_CONFIRM → S_FIX : needs_rework
|
|
|
130
144
|
S_GENERALIZE → S_DISCOVER : similar code found
|
|
131
145
|
S_GENERALIZE → S_RECORD : no similar code
|
|
132
146
|
|
|
133
|
-
S_DISCOVER → S_DIAGNOSE : new bug
|
|
134
|
-
S_DISCOVER → S_FIX : same-pattern bug
|
|
135
|
-
S_DISCOVER → S_RECORD :
|
|
136
|
-
S_DISCOVER → S_RECORD : loops >= max_loops → log
|
|
147
|
+
S_DISCOVER → S_DIAGNOSE : new bug → cross_phase_loops++
|
|
148
|
+
S_DISCOVER → S_FIX : same-pattern bug + fix_template, !skip_fix → cross_phase_loops++
|
|
149
|
+
S_DISCOVER → S_RECORD : remaining_actionable == 0
|
|
150
|
+
S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
|
|
137
151
|
|
|
138
|
-
S_RECORD → END :
|
|
152
|
+
S_RECORD → END : complete
|
|
139
153
|
</transitions>
|
|
140
154
|
|
|
141
155
|
<actions>
|
|
142
156
|
|
|
143
157
|
### A_INTAKE
|
|
144
|
-
1. Parse arguments, generate slug, create
|
|
145
|
-
2.
|
|
146
|
-
3. Derive `phase_goals[]` from flags
|
|
158
|
+
1. Parse arguments, generate slug, create SESSION_DIR
|
|
159
|
+
2. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + Grep keywords
|
|
160
|
+
3. Derive `phase_goals[]` from flags
|
|
147
161
|
4. Write `session.json` + `understanding.md` §1, emit Goal Prompt
|
|
148
162
|
|
|
149
|
-
|
|
163
|
+
Commit: `"odyssey-debug({slug}): INTAKE — parse target and load context"`
|
|
150
164
|
|
|
151
165
|
### A_RESUME_SESSION
|
|
152
|
-
|
|
166
|
+
Glob latest session → read `session.json` → jump to `current_state`.
|
|
153
167
|
|
|
154
168
|
### A_ARCHAEOLOGY
|
|
155
|
-
**
|
|
169
|
+
**Step 1 — Git archaeology (spawn_agents_on_csv, Wave 1):**
|
|
170
|
+
|
|
171
|
+
Write `tasks.csv` with Wave 1 rows:
|
|
172
|
+
```csv
|
|
173
|
+
id,title,description,task_type,deps,wave,status,findings,evidence,error
|
|
174
|
+
"arch-timeline","Git Timeline","Run git log --oneline -20 -- {files}. Return [{sha,date,author,message,files_changed}] as JSON.","archaeology","","1","pending","","",""
|
|
175
|
+
"arch-blame","Git Blame","Top 3 suspicious files: git blame -L {region}. Return [{file,line_range,sha,author,date,content}] as JSON.","archaeology","","1","pending","","",""
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
```javascript
|
|
179
|
+
spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
|
|
180
|
+
instruction: ARCHAEOLOGY_INSTRUCTION + TERMINATION_CONTRACT,
|
|
181
|
+
max_concurrency:2, max_runtime_seconds:300,
|
|
182
|
+
output_csv_path:"wave-1-results.csv", output_schema: SHARED_OUTPUT_SCHEMA })
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Merge results → evidence.ndjson (phase: "archaeology").
|
|
156
186
|
|
|
157
|
-
**CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
|
|
187
|
+
**Step 2 — CLI change review** via `maestro delegate --role analyze --mode analysis` (`run_in_background: true`):
|
|
158
188
|
- PURPOSE: Review recent modifications related to {issue}
|
|
159
189
|
- EXPECTED: JSON [{commit_sha, risk_level, analysis, could_cause_issue, explanation}]
|
|
160
190
|
|
|
161
|
-
Update §2.
|
|
162
|
-
|
|
163
|
-
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): ARCHAEOLOGY — git 考古分析"`
|
|
191
|
+
Update §2. Commit: `"odyssey-debug({slug}): ARCHAEOLOGY — git history analysis"`
|
|
164
192
|
|
|
165
193
|
### A_EXPLORE
|
|
166
|
-
Skip if no
|
|
194
|
+
Skip if no CLI tools (W006).
|
|
167
195
|
|
|
168
196
|
`maestro delegate --role explore --mode analysis` (`run_in_background: true`):
|
|
169
|
-
- PURPOSE:
|
|
197
|
+
- PURPOSE: Call chains, recent changes, error gaps, similar patterns
|
|
170
198
|
- EXPECTED: JSON {call_chains, recent_changes, error_gaps, similar_patterns}
|
|
171
199
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): EXPLORE — 代码探索完成"`
|
|
200
|
+
Write `explore.json` + evidence phase=explore. Update §3. Mark G2. Commit: `"odyssey-debug({slug}): EXPLORE — codebase exploration"`
|
|
175
201
|
|
|
176
202
|
### A_DIAGNOSE
|
|
177
|
-
1.
|
|
178
|
-
2. Test each
|
|
179
|
-
3.
|
|
180
|
-
4.
|
|
203
|
+
1. Hypotheses from evidence, ranked [HIGH]/[MEDIUM]/[LOW] → §4
|
|
204
|
+
2. Test each → evidence phase=diagnosis
|
|
205
|
+
3. Ambiguity → evidence phase=decision; Normal: request_user_input | `-y`: defer
|
|
206
|
+
4. Confirmed → `session.json.root_cause` + §5. Mark G1.
|
|
181
207
|
|
|
182
|
-
|
|
208
|
+
Commit: `"odyssey-debug({slug}): DIAGNOSE — root cause confirmed"`
|
|
183
209
|
|
|
184
210
|
### A_ESCALATE_DIAGNOSIS
|
|
185
|
-
|
|
211
|
+
`diagnosis_retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, → S_DIAGNOSE. >= 3: Normal → request_user_input | `-y` → INCONCLUSIVE → S_RECORD.
|
|
186
212
|
|
|
187
213
|
### A_FIX
|
|
188
214
|
1. Present root cause + proposed fix. Normal: request_user_input | `-y`: auto proceed
|
|
189
|
-
2. Implement fix,
|
|
215
|
+
2. Implement fix, evidence phase=decision
|
|
190
216
|
|
|
191
|
-
|
|
217
|
+
Commit: `"odyssey-debug({slug}): FIX — {summary}"`
|
|
192
218
|
|
|
193
219
|
### A_CONFIRM
|
|
194
|
-
1. Run covering tests
|
|
195
|
-
2.
|
|
220
|
+
1. Run covering tests
|
|
221
|
+
2. `maestro delegate --role review --mode analysis` (`run_in_background: true`):
|
|
196
222
|
- EXPECTED: JSON {verdict, findings [{severity, description, suggestion}], regression_risk}
|
|
197
|
-
3.
|
|
198
|
-
4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3
|
|
223
|
+
3. `session.json.confirmation`: `{test_result, cli_review, overall: "confirmed|needs_rework"}`
|
|
224
|
+
4. Update §6. `needs_rework` → S_FIX. `confirmed` → mark G3.
|
|
199
225
|
|
|
200
|
-
|
|
226
|
+
Commit: `"odyssey-debug({slug}): CONFIRM — fix verified"`
|
|
201
227
|
|
|
202
228
|
### A_GENERALIZE
|
|
203
|
-
|
|
229
|
+
Skip if `--skip-generalize`. Pattern source: root cause + fix.
|
|
230
|
+
Base shared_actions for 3-layer extraction + cross-layer dedup + iterative deepening.
|
|
231
|
+
|
|
232
|
+
**Wave 2 — 4-agent scan (spawn_agents_on_csv):**
|
|
233
|
+
|
|
234
|
+
Append Wave 2 rows to `tasks.csv`:
|
|
235
|
+
```csv
|
|
236
|
+
"gen-syntax","Syntax Grep","Grep syntax-layer signatures '${signature}' across project. Return [{file,line,context,risk_level,layer:'syntax',confidence}].","generalization","","2","pending","","",""
|
|
237
|
+
"gen-semantic","Semantic Scan","Check related modules for anti-pattern: ${description}. Return [{file,line,context,risk_level,layer:'semantic',confidence}].","generalization","","2","pending","","",""
|
|
238
|
+
"gen-structural","Structural Match","Find structurally similar files to ${buggy_files}, check for anti-pattern. Return [{file,line,description,risk,layer:'structural',confidence}].","generalization","","2","pending","","",""
|
|
239
|
+
"gen-historical","Historical Grep","Run git log -S '${signature}' --oneline. Return [{sha,file,date,type:'introduced|fixed',context}].","generalization","","2","pending","","",""
|
|
240
|
+
```
|
|
204
241
|
|
|
205
|
-
|
|
242
|
+
```javascript
|
|
243
|
+
spawn_agents_on_csv({ csv_path:"tasks.csv", id_column:"id",
|
|
244
|
+
instruction: GENERALIZATION_INSTRUCTION + TERMINATION_CONTRACT,
|
|
245
|
+
max_concurrency:4, max_runtime_seconds:300,
|
|
246
|
+
output_csv_path:"wave-2-results.csv", output_schema: SHARED_OUTPUT_SCHEMA })
|
|
247
|
+
```
|
|
206
248
|
|
|
207
|
-
|
|
208
|
-
按 base A_DISCOVER 执行。Mark G5 done.
|
|
249
|
+
Update §7. Mark G4. Commit: `"odyssey-debug({slug}): GENERALIZE — pattern scan complete"`
|
|
209
250
|
|
|
210
|
-
|
|
251
|
+
### A_DISCOVER, A_RECORD
|
|
252
|
+
Base shared_actions. Debug overrides:
|
|
253
|
+
- **A_DISCOVER** routes scan hits per csv_schema wave results. Commit: `"odyssey-debug({slug}): DISCOVER — triage complete"`
|
|
254
|
+
- **A_RECORD** learnings per Knowledge Persistence table
|
|
211
255
|
|
|
212
|
-
|
|
213
|
-
1. Finalize `understanding.md` §9,按 Knowledge Persistence 表分类记录
|
|
214
|
-
2. Mark G6 done. Pending decisions: Normal → request_user_input | `-y` → skip (show deferred count)
|
|
215
|
-
3. 其余按 base A_RECORD 执行
|
|
216
|
-
4. **Completion summary**:
|
|
256
|
+
**Completion summary:**
|
|
217
257
|
```
|
|
218
258
|
--- DEBUG ODYSSEY COMPLETE ---
|
|
219
259
|
Issue: {issue}
|
|
220
260
|
Root cause: {root_cause.hypothesis}
|
|
221
261
|
Fix: {applied|skipped|inconclusive}
|
|
222
|
-
Patterns: {patterns_extracted} ({by_layer}
|
|
223
|
-
Scan hits: {total_hits} ({cross_layer_confirmed}
|
|
262
|
+
Patterns: {patterns_extracted} ({by_layer})
|
|
263
|
+
Scan hits: {total_hits} ({cross_layer_confirmed} confirmed)
|
|
224
264
|
Issues: {N} created
|
|
225
265
|
Decisions: {N} resolved, {M} pending, {K} deferred
|
|
226
|
-
Learnings: {N}
|
|
227
|
-
Self-iter: {N}
|
|
228
|
-
Goals: {done}/{total}
|
|
266
|
+
Learnings: {N} persisted
|
|
267
|
+
Self-iter: {N} rounds across {M} stages
|
|
268
|
+
Goals: {done}/{total} ({skipped} skipped)
|
|
229
269
|
---
|
|
230
270
|
```
|
|
231
271
|
|
|
232
|
-
📌 **Auto-commit**: `git add understanding.md && git commit -m "odyssey-debug({slug}): RECORD — 会话总结与知识沉淀"`
|
|
233
|
-
|
|
234
272
|
</actions>
|
|
235
273
|
|
|
236
274
|
<appendix>
|
|
237
275
|
|
|
238
|
-
###
|
|
276
|
+
### `-y` debug-specific points
|
|
239
277
|
|
|
240
|
-
|
|
278
|
+
| Decision Point | Normal | `-y` |
|
|
279
|
+
|---------------|--------|------|
|
|
280
|
+
| A_DIAGNOSE ambiguity | request_user_input | deferred |
|
|
281
|
+
| A_ESCALATE 3-strike | request_user_input | INCONCLUSIVE |
|
|
282
|
+
| A_FIX direction | request_user_input | auto proceed |
|
|
283
|
+
|
|
284
|
+
### Goal Prompt convergence rules
|
|
241
285
|
|
|
242
286
|
```
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
{for each G in phase_goals where status != "skipped":}
|
|
247
|
-
- {G.id}: {G.goal} — 完成条件: {G.done_when}
|
|
248
|
-
{end for}
|
|
249
|
-
穷尽迭代:直到根因确认(或明确 INCONCLUSIVE)且修复验证通过
|
|
250
|
-
且泛化扫描穷尽且 phase_goals_all_done=true 才停。
|
|
251
|
-
泛化发现的同类 bug 全部修复或创建 issue,不允许遗留。
|
|
252
|
-
遇到 phase=decision 的 pending 必须 request_user_input,不得自行 resolve。
|
|
287
|
+
Stop when root cause confirmed (or INCONCLUSIVE), fix verified,
|
|
288
|
+
generalization exhausted, phase_goals_all_done=true.
|
|
289
|
+
All sibling bugs fixed or issued — no leftovers.
|
|
253
290
|
```
|
|
254
291
|
|
|
255
|
-
### `-y` Auto-Confirm Behavior
|
|
256
|
-
|
|
257
|
-
| Decision Point | Normal | `-y` mode |
|
|
258
|
-
|---------------|--------|-----------|
|
|
259
|
-
| A_DIAGNOSE ambiguity | request_user_input | `deferred`, best-effort continue |
|
|
260
|
-
| A_ESCALATE 3-strike | request_user_input 3-way | auto INCONCLUSIVE |
|
|
261
|
-
| A_FIX direction | request_user_input | auto proceed with suggested fix |
|
|
262
|
-
| A_DISCOVER bug triage | request_user_input | auto create issue |
|
|
263
|
-
| A_DISCOVER ambiguous | request_user_input batch | all `deferred` |
|
|
264
|
-
| A_RECORD decisions | request_user_input per-item | skip, show deferred count |
|
|
265
|
-
| A_RECORD goal audit | request_user_input 3-way | auto accept current state |
|
|
266
|
-
|
|
267
292
|
</appendix>
|
|
268
293
|
|
|
269
294
|
</state_machine>
|
|
@@ -271,33 +296,34 @@ Goals: {done}/{total} confirmed ({skipped} skipped)
|
|
|
271
296
|
<error_codes>
|
|
272
297
|
| Code | Severity | Condition | Recovery |
|
|
273
298
|
|------|----------|-----------|----------|
|
|
274
|
-
| E001 | error | No issue
|
|
275
|
-
|
|
|
276
|
-
|
|
|
277
|
-
|
|
|
278
|
-
|
|
|
299
|
+
| E001 | error | No issue, no session | Provide issue or -c |
|
|
300
|
+
| E002 | error | Target path not found | Check path |
|
|
301
|
+
| W001 | warning | No relevant git history | Proceed |
|
|
302
|
+
| W002 | warning | 3 retries exhausted | INCONCLUSIVE |
|
|
303
|
+
| W005 | warning | Pending decisions | Filter evidence phase=decision |
|
|
304
|
+
| W006 | warning | No CLI tools | Skip explore |
|
|
279
305
|
</error_codes>
|
|
280
306
|
|
|
281
307
|
<success_criteria>
|
|
282
|
-
- [ ] Session
|
|
283
|
-
- [ ]
|
|
308
|
+
- [ ] Session + 4 output files + prior knowledge searched
|
|
309
|
+
- [ ] Archaeology + CLI review → evidence phase=archaeology
|
|
284
310
|
- [ ] CLI exploration → explore.json + evidence phase=explore
|
|
285
|
-
- [ ] Hypotheses tested, root cause
|
|
286
|
-
- [ ] understanding.md
|
|
287
|
-
- [ ] Fix
|
|
288
|
-
- [ ]
|
|
289
|
-
- [ ] Discoveries classified
|
|
290
|
-
- [ ] phase_goals
|
|
291
|
-
- [ ] Completion summary
|
|
311
|
+
- [ ] Hypotheses tested, root cause with evidence refs
|
|
312
|
+
- [ ] understanding.md 9 sections progressive
|
|
313
|
+
- [ ] Fix + confirmed (unless --skip-fix)
|
|
314
|
+
- [ ] Generalization + scan (unless --skip-generalize)
|
|
315
|
+
- [ ] Discoveries classified; unfixed findings individually justified
|
|
316
|
+
- [ ] phase_goals + goal audit + resumable via -c
|
|
317
|
+
- [ ] Completion summary
|
|
292
318
|
</success_criteria>
|
|
293
319
|
|
|
294
320
|
<next_step_routing>
|
|
295
|
-
| Condition | Next
|
|
296
|
-
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
|
|
|
300
|
-
| Second opinion
|
|
321
|
+
| Condition | Next |
|
|
322
|
+
|-----------|------|
|
|
323
|
+
| Discovery issues | `/manage-issue list --source debug-odyssey` |
|
|
324
|
+
| Document pattern | `/learn-decompose <module>` |
|
|
325
|
+
| Formal review | `/quality-review <phase>` |
|
|
326
|
+
| Second opinion | `/learn-second-opinion <understanding.md>` |
|
|
301
327
|
| Related question | `/learn-investigate "<question>"` |
|
|
302
|
-
|
|
|
328
|
+
| Pending decisions | Filter evidence phase=decision status=pending |
|
|
303
329
|
</next_step_routing>
|