refactor(output-contracts): unify OutputContractEntry to item format with use_judge and move runtime dir under .takt
- Remove OutputContractLabelPath (label:path format), unify to OutputContractItem only - Add required format field and use_judge flag to output contracts - Add getJudgmentReportFiles() to filter reports eligible for Phase 3 status judgment - Add supervisor-validation output contract, remove review-summary - Enhance output contracts with finding_id tracking (new/persists/resolved sections) - Move runtime environment directory from .runtime to .takt/.runtime - Update all builtin pieces, e2e fixtures, and tests
This commit is contained in:
parent
def5f27309
commit
2460dbdf61
@ -14,12 +14,26 @@
|
||||
| Context fit | ✅ | - |
|
||||
| Scope | ✅ | - |
|
||||
|
||||
## Issues (if REJECT)
|
||||
| # | Category | Location | Issue |
|
||||
|---|----------|----------|-------|
|
||||
| 1 | Hallucinated API | `src/file.ts:23` | Non-existent method |
|
||||
## 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 |
|
||||
|
||||
## 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 |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| AI-RESOLVED-src-file-L10 | `src/file.ts:10` no longer contains the issue |
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
|
||||
**Cognitive load reduction rules:**
|
||||
- No issues → Summary sentence + checklist only (10 lines or fewer)
|
||||
- Issues found → + Issues in table format (25 lines or fewer)
|
||||
- No issues → Summary sentence + checklist + empty finding sections (10 lines or fewer)
|
||||
- Issues found → include table rows only for impacted sections (30 lines or fewer)
|
||||
|
||||
@ -14,22 +14,28 @@
|
||||
- [x] Dead code
|
||||
- [x] Call chain verification
|
||||
|
||||
## Previous Open Findings
|
||||
| finding_id | Previous Status | Current Status (new/persists/resolved) | Evidence |
|
||||
|------------|-----------------|-----------------------------------------|----------|
|
||||
| ARCH-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |
|
||||
|
||||
## Issues (if REJECT)
|
||||
| # | finding_id | Status (new/persists) | Scope | Location | Issue | Fix Suggestion |
|
||||
|---|------------|-----------------------|-------|----------|-------|----------------|
|
||||
| 1 | ARCH-EXAMPLE-src-file-L42 | new | In-scope | `src/file.ts:42` | Issue description | Fix approach |
|
||||
## 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 |
|
||||
|
||||
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 | 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 |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| ARCH-RESOLVED-src-file-L10 | `src/file.ts:10` now satisfies the rule |
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
|
||||
**Cognitive load reduction rules:**
|
||||
- APPROVE → Summary only (5 lines or fewer)
|
||||
- REJECT → Issues in table format (30 lines or fewer)
|
||||
- REJECT → Include only relevant finding rows (30 lines or fewer)
|
||||
|
||||
@ -15,13 +15,22 @@
|
||||
| Documentation | ✅ | - |
|
||||
| Maintainability | ✅ | - |
|
||||
|
||||
## Previous Open Findings
|
||||
| finding_id | Previous Status | Current Status (new/persists/resolved) | Evidence |
|
||||
|------------|-----------------|-----------------------------------------|----------|
|
||||
| QA-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |
|
||||
## 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 |
|
||||
|
||||
## Issues (if REJECT)
|
||||
| # | finding_id | Status (new/persists) | Category | Issue | Fix Suggestion |
|
||||
|---|------------|-----------------------|----------|-------|----------------|
|
||||
| 1 | QA-EXAMPLE-src-file-L42 | new | Testing | Issue description | Fix approach |
|
||||
## 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 |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| QA-RESOLVED-src-test-L10 | `src/test.ts:10` now covers error path |
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
```markdown
|
||||
# Review Summary
|
||||
|
||||
## Overall Verdict: APPROVE / REJECT
|
||||
|
||||
## Summary
|
||||
{Integrate all review results in 2-3 sentences}
|
||||
|
||||
## Review Results
|
||||
| Review | Result | Key Findings |
|
||||
|--------|--------|-------------|
|
||||
| Architecture | APPROVE/REJECT | {Overview} |
|
||||
| Security | APPROVE/REJECT | {Overview} |
|
||||
| AI Anti-pattern | APPROVE/REJECT | {Overview} |
|
||||
|
||||
## Critical Issues
|
||||
| # | Severity | Source | Location | Issue |
|
||||
|---|----------|--------|----------|-------|
|
||||
| 1 | High | Security | `file:line` | Description |
|
||||
|
||||
## Improvement Suggestions
|
||||
- {Consolidated suggestions from all reviews}
|
||||
```
|
||||
@ -13,16 +13,30 @@
|
||||
| Data Protection | ✅ | - |
|
||||
| Dependencies | ✅ | - |
|
||||
|
||||
## Vulnerabilities (if REJECT)
|
||||
| # | Severity | Type | Location | Fix Suggestion |
|
||||
|---|----------|------|----------|----------------|
|
||||
| 1 | High | SQLi | `src/db.ts:42` | Use parameterized queries |
|
||||
## 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 |
|
||||
|
||||
## 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 |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| SEC-RESOLVED-src-db-L10 | `src/db.ts:10` now uses bound parameters |
|
||||
|
||||
## Warnings (non-blocking)
|
||||
- {Security recommendations}
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
|
||||
**Cognitive load reduction rules:**
|
||||
- No issues → Checklist only (10 lines or fewer)
|
||||
- Warnings present → + Warnings in 1-2 lines (15 lines or fewer)
|
||||
- Vulnerabilities found → + Table format (30 lines or fewer)
|
||||
- Warnings only → + Warnings in 1-2 lines (15 lines or fewer)
|
||||
- Vulnerabilities found → + finding tables (30 lines or fewer)
|
||||
|
||||
36
builtins/en/output-contracts/supervisor-validation.md
Normal file
36
builtins/en/output-contracts/supervisor-validation.md
Normal file
@ -0,0 +1,36 @@
|
||||
```markdown
|
||||
# Final Validation Results
|
||||
|
||||
## Result: APPROVE / REJECT
|
||||
|
||||
## Validation Summary
|
||||
| Item | Status | Verification Method |
|
||||
|------|--------|-------------------|
|
||||
| Requirements met | ✅ | Checked against requirements list |
|
||||
| Tests | ✅ | `npm test` (N passed) |
|
||||
| Build | ✅ | `npm run build` succeeded |
|
||||
| Functional check | ✅ | Main flow verified |
|
||||
|
||||
## Current Iteration Findings (new)
|
||||
| # | finding_id | Item | Evidence | Reason | Required Action |
|
||||
|---|------------|------|----------|--------|-----------------|
|
||||
| 1 | VAL-NEW-src-file-L42 | Requirement mismatch | `file:line` | Description | Fix required |
|
||||
|
||||
## Carry-over Findings (persists)
|
||||
| # | finding_id | Previous Evidence | Current Evidence | Reason | Required Action |
|
||||
|---|------------|-------------------|------------------|--------|-----------------|
|
||||
| 1 | VAL-PERSIST-src-file-L77 | `file:line` | `file:line` | Still unresolved | Apply fix |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| VAL-RESOLVED-src-file-L10 | `file:line` now passes validation |
|
||||
|
||||
## Deliverables
|
||||
- Created: {Created files}
|
||||
- Modified: {Modified files}
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
@ -11,12 +11,26 @@
|
||||
| Build | ✅ | `npm run build` succeeded |
|
||||
| Functional check | ✅ | Main flow verified |
|
||||
|
||||
## Current Iteration Findings (new)
|
||||
| # | finding_id | Item | Evidence | Reason | Required Action |
|
||||
|---|------------|------|----------|--------|-----------------|
|
||||
| 1 | VAL-NEW-src-file-L42 | Requirement mismatch | `file:line` | Description | Fix required |
|
||||
|
||||
## Carry-over Findings (persists)
|
||||
| # | finding_id | Previous Evidence | Current Evidence | Reason | Required Action |
|
||||
|---|------------|-------------------|------------------|--------|-----------------|
|
||||
| 1 | VAL-PERSIST-src-file-L77 | `file:line` | `file:line` | Still unresolved | Apply fix |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Resolution Evidence |
|
||||
|------------|---------------------|
|
||||
| VAL-RESOLVED-src-file-L10 | `file:line` now passes validation |
|
||||
|
||||
## Deliverables
|
||||
- Created: {Created files}
|
||||
- Modified: {Modified files}
|
||||
|
||||
## Incomplete Items (if REJECT)
|
||||
| # | Item | Reason |
|
||||
|---|------|--------|
|
||||
| 1 | {Item} | {Reason} |
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -65,8 +64,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -111,6 +112,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues have been fixed
|
||||
next: ai_review
|
||||
@ -220,6 +222,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
@ -237,6 +240,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All validations pass and ready to merge
|
||||
next: COMPLETE
|
||||
@ -244,8 +248,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -267,6 +274,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues have been fixed
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -64,8 +63,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -109,6 +110,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues have been fixed
|
||||
next: ai_review
|
||||
@ -217,6 +219,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
@ -234,6 +237,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All validations pass and ready to merge
|
||||
next: COMPLETE
|
||||
@ -241,8 +245,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -263,6 +270,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues have been fixed
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -33,7 +32,6 @@ movements:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -66,9 +64,10 @@ movements:
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -115,7 +114,6 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: any("AI-specific issues found", "needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -133,6 +131,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: evaluate
|
||||
movements:
|
||||
@ -30,7 +29,27 @@ movements:
|
||||
- condition: failed
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-claude.md
|
||||
- name: claude-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# Claude Review Result
|
||||
|
||||
## Conclusion
|
||||
{One-line conclusion}
|
||||
|
||||
## Key Findings
|
||||
- {finding 1}
|
||||
- {finding 2}
|
||||
|
||||
## Evidence
|
||||
- {file:line and rationale}
|
||||
|
||||
## Risks / Caveats
|
||||
- {risk}
|
||||
|
||||
## Recommended Next Step
|
||||
- {action}
|
||||
```
|
||||
- name: codex-eye
|
||||
edit: false
|
||||
persona: coder
|
||||
@ -49,11 +68,30 @@ movements:
|
||||
- condition: failed
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 02-codex.md
|
||||
- name: codex-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# Codex Review Result
|
||||
|
||||
## Conclusion
|
||||
{One-line conclusion}
|
||||
|
||||
## Key Findings
|
||||
- {finding 1}
|
||||
- {finding 2}
|
||||
|
||||
## Evidence
|
||||
- {file:line and rationale}
|
||||
|
||||
## Risks / Caveats
|
||||
- {risk}
|
||||
|
||||
## Recommended Next Step
|
||||
- {action}
|
||||
```
|
||||
rules:
|
||||
- condition: any("done")
|
||||
next: synthesize
|
||||
|
||||
- name: synthesize
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -70,8 +108,8 @@ movements:
|
||||
|
||||
**Tasks:**
|
||||
1. Read reports in the Report Directory
|
||||
- `01-claude.md` (Claude's response)
|
||||
- `02-codex.md` (Codex's response)
|
||||
- `claude-review.md` (Claude's response)
|
||||
- `codex-review.md` (Codex's response)
|
||||
Note: If one report is missing (model failed), synthesize from the available report only
|
||||
2. If both reports exist, compare and clarify:
|
||||
- Points of agreement
|
||||
@ -109,4 +147,32 @@ movements:
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: 03-synthesis.md
|
||||
- name: synthesis.md
|
||||
format: |
|
||||
```markdown
|
||||
# Multi-Model Review Synthesis
|
||||
|
||||
## Conclusion
|
||||
{Synthesized conclusion}
|
||||
|
||||
## Response Status
|
||||
| Model | Status |
|
||||
|-------|--------|
|
||||
| Claude | ✅ / ❌ |
|
||||
| Codex | ✅ / ❌ |
|
||||
|
||||
## Agreements
|
||||
- {Points where both models agree}
|
||||
|
||||
## Disagreements
|
||||
| Topic | Claude | Codex |
|
||||
|-------|--------|-------|
|
||||
| {topic} | {Claude's view} | {Codex's view} |
|
||||
|
||||
## Unique Findings
|
||||
- **Claude only:** {Points only Claude mentioned}
|
||||
- **Codex only:** {Points only Codex mentioned}
|
||||
|
||||
## Overall Assessment
|
||||
{Overall assessment considering both responses}
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -62,7 +61,6 @@ movements:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -97,9 +95,10 @@ movements:
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -122,7 +121,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -143,6 +141,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI issues fixed
|
||||
next: ai_review
|
||||
@ -151,7 +150,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -166,7 +164,6 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -215,7 +212,6 @@ movements:
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -235,13 +231,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -253,6 +249,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
next: COMPLETE
|
||||
@ -261,5 +258,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan_test
|
||||
loop_monitors:
|
||||
@ -65,7 +64,6 @@ movements:
|
||||
report:
|
||||
- name: 00-test-plan.md
|
||||
format: test-plan
|
||||
|
||||
- name: implement_test
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -100,9 +98,10 @@ movements:
|
||||
instruction: implement-e2e-test
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -125,7 +124,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -146,6 +144,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI issues fixed
|
||||
next: ai_review
|
||||
@ -154,7 +153,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -169,7 +167,6 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: review_test
|
||||
instruction: arbitrate
|
||||
|
||||
- name: review_test
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
@ -192,7 +189,6 @@ movements:
|
||||
report:
|
||||
- name: 05-qa-review.md
|
||||
format: qa-review
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -213,13 +209,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: review_test
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan_test
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -231,6 +227,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
next: COMPLETE
|
||||
@ -239,5 +236,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 06-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -79,8 +78,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -126,6 +127,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues have been fixed
|
||||
next: ai_review
|
||||
@ -255,6 +257,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
@ -272,6 +275,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All validations pass and ready to merge
|
||||
next: COMPLETE
|
||||
@ -279,8 +283,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -303,6 +310,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues have been fixed
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -78,8 +77,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -124,6 +125,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues have been fixed
|
||||
next: ai_review
|
||||
@ -252,6 +254,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
@ -269,6 +272,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All validations pass and ready to merge
|
||||
next: COMPLETE
|
||||
@ -276,8 +280,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -299,6 +306,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues have been fixed
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -64,8 +63,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -109,6 +110,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues have been fixed
|
||||
next: ai_review
|
||||
@ -236,6 +238,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
@ -253,6 +256,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All validations pass and ready to merge
|
||||
next: COMPLETE
|
||||
@ -260,8 +264,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -282,6 +289,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues have been fixed
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 5
|
||||
initial_movement: melchior
|
||||
movements:
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: implement
|
||||
movements:
|
||||
@ -38,8 +37,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -79,8 +80,11 @@ movements:
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -152,6 +156,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues fixed
|
||||
next: reviewers
|
||||
@ -176,6 +181,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues fixed
|
||||
next: reviewers
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: execute
|
||||
movements:
|
||||
@ -39,4 +38,6 @@ movements:
|
||||
Do the task.
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -109,6 +108,7 @@ movements:
|
||||
Evaluate the research results and determine if they adequately answer the original request.
|
||||
|
||||
**Important**: If there are issues, include specific instructions for the Planner.
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Research results adequately answer the original request
|
||||
next: COMPLETE
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: reviewers
|
||||
movements:
|
||||
@ -38,8 +37,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -79,8 +80,11 @@ movements:
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
rules:
|
||||
- condition: all("No AI-specific issues", "All checks passed")
|
||||
next: COMPLETE
|
||||
@ -152,6 +156,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewer's issues fixed
|
||||
next: reviewers
|
||||
@ -176,6 +181,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Supervisor's issues fixed
|
||||
next: reviewers
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -119,6 +118,7 @@ movements:
|
||||
- Grep
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: approved, PR comment requested
|
||||
next: pr-comment
|
||||
@ -169,7 +169,45 @@ movements:
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: review-summary.md
|
||||
format: |
|
||||
```markdown
|
||||
# Review Summary
|
||||
|
||||
## Overall Verdict: APPROVE / REJECT
|
||||
|
||||
## Summary
|
||||
{Integrate all review results in 2-3 sentences}
|
||||
|
||||
## Review Results
|
||||
| Review | Result | Key Findings |
|
||||
|--------|--------|-------------|
|
||||
| Architecture | APPROVE/REJECT | {Overview} |
|
||||
| Security | APPROVE/REJECT | {Overview} |
|
||||
| AI Anti-pattern | APPROVE/REJECT | {Overview} |
|
||||
|
||||
## Current Iteration Findings (new)
|
||||
| # | finding_id | Severity | Source | Location | Issue | Fix Suggestion |
|
||||
|---|------------|----------|--------|----------|-------|----------------|
|
||||
| 1 | SUM-NEW-src-file-L42 | High | Security | `file:line` | Description | Suggestion |
|
||||
|
||||
## Carry-over Findings (persists)
|
||||
| # | finding_id | Source | Previous Evidence | Current Evidence | Issue |
|
||||
|---|------------|--------|-------------------|------------------|-------|
|
||||
| 1 | SUM-PERSIST-src-file-L77 | Architecture | `file:line` | `file:line` | Description |
|
||||
|
||||
## Resolved Findings (resolved)
|
||||
| finding_id | Source | Resolution Evidence |
|
||||
|------------|--------|---------------------|
|
||||
| SUM-RESOLVED-src-file-L10 | QA | `file:line` |
|
||||
|
||||
## Improvement Suggestions
|
||||
- {Consolidated suggestions from all reviews}
|
||||
|
||||
## Rejection Gate
|
||||
- REJECT is valid only when at least one finding exists in `new` or `persists`
|
||||
- Findings without `finding_id` are invalid
|
||||
```
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
persona: pr-commenter
|
||||
@ -195,14 +233,14 @@ movements:
|
||||
- `01-architect-review.md` (Architecture review)
|
||||
- `02-security-review.md` (Security review)
|
||||
- `03-ai-review.md` (AI antipattern review)
|
||||
- `04-review-summary.md` (Consolidated summary)
|
||||
- `review-summary.md` (Consolidated summary)
|
||||
3. Filter findings by severity and post inline comments for Critical/High/Medium
|
||||
4. Post a summary comment with the following format:
|
||||
|
||||
```
|
||||
## Automated Review Summary
|
||||
|
||||
{Overall verdict and summary from 04-review-summary.md}
|
||||
{Overall verdict and summary from review-summary.md}
|
||||
|
||||
### Review Results
|
||||
| Review | Result |
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 50
|
||||
initial_movement: review
|
||||
loop_monitors:
|
||||
@ -118,8 +117,41 @@ movements:
|
||||
next: COMPLETE
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-full-review.md
|
||||
- name: full-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# Full Project Structural Review
|
||||
|
||||
## Summary
|
||||
- Total files reviewed: {N}
|
||||
- Issues found: {N} (Critical: {N}, High: {N}, Medium: {N})
|
||||
|
||||
## Critical Issues
|
||||
|
||||
### 1. {File path} ({line count} lines)
|
||||
- **Problem**: {category}
|
||||
- **Severity**: Critical
|
||||
- **Responsibilities found**:
|
||||
1. {responsibility 1}
|
||||
2. {responsibility 2}
|
||||
- **Proposed split**:
|
||||
- `{new-file-1}.ts`: {responsibility}
|
||||
- `{new-file-2}.ts`: {responsibility}
|
||||
- **Affected dependents**: {files that import this module}
|
||||
|
||||
## High Priority Issues
|
||||
- {Issue}
|
||||
|
||||
## Medium Priority Issues
|
||||
- {Issue}
|
||||
|
||||
## Dependency Graph Concerns
|
||||
- {circular dependencies, layering violations}
|
||||
|
||||
## Recommended Reform Order
|
||||
1. {file} - {reason for priority}
|
||||
2. {file} - {reason for priority}
|
||||
```
|
||||
- name: plan_reform
|
||||
edit: false
|
||||
persona: planner
|
||||
@ -206,7 +238,6 @@ movements:
|
||||
report:
|
||||
- name: 01-reform-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -239,9 +270,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -290,7 +322,6 @@ movements:
|
||||
next: verify
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -310,13 +341,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: reviewers
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan_reform
|
||||
instruction: fix
|
||||
|
||||
- name: verify
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -371,7 +402,6 @@ movements:
|
||||
report:
|
||||
- name: 06-verification.md
|
||||
format: validation
|
||||
|
||||
- name: next_target
|
||||
edit: false
|
||||
persona: planner
|
||||
@ -434,4 +464,25 @@ movements:
|
||||
next: COMPLETE
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-progress.md
|
||||
- name: progress.md
|
||||
format: |
|
||||
```markdown
|
||||
# Reform Progress
|
||||
|
||||
## Completed Targets
|
||||
| # | Target | Status |
|
||||
|---|--------|--------|
|
||||
| 1 | {file} | Completed |
|
||||
|
||||
## Remaining Targets
|
||||
| # | Target | Priority |
|
||||
|---|--------|----------|
|
||||
| 2 | {file} | Next |
|
||||
|
||||
## Next Action
|
||||
- **Target**: {next file to reform}
|
||||
- **Plan**: {brief description of the split}
|
||||
|
||||
## Overall Progress
|
||||
{N}/{total} targets completed. Estimated remaining iterations: {N}
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan_test
|
||||
loop_monitors:
|
||||
@ -65,7 +64,6 @@ movements:
|
||||
report:
|
||||
- name: 00-test-plan.md
|
||||
format: test-plan
|
||||
|
||||
- name: implement_test
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -100,9 +98,10 @@ movements:
|
||||
instruction: implement-test
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -125,7 +124,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -146,6 +144,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI issues fixed
|
||||
next: ai_review
|
||||
@ -154,7 +153,6 @@ movements:
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -169,7 +167,6 @@ movements:
|
||||
- condition: ai_fix's judgment is valid (no fix needed)
|
||||
next: review_test
|
||||
instruction: arbitrate
|
||||
|
||||
- name: review_test
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
@ -192,7 +189,6 @@ movements:
|
||||
report:
|
||||
- name: 05-qa-review.md
|
||||
format: qa-review
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -213,13 +209,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: Fix complete
|
||||
next: review_test
|
||||
- condition: Cannot proceed, insufficient info
|
||||
next: plan_test
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -231,6 +227,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: All checks passed
|
||||
next: COMPLETE
|
||||
@ -239,5 +236,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 06-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -14,12 +14,26 @@
|
||||
| コンテキスト適合 | ✅ | - |
|
||||
| スコープ | ✅ | - |
|
||||
|
||||
## 問題点(REJECTの場合)
|
||||
| # | カテゴリ | 場所 | 問題 |
|
||||
|---|---------|------|------|
|
||||
| 1 | 幻覚API | `src/file.ts:23` | 存在しないメソッド |
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|
||||
|---|------------|---------|------|------|--------|
|
||||
| 1 | AI-NEW-src-file-L23 | 幻覚API | `src/file.ts:23` | 存在しないメソッド | 実在APIへ置換 |
|
||||
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|
||||
|---|------------|----------|----------|------|--------|
|
||||
| 1 | AI-PERSIST-src-file-L42 | `src/file.ts:42` | `src/file.ts:42` | 未解消 | 既存修正方針を適用 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| AI-RESOLVED-src-file-L10 | `src/file.ts:10` に該当問題なし |
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
|
||||
**認知負荷軽減ルール:**
|
||||
- 問題なし → サマリー1文 + チェック表のみ(10行以内)
|
||||
- 問題あり → + 問題を表形式で(25行以内)
|
||||
- 問題なし → サマリー + チェック表 + 空の指摘セクション(10行以内)
|
||||
- 問題あり → 該当セクションのみ行追加(30行以内)
|
||||
|
||||
@ -14,22 +14,28 @@
|
||||
- [x] デッドコード
|
||||
- [x] 呼び出しチェーン検証
|
||||
|
||||
## 前回Open Findings
|
||||
| finding_id | 前回状態 | 今回状態(new/persists/resolved) | 根拠 |
|
||||
|------------|----------|----------------------------------|------|
|
||||
| ARCH-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |
|
||||
|
||||
## 問題点(REJECTの場合)
|
||||
| # | finding_id | 状態(new/persists) | スコープ | 場所 | 問題 | 修正案 |
|
||||
|---|------------|--------------------|---------|------|------|--------|
|
||||
| 1 | ARCH-EXAMPLE-src-file-L42 | new | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | スコープ | 場所 | 問題 | 修正案 |
|
||||
|---|------------|---------|------|------|--------|
|
||||
| 1 | ARCH-NEW-src-file-L42 | スコープ内 | `src/file.ts:42` | 問題の説明 | 修正方法 |
|
||||
|
||||
スコープ: 「スコープ内」(今回修正可能)/ 「スコープ外」(既存問題・非ブロッキング)
|
||||
|
||||
## 既存問題(参考・非ブロッキング)
|
||||
- {既存問題の記録。今回の変更と無関係な問題}
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|
||||
|---|------------|----------|----------|------|--------|
|
||||
| 1 | ARCH-PERSIST-src-file-L77 | `src/file.ts:77` | `src/file.ts:77` | 未解消 | 既存修正方針を適用 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| ARCH-RESOLVED-src-file-L10 | `src/file.ts:10` は規約を満たす |
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
|
||||
**認知負荷軽減ルール:**
|
||||
- APPROVE → サマリーのみ(5行以内)
|
||||
- REJECT → 問題点を表形式で(30行以内)
|
||||
- REJECT → 該当指摘のみ表で記載(30行以内)
|
||||
|
||||
@ -15,13 +15,22 @@
|
||||
| ドキュメント | ✅ | - |
|
||||
| 保守性 | ✅ | - |
|
||||
|
||||
## 前回Open Findings
|
||||
| finding_id | 前回状態 | 今回状態(new/persists/resolved) | 根拠 |
|
||||
|------------|----------|----------------------------------|------|
|
||||
| QA-EXAMPLE-src-file-L42 | open | persists | `src/file.ts:42` |
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | カテゴリ | 場所 | 問題 | 修正案 |
|
||||
|---|------------|---------|------|------|--------|
|
||||
| 1 | QA-NEW-src-test-L42 | テスト | `src/test.ts:42` | 異常系テスト不足 | 失敗系ケースを追加 |
|
||||
|
||||
## 問題点(REJECTの場合)
|
||||
| # | finding_id | 状態(new/persists) | カテゴリ | 問題 | 修正案 |
|
||||
|---|------------|--------------------|---------|------|--------|
|
||||
| 1 | QA-EXAMPLE-src-file-L42 | new | テスト | 問題の説明 | 修正方法 |
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|
||||
|---|------------|----------|----------|------|--------|
|
||||
| 1 | QA-PERSIST-src-test-L77 | `src/test.ts:77` | `src/test.ts:77` | 不安定なまま | アサーションとセットアップを安定化 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| QA-RESOLVED-src-test-L10 | `src/test.ts:10` で異常系が網羅済み |
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
|
||||
@ -1,23 +0,0 @@
|
||||
```markdown
|
||||
# レビューサマリー
|
||||
|
||||
## 総合判定: APPROVE / REJECT
|
||||
|
||||
## サマリー
|
||||
{2-3文で全レビュー結果を統合}
|
||||
|
||||
## レビュー結果
|
||||
| レビュー | 結果 | 主要な発見 |
|
||||
|---------|------|-----------|
|
||||
| アーキテクチャ | APPROVE/REJECT | {概要} |
|
||||
| セキュリティ | APPROVE/REJECT | {概要} |
|
||||
| AIアンチパターン | APPROVE/REJECT | {概要} |
|
||||
|
||||
## 要注意の問題
|
||||
| # | 重大度 | ソース | 場所 | 問題 |
|
||||
|---|--------|--------|------|------|
|
||||
| 1 | High | セキュリティ | `file:line` | 説明 |
|
||||
|
||||
## 改善提案
|
||||
- {全レビューからの統合提案}
|
||||
```
|
||||
@ -13,16 +13,30 @@
|
||||
| データ保護 | ✅ | - |
|
||||
| 依存関係 | ✅ | - |
|
||||
|
||||
## 脆弱性(REJECTの場合)
|
||||
| # | 重大度 | 種類 | 場所 | 修正案 |
|
||||
|---|--------|------|------|--------|
|
||||
| 1 | High | SQLi | `src/db.ts:42` | パラメータ化クエリを使用 |
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | 重大度 | 種類 | 場所 | 問題 | 修正案 |
|
||||
|---|------------|--------|------|------|------|--------|
|
||||
| 1 | SEC-NEW-src-db-L42 | High | SQLi | `src/db.ts:42` | 生SQL文字列 | パラメータ化クエリを使用 |
|
||||
|
||||
## 警告(ブロッキングではない)
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 問題 | 修正案 |
|
||||
|---|------------|----------|----------|------|--------|
|
||||
| 1 | SEC-PERSIST-src-auth-L18 | `src/auth.ts:18` | `src/auth.ts:18` | 未解消 | バリデーションを強化 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| SEC-RESOLVED-src-db-L10 | `src/db.ts:10` はバインド変数化済み |
|
||||
|
||||
## 警告(非ブロッキング)
|
||||
- {セキュリティに関する推奨事項}
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
|
||||
**認知負荷軽減ルール:**
|
||||
- 問題なし → チェック表のみ(10行以内)
|
||||
- 警告あり → + 警告を1-2行(15行以内)
|
||||
- 脆弱性あり → + 表形式で(30行以内)
|
||||
- 警告のみ → + 警告1-2行(15行以内)
|
||||
- 脆弱性あり → + 指摘表(30行以内)
|
||||
|
||||
36
builtins/ja/output-contracts/supervisor-validation.md
Normal file
36
builtins/ja/output-contracts/supervisor-validation.md
Normal file
@ -0,0 +1,36 @@
|
||||
```markdown
|
||||
# 最終検証結果
|
||||
|
||||
## 結果: APPROVE / REJECT
|
||||
|
||||
## 検証サマリー
|
||||
| 項目 | 状態 | 確認方法 |
|
||||
|------|------|---------|
|
||||
| 要求充足 | ✅ | 要求リストと照合 |
|
||||
| テスト | ✅ | `npm test` (N passed) |
|
||||
| ビルド | ✅ | `npm run build` 成功 |
|
||||
| 動作確認 | ✅ | 主要フロー確認 |
|
||||
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | 項目 | 根拠 | 理由 | 必要アクション |
|
||||
|---|------------|------|------|------|----------------|
|
||||
| 1 | VAL-NEW-src-file-L42 | 要求不一致 | `file:line` | 説明 | 修正が必要 |
|
||||
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 理由 | 必要アクション |
|
||||
|---|------------|----------|----------|------|----------------|
|
||||
| 1 | VAL-PERSIST-src-file-L77 | `file:line` | `file:line` | 未解消 | 修正継続 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| VAL-RESOLVED-src-file-L10 | `file:line` は検証条件を満たす |
|
||||
|
||||
## 成果物
|
||||
- 作成: {作成したファイル}
|
||||
- 変更: {変更したファイル}
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
@ -11,12 +11,26 @@
|
||||
| ビルド | ✅ | `npm run build` 成功 |
|
||||
| 動作確認 | ✅ | 主要フロー確認 |
|
||||
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | 項目 | 根拠 | 理由 | 必要アクション |
|
||||
|---|------------|------|------|------|----------------|
|
||||
| 1 | VAL-NEW-src-file-L42 | 要求不一致 | `file:line` | 説明 | 修正が必要 |
|
||||
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | 前回根拠 | 今回根拠 | 理由 | 必要アクション |
|
||||
|---|------------|----------|----------|------|----------------|
|
||||
| 1 | VAL-PERSIST-src-file-L77 | `file:line` | `file:line` | 未解消 | 修正継続 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | 解消根拠 |
|
||||
|------------|----------|
|
||||
| VAL-RESOLVED-src-file-L10 | `file:line` は検証条件を満たす |
|
||||
|
||||
## 成果物
|
||||
- 作成: {作成したファイル}
|
||||
- 変更: {変更したファイル}
|
||||
|
||||
## 未完了項目(REJECTの場合)
|
||||
| # | 項目 | 理由 |
|
||||
|---|------|------|
|
||||
| 1 | {項目} | {理由} |
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -65,8 +64,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -111,6 +112,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewerの指摘に対する修正が完了した
|
||||
next: ai_review
|
||||
@ -220,6 +222,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正が完了した
|
||||
next: reviewers
|
||||
@ -237,6 +240,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべての検証が完了し、マージ可能な状態である
|
||||
next: COMPLETE
|
||||
@ -244,8 +248,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -267,6 +274,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -64,8 +63,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -109,6 +110,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewerの指摘に対する修正が完了した
|
||||
next: ai_review
|
||||
@ -217,6 +219,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正が完了した
|
||||
next: reviewers
|
||||
@ -234,6 +237,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべての検証が完了し、マージ可能な状態である
|
||||
next: COMPLETE
|
||||
@ -241,8 +245,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -263,6 +270,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -33,7 +32,6 @@ movements:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -66,9 +64,10 @@ movements:
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -115,7 +114,6 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: any("AI特有の問題あり", "needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -133,6 +131,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正完了
|
||||
next: reviewers
|
||||
|
||||
@ -6,10 +6,8 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: evaluate
|
||||
|
||||
movements:
|
||||
- name: evaluate
|
||||
parallel:
|
||||
@ -30,8 +28,27 @@ movements:
|
||||
- condition: failed
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-claude.md
|
||||
- name: claude-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# Claudeレビュー結果
|
||||
|
||||
## 結論
|
||||
{1行結論}
|
||||
|
||||
## 主要な指摘
|
||||
- {finding 1}
|
||||
- {finding 2}
|
||||
|
||||
## 根拠
|
||||
- {file:line と理由}
|
||||
|
||||
## リスク / 注意点
|
||||
- {risk}
|
||||
|
||||
## 推奨次アクション
|
||||
- {action}
|
||||
```
|
||||
- name: codex-eye
|
||||
edit: false
|
||||
persona: coder
|
||||
@ -49,11 +66,30 @@ movements:
|
||||
- condition: failed
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 02-codex.md
|
||||
- name: codex-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# Codexレビュー結果
|
||||
|
||||
## 結論
|
||||
{1行結論}
|
||||
|
||||
## 主要な指摘
|
||||
- {finding 1}
|
||||
- {finding 2}
|
||||
|
||||
## 根拠
|
||||
- {file:line と理由}
|
||||
|
||||
## リスク / 注意点
|
||||
- {risk}
|
||||
|
||||
## 推奨次アクション
|
||||
- {action}
|
||||
```
|
||||
rules:
|
||||
- condition: any("done")
|
||||
next: synthesize
|
||||
|
||||
- name: synthesize
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -70,8 +106,8 @@ movements:
|
||||
|
||||
**やること:**
|
||||
1. Report Directory 内のレポートを読む
|
||||
- `01-claude.md`(Claude の回答)
|
||||
- `02-codex.md`(Codex の回答)
|
||||
- `claude-review.md`(Claude の回答)
|
||||
- `codex-review.md`(Codex の回答)
|
||||
※ 片方が存在しない場合(エラーで失敗した場合)、存在するレポートのみで統合する
|
||||
2. 両方のレポートがある場合は比較し、以下を明示する
|
||||
- 一致している点
|
||||
@ -109,4 +145,32 @@ movements:
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: 03-synthesis.md
|
||||
- name: synthesis.md
|
||||
format: |
|
||||
```markdown
|
||||
# 複数モデルレビュー統合
|
||||
|
||||
## 結論
|
||||
{統合結論}
|
||||
|
||||
## 応答状況
|
||||
| モデル | 状態 |
|
||||
|--------|------|
|
||||
| Claude | ✅ / ❌ |
|
||||
| Codex | ✅ / ❌ |
|
||||
|
||||
## 一致点
|
||||
- {両者が一致した点}
|
||||
|
||||
## 相違点
|
||||
| 論点 | Claude | Codex |
|
||||
|------|--------|-------|
|
||||
| {topic} | {Claudeの見解} | {Codexの見解} |
|
||||
|
||||
## 片側のみの指摘
|
||||
- **Claudeのみ:** {Claudeのみが言及}
|
||||
- **Codexのみ:** {Codexのみが言及}
|
||||
|
||||
## 総合評価
|
||||
{両者を踏まえた総合評価}
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -62,7 +61,6 @@ movements:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -97,9 +95,10 @@ movements:
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -122,7 +121,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -143,6 +141,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI問題の修正完了
|
||||
next: ai_review
|
||||
@ -151,7 +150,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -166,7 +164,6 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: reviewers
|
||||
instruction: arbitrate
|
||||
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -215,7 +212,6 @@ movements:
|
||||
next: supervise
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -235,13 +231,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正完了
|
||||
next: reviewers
|
||||
- condition: 判断できない、情報不足
|
||||
next: plan
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -253,6 +249,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべて問題なし
|
||||
next: COMPLETE
|
||||
@ -261,5 +258,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan_test
|
||||
loop_monitors:
|
||||
@ -65,7 +64,6 @@ movements:
|
||||
report:
|
||||
- name: 00-test-plan.md
|
||||
format: test-plan
|
||||
|
||||
- name: implement_test
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -100,9 +98,10 @@ movements:
|
||||
instruction: implement-e2e-test
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -125,7 +124,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -146,6 +144,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI問題の修正完了
|
||||
next: ai_review
|
||||
@ -154,7 +153,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -169,7 +167,6 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: review_test
|
||||
instruction: arbitrate
|
||||
|
||||
- name: review_test
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
@ -192,7 +189,6 @@ movements:
|
||||
report:
|
||||
- name: 05-qa-review.md
|
||||
format: qa-review
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -213,13 +209,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正完了
|
||||
next: review_test
|
||||
- condition: 判断できない、情報不足
|
||||
next: plan_test
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -231,6 +227,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべて問題なし
|
||||
next: COMPLETE
|
||||
@ -239,5 +236,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 06-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -79,8 +78,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -126,6 +127,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewerの指摘に対する修正が完了した
|
||||
next: ai_review
|
||||
@ -255,6 +257,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正が完了した
|
||||
next: reviewers
|
||||
@ -272,6 +275,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべての検証が完了し、マージ可能な状態である
|
||||
next: COMPLETE
|
||||
@ -279,8 +283,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -303,6 +310,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
loop_monitors:
|
||||
@ -78,8 +77,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -124,6 +125,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewerの指摘に対する修正が完了した
|
||||
next: ai_review
|
||||
@ -252,6 +254,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正が完了した
|
||||
next: reviewers
|
||||
@ -269,6 +272,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべての検証が完了し、マージ可能な状態である
|
||||
next: COMPLETE
|
||||
@ -276,8 +280,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -299,6 +306,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 30
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -64,8 +63,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -109,6 +110,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: ai-fix
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI Reviewerの指摘に対する修正が完了した
|
||||
next: ai_review
|
||||
@ -236,6 +238,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正が完了した
|
||||
next: reviewers
|
||||
@ -253,6 +256,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: supervise
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべての検証が完了し、マージ可能な状態である
|
||||
next: COMPLETE
|
||||
@ -260,8 +264,11 @@ movements:
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
- name: fix_supervisor
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -282,6 +289,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
instruction: fix-supervisor
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: supervise
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 5
|
||||
initial_movement: melchior
|
||||
movements:
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: implement
|
||||
movements:
|
||||
@ -38,8 +37,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -79,8 +80,11 @@ movements:
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -152,6 +156,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI問題の修正完了
|
||||
next: reviewers
|
||||
@ -176,6 +181,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: reviewers
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: execute
|
||||
movements:
|
||||
@ -39,4 +38,6 @@ movements:
|
||||
タスクをこなしてください。
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -109,6 +108,7 @@ movements:
|
||||
調査結果を評価し、元の依頼に対して十分な回答になっているか判断してください。
|
||||
|
||||
**重要**: 問題がある場合は、Plannerへの具体的な指示を含めてください。
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 調査結果が元の依頼に対して十分である
|
||||
next: COMPLETE
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: reviewers
|
||||
movements:
|
||||
@ -38,8 +37,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: ai_review
|
||||
@ -79,8 +80,11 @@ movements:
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
rules:
|
||||
- condition: all("AI特有の問題なし", "すべて問題なし")
|
||||
next: COMPLETE
|
||||
@ -152,6 +156,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI問題の修正完了
|
||||
next: reviewers
|
||||
@ -176,6 +181,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 監督者の指摘に対する修正が完了した
|
||||
next: reviewers
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 10
|
||||
initial_movement: plan
|
||||
movements:
|
||||
@ -119,6 +118,7 @@ movements:
|
||||
- Grep
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: approved, PR comment requested
|
||||
next: pr-comment
|
||||
@ -170,7 +170,45 @@ movements:
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: review-summary.md
|
||||
format: |
|
||||
```markdown
|
||||
# レビューサマリー
|
||||
|
||||
## 総合判定: APPROVE / REJECT
|
||||
|
||||
## サマリー
|
||||
{2-3文で全レビュー結果を統合}
|
||||
|
||||
## レビュー結果
|
||||
| レビュー | 結果 | 主要な発見 |
|
||||
|---------|------|-----------|
|
||||
| アーキテクチャ | APPROVE/REJECT | {概要} |
|
||||
| セキュリティ | APPROVE/REJECT | {概要} |
|
||||
| AIアンチパターン | APPROVE/REJECT | {概要} |
|
||||
|
||||
## 今回の指摘(new)
|
||||
| # | finding_id | 重大度 | ソース | 場所 | 問題 | 修正案 |
|
||||
|---|------------|--------|--------|------|------|--------|
|
||||
| 1 | SUM-NEW-src-file-L42 | High | セキュリティ | `file:line` | 説明 | 提案 |
|
||||
|
||||
## 継続指摘(persists)
|
||||
| # | finding_id | ソース | 前回根拠 | 今回根拠 | 問題 |
|
||||
|---|------------|--------|----------|----------|------|
|
||||
| 1 | SUM-PERSIST-src-file-L77 | アーキテクチャ | `file:line` | `file:line` | 説明 |
|
||||
|
||||
## 解消済み(resolved)
|
||||
| finding_id | ソース | 解消根拠 |
|
||||
|------------|--------|----------|
|
||||
| SUM-RESOLVED-src-file-L10 | QA | `file:line` |
|
||||
|
||||
## 改善提案
|
||||
- {全レビューからの統合提案}
|
||||
|
||||
## REJECT判定条件
|
||||
- `new` または `persists` が1件以上ある場合のみ REJECT 可
|
||||
- `finding_id` なしの指摘は無効
|
||||
```
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
persona: pr-commenter
|
||||
@ -196,14 +234,14 @@ movements:
|
||||
- `01-architect-review.md`(アーキテクチャレビュー)
|
||||
- `02-security-review.md`(セキュリティレビュー)
|
||||
- `03-ai-review.md`(AIアンチパターンレビュー)
|
||||
- `04-review-summary.md`(統合サマリー)
|
||||
- `review-summary.md`(統合サマリー)
|
||||
3. 重要度でフィルタリングし、Critical/High/Mediumの指摘をインラインコメントとして投稿
|
||||
4. 以下のフォーマットでサマリーコメントを投稿:
|
||||
|
||||
```
|
||||
## 自動レビューサマリー
|
||||
|
||||
{04-review-summary.mdからの総合判定とサマリー}
|
||||
{review-summary.mdからの総合判定とサマリー}
|
||||
|
||||
### レビュー結果
|
||||
| レビュー | 結果 |
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 50
|
||||
initial_movement: review
|
||||
loop_monitors:
|
||||
@ -118,8 +117,41 @@ movements:
|
||||
next: COMPLETE
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-full-review.md
|
||||
- name: full-review.md
|
||||
format: |
|
||||
```markdown
|
||||
# 全体構造レビュー
|
||||
|
||||
## サマリー
|
||||
- レビュー対象ファイル数: {N}
|
||||
- 問題件数: {N}(Critical: {N}, High: {N}, Medium: {N})
|
||||
|
||||
## Critical な問題
|
||||
|
||||
### 1. {ファイルパス}({行数} lines)
|
||||
- **問題カテゴリ**: {category}
|
||||
- **重大度**: Critical
|
||||
- **含まれている責務**:
|
||||
1. {responsibility 1}
|
||||
2. {responsibility 2}
|
||||
- **分割案**:
|
||||
- `{new-file-1}.ts`: {responsibility}
|
||||
- `{new-file-2}.ts`: {responsibility}
|
||||
- **影響を受ける依存側**: {このモジュールをimportしているファイル}
|
||||
|
||||
## High 優先の問題
|
||||
- {Issue}
|
||||
|
||||
## Medium 優先の問題
|
||||
- {Issue}
|
||||
|
||||
## 依存グラフ上の懸念
|
||||
- {循環依存・レイヤ違反 など}
|
||||
|
||||
## 推奨リファクタ順序
|
||||
1. {file} - {優先理由}
|
||||
2. {file} - {優先理由}
|
||||
```
|
||||
- name: plan_reform
|
||||
edit: false
|
||||
persona: planner
|
||||
@ -206,7 +238,6 @@ movements:
|
||||
report:
|
||||
- name: 01-reform-plan.md
|
||||
format: plan
|
||||
|
||||
- name: implement
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -239,9 +270,10 @@ movements:
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: reviewers
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -290,7 +322,6 @@ movements:
|
||||
next: verify
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -310,13 +341,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正完了
|
||||
next: reviewers
|
||||
- condition: 判断できない、情報不足
|
||||
next: plan_reform
|
||||
instruction: fix
|
||||
|
||||
- name: verify
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -371,7 +402,6 @@ movements:
|
||||
report:
|
||||
- name: 06-verification.md
|
||||
format: validation
|
||||
|
||||
- name: next_target
|
||||
edit: false
|
||||
persona: planner
|
||||
@ -434,4 +464,25 @@ movements:
|
||||
next: COMPLETE
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-progress.md
|
||||
- name: progress.md
|
||||
format: |
|
||||
```markdown
|
||||
# 改修進捗
|
||||
|
||||
## 完了ターゲット
|
||||
| # | ターゲット | 状態 |
|
||||
|---|------------|------|
|
||||
| 1 | {file} | Completed |
|
||||
|
||||
## 残ターゲット
|
||||
| # | ターゲット | 優先度 |
|
||||
|---|------------|--------|
|
||||
| 2 | {file} | Next |
|
||||
|
||||
## 次アクション
|
||||
- **対象**: {next file to reform}
|
||||
- **実施計画**: {brief description of the split}
|
||||
|
||||
## 全体進捗
|
||||
{N}/{total} targets completed. 推定残り反復: {N}
|
||||
```
|
||||
|
||||
@ -6,7 +6,6 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: plan_test
|
||||
loop_monitors:
|
||||
@ -65,7 +64,6 @@ movements:
|
||||
report:
|
||||
- name: 00-test-plan.md
|
||||
format: test-plan
|
||||
|
||||
- name: implement_test
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -100,9 +98,10 @@ movements:
|
||||
instruction: implement-test
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
|
||||
- name: coder-scope.md
|
||||
format: coder-scope
|
||||
- name: coder-decisions.md
|
||||
format: coder-decisions
|
||||
- name: ai_review
|
||||
edit: false
|
||||
persona: ai-antipattern-reviewer
|
||||
@ -125,7 +124,6 @@ movements:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
|
||||
- name: ai_fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -146,6 +144,7 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: AI問題の修正完了
|
||||
next: ai_review
|
||||
@ -154,7 +153,6 @@ movements:
|
||||
- condition: 判断できない、情報不足
|
||||
next: ai_no_fix
|
||||
instruction: ai-fix
|
||||
|
||||
- name: ai_no_fix
|
||||
edit: false
|
||||
persona: architecture-reviewer
|
||||
@ -169,7 +167,6 @@ movements:
|
||||
- condition: ai_fixの判断が妥当(修正不要)
|
||||
next: review_test
|
||||
instruction: arbitrate
|
||||
|
||||
- name: review_test
|
||||
edit: false
|
||||
persona: qa-reviewer
|
||||
@ -192,7 +189,6 @@ movements:
|
||||
report:
|
||||
- name: 05-qa-review.md
|
||||
format: qa-review
|
||||
|
||||
- name: fix
|
||||
edit: true
|
||||
persona: coder
|
||||
@ -213,13 +209,13 @@ movements:
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
required_permission_mode: edit
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: 修正完了
|
||||
next: review_test
|
||||
- condition: 判断できない、情報不足
|
||||
next: plan_test
|
||||
instruction: fix
|
||||
|
||||
- name: supervise
|
||||
edit: false
|
||||
persona: supervisor
|
||||
@ -231,6 +227,7 @@ movements:
|
||||
- Bash
|
||||
- WebSearch
|
||||
- WebFetch
|
||||
pass_previous_response: false
|
||||
rules:
|
||||
- condition: すべて問題なし
|
||||
next: COMPLETE
|
||||
@ -239,5 +236,8 @@ movements:
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 06-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: supervisor-validation.md
|
||||
format: supervisor-validation
|
||||
- name: summary.md
|
||||
format: summary
|
||||
use_judge: false
|
||||
|
||||
@ -6,13 +6,12 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 20
|
||||
initial_movement: review
|
||||
|
||||
loop_monitors:
|
||||
- cycle: [review, fix]
|
||||
- cycle:
|
||||
- review
|
||||
- fix
|
||||
threshold: 2
|
||||
judge:
|
||||
persona: ../agents/test-reviewer-b.md
|
||||
@ -21,7 +20,6 @@ loop_monitors:
|
||||
next: review
|
||||
- condition: abort_loop
|
||||
next: ABORT
|
||||
|
||||
movements:
|
||||
- name: review
|
||||
persona: ../agents/test-reviewer-a.md
|
||||
@ -32,7 +30,6 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: needs_fix
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
persona: ../agents/test-coder.md
|
||||
edit: true
|
||||
|
||||
@ -6,12 +6,8 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 2
|
||||
|
||||
initial_movement: step-a
|
||||
|
||||
movements:
|
||||
- name: step-a
|
||||
edit: true
|
||||
@ -22,7 +18,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-b
|
||||
|
||||
- name: step-b
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
|
||||
@ -6,10 +6,7 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 3
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
|
||||
@ -6,10 +6,7 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 3
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
|
||||
@ -6,12 +6,8 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 20
|
||||
|
||||
initial_movement: step-1
|
||||
|
||||
movements:
|
||||
- name: step-1
|
||||
edit: true
|
||||
@ -21,7 +17,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-2
|
||||
|
||||
- name: step-2
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -30,7 +25,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-3
|
||||
|
||||
- name: step-3
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -39,7 +33,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-4
|
||||
|
||||
- name: step-4
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -48,7 +41,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-5
|
||||
|
||||
- name: step-5
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -57,7 +49,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-6
|
||||
|
||||
- name: step-6
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -66,7 +57,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-7
|
||||
|
||||
- name: step-7
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
@ -75,7 +65,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-8
|
||||
|
||||
- name: step-8
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
|
||||
@ -6,12 +6,8 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 5
|
||||
|
||||
initial_movement: step-1
|
||||
|
||||
movements:
|
||||
- name: step-1
|
||||
edit: true
|
||||
@ -22,7 +18,6 @@ movements:
|
||||
rules:
|
||||
- condition: Done
|
||||
next: step-2
|
||||
|
||||
- name: step-2
|
||||
edit: true
|
||||
persona: ../agents/test-coder.md
|
||||
|
||||
@ -6,12 +6,8 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 10
|
||||
|
||||
initial_movement: plan
|
||||
|
||||
movements:
|
||||
- name: plan
|
||||
persona: ../agents/test-coder.md
|
||||
@ -20,9 +16,8 @@ movements:
|
||||
instruction_template: |
|
||||
Create a plan for the task.
|
||||
rules:
|
||||
- condition: "Plan complete"
|
||||
- condition: Plan complete
|
||||
next: review
|
||||
|
||||
- name: review
|
||||
parallel:
|
||||
- name: arch-review
|
||||
@ -44,7 +39,6 @@ movements:
|
||||
next: COMPLETE
|
||||
- condition: any("needs_fix")
|
||||
next: fix
|
||||
|
||||
- name: fix
|
||||
persona: ../agents/test-coder.md
|
||||
edit: true
|
||||
@ -52,5 +46,5 @@ movements:
|
||||
instruction_template: |
|
||||
Fix the issues found in review.
|
||||
rules:
|
||||
- condition: "Fix applied"
|
||||
- condition: Fix applied
|
||||
next: review
|
||||
|
||||
@ -6,10 +6,7 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 3
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
@ -21,7 +18,8 @@ movements:
|
||||
required_permission_mode: edit
|
||||
output_contracts:
|
||||
report:
|
||||
- Report: report.md
|
||||
- name: report.md
|
||||
format: report
|
||||
instruction_template: |
|
||||
{task}
|
||||
rules:
|
||||
|
||||
@ -6,10 +6,7 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 5
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: true
|
||||
|
||||
@ -6,10 +6,7 @@ piece_config:
|
||||
network_access: true
|
||||
opencode:
|
||||
network_access: true
|
||||
|
||||
|
||||
max_movements: 5
|
||||
|
||||
movements:
|
||||
- name: execute
|
||||
edit: false
|
||||
|
||||
@ -74,7 +74,7 @@ describe('emitMovementReports', () => {
|
||||
|
||||
it('should emit movement:report when output contract file exists', () => {
|
||||
// Given: a movement with output contract and the file exists
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md', format: 'plan', useJudge: true }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
@ -91,7 +91,7 @@ describe('emitMovementReports', () => {
|
||||
|
||||
it('should not emit when output contract file does not exist', () => {
|
||||
// Given: a movement with output contract but file doesn't exist
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'missing.md' }];
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'missing.md', format: 'missing', useJudge: true }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
const emitter = new EventEmitter();
|
||||
const handler = vi.fn();
|
||||
@ -106,7 +106,7 @@ describe('emitMovementReports', () => {
|
||||
|
||||
it('should emit movement:report when OutputContractItem file exists', () => {
|
||||
// Given: a movement with OutputContractItem and the file exists
|
||||
const outputContracts: OutputContractEntry[] = [{ name: '03-review.md', format: '# Review' }];
|
||||
const outputContracts: OutputContractEntry[] = [{ name: '03-review.md', format: '# Review', useJudge: true }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, '03-review.md'), '# Review\nOK', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
@ -124,9 +124,9 @@ describe('emitMovementReports', () => {
|
||||
it('should emit for each existing file in output contracts array', () => {
|
||||
// Given: a movement with array output contracts, two files exist, one missing
|
||||
const outputContracts: OutputContractEntry[] = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.md' },
|
||||
{ label: 'Missing', path: '03-missing.md' },
|
||||
{ name: '01-scope.md', format: '01-scope', useJudge: true },
|
||||
{ name: '02-decisions.md', format: '02-decisions', useJudge: true },
|
||||
{ name: '03-missing.md', format: '03-missing', useJudge: true },
|
||||
];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, '01-scope.md'), '# Scope', 'utf-8');
|
||||
@ -160,7 +160,7 @@ describe('emitMovementReports', () => {
|
||||
|
||||
it('should not emit when reportDir is empty', () => {
|
||||
// Given: a movement with output contracts but empty reportDir
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md' }];
|
||||
const outputContracts: OutputContractEntry[] = [{ name: 'plan.md', format: 'plan', useJudge: true }];
|
||||
const movement = createMovement({ outputContracts });
|
||||
writeFileSync(join(reportBaseDir, 'plan.md'), '# Plan', 'utf-8');
|
||||
const emitter = new EventEmitter();
|
||||
|
||||
@ -68,7 +68,7 @@ function buildSimpleConfig(): PieceConfig {
|
||||
initialMovement: 'review',
|
||||
movements: [
|
||||
makeMovement('review', {
|
||||
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||
outputContracts: [{ name: '00-review.md', format: '00-review', useJudge: true }],
|
||||
rules: [
|
||||
makeRule('approved', 'COMPLETE'),
|
||||
],
|
||||
@ -138,7 +138,7 @@ describe('PieceEngine: worktree reportDir resolution', () => {
|
||||
movements: [
|
||||
makeMovement('review', {
|
||||
instructionTemplate: 'Write report to {report_dir}',
|
||||
outputContracts: [{ label: 'review', path: '00-review.md' }],
|
||||
outputContracts: [{ name: '00-review.md', format: '00-review', useJudge: true }],
|
||||
rules: [
|
||||
makeRule('approved', 'COMPLETE'),
|
||||
],
|
||||
|
||||
@ -15,29 +15,29 @@ import { makeMovement, makeInstructionContext } from './test-helpers.js';
|
||||
|
||||
describe('isOutputContractItem', () => {
|
||||
it('should return true for OutputContractItem (has name)', () => {
|
||||
expect(isOutputContractItem({ name: 'report.md' })).toBe(true);
|
||||
expect(isOutputContractItem({ name: 'report.md', format: 'report', useJudge: true })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for OutputContractItem with order/format', () => {
|
||||
expect(isOutputContractItem({ name: 'report.md', order: 'Output to file', format: 'markdown' })).toBe(true);
|
||||
expect(isOutputContractItem({ name: 'report.md', order: 'Output to file', format: 'markdown', useJudge: true })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for OutputContractLabelPath (has label and path)', () => {
|
||||
expect(isOutputContractItem({ label: 'Report', path: 'report.md' })).toBe(false);
|
||||
it('should return false when name is missing', () => {
|
||||
expect(isOutputContractItem({ format: 'report', useJudge: true })).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('renderReportContext', () => {
|
||||
it('should render single OutputContractItem', () => {
|
||||
const contracts: OutputContractEntry[] = [{ name: '00-plan.md' }];
|
||||
const contracts: OutputContractEntry[] = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const result = renderReportContext(contracts, '/tmp/reports');
|
||||
|
||||
expect(result).toContain('Report Directory: /tmp/reports/');
|
||||
expect(result).toContain('Report File: /tmp/reports/00-plan.md');
|
||||
});
|
||||
|
||||
it('should render single OutputContractLabelPath', () => {
|
||||
const contracts: OutputContractEntry[] = [{ label: 'Plan', path: 'plan.md' }];
|
||||
it('should render single OutputContractItem by name', () => {
|
||||
const contracts: OutputContractEntry[] = [{ name: 'plan.md', format: 'plan', useJudge: true }];
|
||||
const result = renderReportContext(contracts, '/tmp/reports');
|
||||
|
||||
expect(result).toContain('Report Directory: /tmp/reports/');
|
||||
@ -46,15 +46,15 @@ describe('renderReportContext', () => {
|
||||
|
||||
it('should render multiple contracts as list', () => {
|
||||
const contracts: OutputContractEntry[] = [
|
||||
{ name: '00-plan.md' },
|
||||
{ label: 'Review', path: '01-review.md' },
|
||||
{ name: '00-plan.md', format: '00-plan', useJudge: true },
|
||||
{ name: '01-review.md', format: '01-review', useJudge: true },
|
||||
];
|
||||
const result = renderReportContext(contracts, '/tmp/reports');
|
||||
|
||||
expect(result).toContain('Report Directory: /tmp/reports/');
|
||||
expect(result).toContain('Report Files:');
|
||||
expect(result).toContain('00-plan.md: /tmp/reports/00-plan.md');
|
||||
expect(result).toContain('Review: /tmp/reports/01-review.md');
|
||||
expect(result).toContain('01-review.md: /tmp/reports/01-review.md');
|
||||
});
|
||||
});
|
||||
|
||||
@ -66,13 +66,13 @@ describe('renderReportOutputInstruction', () => {
|
||||
});
|
||||
|
||||
it('should return empty string when no reportDir', () => {
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md' }] });
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md', format: 'report', useJudge: true }] });
|
||||
const ctx = makeInstructionContext();
|
||||
expect(renderReportOutputInstruction(step, ctx, 'en')).toBe('');
|
||||
});
|
||||
|
||||
it('should render English single-file instruction', () => {
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md' }] });
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md', format: 'report', useJudge: true }] });
|
||||
const ctx = makeInstructionContext({ reportDir: '/tmp/reports', movementIteration: 2 });
|
||||
|
||||
const result = renderReportOutputInstruction(step, ctx, 'en');
|
||||
@ -83,7 +83,7 @@ describe('renderReportOutputInstruction', () => {
|
||||
|
||||
it('should render English multi-file instruction', () => {
|
||||
const step = makeMovement({
|
||||
outputContracts: [{ name: 'plan.md' }, { name: 'review.md' }],
|
||||
outputContracts: [{ name: 'plan.md', format: 'plan', useJudge: true }, { name: 'review.md', format: 'review', useJudge: true }],
|
||||
});
|
||||
const ctx = makeInstructionContext({ reportDir: '/tmp/reports' });
|
||||
|
||||
@ -92,7 +92,7 @@ describe('renderReportOutputInstruction', () => {
|
||||
});
|
||||
|
||||
it('should render Japanese single-file instruction', () => {
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md' }] });
|
||||
const step = makeMovement({ outputContracts: [{ name: 'report.md', format: 'report', useJudge: true }] });
|
||||
const ctx = makeInstructionContext({ reportDir: '/tmp/reports', movementIteration: 1 });
|
||||
|
||||
const result = renderReportOutputInstruction(step, ctx, 'ja');
|
||||
@ -103,7 +103,7 @@ describe('renderReportOutputInstruction', () => {
|
||||
|
||||
it('should render Japanese multi-file instruction', () => {
|
||||
const step = makeMovement({
|
||||
outputContracts: [{ name: 'plan.md' }, { name: 'review.md' }],
|
||||
outputContracts: [{ name: 'plan.md', format: 'plan', useJudge: true }, { name: 'review.md', format: 'review', useJudge: true }],
|
||||
});
|
||||
const ctx = makeInstructionContext({ reportDir: '/tmp/reports' });
|
||||
|
||||
|
||||
@ -474,7 +474,7 @@ describe('instruction-builder', () => {
|
||||
it('should include report info in Phase 1 when step has report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.name = 'plan';
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/runs/20260129-test/reports',
|
||||
language: 'en',
|
||||
@ -491,8 +491,8 @@ describe('instruction-builder', () => {
|
||||
it('should include report info for OutputContractEntry[] in Phase 1', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.md' },
|
||||
{ name: '01-scope.md', format: '01-scope', useJudge: true },
|
||||
{ name: '02-decisions.md', format: '02-decisions', useJudge: true },
|
||||
];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/runs/20260129-test/reports',
|
||||
@ -508,7 +508,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include report info for OutputContractItem in Phase 1', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/runs/20260129-test/reports',
|
||||
language: 'en',
|
||||
@ -653,7 +653,7 @@ describe('instruction-builder', () => {
|
||||
describe('buildInstruction report-free (phase separation)', () => {
|
||||
it('should include Report Directory info but NOT report output instruction in Phase 1', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/runs/20260129-test/reports',
|
||||
language: 'en',
|
||||
@ -673,7 +673,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should NOT include output contract in buildInstruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '**Format:**\n# Plan' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '**Format:**\n# Plan', useJudge: true }];
|
||||
const context = createMinimalContext({
|
||||
reportDir: '/project/.takt/runs/20260129-test/reports',
|
||||
language: 'en',
|
||||
@ -727,7 +727,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include execution context with working directory', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext({ cwd: '/my/project' });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -737,7 +737,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include no-source-edit rule in execution rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -747,7 +747,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include no-commit and no-cd rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -758,7 +758,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include report directory and file for string report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext({ reportDir: '/project/.takt/runs/20260130-test/reports' });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -770,8 +770,8 @@ describe('instruction-builder', () => {
|
||||
it('should include report files for OutputContractEntry[] report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.md' },
|
||||
{ name: '01-scope.md', format: '01-scope', useJudge: true },
|
||||
{ name: '02-decisions.md', format: '02-decisions', useJudge: true },
|
||||
];
|
||||
const ctx = createReportContext();
|
||||
|
||||
@ -779,13 +779,13 @@ describe('instruction-builder', () => {
|
||||
|
||||
expect(result).toContain('- Report Directory: /project/.takt/runs/20260129-test/reports/');
|
||||
expect(result).toContain('- Report Files:');
|
||||
expect(result).toContain(' - Scope: /project/.takt/runs/20260129-test/reports/01-scope.md');
|
||||
expect(result).toContain(' - Decisions: /project/.takt/runs/20260129-test/reports/02-decisions.md');
|
||||
expect(result).toContain(' - 01-scope.md: /project/.takt/runs/20260129-test/reports/01-scope.md');
|
||||
expect(result).toContain(' - 02-decisions.md: /project/.takt/runs/20260129-test/reports/02-decisions.md');
|
||||
});
|
||||
|
||||
it('should include report file for OutputContractItem report', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -795,7 +795,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include auto-generated report output instruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -810,6 +810,8 @@ describe('instruction-builder', () => {
|
||||
step.outputContracts = [{
|
||||
name: '00-plan.md',
|
||||
order: 'Output to {report:00-plan.md} file.',
|
||||
format: '00-plan',
|
||||
useJudge: true,
|
||||
}];
|
||||
const ctx = createReportContext();
|
||||
|
||||
@ -824,6 +826,7 @@ describe('instruction-builder', () => {
|
||||
step.outputContracts = [{
|
||||
name: '00-plan.md',
|
||||
format: '**Format:**\n```markdown\n# Plan\n```',
|
||||
useJudge: true,
|
||||
}];
|
||||
const ctx = createReportContext();
|
||||
|
||||
@ -835,7 +838,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include overwrite-and-archive rule in report output instruction', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext({ movementIteration: 5 });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -845,7 +848,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should include instruction body text', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext();
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -856,7 +859,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should NOT include user request, previous response, or status rules', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
step.rules = [
|
||||
{ condition: 'Done', next: 'COMPLETE' },
|
||||
];
|
||||
@ -872,7 +875,7 @@ describe('instruction-builder', () => {
|
||||
|
||||
it('should render Japanese report instruction', () => {
|
||||
const step = createMinimalStep('作業する');
|
||||
step.outputContracts = [{ name: '00-plan.md' }];
|
||||
step.outputContracts = [{ name: '00-plan.md', format: '00-plan', useJudge: true }];
|
||||
const ctx = createReportContext({ language: 'ja' });
|
||||
|
||||
const result = buildReportInstruction(step, ctx);
|
||||
@ -892,8 +895,8 @@ describe('instruction-builder', () => {
|
||||
it('should include multi-file report output instruction for OutputContractEntry[]', () => {
|
||||
const step = createMinimalStep('Do work');
|
||||
step.outputContracts = [
|
||||
{ label: 'Scope', path: '01-scope.md' },
|
||||
{ label: 'Decisions', path: '02-decisions.md' },
|
||||
{ name: '01-scope.md', format: '01-scope', useJudge: true },
|
||||
{ name: '02-decisions.md', format: '02-decisions', useJudge: true },
|
||||
];
|
||||
const ctx = createReportContext();
|
||||
|
||||
@ -1144,15 +1147,15 @@ describe('instruction-builder', () => {
|
||||
|
||||
describe('isOutputContractItem', () => {
|
||||
it('should return true for OutputContractItem', () => {
|
||||
expect(isOutputContractItem({ name: '00-plan.md' })).toBe(true);
|
||||
expect(isOutputContractItem({ name: '00-plan.md', format: '00-plan', useJudge: true })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return true for OutputContractItem with order/format', () => {
|
||||
expect(isOutputContractItem({ name: '00-plan.md', order: 'output to...', format: '# Plan' })).toBe(true);
|
||||
});
|
||||
|
||||
it('should return false for OutputContractLabelPath', () => {
|
||||
expect(isOutputContractItem({ label: 'Scope', path: '01-scope.md' })).toBe(false);
|
||||
it('should return false when name is missing', () => {
|
||||
expect(isOutputContractItem({ format: '01-scope', useJudge: true })).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -281,7 +281,7 @@ describe('Instruction Builder IT: buildReportInstruction', () => {
|
||||
it('should build report instruction with report context', () => {
|
||||
const step = makeMovement({
|
||||
name: 'plan',
|
||||
outputContracts: [{ name: '00-plan.md', format: '# Plan\n{movement_iteration}' }],
|
||||
outputContracts: [{ name: '00-plan.md', format: '# Plan\n{movement_iteration}', useJudge: true }],
|
||||
});
|
||||
|
||||
const result = buildReportInstruction(step, {
|
||||
|
||||
@ -188,7 +188,7 @@ describe('Three-Phase Execution IT: phase1 + phase2 (report defined)', () => {
|
||||
makeMovement('step', agentPath, [
|
||||
makeRule('Done', 'COMPLETE'),
|
||||
makeRule('Not done', 'ABORT'),
|
||||
], { outputContracts: [{ label: 'test', path: 'test-report.md' }] }),
|
||||
], { outputContracts: [{ name: 'test-report.md', format: 'test-report', useJudge: true }] }),
|
||||
],
|
||||
};
|
||||
|
||||
@ -217,7 +217,7 @@ describe('Three-Phase Execution IT: phase1 + phase2 (report defined)', () => {
|
||||
movements: [
|
||||
makeMovement('step', agentPath, [
|
||||
makeRule('Done', 'COMPLETE'),
|
||||
], { outputContracts: [{ label: 'Scope', path: 'scope.md' }, { label: 'Decisions', path: 'decisions.md' }] }),
|
||||
], { outputContracts: [{ name: 'scope.md', format: 'scope', useJudge: true }, { name: 'decisions.md', format: 'decisions', useJudge: true }] }),
|
||||
],
|
||||
};
|
||||
|
||||
@ -320,7 +320,7 @@ describe('Three-Phase Execution IT: all three phases', () => {
|
||||
makeMovement('step', agentPath, [
|
||||
makeRule('Done', 'COMPLETE'),
|
||||
makeRule('Not done', 'ABORT'),
|
||||
], { outputContracts: [{ label: 'test', path: 'test-report.md' }] }),
|
||||
], { outputContracts: [{ name: 'test-report.md', format: 'test-report', useJudge: true }] }),
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@ -560,6 +560,7 @@ describe('section reference resolution', () => {
|
||||
report: [{
|
||||
name: '00-plan.md',
|
||||
format: 'plan',
|
||||
use_judge: true,
|
||||
}],
|
||||
},
|
||||
}],
|
||||
|
||||
@ -235,7 +235,7 @@ describe('pr-comment instruction_template contains piece-specific procedures', (
|
||||
expect(template).toContain('01-architect-review.md');
|
||||
expect(template).toContain('02-security-review.md');
|
||||
expect(template).toContain('03-ai-review.md');
|
||||
expect(template).toContain('04-review-summary.md');
|
||||
expect(template).toContain('review-summary.md');
|
||||
});
|
||||
|
||||
it('JA: should reference specific report files', () => {
|
||||
@ -245,6 +245,6 @@ describe('pr-comment instruction_template contains piece-specific procedures', (
|
||||
expect(template).toContain('01-architect-review.md');
|
||||
expect(template).toContain('02-security-review.md');
|
||||
expect(template).toContain('03-ai-review.md');
|
||||
expect(template).toContain('04-review-summary.md');
|
||||
expect(template).toContain('review-summary.md');
|
||||
});
|
||||
});
|
||||
|
||||
@ -131,24 +131,24 @@ describe('getReportFiles', () => {
|
||||
|
||||
it('should extract name from OutputContractItem entries', () => {
|
||||
const contracts: OutputContractEntry[] = [
|
||||
{ name: '00-plan.md' },
|
||||
{ name: '01-review.md' },
|
||||
{ name: '00-plan.md', format: '00-plan', useJudge: true },
|
||||
{ name: '01-review.md', format: '01-review', useJudge: true },
|
||||
];
|
||||
expect(getReportFiles(contracts)).toEqual(['00-plan.md', '01-review.md']);
|
||||
});
|
||||
|
||||
it('should extract path from OutputContractLabelPath entries', () => {
|
||||
const contracts: OutputContractEntry[] = [
|
||||
{ label: 'Scope', path: 'scope.md' },
|
||||
{ label: 'Decisions', path: 'decisions.md' },
|
||||
{ name: 'scope.md', format: 'scope', useJudge: true },
|
||||
{ name: 'decisions.md', format: 'decisions', useJudge: true },
|
||||
];
|
||||
expect(getReportFiles(contracts)).toEqual(['scope.md', 'decisions.md']);
|
||||
});
|
||||
|
||||
it('should handle mixed entry types', () => {
|
||||
const contracts: OutputContractEntry[] = [
|
||||
{ name: '00-plan.md' },
|
||||
{ label: 'Review', path: 'review.md' },
|
||||
{ name: '00-plan.md', format: '00-plan', useJudge: true },
|
||||
{ name: 'review.md', format: 'review', useJudge: true },
|
||||
];
|
||||
expect(getReportFiles(contracts)).toEqual(['00-plan.md', 'review.md']);
|
||||
});
|
||||
|
||||
@ -52,7 +52,7 @@ describe('prepareRuntimeEnvironment', () => {
|
||||
expect(result).toBeDefined();
|
||||
expect(result?.prepare).toEqual(['gradle', 'node']);
|
||||
|
||||
const runtimeRoot = join(cwd, '.runtime');
|
||||
const runtimeRoot = join(cwd, '.takt', '.runtime');
|
||||
expect(existsSync(runtimeRoot)).toBe(true);
|
||||
expect(existsSync(join(runtimeRoot, 'tmp'))).toBe(true);
|
||||
expect(existsSync(join(runtimeRoot, 'cache'))).toBe(true);
|
||||
@ -89,8 +89,8 @@ describe('prepareRuntimeEnvironment', () => {
|
||||
});
|
||||
|
||||
expect(result).toBeDefined();
|
||||
expect(result?.injectedEnv.CUSTOM_CACHE_DIR).toBe(join(cwd, '.runtime', 'custom-cache'));
|
||||
expect(existsSync(join(cwd, '.runtime', 'custom-cache'))).toBe(true);
|
||||
expect(result?.injectedEnv.CUSTOM_CACHE_DIR).toBe(join(cwd, '.takt', '.runtime', 'custom-cache'));
|
||||
expect(existsSync(join(cwd, '.takt', '.runtime', 'custom-cache'))).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ export type {
|
||||
Status,
|
||||
RuleMatchMethod,
|
||||
PermissionMode,
|
||||
OutputContractLabelPath,
|
||||
OutputContractItem,
|
||||
OutputContractEntry,
|
||||
McpServerConfig,
|
||||
|
||||
@ -34,26 +34,20 @@ export interface PieceRule {
|
||||
aggregateConditionText?: string | string[];
|
||||
}
|
||||
|
||||
/** Output contract configuration (label: path pair format) */
|
||||
export interface OutputContractLabelPath {
|
||||
/** Display label (e.g., "Scope", "Decisions") */
|
||||
label: string;
|
||||
/** File path relative to report directory (e.g., "01-coder-scope.md") */
|
||||
path: string;
|
||||
}
|
||||
|
||||
/** Output contract item configuration with order/format instructions */
|
||||
export interface OutputContractItem {
|
||||
/** Report file name (e.g., "00-plan.md") */
|
||||
name: string;
|
||||
/** Output format template key or inline format content */
|
||||
format: string;
|
||||
/** Whether this report is used as input for status judgment phase (default: true) */
|
||||
useJudge?: boolean;
|
||||
/** Instruction prepended before instruction_template (e.g., output destination) */
|
||||
order?: string;
|
||||
/** Instruction appended after instruction_template (e.g., output format) - resolved from report_formats */
|
||||
format?: string;
|
||||
}
|
||||
|
||||
/** Union type for output contract entries */
|
||||
export type OutputContractEntry = OutputContractLabelPath | OutputContractItem;
|
||||
/** Output contract entry */
|
||||
export type OutputContractEntry = OutputContractItem;
|
||||
|
||||
/** MCP server configuration for stdio transport */
|
||||
export interface McpStdioServerConfig {
|
||||
|
||||
@ -119,52 +119,35 @@ export const PieceProviderOptionsSchema = z.object({
|
||||
*
|
||||
* YAML format:
|
||||
* output_contracts:
|
||||
* report:
|
||||
* - name: 00-plan.md
|
||||
* order: |
|
||||
* **レポート出力:** {report:00-plan.md} に出力してください。
|
||||
* format: |
|
||||
* **出力契約:**
|
||||
* ```markdown
|
||||
* ...
|
||||
* ```
|
||||
* format: plan
|
||||
* use_judge: true
|
||||
*/
|
||||
export const OutputContractItemSchema = z.object({
|
||||
/** Report file name */
|
||||
name: z.string().min(1),
|
||||
/** Instruction appended after instruction_template (e.g., output format) */
|
||||
format: z.string().min(1),
|
||||
/** Whether this report is used as input for status judgment phase */
|
||||
use_judge: z.boolean().optional().default(true),
|
||||
/** Instruction prepended before instruction_template (e.g., output destination) */
|
||||
order: z.string().optional(),
|
||||
/** Instruction appended after instruction_template (e.g., output format) */
|
||||
format: z.string().optional(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Raw output contract entry — array item in output_contracts.report
|
||||
*
|
||||
* Supports:
|
||||
* - Label:path format: { Scope: "01-scope.md" }
|
||||
* - Item format: { name, order?, format? }
|
||||
*/
|
||||
export const OutputContractEntrySchema = z.union([
|
||||
z.record(z.string(), z.string()), // {Scope: "01-scope.md"} format
|
||||
OutputContractItemSchema, // {name, order?, format?} format
|
||||
]);
|
||||
|
||||
/**
|
||||
* Output contracts field schema for movement-level definition.
|
||||
*
|
||||
* YAML format:
|
||||
* output_contracts:
|
||||
* report: # report array (required if output_contracts is specified)
|
||||
* - Scope: 01-scope.md # label:path format
|
||||
* - Decisions: 02-decisions.md
|
||||
* output_contracts:
|
||||
* report:
|
||||
* - name: 00-plan.md # name + order + format format
|
||||
* - name: 00-plan.md
|
||||
* order: ...
|
||||
* format: plan
|
||||
* use_judge: true
|
||||
*/
|
||||
export const OutputContractsFieldSchema = z.object({
|
||||
report: z.array(OutputContractEntrySchema).optional(),
|
||||
report: z.array(OutputContractItemSchema).optional(),
|
||||
}).optional();
|
||||
|
||||
/** Quality gates schema - AI directives for movement completion (string array) */
|
||||
|
||||
@ -33,7 +33,6 @@ export type {
|
||||
// Piece configuration and runtime state
|
||||
export type {
|
||||
PieceRule,
|
||||
OutputContractLabelPath,
|
||||
OutputContractItem,
|
||||
OutputContractEntry,
|
||||
McpServerConfig,
|
||||
|
||||
@ -16,7 +16,7 @@ import type {
|
||||
} from '../../models/types.js';
|
||||
import type { PhaseName } from '../types.js';
|
||||
import { executeAgent } from '../agent-usecases.js';
|
||||
import { InstructionBuilder, isOutputContractItem } from '../instruction/InstructionBuilder.js';
|
||||
import { InstructionBuilder } from '../instruction/InstructionBuilder.js';
|
||||
import { needsStatusJudgmentPhase, runReportPhase, runStatusJudgmentPhase } from '../phase-runner.js';
|
||||
import { detectMatchedRule } from '../evaluation/index.js';
|
||||
import { buildSessionKey } from '../session-key.js';
|
||||
@ -257,7 +257,7 @@ export class MovementExecutor {
|
||||
const baseDir = join(this.deps.getCwd(), this.deps.getReportDir());
|
||||
|
||||
for (const entry of step.outputContracts) {
|
||||
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||
const fileName = entry.name;
|
||||
this.checkReportFile(step, baseDir, fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
*/
|
||||
|
||||
import type { PieceMovement, OutputContractEntry } from '../../models/types.js';
|
||||
import { isOutputContractItem } from '../instruction/InstructionBuilder.js';
|
||||
|
||||
/**
|
||||
* Check whether a movement has tag-based rules (i.e., rules that require
|
||||
@ -42,8 +41,15 @@ export function getAutoSelectedTag(step: PieceMovement): string {
|
||||
*/
|
||||
export function getReportFiles(outputContracts: OutputContractEntry[] | undefined): string[] {
|
||||
if (!outputContracts || outputContracts.length === 0) return [];
|
||||
return outputContracts.map((entry) => {
|
||||
if (isOutputContractItem(entry)) return entry.name;
|
||||
return entry.path;
|
||||
});
|
||||
return outputContracts.map((entry) => entry.name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get report file names that are eligible for Phase 3 status judgment.
|
||||
*/
|
||||
export function getJudgmentReportFiles(outputContracts: OutputContractEntry[] | undefined): string[] {
|
||||
if (!outputContracts || outputContracts.length === 0) return [];
|
||||
return outputContracts
|
||||
.filter((entry) => entry.useJudge !== false)
|
||||
.map((entry) => entry.name);
|
||||
}
|
||||
|
||||
@ -267,16 +267,12 @@ export function renderReportContext(
|
||||
|
||||
if (outputContracts.length === 1) {
|
||||
const entry = outputContracts[0]!;
|
||||
const fileName = isOutputContractItem(entry) ? entry.name : entry.path;
|
||||
const fileName = entry.name;
|
||||
lines.push(`- ${reportFile}: ${reportDir}/${fileName}`);
|
||||
} else {
|
||||
lines.push(`- ${reportFiles}:`);
|
||||
for (const entry of outputContracts) {
|
||||
if (isOutputContractItem(entry)) {
|
||||
lines.push(` - ${entry.name}: ${reportDir}/${entry.name}`);
|
||||
} else {
|
||||
lines.push(` - ${entry.label}: ${reportDir}/${entry.path}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -68,9 +68,12 @@ export class ReportInstructionBuilder {
|
||||
language,
|
||||
};
|
||||
|
||||
const firstContract = this.step.outputContracts[0];
|
||||
if (firstContract && isOutputContractItem(firstContract) && firstContract.order) {
|
||||
reportOutput = replaceTemplatePlaceholders(firstContract.order.trimEnd(), this.step, instrContext);
|
||||
const targetContract = this.context.targetFile
|
||||
? this.step.outputContracts.find((entry) => entry.name === this.context.targetFile)
|
||||
: this.step.outputContracts[0];
|
||||
|
||||
if (targetContract && isOutputContractItem(targetContract) && targetContract.order) {
|
||||
reportOutput = replaceTemplatePlaceholders(targetContract.order.trimEnd(), this.step, instrContext);
|
||||
hasReportOutput = true;
|
||||
} else if (!this.context.targetFile) {
|
||||
const output = renderReportOutputInstruction(this.step, instrContext, language);
|
||||
@ -82,8 +85,8 @@ export class ReportInstructionBuilder {
|
||||
|
||||
let outputContract = '';
|
||||
let hasOutputContract = false;
|
||||
if (firstContract && isOutputContractItem(firstContract) && firstContract.format) {
|
||||
outputContract = replaceTemplatePlaceholders(firstContract.format.trimEnd(), this.step, instrContext);
|
||||
if (targetContract && isOutputContractItem(targetContract) && targetContract.format) {
|
||||
outputContract = replaceTemplatePlaceholders(targetContract.format.trimEnd(), this.step, instrContext);
|
||||
hasOutputContract = true;
|
||||
}
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ import { resolve } from 'node:path';
|
||||
import type { PieceMovement, RuleMatchMethod } from '../models/types.js';
|
||||
import { judgeStatus } from './agent-usecases.js';
|
||||
import { StatusJudgmentBuilder, type StatusJudgmentContext } from './instruction/StatusJudgmentBuilder.js';
|
||||
import { getReportFiles } from './evaluation/rule-utils.js';
|
||||
import { getJudgmentReportFiles } from './evaluation/rule-utils.js';
|
||||
import { createLogger } from '../../shared/utils/index.js';
|
||||
import type { PhaseRunnerContext } from './phase-runner.js';
|
||||
|
||||
@ -23,7 +23,7 @@ function buildBaseContext(
|
||||
step: PieceMovement,
|
||||
ctx: PhaseRunnerContext,
|
||||
): Omit<StatusJudgmentContext, 'structuredOutput'> | undefined {
|
||||
const reportFiles = getReportFiles(step.outputContracts);
|
||||
const reportFiles = getJudgmentReportFiles(step.outputContracts);
|
||||
|
||||
if (reportFiles.length > 0) {
|
||||
const reports: string[] = [];
|
||||
@ -41,6 +41,7 @@ function buildBaseContext(
|
||||
inputSource: 'report',
|
||||
};
|
||||
}
|
||||
throw new Error(`Status judgment requires existing use_judge reports for movement "${step.name}"`);
|
||||
}
|
||||
|
||||
if (!ctx.lastResponse) return undefined;
|
||||
|
||||
@ -188,7 +188,7 @@ export function prepareRuntimeEnvironment(
|
||||
}
|
||||
|
||||
const deduped = dedupePrepare(prepareEntries);
|
||||
const runtimeRoot = join(cwd, '.runtime');
|
||||
const runtimeRoot = join(cwd, '.takt', '.runtime');
|
||||
const envFile = join(runtimeRoot, 'env.sh');
|
||||
const injectedEnv = buildInjectedEnvironment(cwd, runtimeRoot, deduped);
|
||||
|
||||
|
||||
@ -10,7 +10,7 @@ import { dirname, resolve } from 'node:path';
|
||||
import { parse as parseYaml } from 'yaml';
|
||||
import type { z } from 'zod';
|
||||
import { PieceConfigRawSchema, PieceMovementRawSchema } from '../../../core/models/index.js';
|
||||
import type { PieceConfig, PieceMovement, PieceRule, OutputContractEntry, OutputContractLabelPath, OutputContractItem, LoopMonitorConfig, LoopMonitorJudge, ArpeggioMovementConfig, ArpeggioMergeMovementConfig, TeamLeaderConfig } from '../../../core/models/index.js';
|
||||
import type { PieceConfig, PieceMovement, PieceRule, OutputContractEntry, OutputContractItem, LoopMonitorConfig, LoopMonitorJudge, ArpeggioMovementConfig, ArpeggioMergeMovementConfig, TeamLeaderConfig } from '../../../core/models/index.js';
|
||||
import { getLanguage } from '../global/globalConfig.js';
|
||||
import {
|
||||
type PieceSections,
|
||||
@ -93,51 +93,47 @@ function normalizeRuntimeConfig(raw: RawPiece['piece_config']): PieceRuntimeConf
|
||||
};
|
||||
}
|
||||
|
||||
/** Check if a raw output contract item is the object form (has 'name' property). */
|
||||
function isOutputContractItem(raw: unknown): raw is { name: string; order?: string; format?: string } {
|
||||
return typeof raw === 'object' && raw !== null && !Array.isArray(raw) && 'name' in raw;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize the raw output_contracts field from YAML into internal format.
|
||||
*
|
||||
* Input format (YAML):
|
||||
* output_contracts:
|
||||
* report:
|
||||
* - Scope: 01-scope.md # label:path format
|
||||
* - name: 00-plan.md # item format
|
||||
* - name: 00-plan.md
|
||||
* format: plan
|
||||
* use_judge: true
|
||||
*
|
||||
* Output: OutputContractEntry[]
|
||||
*/
|
||||
function normalizeOutputContracts(
|
||||
raw: { report?: Array<Record<string, string> | { name: string; order?: string; format?: string }> } | undefined,
|
||||
raw: { report?: Array<{ name: string; format: string; use_judge?: boolean; order?: string }> } | undefined,
|
||||
pieceDir: string,
|
||||
resolvedReportFormats?: Record<string, string>,
|
||||
context?: FacetResolutionContext,
|
||||
): OutputContractEntry[] | undefined {
|
||||
if (raw?.report == null || raw.report.length === 0) return undefined;
|
||||
|
||||
const result: OutputContractEntry[] = [];
|
||||
const result: OutputContractItem[] = raw.report.map((entry) => {
|
||||
const resolvedFormat = resolveRefToContent(entry.format, resolvedReportFormats, pieceDir, 'output-contracts', context);
|
||||
if (!resolvedFormat) {
|
||||
throw new Error(`Failed to resolve output contract format "${entry.format}" for report "${entry.name}"`);
|
||||
}
|
||||
|
||||
for (const entry of raw.report) {
|
||||
if (isOutputContractItem(entry)) {
|
||||
// Item format: {name, order?, format?}
|
||||
const item: OutputContractItem = {
|
||||
let resolvedOrder: string | undefined;
|
||||
if (entry.order) {
|
||||
resolvedOrder = resolveRefToContent(entry.order, resolvedReportFormats, pieceDir, 'output-contracts', context);
|
||||
if (!resolvedOrder) {
|
||||
throw new Error(`Failed to resolve output contract order "${entry.order}" for report "${entry.name}"`);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
name: entry.name,
|
||||
order: entry.order ? resolveRefToContent(entry.order, resolvedReportFormats, pieceDir, 'output-contracts', context) : undefined,
|
||||
format: entry.format ? resolveRefToContent(entry.format, resolvedReportFormats, pieceDir, 'output-contracts', context) : undefined,
|
||||
useJudge: entry.use_judge ?? true,
|
||||
format: resolvedFormat,
|
||||
order: resolvedOrder,
|
||||
};
|
||||
result.push(item);
|
||||
} else {
|
||||
// Label:path format: {Scope: "01-scope.md"}
|
||||
for (const [label, path] of Object.entries(entry)) {
|
||||
const labelPath: OutputContractLabelPath = { label, path };
|
||||
result.push(labelPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
return result.length > 0 ? result : undefined;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user