feat: reviewers↔fix ループ収束を支援するレポート履歴・ループ監視・参照方針の整備

- phase-runner: レポートを上書きせずタイムスタンプ付きで同ディレクトリに保存し、fix が過去指摘の傾向を追跡できるよう改善
- output-contracts: persists/reopened/family_tag フィールドを追加してレビュー指摘の継続性を明示
- pieces: 全ビルトインピースに reviewers↔fix の loop_monitors を追加し、発散ループを自動検知
- fix.md: 過去レポートの参照方法を「Glob で {レポート名}.* を検索、最大2件読む」と具体化
- loop-monitor-reviewers-fix.md: ループモニタ判定用の共通インストラクションを新規追加
This commit is contained in:
nrslib 2026-03-04 11:32:19 +09:00
parent 6a3c64a033
commit 4e89fe1c23
64 changed files with 699 additions and 179 deletions

View File

@ -1,10 +1,16 @@
Address the reviewer's feedback.
Use reports in the Report Directory shown in the Piece Context and fix the issues raised by the reviewer.
Use files in the Report Directory as primary evidence. If additional context is needed, you may consult Previous Response and conversation history as secondary sources (Previous Response may be unavailable). If information conflicts, prioritize reports in the Report Directory and actual file contents.
Use reports in the Report Directory and fix the issues raised by the reviewer.
**Important**: After fixing, run both build and tests.
- Build verification is mandatory. Run the build (type check) and verify there are no type errors
- Running tests is mandatory. After build succeeds, always run tests and verify results
**Report reference policy:**
- Use the latest review reports in the Report Directory as primary evidence.
- Past iteration reports are saved as `{filename}.{timestamp}` in the same directory (e.g., `architect-review.md.20260304T123456Z`). For each report, run Glob with a `{report-name}.*` pattern, read up to 2 files in descending timestamp order, and understand persists / reopened trends before starting fixes.
**Completion criteria (all must be satisfied):**
- All findings in this iteration (new / reopened) have been fixed
- Potential occurrences of the same `family_tag` have been fixed simultaneously (no partial fixes that cause recurrence)
- At least one regression test per `family_tag` has been added (mandatory for config-contract and boundary-check findings)
- Findings with the same `family_tag` from multiple reviewers have been merged and addressed as one fix
**Important**: After fixing, run the build (type check) and tests.
**Required output (include headings)**
## Work results
@ -15,5 +21,11 @@ Use files in the Report Directory as primary evidence. If additional context is
- {Build execution results}
## Test results
- {Test command executed and results}
## Convergence gate
| Metric | Count |
|--------|-------|
| new (fixed in this iteration) | {N} |
| reopened (recurrence fixed) | {N} |
| persists (carried over, not addressed this iteration) | {N} |
## Evidence
- {List key points from files checked/searches/diffs/logs}

View File

@ -0,0 +1,9 @@
The reviewers → fix loop has repeated {cycle_count} times.
Review the latest review reports in the Report Directory and determine
whether this loop is healthy (converging) or unproductive (diverging or oscillating).
**Judgment criteria:**
- Is the number of new / reopened findings decreasing each cycle?
- Are the same family_tag findings not repeating (is persists not growing)?
- Are fixes actually being applied to the code?

View File

