maestro-flow-one 0.2.35 → 0.2.37

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.
@@ -190,9 +190,11 @@ All behavioral statements MUST use MUST / SHOULD / MAY / MUST NOT / SHOULD NOT.
190
190
  - [ ] No interrogative sentences (all declarative)
191
191
  - [ ] system-architect: §3 contains "Data Model" and "State Machine" headings
192
192
 
193
- ## Return Protocol
193
+ ## Completion Sequence (MANDATORY ORDER)
194
194
 
195
- Report completion with this structure (the orchestrator reads ONLY this, not the files):
195
+ **Step A Write files**: Use the Write tool to create every file under `output_dir/`. Then verify with Glob that `analysis.md` and each `analysis-F-*.md` exist on disk. If any Write call fails, emit `TASK BLOCKED` and stop.
196
+
197
+ **Step B — Report summary**: ONLY AFTER Step A files are confirmed on disk, emit this text (the orchestrator reads this summary to track progress — it does NOT substitute for the files):
196
198
 
197
199
  ```
198
200
  TASK COMPLETE
@@ -205,7 +207,7 @@ rfc_keyword_count: {N}
205
207
  total_lines: {sum across all files}
206
208
  ```
207
209
 
208
- If blocked: report blocker with `TASK BLOCKED` prefix.
210
+ Never emit `TASK COMPLETE` without files on disk. If blocked: report with `TASK BLOCKED` prefix.
209
211
 
210
212
  ## NEVER
211
213
 
@@ -44,6 +44,7 @@ Follow '~/.maestro/workflows/harvest.md' Stages 1-8 in order.
44
44
  2. **Dedup before write** — check harvest-log.jsonl and existing stores before each write.
45
45
  3. **Never modify source artifacts** — harvest is purely extractive.
46
46
  4. **Dedup contract with parallel writers** — when appending to `issues.jsonl`, set `source: "harvest"` on each row so concurrent writers (e.g. `manage-issue-discover` with `source: "discover"`) can be distinguished and deduplicated.
47
+ 5. **Conflict pre-check on spec routing** — when routing to spec (Stage 6b), compare new entry against existing specs with same keywords/category. If semantic conflict detected, set `confidence="low"` on the new entry and log conflict note. Use `maestro spec conflict mark` if contradiction is clear.
47
48
 
48
49
  Extraction patterns, classification rules, routing infrastructure, and fragment ID scheme defined in workflow harvest.md.
49
50
 
@@ -58,6 +59,8 @@ Extraction patterns, classification rules, routing infrastructure, and fragment
58
59
  | Wiki graph needs linking | `/manage-wiki connect --fix` |
59
60
  | Issues created | `/manage-issue list --source harvest` |
60
61
  | Specs extracted | `/spec-load --role implement` |
62
+ | Specs extracted (冲突审查) | `/manage-knowledge-audit --scope spec` — 新写入的 spec 可能与现有条目矛盾 |
63
+ | Spec 冲突标记已存在 | `maestro spec conflict list` — 查看当前冲突状态 |
61
64
  | Full phase retrospective | `/quality-retrospective` |
62
65
  </completion>
63
66
 
@@ -43,10 +43,12 @@ Follow `~/.maestro/workflows/knowledge-audit.md` Stages 1-8 in order.
43
43
  **GATE 1: Load → Detect** (Stages 1-2 → Stage 4)
44
44
  - REQUIRED: Scope 解析通过,互斥标志校验完成。
45
45
  - REQUIRED: 三存储按 scope 加载完成。
46
+ - REQUIRED: 加载已有冲突标记: `maestro spec conflict list` → 合并到 finding 池。
46
47
  - BLOCKED if scope 非法或存储不可读: E001/E002。
47
48
 
48
49
  **GATE 2: Detect → Decision** (Stage 4 → Stage 5)
49
50
  - REQUIRED: Finding 池按 P0/P1/P2 分级输出。
51
+ - REQUIRED: 已标记 `contested` 的条目自动归入 P0 finding(来源: conflict-marker)。
50
52
  - REQUIRED: 未 harvest 的 artifact 删除前触发抢救确认(W002)。
51
53
  - BLOCKED if finding 为空: 无需淘汰,直接输出报告。
52
54
 
@@ -61,6 +63,31 @@ Follow `~/.maestro/workflows/knowledge-audit.md` Stages 1-8 in order.
61
63
  - **Deprecate over delete**: 文本存储首选 `status="deprecated"`,保留历史。
62
64
  - **Purge 仅 artifact**: `--purge` 不作用于 spec/knowhow。
63
65
  - **Rescue before delete**: 未抽取 artifact 删除前强制提示先 `/manage-harvest`。
