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
|
@@ -4,33 +4,21 @@ description: "Long-running codebase improvement cycle — multi-dimensional audi
|
|
|
4
4
|
argument-hint: '"<target>" [--dimensions <list>] [--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
|
-
Baseline-first
|
|
12
|
-
|
|
13
|
-
Core philosophy:
|
|
14
|
-
- **Measure before improving** — baseline first, then optimize
|
|
15
|
-
- **Root cause over symptom** — trace each issue to its origin
|
|
16
|
-
- **Fix one, improve many** — every improvement reveals a class of opportunities
|
|
17
|
-
- **Verify improvement** — measure after fix, compare with baseline
|
|
18
|
-
|
|
19
|
-
**三句哲学约束(穷尽迭代):**
|
|
20
|
-
1. **零遗留** — 每个 finding 必须是 action item(修复 / issue / 决策),不允许只报告不处理
|
|
21
|
-
2. **穷尽迭代** — 按 severity 从高到低逐轮修复,直到 0 remaining actionable findings 才退出 fix loop
|
|
22
|
-
3. **改进即标准** — 每次修复后重审同区域,发现新问题继续修,直到该区域无可改善
|
|
10
|
+
survey → 6-dimension audit → diagnose → fix → verify → generalize → discover → persist.
|
|
11
|
+
Baseline-first, exhaustive iteration until zero remaining actionable findings.
|
|
23
12
|
</purpose>
|
|
24
13
|
|
|
25
14
|
<boundary>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
**Zero-residual principle:** Every finding MUST have a concrete action (fix / issue / decision). "Report and shelve" is not allowed. "Pre-existing issue" is not a valid skip reason — if discovered within scope, it must be addressed.
|
|
15
|
+
**In scope:** Target code quality — performance/security/architecture/reliability/observability/maintainability audit → diagnose → fix → generalize.
|
|
16
|
+
**Out of scope:** UI → `$odyssey-ui` | Features → `$odyssey-planex` | Single bug → `$odyssey-debug` | Style review → `$odyssey-review-test-fix`
|
|
17
|
+
**Zero-residual:** Every finding MUST have action (fix/issue/decision). "Report and shelve" is forbidden.
|
|
30
18
|
</boundary>
|
|
31
19
|
|
|
32
20
|
<context>
|
|
33
|
-
$ARGUMENTS
|
|
21
|
+
$ARGUMENTS
|
|
34
22
|
|
|
35
23
|
**Target resolution:**
|
|
36
24
|
| Input | Resolution |
|
|
@@ -38,19 +26,9 @@ $ARGUMENTS — target and optional flags.
|
|
|
38
26
|
| Module/dir path | Audit that module |
|
|
39
27
|
| `HEAD` / `staged` | Review changes in diff |
|
|
40
28
|
| Feature area keyword | Resolve to related files |
|
|
41
|
-
| `--all` | Full project scan
|
|
42
|
-
|
|
43
|
-
**Flags:**
|
|
44
|
-
| Flag | Effect | Default |
|
|
45
|
-
|------|--------|---------|
|
|
46
|
-
| `--dimensions <list>` | Comma-separated subset of 6 dimensions | all 6 |
|
|
47
|
-
| `--fix-threshold <severity>` | 修复到哪个 severity 为止(all = 全部修复)| all |
|
|
48
|
-
| `--skip-fix` | Audit + diagnose only, no code changes | false |
|
|
49
|
-
| `--skip-generalize` | Skip S_GENERALIZE and S_DISCOVER | false |
|
|
50
|
-
| `--auto` | CLI delegates without confirmation | false |
|
|
51
|
-
| `-y` | Auto-confirm all decisions (see appendix) | false |
|
|
52
|
-
| `-c` | Resume most recent session | — |
|
|
53
|
-
| `--heartbeat` | Enable /loop heartbeat protocol (see base) | false |
|
|
29
|
+
| `--all` | Full project scan |
|
|
30
|
+
|
|
31
|
+
**Flags:** `--dimensions <list>` subset of 6 | `--fix-threshold <severity>` fix cutoff (default: all) | `--skip-fix` audit+diagnose only | `--skip-generalize` skip generalize+discover | `--auto` no delegate confirmation | `-y` auto-confirm | `-c` resume | `--heartbeat` /loop heartbeat
|
|
54
32
|
|
|
55
33
|
**Dimensions (6):**
|
|
56
34
|
1. **performance** — hot paths, N+1 queries, memory allocation, cache efficiency, bundle size, lazy loading
|
|
@@ -58,21 +36,25 @@ $ARGUMENTS — target and optional flags.
|
|
|
58
36
|
3. **architecture** — layer violations, circular dependencies, coupling metrics, interface contracts, SRP violations
|
|
59
37
|
4. **reliability** — error handling gaps, retry logic, timeout handling, graceful degradation, resource cleanup
|
|
60
38
|
5. **observability** — logging coverage, metric gaps, trace propagation, error reporting, health checks
|
|
61
|
-
6. **maintainability** — code complexity
|
|
62
|
-
|
|
63
|
-
**Session**: `SESSION_DIR = .workflow/scratch/{YYYYMMDD}-improve-odyssey-{slug}/`
|
|
39
|
+
6. **maintainability** — code complexity, dead code, test coverage gaps, documentation debt
|
|
64
40
|
|
|
65
|
-
**
|
|
41
|
+
**Session**: `.workflow/scratch/{YYYYMMDD}-improve-odyssey-{slug}/`
|
|
42
|
+
**Output**: `session.json` | `evidence.ndjson` | `understanding.md`
|
|
66
43
|
|
|
67
|
-
**session.json
|
|
44
|
+
**session.json — improve-specific fields:**
|
|
45
|
+
```json
|
|
46
|
+
{ "target": "", "dimensions": [], "baseline_metrics": {},
|
|
47
|
+
"audit_result": null, "diagnoses": [], "confirmation": null,
|
|
48
|
+
"generalization_stats": null }
|
|
49
|
+
```
|
|
68
50
|
|
|
69
|
-
**evidence.ndjson
|
|
51
|
+
**evidence.ndjson phases:**
|
|
70
52
|
- `survey`: `category` (dependency|complexity|coverage|error_pattern), `detail`
|
|
71
53
|
- `audit`: `dimension`, `severity`, `measurement`
|
|
72
54
|
- `diagnosis`: `finding_ref`, `hypothesis`, `result` (confirmed|disproved|inconclusive), `root_cause`
|
|
73
55
|
- `fix`: `finding_ref`, `change_summary`, `risk`
|
|
74
56
|
- `discovery`: `file`, `line`, `classification` (safe|risk|issue), `action` (fix|issue|decision|skip)
|
|
75
|
-
- `decision`: `question`, `options`, `context`, `status
|
|
57
|
+
- `decision`: `question`, `options`, `context`, `status`, `resolution`
|
|
76
58
|
- `self-iteration`: `stage`, `round`, `assessment`, `expansion`
|
|
77
59
|
|
|
78
60
|
**phase_goals[]:**
|
|
@@ -81,198 +63,249 @@ $ARGUMENTS — target and optional flags.
|
|
|
81
63
|
| G1 | Survey completed | S_SURVEY | — |
|
|
82
64
|
| G2 | Audit completed | S_AUDIT | — |
|
|
83
65
|
| G3 | Diagnosis completed | S_DIAGNOSE | — |
|
|
84
|
-
| G4 | Zero remaining: all findings fixed and verified |
|
|
66
|
+
| G4 | Zero remaining: all findings fixed and verified | S_VERIFY | skip_fix |
|
|
85
67
|
| G5 | Pattern generalized | S_GENERALIZE | skip_generalize |
|
|
86
68
|
| G6 | Discoveries triaged | S_DISCOVER | skip_generalize |
|
|
87
69
|
| G7 | Learnings persisted | S_RECORD | — |
|
|
88
70
|
|
|
89
|
-
**understanding.md — 9 sections
|
|
71
|
+
**understanding.md — 9 sections:**
|
|
90
72
|
1. Target & Baseline ← S_INTAKE | 2. Current State Survey ← S_SURVEY | 3. Audit Findings ← S_AUDIT
|
|
91
73
|
4. Root Cause Diagnosis ← S_DIAGNOSE | 5. Fix & Verification ← S_FIX+S_VERIFY
|
|
92
74
|
6. Generalization ← S_GENERALIZE | 7. Discoveries ← S_DISCOVER
|
|
93
|
-
8. Improvement Metrics ← S_RECORD
|
|
94
|
-
|
|
95
|
-
### Pre-load(可选,缺失不阻塞)
|
|
96
|
-
- ARCHITECTURE.md → 模块边界 | `maestro search "<target>" --json` → 先前优化(top 5)
|
|
97
|
-
- `maestro load --type spec --category coding` + `--category debug` → 编码规范 + 已知模式
|
|
98
|
-
- `maestro search --category coding` → knowhow | `Glob(".workflow/scratch/*-improve-odyssey-*")` → 先前会话
|
|
75
|
+
8. Improvement Metrics ← S_RECORD | 9. Engineering Learnings ← S_RECORD
|
|
99
76
|
|
|
100
|
-
|
|
77
|
+
**Knowledge Persistence categories (written to understanding.md section 9):**
|
|
101
78
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
|
105
|
-
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
| 架构约束 | 违反描述 + 正确边界 + 检查方法 | `/spec-add arch "..."` |
|
|
109
|
-
| 可靠性 pattern | 故障模式 + 处理策略 + 验证手段 | `/spec-add coding "..."` |
|
|
79
|
+
| Category | Content | Follow-up |
|
|
80
|
+
|----------|---------|-----------|
|
|
81
|
+
| Performance pattern | Bottleneck type + fix + measurement | `/spec-add coding` |
|
|
82
|
+
| Security rule | Vulnerability class + fix + prevention | `/spec-add debug` |
|
|
83
|
+
| Architecture constraint | Violation + correct boundary + verification | `/spec-add arch` |
|
|
84
|
+
| Reliability pattern | Failure mode + handling strategy + validation | `/spec-add coding` |
|
|
110
85
|
</context>
|
|
111
86
|
|
|
112
|
-
|
|
87
|
+
<csv_schema>
|
|
88
|
+
|
|
89
|
+
### Shared Output Schema (all waves)
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"type": "object",
|
|
93
|
+
"properties": {
|
|
94
|
+
"id": { "type": "string" },
|
|
95
|
+
"result_status": { "type": "string", "enum": ["completed", "failed"] },
|
|
96
|
+
"findings": { "type": "string", "maxLength": 500 },
|
|
97
|
+
"evidence": { "type": "string" },
|
|
98
|
+
"error": { "type": "string" }
|
|
99
|
+
},
|
|
100
|
+
"required": ["id", "result_status", "findings"]
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Termination contract:** Call `report_agent_job_result` EXACTLY ONCE. Read-only. Do NOT modify source files, tasks.csv, wave-*.csv, results.csv, or call spawn_agents_on_csv.
|
|
105
|
+
|
|
106
|
+
### tasks.csv
|
|
107
|
+
```csv
|
|
108
|
+
id,title,description,task_type,dimension,deps,wave,status,findings,evidence,error
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Waves:**
|
|
112
|
+
| Wave | Tasks | Parallelism |
|
|
113
|
+
|------|-------|-------------|
|
|
114
|
+
| 1 | Survey (dependency-audit, complexity-scan) | 2 agents |
|
|
115
|
+
| 2 | Audit (performance, security, architecture, reliability, observability, maintainability) | 6 agents |
|
|
116
|
+
| 3 | Generalization (syntax-grep, semantic-scan, structural-match, historical-grep) | 4 agents |
|
|
117
|
+
</csv_schema>
|
|
118
|
+
|
|
119
|
+
<invariants>
|
|
120
|
+
Base invariants apply. Additional: baseline metrics captured before any fix; every fix re-verified against baseline.
|
|
121
|
+
</invariants>
|
|
122
|
+
|
|
123
|
+
<self_iteration>
|
|
124
|
+
Applies to: **S_SURVEY, S_AUDIT, S_DIAGNOSE, S_GENERALIZE**. Logic in base.
|
|
125
|
+
</self_iteration>
|
|
113
126
|
|
|
114
127
|
<state_machine>
|
|
115
128
|
|
|
116
129
|
<states>
|
|
117
|
-
S_INTAKE
|
|
118
|
-
S_SURVEY — Current state: dependency audit, complexity scan, coverage PERSIST: evidence.ndjson (survey) + understanding.md §2
|
|
119
|
-
S_AUDIT — 6-dimension parallel deep audit PERSIST: evidence.ndjson (audit) + understanding.md §3
|
|
120
|
-
S_DIAGNOSE — Root cause analysis for critical/high findings PERSIST: evidence.ndjson (diagnosis|decision) + understanding.md §4
|
|
121
|
-
S_FIX — Implement improvements (skip if --skip-fix) PERSIST: code changes + evidence.ndjson (fix)
|
|
122
|
-
S_VERIFY — Tests + measurement comparison (skip if --skip-fix) PERSIST: session.json.confirmation + understanding.md §5
|
|
123
|
-
S_GENERALIZE — Pattern extraction + 4-agent scan (skip if --skip-gen) PERSIST: session.json.patterns + understanding.md §6
|
|
124
|
-
S_DISCOVER — Classify hits, create issues (skip if --skip-gen) PERSIST: evidence.ndjson (discovery|decision) + understanding.md §7
|
|
125
|
-
S_RECORD — Persist metrics + learnings + final report PERSIST: understanding.md §8-9 + spec entries
|
|
130
|
+
S_INTAKE → S_SURVEY → S_AUDIT → S_DIAGNOSE → S_FIX → S_VERIFY → S_GENERALIZE → S_DISCOVER → S_RECORD → END
|
|
126
131
|
</states>
|
|
127
132
|
|
|
128
133
|
<transitions>
|
|
129
|
-
S_INTAKE:
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
S_AUDIT:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
S_DIAGNOSE:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
S_DISCOVER → S_FIX : same-pattern fix, !skip_fix → cross_phase_loops++
|
|
161
|
-
S_DISCOVER → S_RECORD : triage complete AND remaining_actionable == 0
|
|
162
|
-
S_DISCOVER → S_RECORD : loops >= max_loops → MUST log each unfixed item with specific reason (blanket "pre-existing" is forbidden)
|
|
163
|
-
|
|
164
|
-
S_RECORD → END DO A_RECORD
|
|
134
|
+
S_INTAKE → S_INTAKE : -c + session found → A_RESUME
|
|
135
|
+
S_INTAKE → S_SURVEY : target resolved → A_INTAKE
|
|
136
|
+
S_INTAKE → S_INTAKE : no target → request_user_input
|
|
137
|
+
|
|
138
|
+
S_SURVEY → S_AUDIT : complete
|
|
139
|
+
|
|
140
|
+
S_AUDIT → S_DIAGNOSE : critical/high findings exist
|
|
141
|
+
S_AUDIT → S_GENERALIZE : no critical/high, !skip_generalize
|
|
142
|
+
S_AUDIT → S_RECORD : no findings OR skip_generalize
|
|
143
|
+
|
|
144
|
+
S_DIAGNOSE → S_FIX : root causes identified, !skip_fix
|
|
145
|
+
S_DIAGNOSE → S_GENERALIZE : root causes identified, skip_fix, !skip_generalize
|
|
146
|
+
S_DIAGNOSE → S_RECORD : root causes identified, skip_fix, skip_generalize
|
|
147
|
+
S_DIAGNOSE → S_DIAGNOSE : hypotheses failed, retries < 3 → A_ESCALATE_DIAGNOSIS
|
|
148
|
+
S_DIAGNOSE → S_RECORD : retries >= 3 → INCONCLUSIVE
|
|
149
|
+
|
|
150
|
+
S_FIX → S_VERIFY : fix implemented
|
|
151
|
+
|
|
152
|
+
S_VERIFY → S_GENERALIZE : verified, !skip_generalize
|
|
153
|
+
S_VERIFY → S_RECORD : verified, skip_generalize
|
|
154
|
+
S_VERIFY → S_FIX : needs_rework
|
|
155
|
+
|
|
156
|
+
S_GENERALIZE → S_DISCOVER : hits found
|
|
157
|
+
S_GENERALIZE → S_RECORD : no hits
|
|
158
|
+
|
|
159
|
+
S_DISCOVER → S_DIAGNOSE : new critical issue → cross_phase_loops++
|
|
160
|
+
S_DISCOVER → S_FIX : same-pattern fix, !skip_fix → cross_phase_loops++
|
|
161
|
+
S_DISCOVER → S_RECORD : remaining_actionable == 0
|
|
162
|
+
S_DISCOVER → S_RECORD : loops >= max_loops → log per-item reasons
|
|
163
|
+
|
|
164
|
+
S_RECORD → END : complete
|
|
165
165
|
</transitions>
|
|
166
166
|
|
|
167
167
|
<actions>
|
|
168
168
|
|
|
169
169
|
### A_INTAKE
|
|
170
|
-
1. Parse arguments: target
|
|
171
|
-
2. Generate slug, create
|
|
172
|
-
3.
|
|
170
|
+
1. Parse arguments: target, flags, `--dimensions` subset
|
|
171
|
+
2. Generate slug, create SESSION_DIR
|
|
172
|
+
3. `maestro search "<keywords>"` + Glob prior sessions + ARCHITECTURE.md + spec load coding/debug
|
|
173
173
|
4. **Baseline capture**: Record current metrics (test pass rate, bundle size, dependency count, complexity hotspots) to `session.json.baseline_metrics`
|
|
174
|
-
5. Derive `phase_goals[]` from flags
|
|
175
|
-
6. Write `session.json` + `understanding.md`
|
|
176
|
-
7. Emit Goal Prompt (see Appendix)
|
|
174
|
+
5. Derive `phase_goals[]` from flags
|
|
175
|
+
6. Write `session.json` + `understanding.md` section 1, emit Goal Prompt
|
|
177
176
|
|
|
178
|
-
|
|
177
|
+
Commit: `"odyssey-improve({slug}): INTAKE — target parsed and baseline captured"`
|
|
179
178
|
|
|
180
179
|
### A_RESUME
|
|
181
|
-
|
|
180
|
+
Glob latest session → read `session.json` → jump to `current_state`.
|
|
182
181
|
|
|
183
182
|
### A_SURVEY
|
|
184
|
-
|
|
183
|
+
**spawn_agents_on_csv (Wave 1):**
|
|
184
|
+
|
|
185
|
+
Write `tasks.csv` with Wave 1 rows:
|
|
186
|
+
```csv
|
|
187
|
+
"survey-deps","Dependency Audit","Analyze dependencies for {target_files}: package versions, known CVEs, unused deps, circular imports, dep depth. Return [{dep,version,issue_type,severity,detail}].","survey","","","1","pending","","",""
|
|
188
|
+
"survey-complexity","Complexity Scan","Measure complexity for {target_files}: cyclomatic complexity, function length, nesting depth, file size, export count. Return [{file,metric,value,threshold,status}].","survey","","","1","pending","","",""
|
|
189
|
+
```
|
|
190
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:2, max_runtime_seconds:300, output_csv_path:"wave-1-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
185
191
|
|
|
186
|
-
|
|
187
|
-
2. **CLI-assisted** (optional): `maestro delegate` with `--role analyze --mode analysis` for dependency health, complexity hotspots, coverage gaps, error patterns. Execute `run_in_background: true`.
|
|
188
|
-
3. Append evidence.ndjson (phase: "survey"). Update `understanding.md` §2. Mark G1 done.
|
|
192
|
+
Merge → evidence.ndjson (phase: "survey"). Extract `baseline_metrics`. Update section 2. Mark G1.
|
|
189
193
|
|
|
190
|
-
|
|
194
|
+
Commit: `"odyssey-improve({slug}): SURVEY — current state survey"`
|
|
191
195
|
|
|
192
196
|
### A_AUDIT
|
|
193
|
-
|
|
194
|
-
|
|
197
|
+
**spawn_agents_on_csv (Wave 2)** — 6 agents (one per dimension, or `--dimensions` subset):
|
|
198
|
+
|
|
199
|
+
Append Wave 2 rows to `tasks.csv`:
|
|
200
|
+
```csv
|
|
201
|
+
"audit-perf","Performance","Hot paths, N+1 queries, memory allocation, cache strategy, bundle analysis, lazy loading for {target_files}","audit","performance","","2","pending","","",""
|
|
202
|
+
"audit-security","Security","OWASP Top 10: injection, broken auth, data exposure, XXE, access control, misconfig, XSS, deserialization, deps, logging for {target_files}","audit","security","","2","pending","","",""
|
|
203
|
+
"audit-arch","Architecture","Layer boundaries, circular deps, coupling metrics, interface contracts, SRP compliance, dependency direction for {target_files}","audit","architecture","","2","pending","","",""
|
|
204
|
+
"audit-reliability","Reliability","Error handling completeness, retry logic, timeout config, circuit breakers, graceful degradation, resource cleanup for {target_files}","audit","reliability","","2","pending","","",""
|
|
205
|
+
"audit-observability","Observability","Logging coverage, structured logs, metrics emission, trace propagation, error reporting, health endpoints for {target_files}","audit","observability","","2","pending","","",""
|
|
206
|
+
"audit-maintain","Maintainability","Dead code, complex conditionals, test coverage gaps, magic numbers, naming clarity, doc debt for {target_files}","audit","maintainability","","2","pending","","",""
|
|
207
|
+
```
|
|
208
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:6, max_runtime_seconds:600, output_csv_path:"wave-2-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
195
209
|
|
|
196
|
-
Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result
|
|
197
|
-
Update
|
|
210
|
+
Merge → evidence.ndjson (phase: "audit"). Write `session.json.audit_result` with dimensions, finding count, severity distribution.
|
|
211
|
+
Update section 3. Mark G2.
|
|
198
212
|
|
|
199
|
-
|
|
213
|
+
Commit: `"odyssey-improve({slug}): AUDIT — multi-dimensional audit"`
|
|
200
214
|
|
|
201
215
|
### A_DIAGNOSE
|
|
202
|
-
Root cause analysis for critical/high findings
|
|
216
|
+
Root cause analysis for critical/high findings.
|
|
203
217
|
|
|
204
|
-
1. Group by dimension, prioritize by severity. For each: hypothesis → trace code path + git history → evidence
|
|
205
|
-
2.
|
|
206
|
-
3.
|
|
207
|
-
4. Write `session.json.diagnoses[]`. Update
|
|
218
|
+
1. Group by dimension, prioritize by severity. For each: hypothesis → trace code path + git history → evidence (phase: "diagnosis")
|
|
219
|
+
2. Ambiguity → evidence (phase: "decision"); Normal: request_user_input | `-y`: defer
|
|
220
|
+
3. Complex findings: `maestro delegate --role analyze --mode analysis` (`run_in_background: true`)
|
|
221
|
+
4. Write `session.json.diagnoses[]`. Update section 4. Mark G3.
|
|
208
222
|
|
|
209
|
-
|
|
223
|
+
Commit: `"odyssey-improve({slug}): DIAGNOSE — root cause analysis"`
|
|
210
224
|
|
|
211
225
|
### A_ESCALATE_DIAGNOSIS
|
|
212
|
-
|
|
226
|
+
`retries++`. < 3: `maestro delegate --role analyze`, new hypotheses, → S_DIAGNOSE. >= 3: Normal → request_user_input | `-y` → INCONCLUSIVE → S_RECORD.
|
|
213
227
|
|
|
214
228
|
### A_FIX
|
|
215
|
-
|
|
229
|
+
Fix ALL diagnosed issues by severity tier (critical → high → medium → low within fix_threshold), one dimension at a time. After each tier, re-verify modified area — new findings append to current tier.
|
|
216
230
|
|
|
217
|
-
|
|
218
|
-
2. For each fix: implement → record evidence.ndjson (phase: "fix")
|
|
219
|
-
3. **Normal**: request_user_input per-fix confirmation. **`-y`**: auto-proceed, record `deferred`.
|
|
231
|
+
For each fix: implement → evidence (phase: "fix"). Normal: request_user_input per-fix confirmation | `-y`: auto-proceed.
|
|
220
232
|
|
|
221
|
-
|
|
233
|
+
Commit: `"odyssey-improve({slug}): FIX — improvements implemented"`
|
|
222
234
|
|
|
223
235
|
### A_VERIFY
|
|
224
236
|
1. Run tests covering modified areas
|
|
225
237
|
2. Re-capture metrics, compare with `session.json.baseline_metrics`
|
|
226
|
-
3.
|
|
227
|
-
4. `needs_rework` → S_FIX. `verified` → mark G4
|
|
228
|
-
5. Write `session.json.confirmation`. Update
|
|
238
|
+
3. `maestro delegate --role review --mode analysis` (`run_in_background: true`) — check fix correctness, regressions, impact vs baseline
|
|
239
|
+
4. `needs_rework` → S_FIX. `verified` → mark G4.
|
|
240
|
+
5. Write `session.json.confirmation`. Update section 5.
|
|
229
241
|
|
|
230
|
-
|
|
242
|
+
Commit: `"odyssey-improve({slug}): VERIFY — improvements verified"`
|
|
231
243
|
|
|
232
244
|
### A_GENERALIZE
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
Base shared_actions. Improve overrides:
|
|
246
|
+
- Pattern source: diagnoses + fixes
|
|
247
|
+
|
|
248
|
+
**Wave 3 — spawn_agents_on_csv (4 agents):**
|
|
249
|
+
|
|
250
|
+
Append Wave 3 rows to `tasks.csv`:
|
|
251
|
+
```csv
|
|
252
|
+
"gen-syntax","Syntax Grep","Grep syntax-layer signatures '${signatures}' across project. Return [{file,line,context,risk_level,layer:'syntax',confidence}].","generalization","syntax","","3","pending","","",""
|
|
253
|
+
"gen-semantic","Semantic Scan","Check related modules for anti-pattern: ${description}. Return [{file,line,context,risk_level,layer:'semantic',confidence}].","generalization","semantic","","3","pending","","",""
|
|
254
|
+
"gen-structural","Structural Match","Find structurally similar files to ${diagnosed_files}, check for same anti-pattern. Return [{file,line,description,risk,layer:'structural',confidence}].","generalization","structural","","3","pending","","",""
|
|
255
|
+
"gen-historical","Historical Grep","Run git log -S '${signature}' --oneline. Return [{sha,file,date,type:'introduced|fixed',context}].","generalization","historical","","3","pending","","",""
|
|
256
|
+
```
|
|
257
|
+
`spawn_agents_on_csv({ csv_path:"tasks.csv", max_concurrency:4, max_runtime_seconds:300, output_csv_path:"wave-3-results.csv", output_schema:SHARED_OUTPUT_SCHEMA })`
|
|
258
|
+
|
|
259
|
+
Update section 6. Mark G5.
|
|
260
|
+
|
|
261
|
+
Commit: `"odyssey-improve({slug}): GENERALIZE — pattern scan"`
|
|
262
|
+
|
|
263
|
+
### A_DISCOVER, A_RECORD
|
|
264
|
+
Base shared_actions. Improve overrides:
|
|
265
|
+
- **A_RECORD** section 8: before/after comparison table from baseline_metrics vs current measurements
|
|
266
|
+
- **A_RECORD** section 9: learnings per Knowledge Persistence table
|
|
267
|
+
|
|
268
|
+
**Completion summary:**
|
|
269
|
+
```
|
|
270
|
+
--- IMPROVE ODYSSEY COMPLETE ---
|
|
271
|
+
Target: {target}
|
|
272
|
+
Dimensions: {dimensions}
|
|
273
|
+
Findings: {critical}/{high}/{medium}/{low}
|
|
274
|
+
Diagnosed: {count}
|
|
275
|
+
Fixed: {count} verified
|
|
276
|
+
Metrics: {improved}/{regressed}
|
|
277
|
+
Patterns: {count} ({by_layer})
|
|
278
|
+
Scan hits: {total} ({cross_layer} confirmed)
|
|
279
|
+
Issues: {N} created
|
|
280
|
+
Decisions: {N} resolved, {M} pending, {K} deferred
|
|
281
|
+
Learnings: {N} persisted
|
|
282
|
+
Self-iter: {N} rounds across {M} stages
|
|
283
|
+
Cross-loops:{N} used
|
|
284
|
+
Goals: {done}/{total} ({skipped} skipped)
|
|
285
|
+
---
|
|
286
|
+
```
|
|
250
287
|
|
|
251
288
|
</actions>
|
|
252
289
|
|
|
253
290
|
<appendix>
|
|
254
291
|
|
|
255
|
-
###
|
|
256
|
-
**⚠️ 仅在 A_INTAKE 完成后显示一次,A_RECORD 完成时不重复。**
|
|
292
|
+
### `-y` improve-specific points
|
|
257
293
|
|
|
258
|
-
列出所有非 skipped 的 phase_goals,附加收敛规则:
|
|
259
|
-
- 穷尽迭代至所有 findings 已处理(fix/issue/decision)且 `phase_goals_all_done=true`
|
|
260
|
-
- 修复按 severity 逐轮迭代,每轮 re-verify
|
|
261
|
-
- Baseline 修复前采集,修复后对比确认改进
|
|
262
|
-
- pending decision 必须 request_user_input,不允许"只报告不处理"
|
|
263
|
-
|
|
264
|
-
### `-y` Auto-Confirm Behavior
|
|
265
294
|
| Decision Point | Normal | `-y` |
|
|
266
295
|
|---------------|--------|------|
|
|
267
|
-
| A_FIX improvement confirmation | request_user_input | auto-proceed,
|
|
268
|
-
| A_DIAGNOSE ambiguity | request_user_input | best-effort,
|
|
269
|
-
| A_ESCALATE 3-strike | request_user_input
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
| A_RECORD pending decisions | request_user_input | skip, show deferred count |
|
|
273
|
-
| A_RECORD goal audit | request_user_input | auto accept |
|
|
296
|
+
| A_FIX improvement confirmation | request_user_input | auto-proceed, deferred |
|
|
297
|
+
| A_DIAGNOSE ambiguity | request_user_input | best-effort, deferred |
|
|
298
|
+
| A_ESCALATE 3-strike | request_user_input | INCONCLUSIVE |
|
|
299
|
+
|
|
300
|
+
### Goal Prompt convergence rules
|
|
274
301
|
|
|
275
|
-
|
|
302
|
+
```
|
|
303
|
+
Exhaust all findings (fix/issue/decision) until remaining_actionable == 0
|
|
304
|
+
and phase_goals_all_done=true.
|
|
305
|
+
Fix by severity tier with re-verify per tier.
|
|
306
|
+
Baseline captured before fix, compared after to confirm improvement.
|
|
307
|
+
Pending decisions must request_user_input — no report-only.
|
|
308
|
+
```
|
|
276
309
|
|
|
277
310
|
</appendix>
|
|
278
311
|
|
|
@@ -289,24 +322,24 @@ Skip if `--skip-fix`. Implement improvements for diagnosed root causes.
|
|
|
289
322
|
|
|
290
323
|
<success_criteria>
|
|
291
324
|
- [ ] Target resolved, baseline metrics captured
|
|
292
|
-
- [ ] Survey + 6-dimension audit with
|
|
325
|
+
- [ ] Survey + 6-dimension audit with severity matrix
|
|
293
326
|
- [ ] Root causes diagnosed for critical/high findings
|
|
294
327
|
- [ ] Improvements implemented and verified with before/after metrics (unless --skip-fix)
|
|
295
328
|
- [ ] Multi-layer generalization + cross-phase loops (unless --skip-generalize)
|
|
296
|
-
- [ ] Every unfixed finding
|
|
297
|
-
- [ ] understanding.md
|
|
329
|
+
- [ ] Every unfixed finding individually classified with reason
|
|
330
|
+
- [ ] understanding.md sections 8-9 completed
|
|
298
331
|
- [ ] phase_goals G1-G7 tracked and audited
|
|
299
332
|
- [ ] Session resumable via -c
|
|
300
333
|
</success_criteria>
|
|
301
334
|
|
|
302
335
|
<next_step_routing>
|
|
303
|
-
| Condition | Next
|
|
304
|
-
|
|
336
|
+
| Condition | Next |
|
|
337
|
+
|-----------|------|
|
|
305
338
|
| Security findings need deep investigation | `$odyssey-debug "<finding>"` |
|
|
306
339
|
| UI-related findings | `$odyssey-ui "<component>"` |
|
|
307
340
|
| Issues created from discoveries | `/manage-issue list --source improve-odyssey` |
|
|
308
341
|
| Architecture pattern to document | `/spec-add arch "..."` |
|
|
309
342
|
| Performance pattern to persist | `/spec-add coding "..."` |
|
|
310
|
-
|
|
|
311
|
-
|
|
|
343
|
+
| Formal review of changes | `$odyssey-review-test-fix <changed-files>` |
|
|
344
|
+
| Pending decisions | Filter evidence phase=decision status=pending |
|
|
312
345
|
</next_step_routing>
|