@ -15,22 +15,27 @@
| Scope | ✅ | - |
## Current Iteration Findings (new)
| # | finding_id | Category | Location | Issue | Fix Suggestion |
|---|------------|----------|----------|-------|----------------|
| 1 | AI-NEW-src-file-L23 | Hallucinated API | `src/file.ts:23` | Non-existent method | Replace with existing API |
| # | finding_id | family_tag | Category | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|----------|-------|----------------|
| 1 | AI-NEW-src-file-L23 | hallucination | Hallucinated API | `src/file.ts:23` | Non-existent method | Replace with existing API |
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | AI-PERSIST-src-file-L42 | `src/file.ts:42` | `src/file.ts:42` | Still unresolved | Apply prior fix plan |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | AI-PERSIST-src-file-L42 | hallucination | `src/file.ts:42` | `src/file.ts:42` | Still unresolved | Apply prior fix plan |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| AI-RESOLVED-src-file-L10 | `src/file.ts:10` no longer contains the issue |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | AI-REOPENED-src-file-L55 | hallucination | `Previously fixed at src/file.ts:10` | `Recurred at src/file.ts:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -15,24 +15,29 @@
- [x] Call chain verification
## Current Iteration Findings (new)
| # | finding_id | Scope | Location | Issue | Fix Suggestion |
|---|------------|-------|----------|-------|----------------|
| 1 | ARCH-NEW-src-file-L42 | In-scope | `src/file.ts:42` | Issue description | Fix approach |
| # | finding_id | family_tag | Scope | Location | Issue | Fix Suggestion |
|---|------------|------------|-------|----------|-------|----------------|
| 1 | ARCH-NEW-src-file-L42 | design-violation | In-scope | `src/file.ts:42` | Issue description | Fix approach |
Scope: "In-scope" (fixable in this change) / "Out-of-scope" (existing issue, non-blocking)
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | ARCH-PERSIST-src-file-L77 | `src/file.ts:77` | `src/file.ts:77` | Still unresolved | Apply prior fix plan |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | ARCH-PERSIST-src-file-L77 | design-violation | `src/file.ts:77` | `src/file.ts:77` | Still unresolved | Apply prior fix plan |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| ARCH-RESOLVED-src-file-L10 | `src/file.ts:10` now satisfies the rule |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | ARCH-REOPENED-src-file-L55 | design-violation | `Previously fixed at src/file.ts:10` | `Recurred at src/file.ts:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -15,13 +15,33 @@
| Projections | ✅ | - |
| Eventual consistency | ✅ | - |
## Issues (if REJECT)
| # | Scope | Location | Issue | Fix Suggestion |
|---|-------|----------|-------|----------------|
| 1 | In-scope | `src/file.ts:42` | Issue description | Fix approach |
## Current Iteration Findings (new)
| # | finding_id | family_tag | Scope | Location | Issue | Fix Suggestion |
|---|------------|------------|-------|----------|-------|----------------|
| 1 | CQRS-NEW-src-file-L42 | cqrs-violation | In-scope | `src/file.ts:42` | Issue description | Fix approach |
Scope: "In-scope" (fixable in this change) / "Out-of-scope" (existing issue, non-blocking)
## Existing Issues (reference, non-blocking)
- {Record of existing issues unrelated to the current change}
## Carry-over Findings (persists)
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | CQRS-PERSIST-src-file-L77 | cqrs-violation | `src/file.ts:77` | `src/file.ts:77` | Still unresolved | Apply prior fix plan |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| CQRS-RESOLVED-src-file-L10 | `src/file.ts:10` now satisfies the rule |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | CQRS-REOPENED-src-file-L55 | cqrs-violation | `Previously fixed at src/file.ts:10` | `Recurred at src/file.ts:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```
**Cognitive load reduction rules:**
- APPROVE → Summary only (5 lines or fewer)
- REJECT → Include only relevant finding rows (30 lines or fewer)

View File

@ -15,8 +15,31 @@
| Accessibility | ✅ | - |
| Type safety | ✅ | - |
## Issues (if REJECT)
| # | Location | Issue | Fix Suggestion |
|---|----------|-------|----------------|
| 1 | `src/file.tsx:42` | Issue description | Fix approach |
## Current Iteration Findings (new)
| # | finding_id | family_tag | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|-------|----------------|
| 1 | FE-NEW-src-file-L42 | component-design | `src/file.tsx:42` | Issue description | Fix approach |
## Carry-over Findings (persists)
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | FE-PERSIST-src-file-L77 | component-design | `src/file.tsx:77` | `src/file.tsx:77` | Still unresolved | Apply prior fix plan |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| FE-RESOLVED-src-file-L10 | `src/file.tsx:10` now satisfies the rule |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | FE-REOPENED-src-file-L55 | component-design | `Previously fixed at src/file.tsx:10` | `Recurred at src/file.tsx:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```
**Cognitive load reduction rules:**
- APPROVE → Summary only (5 lines or fewer)
- REJECT → Include only relevant finding rows (30 lines or fewer)

View File