66
+
67
+ ### Conflict Resolution Integration
68
+
69
+ 四态决策(扩展自三态 keep/deprecate/delete):
70
+
71
+ | 动作 | 适用场景 | 执行 |
72
+ |------|---------|------|
73
+ | `keep` | 内容正确,无需变更 | 写 audit-log ignore 记录 |
74
+ | `contest` | 矛盾真实存在,需进一步审查 | `maestro spec conflict mark <file> <line> --note "<evidence>"` |
75
+ | `deprecate` | 内容过时或被取代 | 注入 `status="deprecated"` + `maestro spec conflict clear <file> <line>` |
76
+ | `delete` | 内容明确错误 | 移除 entry + `maestro spec conflict clear <file> <line>` |
77
+
78
+ **关键**: deprecate/delete 执行时,如果目标条目有 conflict-marker,必须同步调用 `maestro spec conflict clear` 清除标记,避免悬空冲突。
79
+
80
+ ### Code-as-Truth 校验(审查核心原则)
81
+
82
+ **代码是唯一真理源。** Spec/knowhow 中的任何声明,必须与代码实际行为一致。
83
+
84
+ 当 detector 发现 spec 条目声称某行为/规则时:
85
+ 1. **代码校验**: grep/read 代码中相关实现,确认 spec 声明是否与代码一致
86
+ 2. **不一致处理**:
87
+ - 代码正确、spec 过时 → `deprecate` 或 `delete` spec 条目
88
+ - 代码正确、spec 不完整 → `contest` 并建议补充
89
+ - 代码有 bug、spec 正确 → `keep` spec,生成 issue 修代码
90
+ 3. **禁止**: 仅凭 spec 文本判断正确性。每个 finding 的 evidence 必须包含代码引用(文件:行号)
64
91
  </execution>
65
92
 
66
93
  <completion>
@@ -71,6 +98,8 @@ Follow `~/.maestro/workflows/knowledge-audit.md` Stages 1-8 in order.
71
98
  | 复审淘汰记录 | 查看 `audit-report-{date}.md` |
72
99
  | 抢救未抽取 artifact | `/manage-harvest <artifact-id>` |
73
100
  | 验证 spec 现状 | `/spec-load --role implement` |
101
+ | 查看冲突标记 | `maestro spec conflict list` |
102
+ | 清除已解决冲突 | `maestro spec conflict clear-all <file>` |
74
103
  | 周期巡检 | `--scope all --report` |
75
104
  </completion>
76
105
 
@@ -50,6 +50,7 @@ Each artifact's type determines its outputs at `.workflow/{a.path}/`:
50
50
  - Codebase docs: `.workflow/codebase/ARCHITECTURE.md` → component boundaries, layer rules
51
51
  - Wiki constraints: `maestro search "architecture constraint" --json` → documented decisions
52
52
  - Specs: `maestro spec load --category review` → review standards, checklists, knowhow tools
53
+ - Conflict state: `maestro spec conflict list` → 当前已标记冲突的 spec 条目(review 时优先关注)
53
54
  - Role knowledge: `maestro search --category review` → select relevant → `maestro wiki load`
54
55
 
55
56
  **Output**: `REVIEW_DIR = .workflow/scratch/{YYYYMMDD}-review-P{N}-{slug}/` (P{N} = phase number, enables directory-level identification as state.json fallback)
@@ -73,6 +74,7 @@ Follow '~/.maestro/workflows/review.md' completely.
73
74
  - REQUIRED: review.json written with findings, severity distribution, and verdict.
74
75
  - REQUIRED: Issues auto-created based on level thresholds.
75
76
  - REQUIRED: index.json updated with review status.
77
+ - REQUIRED: Spec conflict check — if any finding directly contradicts a loaded spec entry (code behavior ≠ spec rule), suggest `maestro spec conflict mark` on the spec entry. Code is the single source of truth.
76
78
 
77
79
  **Output writes to REVIEW_DIR** (not EXEC_DIR):
78
80
  - `REVIEW_DIR/review.json` — findings, severity distribution, verdict
@@ -127,6 +129,7 @@ maestro ralph complete <idx> --status {STATUS} [--evidence {path}]
127
129
  | PASS verdict | `/quality-test {phase}` |
128
130
  | WARN verdict (non-blocking issues) | `/quality-test {phase}` (proceed with caveats) |
129
131
  | BLOCK verdict (critical findings) | `/maestro-plan {phase} --gaps` (fix first) |
132
+ | Spec contradictions found | `maestro spec conflict list` → `/manage-knowledge-audit --scope spec` |
130
133
  | Want code cleanup | `/quality-refactor {phase}` |
131
134
  </completion>
132
135
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maestro-flow-one",
3
- "version": "0.2.35",
3
+ "version": "0.2.37",
4
4
  "description": "All Maestro workflow commands as a single Claude Code skill — intent routing, decision gates, minimal closed-loop chains",
5
5
  "bin": {
6
6
  "maestro-flow": "bin/maestro-flow.js"