@ -16,21 +16,26 @@
| Maintainability | ✅ | - |
## Current Iteration Findings (new)
| # | finding_id | Category | Location | Issue | Fix Suggestion |
|---|------------|----------|----------|-------|----------------|
| 1 | QA-NEW-src-test-L42 | Testing | `src/test.ts:42` | Missing negative test | Add failure-path test |
| # | finding_id | family_tag | Category | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|----------|-------|----------------|
| 1 | QA-NEW-src-test-L42 | test-coverage | Testing | `src/test.ts:42` | Missing negative test | Add failure-path test |
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | QA-PERSIST-src-test-L77 | `src/test.ts:77` | `src/test.ts:77` | Still flaky | Stabilize assertion & setup |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | QA-PERSIST-src-test-L77 | test-coverage | `src/test.ts:77` | `src/test.ts:77` | Still flaky | Stabilize assertion & setup |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| QA-RESOLVED-src-test-L10 | `src/test.ts:10` now covers error path |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | QA-REOPENED-src-test-L55 | test-coverage | `Previously fixed at src/test.ts:10` | `Recurred at src/test.ts:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -20,22 +20,27 @@
| 1 | {change not in requirements} | `src/file.ts` | Justified/Unnecessary |
## Current Iteration Findings (new)
| # | finding_id | Category | Location | Issue | Fix Suggestion |
|---|------------|----------|----------|-------|----------------|
| 1 | REQ-NEW-src-file-L42 | Unimplemented | `src/file.ts:42` | Issue description | Fix suggestion |
| # | finding_id | family_tag | Category | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|----------|-------|----------------|
| 1 | REQ-NEW-src-file-L42 | req-gap | Unimplemented | `src/file.ts:42` | Issue description | Fix suggestion |
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | REQ-PERSIST-src-file-L77 | `file:line` | `file:line` | Unresolved | Fix suggestion |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | REQ-PERSIST-src-file-L77 | req-gap | `file:line` | `file:line` | Unresolved | Fix suggestion |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| REQ-RESOLVED-src-file-L10 | `file:line` now satisfies the requirement |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | REQ-REOPENED-src-file-L55 | req-gap | `Previously fixed at file:line` | `Recurred at file:line` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -14,25 +14,30 @@
| Dependencies | ✅ | - |
## Current Iteration Findings (new)
| # | finding_id | Severity | Type | Location | Issue | Fix Suggestion |
|---|------------|----------|------|----------|-------|----------------|
| 1 | SEC-NEW-src-db-L42 | High | SQLi | `src/db.ts:42` | Raw query string | Use parameterized queries |
| # | finding_id | family_tag | Severity | Type | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|------|----------|-------|----------------|
| 1 | SEC-NEW-src-db-L42 | injection-risk | High | SQLi | `src/db.ts:42` | Raw query string | Use parameterized queries |
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | SEC-PERSIST-src-auth-L18 | `src/auth.ts:18` | `src/auth.ts:18` | Weak validation persists | Harden validation |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | SEC-PERSIST-src-auth-L18 | injection-risk | `src/auth.ts:18` | `src/auth.ts:18` | Weak validation persists | Harden validation |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| SEC-RESOLVED-src-db-L10 | `src/db.ts:10` now uses bound parameters |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | SEC-REOPENED-src-auth-L55 | injection-risk | `Previously fixed at src/auth.ts:20` | `Recurred at src/auth.ts:55` | Issue description | Fix approach |
## Warnings (non-blocking)
- {Security recommendations}
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -4,39 +4,44 @@
## Result: APPROVE / REJECT
## Summary
{1-2 sentences summarizing the result}
{Summarize the result in 1-2 sentences}
## Reviewed Aspects
- [x] Variable declarations (type, description, sensitive)
- [x] Resource naming (name_prefix pattern)
- [x] File organization (one file per concern)
- [x] Security configurations
- [x] File structure (one concern per file)
- [x] Security settings
- [x] Tag management
- [x] Lifecycle rules
- [x] lifecycle rules
- [x] Cost trade-off documentation
## New Findings (new)
| # | finding_id | Scope | Location | Issue | Fix Suggestion |
|---|------------|-------|----------|-------|---------------|
| 1 | TF-NEW-file-L42 | In scope | `modules/example/main.tf:42` | Issue description | How to fix |
## Current Iteration Findings (new)
| # | finding_id | family_tag | Scope | Location | Issue | Fix Suggestion |
|---|------------|------------|-------|----------|-------|----------------|
| 1 | TF-NEW-file-L42 | tf-convention | In-scope | `modules/example/main.tf:42` | Issue description | Fix approach |
Scope: "In scope" (fixable now) / "Out of scope" (existing issue, non-blocking)
Scope: "In-scope" (fixable in this change) / "Out-of-scope" (existing issue, non-blocking)
## Persisting Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|---------------|
| 1 | TF-PERSIST-file-L77 | `file.tf:77` | `file.tf:77` | Unresolved | Apply existing fix plan |
## Carry-over Findings (persists)
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | TF-PERSIST-file-L77 | tf-convention | `file.tf:77` | `file.tf:77` | Still unresolved | Apply prior fix plan |
## Resolved
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|-------------------|
| TF-RESOLVED-file-L10 | `file.tf:10` meets conventions |
|------------|---------------------|
| TF-RESOLVED-file-L10 | `file.tf:10` now satisfies the convention |
## REJECT Criteria
- REJECT only if 1+ `new` or `persists` findings exist
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | TF-REOPENED-file-L55 | tf-convention | `Previously fixed at file.tf:10` | `Recurred at file.tf:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```
**Cognitive load reduction rules:**
- APPROVE → Summary only (5 lines or less)
- REJECT → Only relevant findings in table (30 lines or less)
- APPROVE → Summary only (5 lines or fewer)
- REJECT → Include only relevant finding rows (30 lines or fewer)

View File

@ -17,22 +17,27 @@
| Test strategy (unit/integration/E2E) | ✅ | - |
## Current Iteration Findings (new)
| # | finding_id | Category | Location | Issue | Fix Suggestion |
|---|------------|----------|----------|-------|----------------|
| 1 | TEST-NEW-src-test-L42 | Coverage | `src/test.ts:42` | Issue description | Fix suggestion |
| # | finding_id | family_tag | Category | Location | Issue | Fix Suggestion |
|---|------------|------------|----------|----------|-------|----------------|
| 1 | TEST-NEW-src-test-L42 | test-structure | Coverage | `src/test.ts:42` | Issue description | Fix suggestion |
## Carry-over Findings (persists)
| # | finding_id | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|-------------------|------------------|-------|----------------|
| 1 | TEST-PERSIST-src-test-L77 | `src/test.ts:77` | `src/test.ts:77` | Unresolved | Fix suggestion |
| # | finding_id | family_tag | Previous Evidence | Current Evidence | Issue | Fix Suggestion |
|---|------------|------------|-------------------|------------------|-------|----------------|
| 1 | TEST-PERSIST-src-test-L77 | test-structure | `src/test.ts:77` | `src/test.ts:77` | Unresolved | Fix suggestion |
## Resolved Findings (resolved)
| finding_id | Resolution Evidence |
|------------|---------------------|
| TEST-RESOLVED-src-test-L10 | `src/test.ts:10` now has sufficient coverage |
## Reopened Findings (reopened)
| # | finding_id | family_tag | Prior Resolution Evidence | Recurrence Evidence | Issue | Fix Suggestion |
|---|------------|------------|--------------------------|---------------------|-------|----------------|
| 1 | TEST-REOPENED-src-test-L55 | test-structure | `Previously fixed at src/test.ts:10` | `Recurred at src/test.ts:55` | Issue description | Fix approach |
## Rejection Gate
- REJECT is valid only when at least one finding exists in `new` or `persists`
- REJECT is valid only when at least one finding exists in `new`, `persists`, or `reopened`
- Findings without `finding_id` are invalid
```

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: fix_both
- condition: unproductive (same findings repeating)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: reviewers
- condition: unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: fix_both
- condition: unproductive (same findings repeating)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: reviewers
- condition: unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: Unproductive (no improvement)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: reviewers
- condition: unproductive (same findings repeating)
next: ABORT
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: fix_both
- condition: unproductive (same findings repeating)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -21,6 +21,18 @@ loop_monitors:
next: ai_review
- condition: Unproductive (same findings repeated or fixes not reflected)
next: ai_no_fix
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (findings decreasing, fixes applied)
next: reviewers
- condition: Unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: fix_both
- condition: unproductive (same findings repeating)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -21,6 +21,18 @@ loop_monitors:
next: ai_review
- condition: Unproductive (same findings repeated or fixes not reflected)
next: ai_no_fix
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: reviewers
- condition: unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: fix_both
- condition: unproductive (same findings repeating)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: converging (findings decreasing, fixes applied)
next: reviewers
- condition: unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (progress being made)
next: reviewers

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: Unproductive (no improvement)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (findings decreasing, fixes applied)
next: reviewers
- condition: Unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: Unproductive (no improvement)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: Healthy (findings decreasing, fixes applied)
next: reviewers
- condition: Unproductive (same findings repeating)
next: supervise
movements:
- name: plan
edit: false

View File

@ -1,10 +1,16 @@
レビュアーのフィードバックに対応してください。
Piece Contextに示されたReport Directory内のレポートを確認し、レビュアーの指摘事項を修正してください。
必要な根拠はReport Directory内のファイルを一次情報として取得してください。不足情報の補完が必要な場合に限り、Previous Responseや会話履歴を補助的に参照して構いませんPrevious Responseは提供されない場合があります。情報が競合する場合は、Report Directory内のレポートと実際のファイル内容を優先してください。
Report Directory内のレビューレポートを確認し、指摘事項を修正してください。
**重要**: 修正後、ビルドとテストの両方を実行してください。
- ビルド確認は必須。ビルド(型チェック)を実行し、型エラーがないことを確認
- テスト実行は必須。ビルド成功後、必ずテストを実行して結果を確認
**レポート参照方針:**
- Report Directory内の最新レビューレポートを一次情報として参照してください。
- 過去イテレーションのレポートは `{ファイル名}.{タイムスタンプ}` 形式で同ディレクトリに保存されています(例: `architect-review.md.20260304T123456Z`)。各レポートについて `{レポート名}.*` パターンで Glob を実行し、タイムスタンプ降順で最大2件まで読み、persists / reopened の傾向を把握してから修正に入ること。
**完了条件(以下をすべて満たすこと):**
- 今回受け取った全指摘new / reopenedを修正したこと
- 同一 `family_tag` の潜在箇所を同時に修正したこと(部分修正で再発させない)
- `family_tag` ごとに最低1件の再発防止テストを追加したことconfig契約/境界チェック系は必須)
- 複数レビュアーから同一 `family_tag` の指摘が届いている場合は1件に統合して対応したこと
**重要**: 修正後、ビルド(型チェック)とテストを必ず実行してください。
**必須出力(見出しを含める)**
## 作業結果
@ -15,5 +21,11 @@ Piece Contextに示されたReport Directory内のレポートを確認し、レ
- {ビルド実行結果}
## テスト結果
- {テスト実行コマンドと結果}
## 収束ゲート
| 指標 | 件数 |
|------|------|
| new今回修正 | {N} |
| reopened再発修正 | {N} |
| persists前回から継続、今回未着手 | {N} |
## 証拠
- {確認したファイル/検索/差分/ログの要点を列挙}

View File

@ -0,0 +1,9 @@
reviewers → fix のループが {cycle_count} 回繰り返されました。
Report Directory 内の最新レビューレポートを確認し、
このループが健全(収束傾向)か非生産的(発散・振動)かを判断してください。
**判断基準:**
- 各サイクルで new / reopened の指摘件数が減少しているか
- 同じ family_tag の指摘が繰り返されていないかpersists が増えていないか)
- 修正が実際にコードに反映されているか

View File

@ -15,22 +15,27 @@
| スコープ | ✅ | - |
## 今回の指摘new
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | AI-NEW-src-file-L23 | 幻覚API | `src/file.ts:23` | 存在しないメソッド | 実在APIへ置換 |
| # | finding_id | family_tag | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | AI-NEW-src-file-L23 | hallucination | 幻覚API | `src/file.ts:23` | 存在しないメソッド | 実在APIへ置換 |
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | AI-PERSIST-src-file-L42 | `src/file.ts:42` | `src/file.ts:42` | 未解消 | 既存修正方針を適用 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | AI-PERSIST-src-file-L42 | hallucination | `src/file.ts:42` | `src/file.ts:42` | 未解消 | 既存修正方針を適用 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| AI-RESOLVED-src-file-L10 | `src/file.ts:10` に該当問題なし |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | AI-REOPENED-src-file-L55 | hallucination | `前回: src/file.ts:10 で修正済み` | `src/file.ts:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -15,24 +15,29 @@
- [x] 呼び出しチェーン検証
## 今回の指摘new
| # | finding_id | スコープ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | ARCH-NEW-src-file-L42 | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
| # | finding_id | family_tag | スコープ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | ARCH-NEW-src-file-L42 | design-violation | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
スコープ: 「スコープ内」(今回修正可能)/ 「スコープ外」(既存問題・非ブロッキング)
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | ARCH-PERSIST-src-file-L77 | `src/file.ts:77` | `src/file.ts:77` | 未解消 | 既存修正方針を適用 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | ARCH-PERSIST-src-file-L77 | design-violation | `src/file.ts:77` | `src/file.ts:77` | 未解消 | 既存修正方針を適用 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| ARCH-RESOLVED-src-file-L10 | `src/file.ts:10` は規約を満たす |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | ARCH-REOPENED-src-file-L55 | design-violation | `前回: src/file.ts:10 で修正済み` | `src/file.ts:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -15,13 +15,33 @@
| プロジェクション | ✅ | - |
| 結果整合性 | ✅ | - |
## 問題点REJECTの場合
| # | スコープ | 場所 | 問題 | 修正案 |
|---|---------|------|------|--------|
| 1 | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 今回の指摘new
| # | finding_id | family_tag | スコープ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | CQRS-NEW-src-file-L42 | cqrs-violation | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
スコープ: 「スコープ内」(今回修正可能)/ 「スコープ外」(既存問題・非ブロッキング)
## 既存問題(参考・非ブロッキング)
- {既存問題の記録。今回の変更と無関係な問題}
## 継続指摘persists
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | CQRS-PERSIST-src-file-L77 | cqrs-violation | `src/file.ts:77` | `src/file.ts:77` | 未解消 | 既存修正方針を適用 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| CQRS-RESOLVED-src-file-L10 | `src/file.ts:10` は規約を満たす |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | CQRS-REOPENED-src-file-L55 | cqrs-violation | `前回: src/file.ts:10 で修正済み` | `src/file.ts:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```
**認知負荷軽減ルール:**
- APPROVE → サマリーのみ5行以内
- REJECT → 該当指摘のみ表で記載30行以内

View File

@ -15,8 +15,31 @@
| アクセシビリティ | ✅ | - |
| 型安全性 | ✅ | - |
## 問題点REJECTの場合
| # | 場所 | 問題 | 修正案 |
|---|------|------|--------|
| 1 | `src/file.tsx:42` | 問題の説明 | 修正方法 |
## 今回の指摘new
| # | finding_id | family_tag | 場所 | 問題 | 修正案 |
|---|------------|------------|------|------|--------|
| 1 | FE-NEW-src-file-L42 | component-design | `src/file.tsx:42` | 問題の説明 | 修正方法 |
## 継続指摘persists
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | FE-PERSIST-src-file-L77 | component-design | `src/file.tsx:77` | `src/file.tsx:77` | 未解消 | 既存修正方針を適用 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| FE-RESOLVED-src-file-L10 | `src/file.tsx:10` は規約を満たす |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | FE-REOPENED-src-file-L55 | component-design | `前回: src/file.tsx:10 で修正済み` | `src/file.tsx:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```
**認知負荷軽減ルール:**
- APPROVE → サマリーのみ5行以内
- REJECT → 該当指摘のみ表で記載30行以内

View File

@ -16,21 +16,26 @@
| 保守性 | ✅ | - |
## 今回の指摘new
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | QA-NEW-src-test-L42 | テスト | `src/test.ts:42` | 異常系テスト不足 | 失敗系ケースを追加 |
| # | finding_id | family_tag | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | QA-NEW-src-test-L42 | test-coverage | テスト | `src/test.ts:42` | 異常系テスト不足 | 失敗系ケースを追加 |
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | QA-PERSIST-src-test-L77 | `src/test.ts:77` | `src/test.ts:77` | 不安定なまま | アサーションとセットアップを安定化 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | QA-PERSIST-src-test-L77 | test-coverage | `src/test.ts:77` | `src/test.ts:77` | 不安定なまま | アサーションとセットアップを安定化 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| QA-RESOLVED-src-test-L10 | `src/test.ts:10` で異常系が網羅済み |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | QA-REOPENED-src-test-L55 | test-coverage | `前回: src/test.ts:10 で修正済み` | `src/test.ts:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -20,22 +20,27 @@
| 1 | {要求にない変更} | `src/file.ts` | 妥当/不要 |
## 今回の指摘new
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | REQ-NEW-src-file-L42 | 未実装 | `src/file.ts:42` | 問題の説明 | 修正方法 |
| # | finding_id | family_tag | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | REQ-NEW-src-file-L42 | req-gap | 未実装 | `src/file.ts:42` | 問題の説明 | 修正方法 |
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | REQ-PERSIST-src-file-L77 | `file:line` | `file:line` | 未解消 | 修正方法 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | REQ-PERSIST-src-file-L77 | req-gap | `file:line` | `file:line` | 未解消 | 修正方法 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| REQ-RESOLVED-src-file-L10 | `file:line` は要件を充足 |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | REQ-REOPENED-src-file-L55 | req-gap | `前回: file:line で修正済み` | `file:line で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -14,25 +14,30 @@
| 依存関係 | ✅ | - |
## 今回の指摘new
| # | finding_id | 重大度 | 種類 | 場所 | 問題 | 修正案 |
|---|------------|--------|------|------|------|--------|
| 1 | SEC-NEW-src-db-L42 | High | SQLi | `src/db.ts:42` | 生SQL文字列 | パラメータ化クエリを使用 |
| # | finding_id | family_tag | 重大度 | 種類 | 場所 | 問題 | 修正案 |
|---|------------|------------|--------|------|------|------|--------|
| 1 | SEC-NEW-src-db-L42 | injection-risk | High | SQLi | `src/db.ts:42` | 生SQL文字列 | パラメータ化クエリを使用 |
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | SEC-PERSIST-src-auth-L18 | `src/auth.ts:18` | `src/auth.ts:18` | 未解消 | バリデーションを強化 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | SEC-PERSIST-src-auth-L18 | injection-risk | `src/auth.ts:18` | `src/auth.ts:18` | 未解消 | バリデーションを強化 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| SEC-RESOLVED-src-db-L10 | `src/db.ts:10` はバインド変数化済み |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | SEC-REOPENED-src-auth-L55 | injection-risk | `前回: src/auth.ts:20 で修正済み` | `src/auth.ts:55 で再発` | 問題の説明 | 修正方法 |
## 警告(非ブロッキング)
- {セキュリティに関する推奨事項}
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -16,24 +16,29 @@
- [x] コストトレードオフ文書化
## 今回の指摘new
| # | finding_id | スコープ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | TF-NEW-file-L42 | スコープ内 | `modules/example/main.tf:42` | 問題の説明 | 修正方法 |
| # | finding_id | family_tag | スコープ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | TF-NEW-file-L42 | tf-convention | スコープ内 | `modules/example/main.tf:42` | 問題の説明 | 修正方法 |
スコープ: 「スコープ内」(今回修正可能)/ 「スコープ外」(既存問題・非ブロッキング)
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | TF-PERSIST-file-L77 | `file.tf:77` | `file.tf:77` | 未解消 | 既存修正方針を適用 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | TF-PERSIST-file-L77 | tf-convention | `file.tf:77` | `file.tf:77` | 未解消 | 既存修正方針を適用 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| TF-RESOLVED-file-L10 | `file.tf:10` は規約を満たす |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | TF-REOPENED-file-L55 | tf-convention | `前回: file.tf:10 で修正済み` | `file.tf:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -17,22 +17,27 @@
| テスト戦略(ユニット/統合/E2E | ✅ | - |
## 今回の指摘new
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|---------|------|------|--------|
| 1 | TEST-NEW-src-test-L42 | カバレッジ | `src/test.ts:42` | 問題の説明 | 修正方法 |
| # | finding_id | family_tag | カテゴリ | 場所 | 問題 | 修正案 |
|---|------------|------------|---------|------|------|--------|
| 1 | TEST-NEW-src-test-L42 | test-structure | カバレッジ | `src/test.ts:42` | 問題の説明 | 修正方法 |
## 継続指摘persists
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|----------|----------|------|--------|
| 1 | TEST-PERSIST-src-test-L77 | `src/test.ts:77` | `src/test.ts:77` | 未解消 | 修正方法 |
| # | finding_id | family_tag | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|---|------------|------------|----------|----------|------|--------|
| 1 | TEST-PERSIST-src-test-L77 | test-structure | `src/test.ts:77` | `src/test.ts:77` | 未解消 | 修正方法 |
## 解消済みresolved
| finding_id | 解消根拠 |
|------------|----------|
| TEST-RESOLVED-src-test-L10 | `src/test.ts:10` でカバレッジ充足 |
## 再開指摘reopened
| # | finding_id | family_tag | 解消根拠(前回) | 再発根拠 | 問題 | 修正案 |
|---|------------|------------|----------------|---------|------|--------|
| 1 | TEST-REOPENED-src-test-L55 | test-structure | `前回: src/test.ts:10 で修正済み` | `src/test.ts:55 で再発` | 問題の説明 | 修正方法 |
## REJECT判定条件
- `new` または `persists` が1件以上ある場合のみ REJECT 可
- `new``persists`、または `reopened` が1件以上ある場合のみ REJECT 可
- `finding_id` なしの指摘は無効
```

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: fix_both
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: fix_both
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: 非生産的(改善なし)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: ABORT
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: fix_both
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -21,6 +21,18 @@ loop_monitors:
next: ai_review
- condition: 非生産的(同じ指摘の反復・修正未反映)
next: ai_no_fix
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: fix_both
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -21,6 +21,18 @@ loop_monitors:
next: ai_review
- condition: 非生産的(同じ指摘の反復・修正未反映)
next: ai_no_fix
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 20
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix_both
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: fix_both
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise_fix
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -8,6 +8,19 @@ piece_config:
network_access: true
max_movements: 30
initial_movement: plan
loop_monitors:
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -15,7 +15,7 @@ loop_monitors:
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-ai-fix
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(進捗あり)
next: reviewers

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: 非生産的(改善なし)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -33,6 +33,18 @@ loop_monitors:
next: ai_review
- condition: 非生産的(改善なし)
next: reviewers
- cycle:
- reviewers
- fix
threshold: 3
judge:
persona: supervisor
instruction_template: loop-monitor-reviewers-fix
rules:
- condition: 健全(指摘数が減少、修正が反映されている)
next: reviewers
- condition: 非生産的(同じ指摘が繰り返される)
next: supervise
movements:
- name: plan
edit: false

View File

@ -66,7 +66,7 @@ describe('runReportPhase report history behavior', () => {
}
});
it('should overwrite report file and archive previous content to reports-history', async () => {
it('should overwrite report file and save versioned copy in the same report directory', async () => {
// Given
const reportDir = join(tmpRoot, '.takt', 'runs', 'sample-run', 'reports');
const step = createStep('05-architect-review.md');
@ -97,12 +97,11 @@ describe('runReportPhase report history behavior', () => {
const latestContent = readFileSync(latestPath, 'utf-8');
expect(latestContent).toBe('Second review result');
const historyDir = join(tmpRoot, '.takt', 'runs', 'sample-run', 'logs', 'reports-history');
const historyFiles = readdirSync(historyDir);
expect(historyFiles).toHaveLength(1);
expect(historyFiles[0]).toMatch(/^05-architect-review\.\d{8}T\d{6}Z\.md$/);
const versionedFiles = readdirSync(reportDir).filter(f => f !== '05-architect-review.md');
expect(versionedFiles).toHaveLength(1);
expect(versionedFiles[0]).toMatch(/^05-architect-review\.md\.\d{8}T\d{6}Z$/);
const archivedContent = readFileSync(join(historyDir, historyFiles[0]!), 'utf-8');
const archivedContent = readFileSync(join(reportDir, versionedFiles[0]!), 'utf-8');
expect(archivedContent).toBe('First review result');
});
@ -144,11 +143,10 @@ describe('runReportPhase report history behavior', () => {
await runReportPhase(step, 3, ctx);
// Then
const historyDir = join(tmpRoot, '.takt', 'runs', 'sample-run', 'logs', 'reports-history');
const historyFiles = readdirSync(historyDir).sort();
expect(historyFiles).toEqual([
'06-qa-review.20260210T061143Z.1.md',
'06-qa-review.20260210T061143Z.md',
const versionedFiles = readdirSync(reportDir).filter(f => f !== '06-qa-review.md').sort();
expect(versionedFiles).toEqual([
'06-qa-review.md.20260210T061143Z',
'06-qa-review.md.20260210T061143Z.1',
]);
});

View File

@ -6,7 +6,7 @@
*/
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { dirname, parse, resolve, sep } from 'node:path';
import { dirname, resolve, sep } from 'node:path';
import type { PieceMovement, Language, AgentResponse } from '../models/types.js';
import type { PhaseName } from './types.js';
import type { RunAgentOptions } from '../../agents/runner.js';
@ -67,10 +67,9 @@ function formatHistoryTimestamp(date: Date): string {
return `${year}${month}${day}T${hour}${minute}${second}Z`;
}
function buildHistoryFileName(fileName: string, timestamp: string, sequence: number): string {
const parsed = parse(fileName);
function buildVersionedFileName(fileName: string, timestamp: string, sequence: number): string {
const duplicateSuffix = sequence === 0 ? '' : `.${sequence}`;
return `${parsed.name}.${timestamp}${duplicateSuffix}${parsed.ext}`;
return `${fileName}.${timestamp}${duplicateSuffix}`;
}
function backupExistingReport(reportDir: string, fileName: string, targetPath: string): void {
@ -79,18 +78,15 @@ function backupExistingReport(reportDir: string, fileName: string, targetPath: s
}
const currentContent = readFileSync(targetPath, 'utf-8');
const historyDir = resolve(reportDir, '..', 'logs', 'reports-history');
mkdirSync(historyDir, { recursive: true });
const timestamp = formatHistoryTimestamp(new Date());
let sequence = 0;
let historyPath = resolve(historyDir, buildHistoryFileName(fileName, timestamp, sequence));
while (existsSync(historyPath)) {
let versionedPath = resolve(reportDir, buildVersionedFileName(fileName, timestamp, sequence));
while (existsSync(versionedPath)) {
sequence += 1;
historyPath = resolve(historyDir, buildHistoryFileName(fileName, timestamp, sequence));
versionedPath = resolve(reportDir, buildVersionedFileName(fileName, timestamp, sequence));
}
writeFileSync(historyPath, currentContent);
writeFileSync(versionedPath, currentContent);
}
function writeReportFile(reportDir: string, fileName: string, content: string): void {