From 2460dbdf61f1e1df04bc1aaa30fed71dc0a6cdfd Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sun, 15 Feb 2026 11:17:55 +0900 Subject: [PATCH 1/2] 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 --- builtins/en/output-contracts/ai-review.md | 26 ++++-- .../output-contracts/architecture-review.md | 30 ++++--- builtins/en/output-contracts/qa-review.md | 25 ++++-- .../en/output-contracts/review-summary.md | 23 ------ .../en/output-contracts/security-review.md | 26 ++++-- .../output-contracts/supervisor-validation.md | 36 +++++++++ builtins/en/output-contracts/validation.md | 22 ++++- builtins/en/pieces/backend-cqrs.yaml | 18 +++-- builtins/en/pieces/backend.yaml | 18 +++-- builtins/en/pieces/coding.yaml | 11 ++- builtins/en/pieces/compound-eye.yaml | 80 +++++++++++++++++-- builtins/en/pieces/default.yaml | 24 +++--- builtins/en/pieces/e2e-test.yaml | 24 +++--- builtins/en/pieces/expert-cqrs.yaml | 18 +++-- builtins/en/pieces/expert.yaml | 18 +++-- builtins/en/pieces/frontend.yaml | 18 +++-- builtins/en/pieces/magi.yaml | 1 - builtins/en/pieces/minimal.yaml | 16 ++-- builtins/en/pieces/passthrough.yaml | 5 +- builtins/en/pieces/research.yaml | 2 +- builtins/en/pieces/review-fix-minimal.yaml | 16 ++-- builtins/en/pieces/review-only.yaml | 46 ++++++++++- builtins/en/pieces/structural-reform.yaml | 71 +++++++++++++--- builtins/en/pieces/unit-test.yaml | 24 +++--- builtins/ja/output-contracts/ai-review.md | 26 ++++-- .../output-contracts/architecture-review.md | 30 ++++--- builtins/ja/output-contracts/qa-review.md | 25 ++++-- .../ja/output-contracts/review-summary.md | 23 ------ .../ja/output-contracts/security-review.md | 28 +++++-- .../output-contracts/supervisor-validation.md | 36 +++++++++ builtins/ja/output-contracts/validation.md | 22 ++++- builtins/ja/pieces/backend-cqrs.yaml | 18 +++-- builtins/ja/pieces/backend.yaml | 18 +++-- builtins/ja/pieces/coding.yaml | 11 ++- builtins/ja/pieces/compound-eye.yaml | 80 +++++++++++++++++-- builtins/ja/pieces/default.yaml | 24 +++--- builtins/ja/pieces/e2e-test.yaml | 24 +++--- builtins/ja/pieces/expert-cqrs.yaml | 18 +++-- builtins/ja/pieces/expert.yaml | 18 +++-- builtins/ja/pieces/frontend.yaml | 18 +++-- builtins/ja/pieces/magi.yaml | 1 - builtins/ja/pieces/minimal.yaml | 16 ++-- builtins/ja/pieces/passthrough.yaml | 5 +- builtins/ja/pieces/research.yaml | 2 +- builtins/ja/pieces/review-fix-minimal.yaml | 16 ++-- builtins/ja/pieces/review-only.yaml | 46 ++++++++++- builtins/ja/pieces/structural-reform.yaml | 71 +++++++++++++--- builtins/ja/pieces/unit-test.yaml | 24 +++--- e2e/fixtures/pieces/mock-cycle-detect.yaml | 9 +-- e2e/fixtures/pieces/mock-max-iter.yaml | 5 -- e2e/fixtures/pieces/mock-no-match.yaml | 3 - e2e/fixtures/pieces/mock-single-step.yaml | 3 - e2e/fixtures/pieces/mock-slow-multi-step.yaml | 11 --- e2e/fixtures/pieces/mock-two-step.yaml | 5 -- e2e/fixtures/pieces/multi-step-parallel.yaml | 10 +-- e2e/fixtures/pieces/report-judge.yaml | 6 +- e2e/fixtures/pieces/simple.yaml | 3 - e2e/fixtures/pieces/structured-output.yaml | 3 - src/__tests__/engine-report.test.ts | 14 ++-- src/__tests__/engine-worktree-report.test.ts | 4 +- src/__tests__/instruction-helpers.test.ts | 30 +++---- src/__tests__/instructionBuilder.test.ts | 53 ++++++------ src/__tests__/it-instruction-builder.test.ts | 2 +- .../it-three-phase-execution.test.ts | 6 +- src/__tests__/policy-persona.test.ts | 1 + src/__tests__/review-only-piece.test.ts | 4 +- src/__tests__/rule-utils.test.ts | 12 +-- src/__tests__/runtime-environment.test.ts | 6 +- src/core/models/index.ts | 1 - src/core/models/piece-types.ts | 18 ++--- src/core/models/schemas.ts | 39 +++------ src/core/models/types.ts | 1 - src/core/piece/engine/MovementExecutor.ts | 4 +- src/core/piece/evaluation/rule-utils.ts | 16 ++-- .../piece/instruction/InstructionBuilder.ts | 8 +- .../instruction/ReportInstructionBuilder.ts | 13 +-- src/core/piece/status-judgment-phase.ts | 5 +- src/core/runtime/runtime-environment.ts | 2 +- src/infra/config/loaders/pieceParser.ts | 46 +++++------ 79 files changed, 1014 insertions(+), 527 deletions(-) delete mode 100644 builtins/en/output-contracts/review-summary.md create mode 100644 builtins/en/output-contracts/supervisor-validation.md delete mode 100644 builtins/ja/output-contracts/review-summary.md create mode 100644 builtins/ja/output-contracts/supervisor-validation.md diff --git a/builtins/en/output-contracts/ai-review.md b/builtins/en/output-contracts/ai-review.md index 0591515..b515edd 100644 --- a/builtins/en/output-contracts/ai-review.md +++ b/builtins/en/output-contracts/ai-review.md @@ -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) diff --git a/builtins/en/output-contracts/architecture-review.md b/builtins/en/output-contracts/architecture-review.md index c2b3aa2..e972926 100644 --- a/builtins/en/output-contracts/architecture-review.md +++ b/builtins/en/output-contracts/architecture-review.md @@ -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) diff --git a/builtins/en/output-contracts/qa-review.md b/builtins/en/output-contracts/qa-review.md index d977b87..07cd488 100644 --- a/builtins/en/output-contracts/qa-review.md +++ b/builtins/en/output-contracts/qa-review.md @@ -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 ``` diff --git a/builtins/en/output-contracts/review-summary.md b/builtins/en/output-contracts/review-summary.md deleted file mode 100644 index bf354de..0000000 --- a/builtins/en/output-contracts/review-summary.md +++ /dev/null @@ -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} -``` diff --git a/builtins/en/output-contracts/security-review.md b/builtins/en/output-contracts/security-review.md index 7f24c6d..4015630 100644 --- a/builtins/en/output-contracts/security-review.md +++ b/builtins/en/output-contracts/security-review.md @@ -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) diff --git a/builtins/en/output-contracts/supervisor-validation.md b/builtins/en/output-contracts/supervisor-validation.md new file mode 100644 index 0000000..d84a19b --- /dev/null +++ b/builtins/en/output-contracts/supervisor-validation.md @@ -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 +``` diff --git a/builtins/en/output-contracts/validation.md b/builtins/en/output-contracts/validation.md index a55ebec..d84a19b 100644 --- a/builtins/en/output-contracts/validation.md +++ b/builtins/en/output-contracts/validation.md @@ -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 ``` diff --git a/builtins/en/pieces/backend-cqrs.yaml b/builtins/en/pieces/backend-cqrs.yaml index 7003e13..c933f11 100644 --- a/builtins/en/pieces/backend-cqrs.yaml +++ b/builtins/en/pieces/backend-cqrs.yaml @@ -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 diff --git a/builtins/en/pieces/backend.yaml b/builtins/en/pieces/backend.yaml index 9d60c30..3d50f0b 100644 --- a/builtins/en/pieces/backend.yaml +++ b/builtins/en/pieces/backend.yaml @@ -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 diff --git a/builtins/en/pieces/coding.yaml b/builtins/en/pieces/coding.yaml index bb82eb5..0688b44 100644 --- a/builtins/en/pieces/coding.yaml +++ b/builtins/en/pieces/coding.yaml @@ -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 diff --git a/builtins/en/pieces/compound-eye.yaml b/builtins/en/pieces/compound-eye.yaml index b1e65b6..5a223dd 100644 --- a/builtins/en/pieces/compound-eye.yaml +++ b/builtins/en/pieces/compound-eye.yaml @@ -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} + ``` diff --git a/builtins/en/pieces/default.yaml b/builtins/en/pieces/default.yaml index 93ce4af..77ad161 100644 --- a/builtins/en/pieces/default.yaml +++ b/builtins/en/pieces/default.yaml @@ -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 diff --git a/builtins/en/pieces/e2e-test.yaml b/builtins/en/pieces/e2e-test.yaml index 1c92646..65b42b0 100644 --- a/builtins/en/pieces/e2e-test.yaml +++ b/builtins/en/pieces/e2e-test.yaml @@ -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 diff --git a/builtins/en/pieces/expert-cqrs.yaml b/builtins/en/pieces/expert-cqrs.yaml index 301179f..2347dee 100644 --- a/builtins/en/pieces/expert-cqrs.yaml +++ b/builtins/en/pieces/expert-cqrs.yaml @@ -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 diff --git a/builtins/en/pieces/expert.yaml b/builtins/en/pieces/expert.yaml index 40c72c4..65d7fc0 100644 --- a/builtins/en/pieces/expert.yaml +++ b/builtins/en/pieces/expert.yaml @@ -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 diff --git a/builtins/en/pieces/frontend.yaml b/builtins/en/pieces/frontend.yaml index 7a3daaf..ace9b0f 100644 --- a/builtins/en/pieces/frontend.yaml +++ b/builtins/en/pieces/frontend.yaml @@ -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 diff --git a/builtins/en/pieces/magi.yaml b/builtins/en/pieces/magi.yaml index 7bb7d80..a58a3ed 100644 --- a/builtins/en/pieces/magi.yaml +++ b/builtins/en/pieces/magi.yaml @@ -6,7 +6,6 @@ piece_config: network_access: true opencode: network_access: true - max_movements: 5 initial_movement: melchior movements: diff --git a/builtins/en/pieces/minimal.yaml b/builtins/en/pieces/minimal.yaml index 214247b..e4e86b1 100644 --- a/builtins/en/pieces/minimal.yaml +++ b/builtins/en/pieces/minimal.yaml @@ -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 diff --git a/builtins/en/pieces/passthrough.yaml b/builtins/en/pieces/passthrough.yaml index a798695..bdc733b 100644 --- a/builtins/en/pieces/passthrough.yaml +++ b/builtins/en/pieces/passthrough.yaml @@ -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 diff --git a/builtins/en/pieces/research.yaml b/builtins/en/pieces/research.yaml index 0d9af43..73662e6 100644 --- a/builtins/en/pieces/research.yaml +++ b/builtins/en/pieces/research.yaml @@ -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 diff --git a/builtins/en/pieces/review-fix-minimal.yaml b/builtins/en/pieces/review-fix-minimal.yaml index e46f5c3..309638f 100644 --- a/builtins/en/pieces/review-fix-minimal.yaml +++ b/builtins/en/pieces/review-fix-minimal.yaml @@ -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 diff --git a/builtins/en/pieces/review-only.yaml b/builtins/en/pieces/review-only.yaml index a665b86..01ff36c 100644 --- a/builtins/en/pieces/review-only.yaml +++ b/builtins/en/pieces/review-only.yaml @@ -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 | diff --git a/builtins/en/pieces/structural-reform.yaml b/builtins/en/pieces/structural-reform.yaml index c0dacc9..2c6da4e 100644 --- a/builtins/en/pieces/structural-reform.yaml +++ b/builtins/en/pieces/structural-reform.yaml @@ -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} + ``` diff --git a/builtins/en/pieces/unit-test.yaml b/builtins/en/pieces/unit-test.yaml index 239937a..8c5be33 100644 --- a/builtins/en/pieces/unit-test.yaml +++ b/builtins/en/pieces/unit-test.yaml @@ -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 diff --git a/builtins/ja/output-contracts/ai-review.md b/builtins/ja/output-contracts/ai-review.md index 0d12934..3fbb746 100644 --- a/builtins/ja/output-contracts/ai-review.md +++ b/builtins/ja/output-contracts/ai-review.md @@ -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行以内) diff --git a/builtins/ja/output-contracts/architecture-review.md b/builtins/ja/output-contracts/architecture-review.md index d6429ae..487320c 100644 --- a/builtins/ja/output-contracts/architecture-review.md +++ b/builtins/ja/output-contracts/architecture-review.md @@ -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行以内) diff --git a/builtins/ja/output-contracts/qa-review.md b/builtins/ja/output-contracts/qa-review.md index 84dc0d1..67926f0 100644 --- a/builtins/ja/output-contracts/qa-review.md +++ b/builtins/ja/output-contracts/qa-review.md @@ -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` なしの指摘は無効 ``` diff --git a/builtins/ja/output-contracts/review-summary.md b/builtins/ja/output-contracts/review-summary.md deleted file mode 100644 index 051d62e..0000000 --- a/builtins/ja/output-contracts/review-summary.md +++ /dev/null @@ -1,23 +0,0 @@ -```markdown -# レビューサマリー - -## 総合判定: APPROVE / REJECT - -## サマリー -{2-3文で全レビュー結果を統合} - -## レビュー結果 -| レビュー | 結果 | 主要な発見 | -|---------|------|-----------| -| アーキテクチャ | APPROVE/REJECT | {概要} | -| セキュリティ | APPROVE/REJECT | {概要} | -| AIアンチパターン | APPROVE/REJECT | {概要} | - -## 要注意の問題 -| # | 重大度 | ソース | 場所 | 問題 | -|---|--------|--------|------|------| -| 1 | High | セキュリティ | `file:line` | 説明 | - -## 改善提案 -- {全レビューからの統合提案} -``` diff --git a/builtins/ja/output-contracts/security-review.md b/builtins/ja/output-contracts/security-review.md index 45a5acc..33548b5 100644 --- a/builtins/ja/output-contracts/security-review.md +++ b/builtins/ja/output-contracts/security-review.md @@ -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行以内) diff --git a/builtins/ja/output-contracts/supervisor-validation.md b/builtins/ja/output-contracts/supervisor-validation.md new file mode 100644 index 0000000..4fd1110 --- /dev/null +++ b/builtins/ja/output-contracts/supervisor-validation.md @@ -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` なしの指摘は無効 +``` diff --git a/builtins/ja/output-contracts/validation.md b/builtins/ja/output-contracts/validation.md index 49007cd..4fd1110 100644 --- a/builtins/ja/output-contracts/validation.md +++ b/builtins/ja/output-contracts/validation.md @@ -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` なしの指摘は無効 ``` diff --git a/builtins/ja/pieces/backend-cqrs.yaml b/builtins/ja/pieces/backend-cqrs.yaml index 50f3922..42574af 100644 --- a/builtins/ja/pieces/backend-cqrs.yaml +++ b/builtins/ja/pieces/backend-cqrs.yaml @@ -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 diff --git a/builtins/ja/pieces/backend.yaml b/builtins/ja/pieces/backend.yaml index c477b1c..fbad56b 100644 --- a/builtins/ja/pieces/backend.yaml +++ b/builtins/ja/pieces/backend.yaml @@ -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 diff --git a/builtins/ja/pieces/coding.yaml b/builtins/ja/pieces/coding.yaml index 8eb67e4..63eb435 100644 --- a/builtins/ja/pieces/coding.yaml +++ b/builtins/ja/pieces/coding.yaml @@ -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 diff --git a/builtins/ja/pieces/compound-eye.yaml b/builtins/ja/pieces/compound-eye.yaml index fd0f300..ad187d6 100644 --- a/builtins/ja/pieces/compound-eye.yaml +++ b/builtins/ja/pieces/compound-eye.yaml @@ -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のみが言及} + + ## 総合評価 + {両者を踏まえた総合評価} + ``` diff --git a/builtins/ja/pieces/default.yaml b/builtins/ja/pieces/default.yaml index dadee60..1c47f08 100644 --- a/builtins/ja/pieces/default.yaml +++ b/builtins/ja/pieces/default.yaml @@ -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 diff --git a/builtins/ja/pieces/e2e-test.yaml b/builtins/ja/pieces/e2e-test.yaml index 20521c5..cb17d69 100644 --- a/builtins/ja/pieces/e2e-test.yaml +++ b/builtins/ja/pieces/e2e-test.yaml @@ -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 diff --git a/builtins/ja/pieces/expert-cqrs.yaml b/builtins/ja/pieces/expert-cqrs.yaml index ebec536..186dec7 100644 --- a/builtins/ja/pieces/expert-cqrs.yaml +++ b/builtins/ja/pieces/expert-cqrs.yaml @@ -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 diff --git a/builtins/ja/pieces/expert.yaml b/builtins/ja/pieces/expert.yaml index e6384fd..a314d8f 100644 --- a/builtins/ja/pieces/expert.yaml +++ b/builtins/ja/pieces/expert.yaml @@ -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 diff --git a/builtins/ja/pieces/frontend.yaml b/builtins/ja/pieces/frontend.yaml index 4487814..5b6a458 100644 --- a/builtins/ja/pieces/frontend.yaml +++ b/builtins/ja/pieces/frontend.yaml @@ -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 diff --git a/builtins/ja/pieces/magi.yaml b/builtins/ja/pieces/magi.yaml index f722c3d..4ecced6 100644 --- a/builtins/ja/pieces/magi.yaml +++ b/builtins/ja/pieces/magi.yaml @@ -6,7 +6,6 @@ piece_config: network_access: true opencode: network_access: true - max_movements: 5 initial_movement: melchior movements: diff --git a/builtins/ja/pieces/minimal.yaml b/builtins/ja/pieces/minimal.yaml index eed090f..8a874d9 100644 --- a/builtins/ja/pieces/minimal.yaml +++ b/builtins/ja/pieces/minimal.yaml @@ -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 diff --git a/builtins/ja/pieces/passthrough.yaml b/builtins/ja/pieces/passthrough.yaml index 51bc4ff..962922a 100644 --- a/builtins/ja/pieces/passthrough.yaml +++ b/builtins/ja/pieces/passthrough.yaml @@ -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 diff --git a/builtins/ja/pieces/research.yaml b/builtins/ja/pieces/research.yaml index 708601c..005c0fd 100644 --- a/builtins/ja/pieces/research.yaml +++ b/builtins/ja/pieces/research.yaml @@ -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 diff --git a/builtins/ja/pieces/review-fix-minimal.yaml b/builtins/ja/pieces/review-fix-minimal.yaml index 4e8e301..9803ae7 100644 --- a/builtins/ja/pieces/review-fix-minimal.yaml +++ b/builtins/ja/pieces/review-fix-minimal.yaml @@ -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 diff --git a/builtins/ja/pieces/review-only.yaml b/builtins/ja/pieces/review-only.yaml index c9eeb06..cdd77be 100644 --- a/builtins/ja/pieces/review-only.yaml +++ b/builtins/ja/pieces/review-only.yaml @@ -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からの総合判定とサマリー} ### レビュー結果 | レビュー | 結果 | diff --git a/builtins/ja/pieces/structural-reform.yaml b/builtins/ja/pieces/structural-reform.yaml index 6c56aaf..dfb63f2 100644 --- a/builtins/ja/pieces/structural-reform.yaml +++ b/builtins/ja/pieces/structural-reform.yaml @@ -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} + ``` diff --git a/builtins/ja/pieces/unit-test.yaml b/builtins/ja/pieces/unit-test.yaml index e8b0710..356f690 100644 --- a/builtins/ja/pieces/unit-test.yaml +++ b/builtins/ja/pieces/unit-test.yaml @@ -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 diff --git a/e2e/fixtures/pieces/mock-cycle-detect.yaml b/e2e/fixtures/pieces/mock-cycle-detect.yaml index fce5766..30c1c78 100644 --- a/e2e/fixtures/pieces/mock-cycle-detect.yaml +++ b/e2e/fixtures/pieces/mock-cycle-detect.yaml @@ -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 diff --git a/e2e/fixtures/pieces/mock-max-iter.yaml b/e2e/fixtures/pieces/mock-max-iter.yaml index f97b7c2..11716e8 100644 --- a/e2e/fixtures/pieces/mock-max-iter.yaml +++ b/e2e/fixtures/pieces/mock-max-iter.yaml @@ -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 diff --git a/e2e/fixtures/pieces/mock-no-match.yaml b/e2e/fixtures/pieces/mock-no-match.yaml index 2334772..a7962e7 100644 --- a/e2e/fixtures/pieces/mock-no-match.yaml +++ b/e2e/fixtures/pieces/mock-no-match.yaml @@ -6,10 +6,7 @@ piece_config: network_access: true opencode: network_access: true - - max_movements: 3 - movements: - name: execute edit: true diff --git a/e2e/fixtures/pieces/mock-single-step.yaml b/e2e/fixtures/pieces/mock-single-step.yaml index 228bada..92fc443 100644 --- a/e2e/fixtures/pieces/mock-single-step.yaml +++ b/e2e/fixtures/pieces/mock-single-step.yaml @@ -6,10 +6,7 @@ piece_config: network_access: true opencode: network_access: true - - max_movements: 3 - movements: - name: execute edit: true diff --git a/e2e/fixtures/pieces/mock-slow-multi-step.yaml b/e2e/fixtures/pieces/mock-slow-multi-step.yaml index 0921826..bd57d45 100644 --- a/e2e/fixtures/pieces/mock-slow-multi-step.yaml +++ b/e2e/fixtures/pieces/mock-slow-multi-step.yaml @@ -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 diff --git a/e2e/fixtures/pieces/mock-two-step.yaml b/e2e/fixtures/pieces/mock-two-step.yaml index 8cdcd68..2395481 100644 --- a/e2e/fixtures/pieces/mock-two-step.yaml +++ b/e2e/fixtures/pieces/mock-two-step.yaml @@ -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 diff --git a/e2e/fixtures/pieces/multi-step-parallel.yaml b/e2e/fixtures/pieces/multi-step-parallel.yaml index e4238fc..d06b881 100644 --- a/e2e/fixtures/pieces/multi-step-parallel.yaml +++ b/e2e/fixtures/pieces/multi-step-parallel.yaml @@ -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 diff --git a/e2e/fixtures/pieces/report-judge.yaml b/e2e/fixtures/pieces/report-judge.yaml index 97ab923..2bea4f9 100644 --- a/e2e/fixtures/pieces/report-judge.yaml +++ b/e2e/fixtures/pieces/report-judge.yaml @@ -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: diff --git a/e2e/fixtures/pieces/simple.yaml b/e2e/fixtures/pieces/simple.yaml index 4b9a14c..50d4dcd 100644 --- a/e2e/fixtures/pieces/simple.yaml +++ b/e2e/fixtures/pieces/simple.yaml @@ -6,10 +6,7 @@ piece_config: network_access: true opencode: network_access: true - - max_movements: 5 - movements: - name: execute edit: true diff --git a/e2e/fixtures/pieces/structured-output.yaml b/e2e/fixtures/pieces/structured-output.yaml index 0bff372..6de27cd 100644 --- a/e2e/fixtures/pieces/structured-output.yaml +++ b/e2e/fixtures/pieces/structured-output.yaml @@ -6,10 +6,7 @@ piece_config: network_access: true opencode: network_access: true - - max_movements: 5 - movements: - name: execute edit: false diff --git a/src/__tests__/engine-report.test.ts b/src/__tests__/engine-report.test.ts index 5b81344..ad55b12 100644 --- a/src/__tests__/engine-report.test.ts +++ b/src/__tests__/engine-report.test.ts @@ -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(); diff --git a/src/__tests__/engine-worktree-report.test.ts b/src/__tests__/engine-worktree-report.test.ts index f90084f..3cc2a8d 100644 --- a/src/__tests__/engine-worktree-report.test.ts +++ b/src/__tests__/engine-worktree-report.test.ts @@ -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'), ], diff --git a/src/__tests__/instruction-helpers.test.ts b/src/__tests__/instruction-helpers.test.ts index dcb6c50..79c440f 100644 --- a/src/__tests__/instruction-helpers.test.ts +++ b/src/__tests__/instruction-helpers.test.ts @@ -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' }); diff --git a/src/__tests__/instructionBuilder.test.ts b/src/__tests__/instructionBuilder.test.ts index d5e0296..2e036fd 100644 --- a/src/__tests__/instructionBuilder.test.ts +++ b/src/__tests__/instructionBuilder.test.ts @@ -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); }); }); diff --git a/src/__tests__/it-instruction-builder.test.ts b/src/__tests__/it-instruction-builder.test.ts index dac6b25..e972a3d 100644 --- a/src/__tests__/it-instruction-builder.test.ts +++ b/src/__tests__/it-instruction-builder.test.ts @@ -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, { diff --git a/src/__tests__/it-three-phase-execution.test.ts b/src/__tests__/it-three-phase-execution.test.ts index d5b173e..82338a4 100644 --- a/src/__tests__/it-three-phase-execution.test.ts +++ b/src/__tests__/it-three-phase-execution.test.ts @@ -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 }] }), ], }; diff --git a/src/__tests__/policy-persona.test.ts b/src/__tests__/policy-persona.test.ts index 7fd2cf2..f841b2c 100644 --- a/src/__tests__/policy-persona.test.ts +++ b/src/__tests__/policy-persona.test.ts @@ -560,6 +560,7 @@ describe('section reference resolution', () => { report: [{ name: '00-plan.md', format: 'plan', + use_judge: true, }], }, }], diff --git a/src/__tests__/review-only-piece.test.ts b/src/__tests__/review-only-piece.test.ts index 74e891b..92ec975 100644 --- a/src/__tests__/review-only-piece.test.ts +++ b/src/__tests__/review-only-piece.test.ts @@ -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'); }); }); diff --git a/src/__tests__/rule-utils.test.ts b/src/__tests__/rule-utils.test.ts index 80e184b..e3c160f 100644 --- a/src/__tests__/rule-utils.test.ts +++ b/src/__tests__/rule-utils.test.ts @@ -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']); }); diff --git a/src/__tests__/runtime-environment.test.ts b/src/__tests__/runtime-environment.test.ts index 31d6290..885219d 100644 --- a/src/__tests__/runtime-environment.test.ts +++ b/src/__tests__/runtime-environment.test.ts @@ -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); }); }); diff --git a/src/core/models/index.ts b/src/core/models/index.ts index 49fca05..6014899 100644 --- a/src/core/models/index.ts +++ b/src/core/models/index.ts @@ -4,7 +4,6 @@ export type { Status, RuleMatchMethod, PermissionMode, - OutputContractLabelPath, OutputContractItem, OutputContractEntry, McpServerConfig, diff --git a/src/core/models/piece-types.ts b/src/core/models/piece-types.ts index 5cdee06..2ebd096 100644 --- a/src/core/models/piece-types.ts +++ b/src/core/models/piece-types.ts @@ -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 { diff --git a/src/core/models/schemas.ts b/src/core/models/schemas.ts index 1ec9a2a..db26d8f 100644 --- a/src/core/models/schemas.ts +++ b/src/core/models/schemas.ts @@ -119,52 +119,35 @@ export const PieceProviderOptionsSchema = z.object({ * * YAML format: * output_contracts: - * - name: 00-plan.md - * order: | - * **レポート出力:** {report:00-plan.md} に出力してください。 - * format: | - * **出力契約:** - * ```markdown - * ... - * ``` + * report: + * - name: 00-plan.md + * 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) */ diff --git a/src/core/models/types.ts b/src/core/models/types.ts index 872ab80..e3f64d4 100644 --- a/src/core/models/types.ts +++ b/src/core/models/types.ts @@ -33,7 +33,6 @@ export type { // Piece configuration and runtime state export type { PieceRule, - OutputContractLabelPath, OutputContractItem, OutputContractEntry, McpServerConfig, diff --git a/src/core/piece/engine/MovementExecutor.ts b/src/core/piece/engine/MovementExecutor.ts index 32a2b8a..a191a3d 100644 --- a/src/core/piece/engine/MovementExecutor.ts +++ b/src/core/piece/engine/MovementExecutor.ts @@ -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); } } diff --git a/src/core/piece/evaluation/rule-utils.ts b/src/core/piece/evaluation/rule-utils.ts index 94dd17d..4714748 100644 --- a/src/core/piece/evaluation/rule-utils.ts +++ b/src/core/piece/evaluation/rule-utils.ts @@ -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); } diff --git a/src/core/piece/instruction/InstructionBuilder.ts b/src/core/piece/instruction/InstructionBuilder.ts index 316ebd0..1c39df9 100644 --- a/src/core/piece/instruction/InstructionBuilder.ts +++ b/src/core/piece/instruction/InstructionBuilder.ts @@ -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}`); - } + lines.push(` - ${entry.name}: ${reportDir}/${entry.name}`); } } diff --git a/src/core/piece/instruction/ReportInstructionBuilder.ts b/src/core/piece/instruction/ReportInstructionBuilder.ts index 009822c..dd86d6e 100644 --- a/src/core/piece/instruction/ReportInstructionBuilder.ts +++ b/src/core/piece/instruction/ReportInstructionBuilder.ts @@ -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; } diff --git a/src/core/piece/status-judgment-phase.ts b/src/core/piece/status-judgment-phase.ts index 618de99..2821166 100644 --- a/src/core/piece/status-judgment-phase.ts +++ b/src/core/piece/status-judgment-phase.ts @@ -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 | 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; diff --git a/src/core/runtime/runtime-environment.ts b/src/core/runtime/runtime-environment.ts index b00bf93..88b1ca5 100644 --- a/src/core/runtime/runtime-environment.ts +++ b/src/core/runtime/runtime-environment.ts @@ -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); diff --git a/src/infra/config/loaders/pieceParser.ts b/src/infra/config/loaders/pieceParser.ts index 86d3fd6..cf39b40 100644 --- a/src/infra/config/loaders/pieceParser.ts +++ b/src/infra/config/loaders/pieceParser.ts @@ -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 | { name: string; order?: string; format?: string }> } | undefined, + raw: { report?: Array<{ name: string; format: string; use_judge?: boolean; order?: string }> } | undefined, pieceDir: string, resolvedReportFormats?: Record, 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 = { - 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, - }; - 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); + 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, + useJudge: entry.use_judge ?? true, + format: resolvedFormat, + order: resolvedOrder, + }; + }); return result.length > 0 ? result : undefined; } From 05b893f72081ac6c3d24f80f34698a5b3b220b72 Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sun, 15 Feb 2026 12:00:21 +0900 Subject: [PATCH 2/2] Release v0.17.0 --- CHANGELOG.md | 26 ++ README.md | 8 +- builtins/en/instructions/supervise.md | 20 +- .../output-contracts/supervisor-validation.md | 14 +- builtins/en/personas/supervisor.md | 6 +- builtins/en/piece-categories.yaml | 22 +- builtins/en/pieces/backend-cqrs-mini.yaml | 247 ++++++++++++++++++ builtins/en/pieces/backend-mini.yaml | 240 +++++++++++++++++ builtins/en/pieces/coding.yaml | 140 ---------- .../{minimal.yaml => default-mini.yaml} | 35 ++- builtins/en/pieces/frontend-mini.yaml | 240 +++++++++++++++++ builtins/ja/instructions/supervise.md | 20 +- .../output-contracts/supervisor-validation.md | 14 +- builtins/ja/personas/supervisor.md | 6 +- builtins/ja/piece-categories.yaml | 22 +- builtins/ja/pieces/backend-cqrs-mini.yaml | 247 ++++++++++++++++++ builtins/ja/pieces/backend-mini.yaml | 240 +++++++++++++++++ builtins/ja/pieces/coding.yaml | 140 ---------- .../{minimal.yaml => default-mini.yaml} | 35 ++- builtins/ja/pieces/frontend-mini.yaml | 240 +++++++++++++++++ docs/README.ja.md | 8 +- package-lock.json | 4 +- package.json | 2 +- src/__tests__/config.test.ts | 12 +- src/__tests__/it-piece-loader.test.ts | 10 +- src/__tests__/it-piece-patterns.test.ts | 14 +- src/__tests__/it-pipeline-modes.test.ts | 3 +- src/__tests__/it-pipeline.test.ts | 5 +- .../tasks/list/taskBranchLifecycleActions.ts | 2 +- src/infra/task/clone.ts | 2 +- 30 files changed, 1682 insertions(+), 342 deletions(-) create mode 100644 builtins/en/pieces/backend-cqrs-mini.yaml create mode 100644 builtins/en/pieces/backend-mini.yaml delete mode 100644 builtins/en/pieces/coding.yaml rename builtins/en/pieces/{minimal.yaml => default-mini.yaml} (83%) create mode 100644 builtins/en/pieces/frontend-mini.yaml create mode 100644 builtins/ja/pieces/backend-cqrs-mini.yaml create mode 100644 builtins/ja/pieces/backend-mini.yaml delete mode 100644 builtins/ja/pieces/coding.yaml rename builtins/ja/pieces/{minimal.yaml => default-mini.yaml} (84%) create mode 100644 builtins/ja/pieces/frontend-mini.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 8602f34..24cab3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,32 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [0.17.0] - 2026-02-15 + +### Added + +- **mini ピースシリーズ**: `default-mini`、`frontend-mini`、`backend-mini`、`backend-cqrs-mini` を追加 — `coding`/`minimal` の後継として、並列レビュー(AI アンチパターン+スーパーバイザー)付きの軽量開発ピースを提供 +- ピースカテゴリに「⚡ Mini」カテゴリを追加 +- `supervisor-validation` 出力契約を追加 — 要件充足チェックテーブル(Requirements Fulfillment Check)で要件ごとにコード根拠を提示する形式 +- `getJudgmentReportFiles()`: `use_judge` フラグにより Phase 3 ステータス判定の対象レポートをフィルタリング可能に +- Output contract に finding_id トラッキングを追加(new/persists/resolved セクションによる指摘の追跡) + +### Changed + +- **BREAKING: `coding` ピースと `minimal` ピースを削除** — mini ピースシリーズに置き換え。`coding` → `default-mini`、`minimal` → `default-mini` への移行を推奨 +- **BREAKING: Output contract を item 形式に統一** — `use_judge`(boolean)と `format`(string)フィールドを必須化し、`OutputContractLabelPath`(label:path 形式)を廃止 +- ランタイム環境ディレクトリを `.runtime` から `.takt/.runtime` に移動 +- スーパーバイザーの要件充足検証を強化: 要件を個別に抽出し、コード(file:line)に対して1件ずつ検証する方式に変更 — 「おおむね完了」は APPROVE の根拠にならない + +### Fixed + +- クローン/worktree ディレクトリの削除にリトライ機構を追加(`maxRetries: 3`, `retryDelay: 200`)— ファイルロックによる一時的な削除失敗を軽減 + +### Internal + +- `review-summary` 出力契約を削除(`supervisor-validation` に統合) +- 全ビルトインピース、e2e フィクスチャ、テストを output contract の新形式に更新 + ## [0.16.0] - 2026-02-15 ### Added diff --git a/README.md b/README.md index 449c89c..bfd9ae0 100644 --- a/README.md +++ b/README.md @@ -304,7 +304,7 @@ takt reset categories | Piece | Recommended Use | |----------|-----------------| | `default` | Serious development tasks. Used for TAKT's own development. Multi-stage review with parallel reviews (architect + security). | -| `minimal` | Simple fixes and straightforward tasks. Minimal piece with basic review. | +| `default-mini` | Simple fixes and straightforward tasks. Lightweight piece with AI antipattern review + supervisor. | | `review-fix-minimal` | Review & fix piece. Specialized for iterative improvement based on review feedback. | | `research` | Investigation and research. Autonomously executes research without asking questions. | @@ -460,13 +460,15 @@ TAKT includes multiple builtin pieces: | Piece | Description | |----------|-------------| | `default` | Full development piece: plan → implement → AI review → parallel review (architect + QA) → supervisor approval. Includes fix loops at each review stage. | -| `minimal` | Quick piece: plan → implement → review → supervisor. Minimal steps for fast iteration. | +| `default-mini` | Mini development piece: plan → implement → parallel review (AI antipattern + supervisor) → fix if needed. Lightweight with review. | +| `frontend-mini` | Mini frontend piece: plan → implement → parallel review (AI antipattern + supervisor) with frontend knowledge injection. | +| `backend-mini` | Mini backend piece: plan → implement → parallel review (AI antipattern + supervisor) with backend knowledge injection. | +| `backend-cqrs-mini` | Mini CQRS+ES piece: plan → implement → parallel review (AI antipattern + supervisor) with CQRS+ES knowledge injection. | | `review-fix-minimal` | Review-focused piece: review → fix → supervisor. For iterative improvement based on review feedback. | | `research` | Research piece: planner → digger → supervisor. Autonomously executes research without asking questions. | | `expert` | Full-stack development piece: architecture, frontend, security, QA reviews with fix loops. | | `expert-cqrs` | Full-stack development piece (CQRS+ES specialized): CQRS+ES, frontend, security, QA reviews with fix loops. | | `magi` | Deliberation system inspired by Evangelion. Three AI personas (MELCHIOR, BALTHASAR, CASPER) analyze and vote. | -| `coding` | Lightweight development piece: planner → implement → parallel review (AI antipattern + architecture) → fix. Fast feedback loop without supervisor. | | `passthrough` | Thinnest wrapper. Pass task directly to coder as-is. No review. | | `compound-eye` | Multi-model review: sends the same instruction to Claude and Codex simultaneously, then synthesizes both responses. | | `review-only` | Read-only code review piece that makes no changes. | diff --git a/builtins/en/instructions/supervise.md b/builtins/en/instructions/supervise.md index f5c5dcd..a7dda1d 100644 --- a/builtins/en/instructions/supervise.md +++ b/builtins/en/instructions/supervise.md @@ -4,7 +4,11 @@ Run tests, verify the build, and perform final approval. 1. Whether the plan and implementation results are consistent 2. Whether findings from each review movement have been addressed 3. Whether each task spec requirement has been achieved - - Do not rely on the plan report's judgment; independently verify each requirement against actual code (file:line) + - Extract requirements one by one from the task spec + - For each requirement, identify the implementing code (file:line) + - Verify the code actually fulfills the requirement (read the file, run the test) + - Do not rely on the plan report's judgment; independently verify each requirement + - If any requirement is unfulfilled, REJECT **Report verification:** Read all reports in the Report Directory and check for any unaddressed improvement suggestions. @@ -15,10 +19,22 @@ check for any unaddressed improvement suggestions. ## Result: APPROVE / REJECT +## Requirements Fulfillment Check + +Extract requirements from the task spec and verify each one individually against actual code. + +| # | Requirement (extracted from task spec) | Met | Evidence (file:line) | +|---|---------------------------------------|-----|---------------------| +| 1 | {requirement 1} | ✅/❌ | `src/file.ts:42` | +| 2 | {requirement 2} | ✅/❌ | `src/file.ts:55` | + +- If any ❌ exists, REJECT is mandatory +- ✅ without evidence is invalid (must verify against actual code) +- Do not rely on plan report's judgment; independently verify each requirement + ## Verification Summary | Item | Status | Verification method | |------|--------|-------------------| -| Requirements met | ✅ | Cross-checked with requirements list | | Tests | ✅ | `npm test` (N passed) | | Build | ✅ | `npm run build` succeeded | | Functional check | ✅ | Main flows verified | diff --git a/builtins/en/output-contracts/supervisor-validation.md b/builtins/en/output-contracts/supervisor-validation.md index d84a19b..5428760 100644 --- a/builtins/en/output-contracts/supervisor-validation.md +++ b/builtins/en/output-contracts/supervisor-validation.md @@ -3,10 +3,22 @@ ## Result: APPROVE / REJECT +## Requirements Fulfillment Check + +Extract requirements from the task spec and verify each one individually against actual code. + +| # | Requirement (extracted from task spec) | Met | Evidence (file:line) | +|---|---------------------------------------|-----|---------------------| +| 1 | {requirement 1} | ✅/❌ | `src/file.ts:42` | +| 2 | {requirement 2} | ✅/❌ | `src/file.ts:55` | + +- If any ❌ exists, REJECT is mandatory +- ✅ without evidence is invalid (must verify against actual code) +- Do not rely on plan report's judgment; independently verify each requirement + ## 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 | diff --git a/builtins/en/personas/supervisor.md b/builtins/en/personas/supervisor.md index 78c2b78..8e038b4 100644 --- a/builtins/en/personas/supervisor.md +++ b/builtins/en/personas/supervisor.md @@ -36,12 +36,12 @@ You are the **human proxy** in the automated piece. Before approval, verify the ## Verification Perspectives -### 1. Requirements Fulfillment +### 1. Requirements Fulfillment (Most Critical) -- Are **all** original task requirements met? +- Verify all requirements individually; do NOT APPROVE if any single requirement is unfulfilled - Can it **actually** do what was claimed? - Are implicit requirements (naturally expected behavior) met? -- Are there overlooked requirements? +- "Mostly done" or "main parts complete" is NOT grounds for APPROVE. All requirements must be fulfilled **Note**: Don't take Coder's "complete" at face value. Actually verify. diff --git a/builtins/en/piece-categories.yaml b/builtins/en/piece-categories.yaml index 1cd1933..b8c77b5 100644 --- a/builtins/en/piece-categories.yaml +++ b/builtins/en/piece-categories.yaml @@ -1,23 +1,31 @@ piece_categories: 🚀 Quick Start: pieces: + - default-mini + - frontend-mini + - backend-mini - default - - passthrough - - coding - - minimal - compound-eye + ⚡ Mini: + pieces: + - default-mini + - frontend-mini + - backend-mini + - backend-cqrs-mini 🎨 Frontend: pieces: - frontend + - frontend-mini ⚙️ Backend: pieces: - backend + - backend-mini - backend-cqrs + - backend-cqrs-mini 🔧 Expert: - Full Stack: - pieces: - - expert - - expert-cqrs + pieces: + - expert + - expert-cqrs 🛠️ Refactoring: pieces: - structural-reform diff --git a/builtins/en/pieces/backend-cqrs-mini.yaml b/builtins/en/pieces/backend-cqrs-mini.yaml new file mode 100644 index 0000000..7b9803b --- /dev/null +++ b/builtins/en/pieces/backend-cqrs-mini.yaml @@ -0,0 +1,247 @@ +name: backend-cqrs-mini +description: CQRS+ES-focused mini development piece (plan -> implement -> parallel review -> fix if needed -> complete) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: Requirements are clear and implementation is possible + next: implement + - condition: User is asking a question (not an implementation task) + next: COMPLETE + - condition: Requirements are unclear, insufficient information + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: Implementation complete + next: reviewers + - condition: Cannot proceed, insufficient info + next: ABORT + - condition: User input required because there are items to confirm with the user + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: No AI-specific issues + - condition: AI-specific issues found + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: All checks passed + - condition: Requirements unmet, tests failing + output_contracts: + report: + - 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 + - condition: all("AI-specific issues found", "Requirements unmet, tests failing") + next: fix_both + - condition: any("AI-specific issues found") + next: ai_fix + - condition: any("Requirements unmet, tests failing") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI Reviewer's issues fixed + - condition: No fix needed (verified target files/spec) + - condition: Cannot proceed, insufficient info + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: Supervisor's issues fixed + - condition: Cannot proceed, insufficient info + instruction: fix-supervisor + rules: + - condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed") + next: reviewers + - condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI Reviewer's issues fixed + next: reviewers + - condition: No fix needed (verified target files/spec) + next: implement + - condition: Cannot proceed, insufficient info + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: Supervisor's issues fixed + next: reviewers + - condition: Cannot proceed, insufficient info + next: implement + instruction: fix-supervisor diff --git a/builtins/en/pieces/backend-mini.yaml b/builtins/en/pieces/backend-mini.yaml new file mode 100644 index 0000000..0927fc1 --- /dev/null +++ b/builtins/en/pieces/backend-mini.yaml @@ -0,0 +1,240 @@ +name: backend-mini +description: Backend-focused mini development piece (plan -> implement -> parallel review -> fix if needed -> complete) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: Requirements are clear and implementation is possible + next: implement + - condition: User is asking a question (not an implementation task) + next: COMPLETE + - condition: Requirements are unclear, insufficient information + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: Implementation complete + next: reviewers + - condition: Cannot proceed, insufficient info + next: ABORT + - condition: User input required because there are items to confirm with the user + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: No AI-specific issues + - condition: AI-specific issues found + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: All checks passed + - condition: Requirements unmet, tests failing + output_contracts: + report: + - 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 + - condition: all("AI-specific issues found", "Requirements unmet, tests failing") + next: fix_both + - condition: any("AI-specific issues found") + next: ai_fix + - condition: any("Requirements unmet, tests failing") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI Reviewer's issues fixed + - condition: No fix needed (verified target files/spec) + - condition: Cannot proceed, insufficient info + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: Supervisor's issues fixed + - condition: Cannot proceed, insufficient info + instruction: fix-supervisor + rules: + - condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed") + next: reviewers + - condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI Reviewer's issues fixed + next: reviewers + - condition: No fix needed (verified target files/spec) + next: implement + - condition: Cannot proceed, insufficient info + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: Supervisor's issues fixed + next: reviewers + - condition: Cannot proceed, insufficient info + next: implement + instruction: fix-supervisor diff --git a/builtins/en/pieces/coding.yaml b/builtins/en/pieces/coding.yaml deleted file mode 100644 index 0688b44..0000000 --- a/builtins/en/pieces/coding.yaml +++ /dev/null @@ -1,140 +0,0 @@ -name: coding -description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete) -piece_config: - provider_options: - codex: - network_access: true - opencode: - network_access: true -max_movements: 20 -initial_movement: plan -movements: - - name: plan - edit: false - persona: planner - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Bash - - WebSearch - - WebFetch - rules: - - condition: Requirements are clear and implementable - next: implement - - condition: User is asking a question (not an implementation task) - next: COMPLETE - - condition: Requirements are unclear, insufficient information - next: ABORT - instruction: plan - output_contracts: - report: - - name: 00-plan.md - format: plan - - name: implement - edit: true - persona: coder - policy: - - coding - - testing - session: refresh - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Edit - - Write - - Bash - - WebSearch - - WebFetch - required_permission_mode: edit - rules: - - condition: Implementation complete - next: reviewers - - condition: Implementation not started (report only) - next: reviewers - - condition: Cannot determine, insufficient information - next: reviewers - - condition: User input required - next: implement - requires_user_input: true - interactive_only: true - instruction: implement - output_contracts: - report: - - name: coder-scope.md - format: coder-scope - - name: coder-decisions.md - format: coder-decisions - - name: reviewers - parallel: - - name: ai_review - edit: false - persona: ai-antipattern-reviewer - policy: - - review - - ai-antipattern - allowed_tools: - - Read - - Glob - - Grep - - WebSearch - - WebFetch - rules: - - condition: No AI-specific issues - - condition: AI-specific issues found - instruction: ai-review - output_contracts: - report: - - name: 04-ai-review.md - format: ai-review - - name: arch-review - edit: false - persona: architecture-reviewer - policy: review - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - WebSearch - - WebFetch - rules: - - condition: approved - - condition: needs_fix - instruction: review-arch - output_contracts: - report: - - name: 05-architect-review.md - format: architecture-review - rules: - - condition: all("No AI-specific issues", "approved") - next: COMPLETE - - condition: any("AI-specific issues found", "needs_fix") - next: fix - - name: fix - edit: true - persona: coder - policy: - - coding - - testing - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Edit - - Write - - Bash - - WebSearch - - WebFetch - required_permission_mode: edit - pass_previous_response: false - rules: - - condition: Fix complete - next: reviewers - - condition: Cannot determine, insufficient information - next: ABORT - instruction: fix diff --git a/builtins/en/pieces/minimal.yaml b/builtins/en/pieces/default-mini.yaml similarity index 83% rename from builtins/en/pieces/minimal.yaml rename to builtins/en/pieces/default-mini.yaml index e4e86b1..b5b05ed 100644 --- a/builtins/en/pieces/minimal.yaml +++ b/builtins/en/pieces/default-mini.yaml @@ -1,5 +1,5 @@ -name: minimal -description: Minimal development piece (implement -> parallel review -> fix if needed -> complete) +name: default-mini +description: Mini development piece (plan -> implement -> parallel review -> fix if needed -> complete) piece_config: provider_options: codex: @@ -7,14 +7,38 @@ piece_config: opencode: network_access: true max_movements: 20 -initial_movement: implement +initial_movement: plan movements: + - name: plan + edit: false + persona: planner + knowledge: architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: Requirements are clear and implementation is possible + next: implement + - condition: User is asking a question (not an implementation task) + next: COMPLETE + - condition: Requirements are unclear, insufficient information + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan - name: implement edit: true persona: coder policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -67,6 +91,7 @@ movements: edit: false persona: supervisor policy: review + knowledge: architecture allowed_tools: - Read - Glob @@ -102,6 +127,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -122,6 +148,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -146,6 +173,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -171,6 +199,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob diff --git a/builtins/en/pieces/frontend-mini.yaml b/builtins/en/pieces/frontend-mini.yaml new file mode 100644 index 0000000..b7ecc7e --- /dev/null +++ b/builtins/en/pieces/frontend-mini.yaml @@ -0,0 +1,240 @@ +name: frontend-mini +description: Frontend-focused mini development piece (plan -> implement -> parallel review -> fix if needed -> complete) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: Requirements are clear and implementation is possible + next: implement + - condition: User is asking a question (not an implementation task) + next: COMPLETE + - condition: Requirements are unclear, insufficient information + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: Implementation complete + next: reviewers + - condition: Cannot proceed, insufficient info + next: ABORT + - condition: User input required because there are items to confirm with the user + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: No AI-specific issues + - condition: AI-specific issues found + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: All checks passed + - condition: Requirements unmet, tests failing + output_contracts: + report: + - 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 + - condition: all("AI-specific issues found", "Requirements unmet, tests failing") + next: fix_both + - condition: any("AI-specific issues found") + next: ai_fix + - condition: any("Requirements unmet, tests failing") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI Reviewer's issues fixed + - condition: No fix needed (verified target files/spec) + - condition: Cannot proceed, insufficient info + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: Supervisor's issues fixed + - condition: Cannot proceed, insufficient info + instruction: fix-supervisor + rules: + - condition: all("AI Reviewer's issues fixed", "Supervisor's issues fixed") + next: reviewers + - condition: any("No fix needed (verified target files/spec)", "Cannot proceed, insufficient info") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI Reviewer's issues fixed + next: reviewers + - condition: No fix needed (verified target files/spec) + next: implement + - condition: Cannot proceed, insufficient info + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: Supervisor's issues fixed + next: reviewers + - condition: Cannot proceed, insufficient info + next: implement + instruction: fix-supervisor diff --git a/builtins/ja/instructions/supervise.md b/builtins/ja/instructions/supervise.md index c2c44e2..2e0518e 100644 --- a/builtins/ja/instructions/supervise.md +++ b/builtins/ja/instructions/supervise.md @@ -4,7 +4,11 @@ 1. 計画と実装結果が一致しているか 2. 各レビュームーブメントの指摘が対応されているか 3. タスク指示書の各要件が達成されているか - - 計画レポートの判断を鵜呑みにせず、要件ごとに実コード(ファイル:行)で独立照合する + - タスク指示書から要件を1つずつ抽出する + - 各要件について、実装されたコード(ファイル:行)を特定する + - コードが要件を満たしていることを実際に確認する(ファイルを読む、テストを実行する) + - 計画レポートの判断を鵜呑みにせず、要件ごとに独立照合する + - 充足していない要件が1つでもあれば REJECT する **レポートの確認:** Report Directory内の全レポートを読み、 未対応の改善提案がないか確認してください。 @@ -15,10 +19,22 @@ ## 結果: APPROVE / REJECT +## 要件充足チェック + +タスク指示書から要件を抽出し、各要件を実コードで個別に検証する。 + +| # | 要件(タスク指示書から抽出) | 充足 | 根拠(ファイル:行) | +|---|---------------------------|------|-------------------| +| 1 | {要件1} | ✅/❌ | `src/file.ts:42` | +| 2 | {要件2} | ✅/❌ | `src/file.ts:55` | + +- ❌ が1件でもある場合は REJECT 必須 +- 根拠なしの ✅ は無効(実コードで確認すること) +- 計画レポートの判断を鵜呑みにせず、要件ごとに独立照合する + ## 検証サマリー | 項目 | 状態 | 確認方法 | |------|------|---------| -| 要求充足 | ✅ | 要求リストと照合 | | テスト | ✅ | `npm test` (N passed) | | ビルド | ✅ | `npm run build` 成功 | | 動作確認 | ✅ | 主要フロー確認 | diff --git a/builtins/ja/output-contracts/supervisor-validation.md b/builtins/ja/output-contracts/supervisor-validation.md index 4fd1110..b7f1503 100644 --- a/builtins/ja/output-contracts/supervisor-validation.md +++ b/builtins/ja/output-contracts/supervisor-validation.md @@ -3,10 +3,22 @@ ## 結果: APPROVE / REJECT +## 要件充足チェック + +タスク指示書から要件を抽出し、各要件を実コードで個別に検証する。 + +| # | 要件(タスク指示書から抽出) | 充足 | 根拠(ファイル:行) | +|---|---------------------------|------|-------------------| +| 1 | {要件1} | ✅/❌ | `src/file.ts:42` | +| 2 | {要件2} | ✅/❌ | `src/file.ts:55` | + +- ❌ が1件でもある場合は REJECT 必須 +- 根拠なしの ✅ は無効(実コードで確認すること) +- 計画レポートの判断を鵜呑みにせず、要件ごとに独立照合する + ## 検証サマリー | 項目 | 状態 | 確認方法 | |------|------|---------| -| 要求充足 | ✅ | 要求リストと照合 | | テスト | ✅ | `npm test` (N passed) | | ビルド | ✅ | `npm run build` 成功 | | 動作確認 | ✅ | 主要フロー確認 | diff --git a/builtins/ja/personas/supervisor.md b/builtins/ja/personas/supervisor.md index b9b22c7..d519e74 100644 --- a/builtins/ja/personas/supervisor.md +++ b/builtins/ja/personas/supervisor.md @@ -43,10 +43,12 @@ ### 検証観点 -**要求の充足:** -- 元のタスク要求がすべて満たされているか +**要求の充足(最重要):** + +- 全要件を個別に検証し、1件でも未充足なら APPROVE しない - 「~もできる」と言っていたことが本当にできるか - 暗黙の要求(当然期待される動作)が満たされているか +- 「概ね完了」「主要部分は完了」は APPROVE の根拠にならない。全要件の充足が必要 **動作確認(実際に実行する):** diff --git a/builtins/ja/piece-categories.yaml b/builtins/ja/piece-categories.yaml index 6daf434..3a3c28b 100644 --- a/builtins/ja/piece-categories.yaml +++ b/builtins/ja/piece-categories.yaml @@ -1,23 +1,31 @@ piece_categories: 🚀 クイックスタート: pieces: + - default-mini + - frontend-mini + - backend-mini - default - - passthrough - - coding - - minimal - compound-eye + ⚡ Mini: + pieces: + - default-mini + - frontend-mini + - backend-mini + - backend-cqrs-mini 🎨 フロントエンド: pieces: - frontend + - frontend-mini ⚙️ バックエンド: pieces: - backend + - backend-mini - backend-cqrs + - backend-cqrs-mini 🔧 エキスパート: - フルスタック: - pieces: - - expert - - expert-cqrs + pieces: + - expert + - expert-cqrs 🛠️ リファクタリング: pieces: - structural-reform diff --git a/builtins/ja/pieces/backend-cqrs-mini.yaml b/builtins/ja/pieces/backend-cqrs-mini.yaml new file mode 100644 index 0000000..a7f59a7 --- /dev/null +++ b/builtins/ja/pieces/backend-cqrs-mini.yaml @@ -0,0 +1,247 @@ +name: backend-cqrs-mini +description: CQRS+ES向けMini開発ピース(plan → implement → 並列レビュー → 修正 → 完了) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: 要件が明確で実装可能 + next: implement + - condition: ユーザーが質問をしている(実装タスクではない) + next: COMPLETE + - condition: 要件が不明確、情報不足 + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: 実装が完了した + next: reviewers + - condition: 実装を進行できない + next: ABORT + - condition: ユーザーへの確認事項があるためユーザー入力が必要 + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: AI特有の問題なし + - condition: AI特有の問題あり + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: すべて問題なし + - condition: 要求未達成、テスト失敗、ビルドエラー + output_contracts: + report: + - name: supervisor-validation.md + format: supervisor-validation + - name: summary.md + format: summary + use_judge: false + rules: + - condition: all("AI特有の問題なし", "すべて問題なし") + next: COMPLETE + - condition: all("AI特有の問題あり", "要求未達成、テスト失敗、ビルドエラー") + next: fix_both + - condition: any("AI特有の問題あり") + next: ai_fix + - condition: any("要求未達成、テスト失敗、ビルドエラー") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI問題の修正完了 + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + - condition: 判断できない、情報不足 + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: 監督者の指摘に対する修正が完了した + - condition: 修正を進行できない + instruction: fix-supervisor + rules: + - condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した") + next: reviewers + - condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI問題の修正完了 + next: reviewers + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + next: implement + - condition: 判断できない、情報不足 + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - cqrs-es + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: 監督者の指摘に対する修正が完了した + next: reviewers + - condition: 修正を進行できない + next: implement + instruction: fix-supervisor diff --git a/builtins/ja/pieces/backend-mini.yaml b/builtins/ja/pieces/backend-mini.yaml new file mode 100644 index 0000000..439c396 --- /dev/null +++ b/builtins/ja/pieces/backend-mini.yaml @@ -0,0 +1,240 @@ +name: backend-mini +description: バックエンド向けMini開発ピース(plan → implement → 並列レビュー → 修正 → 完了) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: 要件が明確で実装可能 + next: implement + - condition: ユーザーが質問をしている(実装タスクではない) + next: COMPLETE + - condition: 要件が不明確、情報不足 + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: 実装が完了した + next: reviewers + - condition: 実装を進行できない + next: ABORT + - condition: ユーザーへの確認事項があるためユーザー入力が必要 + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: AI特有の問題なし + - condition: AI特有の問題あり + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: すべて問題なし + - condition: 要求未達成、テスト失敗、ビルドエラー + output_contracts: + report: + - name: supervisor-validation.md + format: supervisor-validation + - name: summary.md + format: summary + use_judge: false + rules: + - condition: all("AI特有の問題なし", "すべて問題なし") + next: COMPLETE + - condition: all("AI特有の問題あり", "要求未達成、テスト失敗、ビルドエラー") + next: fix_both + - condition: any("AI特有の問題あり") + next: ai_fix + - condition: any("要求未達成、テスト失敗、ビルドエラー") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI問題の修正完了 + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + - condition: 判断できない、情報不足 + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: 監督者の指摘に対する修正が完了した + - condition: 修正を進行できない + instruction: fix-supervisor + rules: + - condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した") + next: reviewers + - condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI問題の修正完了 + next: reviewers + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + next: implement + - condition: 判断できない、情報不足 + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - backend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: 監督者の指摘に対する修正が完了した + next: reviewers + - condition: 修正を進行できない + next: implement + instruction: fix-supervisor diff --git a/builtins/ja/pieces/coding.yaml b/builtins/ja/pieces/coding.yaml deleted file mode 100644 index 63eb435..0000000 --- a/builtins/ja/pieces/coding.yaml +++ /dev/null @@ -1,140 +0,0 @@ -name: coding -description: Lightweight development piece with planning and parallel reviews (plan -> implement -> parallel review -> complete) -piece_config: - provider_options: - codex: - network_access: true - opencode: - network_access: true -max_movements: 20 -initial_movement: plan -movements: - - name: plan - edit: false - persona: planner - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Bash - - WebSearch - - WebFetch - rules: - - condition: 要件が明確で実装可能 - next: implement - - condition: ユーザーが質問をしている(実装タスクではない) - next: COMPLETE - - condition: 要件が不明確、情報不足 - next: ABORT - instruction: plan - output_contracts: - report: - - name: 00-plan.md - format: plan - - name: implement - edit: true - persona: coder - policy: - - coding - - testing - session: refresh - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Edit - - Write - - Bash - - WebSearch - - WebFetch - required_permission_mode: edit - rules: - - condition: 実装完了 - next: reviewers - - condition: 実装未着手(レポートのみ) - next: reviewers - - condition: 判断できない、情報不足 - next: reviewers - - condition: ユーザー入力が必要 - next: implement - requires_user_input: true - interactive_only: true - instruction: implement - output_contracts: - report: - - name: coder-scope.md - format: coder-scope - - name: coder-decisions.md - format: coder-decisions - - name: reviewers - parallel: - - name: ai_review - edit: false - persona: ai-antipattern-reviewer - policy: - - review - - ai-antipattern - allowed_tools: - - Read - - Glob - - Grep - - WebSearch - - WebFetch - rules: - - condition: AI特有の問題なし - - condition: AI特有の問題あり - instruction: ai-review - output_contracts: - report: - - name: 04-ai-review.md - format: ai-review - - name: arch-review - edit: false - persona: architecture-reviewer - policy: review - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - WebSearch - - WebFetch - rules: - - condition: approved - - condition: needs_fix - instruction: review-arch - output_contracts: - report: - - name: 05-architect-review.md - format: architecture-review - rules: - - condition: all("AI特有の問題なし", "approved") - next: COMPLETE - - condition: any("AI特有の問題あり", "needs_fix") - next: fix - - name: fix - edit: true - persona: coder - policy: - - coding - - testing - knowledge: architecture - allowed_tools: - - Read - - Glob - - Grep - - Edit - - Write - - Bash - - WebSearch - - WebFetch - required_permission_mode: edit - pass_previous_response: false - rules: - - condition: 修正完了 - next: reviewers - - condition: 判断できない、情報不足 - next: ABORT - instruction: fix diff --git a/builtins/ja/pieces/minimal.yaml b/builtins/ja/pieces/default-mini.yaml similarity index 84% rename from builtins/ja/pieces/minimal.yaml rename to builtins/ja/pieces/default-mini.yaml index 8a874d9..477074d 100644 --- a/builtins/ja/pieces/minimal.yaml +++ b/builtins/ja/pieces/default-mini.yaml @@ -1,5 +1,5 @@ -name: minimal -description: Minimal development piece (implement -> parallel review -> fix if needed -> complete) +name: default-mini +description: Mini開発ピース(plan → implement → 並列レビュー → 修正 → 完了) piece_config: provider_options: codex: @@ -7,14 +7,38 @@ piece_config: opencode: network_access: true max_movements: 20 -initial_movement: implement +initial_movement: plan movements: + - name: plan + edit: false + persona: planner + knowledge: architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: 要件が明確で実装可能 + next: implement + - condition: ユーザーが質問をしている(実装タスクではない) + next: COMPLETE + - condition: 要件が不明確、情報不足 + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan - name: implement edit: true persona: coder policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -67,6 +91,7 @@ movements: edit: false persona: supervisor policy: review + knowledge: architecture allowed_tools: - Read - Glob @@ -102,6 +127,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -122,6 +148,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -146,6 +173,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob @@ -171,6 +199,7 @@ movements: policy: - coding - testing + knowledge: architecture allowed_tools: - Read - Glob diff --git a/builtins/ja/pieces/frontend-mini.yaml b/builtins/ja/pieces/frontend-mini.yaml new file mode 100644 index 0000000..e56b21f --- /dev/null +++ b/builtins/ja/pieces/frontend-mini.yaml @@ -0,0 +1,240 @@ +name: frontend-mini +description: フロントエンド向けMini開発ピース(plan → implement → 並列レビュー → 修正 → 完了) +piece_config: + provider_options: + codex: + network_access: true + opencode: + network_access: true +max_movements: 20 +initial_movement: plan +movements: + - name: plan + edit: false + persona: planner + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + rules: + - condition: 要件が明確で実装可能 + next: implement + - condition: ユーザーが質問をしている(実装タスクではない) + next: COMPLETE + - condition: 要件が不明確、情報不足 + next: ABORT + instruction: plan + output_contracts: + report: + - name: 00-plan.md + format: plan + - name: implement + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + instruction: implement + rules: + - condition: 実装が完了した + next: reviewers + - condition: 実装を進行できない + next: ABORT + - condition: ユーザーへの確認事項があるためユーザー入力が必要 + next: implement + requires_user_input: true + interactive_only: true + output_contracts: + report: + - name: coder-scope.md + format: coder-scope + - name: coder-decisions.md + format: coder-decisions + - name: reviewers + parallel: + - name: ai_review + edit: false + persona: ai-antipattern-reviewer + policy: + - review + - ai-antipattern + allowed_tools: + - Read + - Glob + - Grep + - WebSearch + - WebFetch + instruction: review-ai + rules: + - condition: AI特有の問題なし + - condition: AI特有の問題あり + output_contracts: + report: + - name: 03-ai-review.md + format: ai-review + - name: supervise + edit: false + persona: supervisor + policy: review + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Bash + - WebSearch + - WebFetch + instruction: supervise + rules: + - condition: すべて問題なし + - condition: 要求未達成、テスト失敗、ビルドエラー + output_contracts: + report: + - name: supervisor-validation.md + format: supervisor-validation + - name: summary.md + format: summary + use_judge: false + rules: + - condition: all("AI特有の問題なし", "すべて問題なし") + next: COMPLETE + - condition: all("AI特有の問題あり", "要求未達成、テスト失敗、ビルドエラー") + next: fix_both + - condition: any("AI特有の問題あり") + next: ai_fix + - condition: any("要求未達成、テスト失敗、ビルドエラー") + next: supervise_fix + - name: fix_both + parallel: + - name: ai_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: AI問題の修正完了 + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + - condition: 判断できない、情報不足 + instruction: ai-fix + - name: supervise_fix_parallel + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + rules: + - condition: 監督者の指摘に対する修正が完了した + - condition: 修正を進行できない + instruction: fix-supervisor + rules: + - condition: all("AI問題の修正完了", "監督者の指摘に対する修正が完了した") + next: reviewers + - condition: any("修正不要(指摘対象ファイル/仕様の確認済み)", "判断できない、情報不足", "修正を進行できない") + next: implement + - name: ai_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: AI問題の修正完了 + next: reviewers + - condition: 修正不要(指摘対象ファイル/仕様の確認済み) + next: implement + - condition: 判断できない、情報不足 + next: implement + instruction: ai-fix + - name: supervise_fix + edit: true + persona: coder + policy: + - coding + - testing + knowledge: + - frontend + - security + - architecture + allowed_tools: + - Read + - Glob + - Grep + - Edit + - Write + - Bash + - WebSearch + - WebFetch + required_permission_mode: edit + pass_previous_response: false + rules: + - condition: 監督者の指摘に対する修正が完了した + next: reviewers + - condition: 修正を進行できない + next: implement + instruction: fix-supervisor diff --git a/docs/README.ja.md b/docs/README.ja.md index 65af6ad..1a5e362 100644 --- a/docs/README.ja.md +++ b/docs/README.ja.md @@ -304,7 +304,7 @@ takt reset categories | ピース | おすすめ用途 | |------------|------------| | `default` | 本格的な開発タスク。TAKT自身の開発で使用。アーキテクト+セキュリティの並列レビュー付き多段階レビュー。 | -| `minimal` | 簡単な修正やシンプルなタスク。基本的なレビュー付きの最小限のピース。 | +| `default-mini` | 簡単な修正やシンプルなタスク。AI アンチパターンレビュー+スーパーバイザー付きの軽量ピース。 | | `review-fix-minimal` | レビュー&修正ピース。レビューフィードバックに基づく反復的な改善に特化。 | | `research` | 調査・リサーチ。質問せずに自律的にリサーチを実行。 | @@ -460,13 +460,15 @@ TAKTには複数のビルトインピースが同梱されています: | ピース | 説明 | |------------|------| | `default` | フル開発ピース: 計画 → 実装 → AI レビュー → 並列レビュー(アーキテクト+QA)→ スーパーバイザー承認。各レビュー段階に修正ループあり。 | -| `minimal` | クイックピース: 計画 → 実装 → レビュー → スーパーバイザー。高速イテレーション向けの最小構成。 | +| `default-mini` | ミニ開発ピース: 計画 → 実装 → 並列レビュー(AI アンチパターン+スーパーバイザー)→ 修正。レビュー付きの軽量構成。 | +| `frontend-mini` | ミニフロントエンドピース: 計画 → 実装 → 並列レビュー(AI アンチパターン+スーパーバイザー)。フロントエンドナレッジ注入付き。 | +| `backend-mini` | ミニバックエンドピース: 計画 → 実装 → 並列レビュー(AI アンチパターン+スーパーバイザー)。バックエンドナレッジ注入付き。 | +| `backend-cqrs-mini` | ミニ CQRS+ES ピース: 計画 → 実装 → 並列レビュー(AI アンチパターン+スーパーバイザー)。CQRS+ES ナレッジ注入付き。 | | `review-fix-minimal` | レビュー重視ピース: レビュー → 修正 → スーパーバイザー。レビューフィードバックに基づく反復改善向け。 | | `research` | リサーチピース: プランナー → ディガー → スーパーバイザー。質問せずに自律的にリサーチを実行。 | | `expert` | フルスタック開発ピース: アーキテクチャ、フロントエンド、セキュリティ、QA レビューと修正ループ。 | | `expert-cqrs` | フルスタック開発ピース(CQRS+ES特化): CQRS+ES、フロントエンド、セキュリティ、QA レビューと修正ループ。 | | `magi` | エヴァンゲリオンにインスパイアされた審議システム。3つの AI ペルソナ(MELCHIOR、BALTHASAR、CASPER)が分析し投票。 | -| `coding` | 軽量開発ピース: planner → 実装 → 並列レビュー(AI アンチパターン+アーキテクチャ)→ 修正。スーパーバイザーなしの高速フィードバックループ。 | | `passthrough` | 最小構成。タスクをそのまま coder に渡す薄いラッパー。レビューなし。 | | `compound-eye` | マルチモデルレビュー: Claude と Codex に同じ指示を同時送信し、両方の回答を統合。 | | `review-only` | 変更を加えない読み取り専用のコードレビューピース。 | diff --git a/package-lock.json b/package-lock.json index ec4a22f..94fc58b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "takt", - "version": "0.16.0", + "version": "0.17.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "takt", - "version": "0.16.0", + "version": "0.17.0", "license": "MIT", "dependencies": { "@anthropic-ai/claude-agent-sdk": "^0.2.37", diff --git a/package.json b/package.json index bb1f49a..4abf12b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "takt", - "version": "0.16.0", + "version": "0.17.0", "description": "TAKT: TAKT Agent Koordination Topology - AI Agent Piece Orchestration", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/__tests__/config.test.ts b/src/__tests__/config.test.ts index 5c2f910..012ec05 100644 --- a/src/__tests__/config.test.ts +++ b/src/__tests__/config.test.ts @@ -217,10 +217,10 @@ describe('loadPiece (builtin fallback)', () => { expect(piece).toBeNull(); }); - it('should load builtin pieces like minimal, research, e2e-test', () => { - const minimal = loadPiece('minimal', process.cwd()); - expect(minimal).not.toBeNull(); - expect(minimal!.name).toBe('minimal'); + it('should load builtin pieces like default-mini, research, e2e-test', () => { + const mini = loadPiece('default-mini', process.cwd()); + expect(mini).not.toBeNull(); + expect(mini!.name).toBe('default-mini'); const research = loadPiece('research', process.cwd()); expect(research).not.toBeNull(); @@ -249,7 +249,7 @@ describe('listPieces (builtin fallback)', () => { it('should include builtin pieces', () => { const pieces = listPieces(testDir); expect(pieces).toContain('default'); - expect(pieces).toContain('minimal'); + expect(pieces).toContain('default-mini'); expect(pieces).toContain('e2e-test'); }); @@ -277,7 +277,7 @@ describe('loadAllPieces (builtin fallback)', () => { it('should include builtin pieces in the map', () => { const pieces = loadAllPieces(testDir); expect(pieces.has('default')).toBe(true); - expect(pieces.has('minimal')).toBe(true); + expect(pieces.has('default-mini')).toBe(true); }); }); diff --git a/src/__tests__/it-piece-loader.test.ts b/src/__tests__/it-piece-loader.test.ts index 3ab53ac..1572c14 100644 --- a/src/__tests__/it-piece-loader.test.ts +++ b/src/__tests__/it-piece-loader.test.ts @@ -156,7 +156,7 @@ describe('Piece Loader IT: agent path resolution', () => { }); it('should resolve relative agent paths from piece YAML location', () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); for (const movement of config!.movements) { @@ -223,7 +223,7 @@ describe('Piece Loader IT: rule syntax parsing', () => { }); it('should parse standard rules with next movement', () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); const implementStep = config!.movements.find((s) => s.name === 'implement'); @@ -251,14 +251,14 @@ describe('Piece Loader IT: piece config validation', () => { }); it('should set max_movements from YAML', () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); expect(typeof config!.maxMovements).toBe('number'); expect(config!.maxMovements).toBeGreaterThan(0); }); it('should set initial_movement from YAML', () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); expect(typeof config!.initialMovement).toBe('string'); @@ -290,7 +290,7 @@ describe('Piece Loader IT: piece config validation', () => { }); it('should set passPreviousResponse from YAML', () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); // At least some movements should have passPreviousResponse set diff --git a/src/__tests__/it-piece-patterns.test.ts b/src/__tests__/it-piece-patterns.test.ts index bd99736..9c1fb65 100644 --- a/src/__tests__/it-piece-patterns.test.ts +++ b/src/__tests__/it-piece-patterns.test.ts @@ -80,7 +80,7 @@ function createEngine(config: PieceConfig, dir: string, task: string): PieceEngi }); } -describe('Piece Patterns IT: minimal piece', () => { +describe('Piece Patterns IT: default-mini piece', () => { let testDir: string; beforeEach(() => { @@ -93,11 +93,12 @@ describe('Piece Patterns IT: minimal piece', () => { rmSync(testDir, { recursive: true, force: true }); }); - it('should complete: implement → reviewers (parallel: ai_review + supervise) → COMPLETE', async () => { - const config = loadPiece('minimal', testDir); + it('should complete: plan → implement → reviewers (parallel: ai_review + supervise) → COMPLETE', async () => { + const config = loadPiece('default-mini', testDir); expect(config).not.toBeNull(); setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementation is possible.' }, { persona: 'coder', status: 'done', content: 'Implementation complete.' }, { persona: 'ai-antipattern-reviewer', status: 'done', content: 'No AI-specific issues.' }, { persona: 'supervisor', status: 'done', content: 'All checks passed.' }, @@ -107,13 +108,14 @@ describe('Piece Patterns IT: minimal piece', () => { const state = await engine.run(); expect(state.status).toBe('completed'); - expect(state.iteration).toBe(2); + expect(state.iteration).toBe(3); }); it('should ABORT when implement cannot proceed', async () => { - const config = loadPiece('minimal', testDir); + const config = loadPiece('default-mini', testDir); setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementation is possible.' }, { persona: 'coder', status: 'done', content: 'Cannot proceed, insufficient info.' }, ]); @@ -121,7 +123,7 @@ describe('Piece Patterns IT: minimal piece', () => { const state = await engine.run(); expect(state.status).toBe('aborted'); - expect(state.iteration).toBe(1); + expect(state.iteration).toBe(2); }); }); diff --git a/src/__tests__/it-pipeline-modes.test.ts b/src/__tests__/it-pipeline-modes.test.ts index a381483..ee9314b 100644 --- a/src/__tests__/it-pipeline-modes.test.ts +++ b/src/__tests__/it-pipeline-modes.test.ts @@ -282,6 +282,7 @@ describe('Pipeline Modes IT: --task + --piece name (builtin)', () => { it('should load and execute builtin minimal piece by name', async () => { setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementation is possible.' }, { persona: 'coder', status: 'done', content: 'Implementation complete' }, { persona: 'ai-antipattern-reviewer', status: 'done', content: 'No AI-specific issues' }, { persona: 'supervisor', status: 'done', content: 'All checks passed' }, @@ -289,7 +290,7 @@ describe('Pipeline Modes IT: --task + --piece name (builtin)', () => { const exitCode = await executePipeline({ task: 'Add a feature', - piece: 'minimal', + piece: 'default-mini', autoPr: false, skipGit: true, cwd: testDir, diff --git a/src/__tests__/it-pipeline.test.ts b/src/__tests__/it-pipeline.test.ts index 5743f29..1262957 100644 --- a/src/__tests__/it-pipeline.test.ts +++ b/src/__tests__/it-pipeline.test.ts @@ -228,10 +228,11 @@ describe('Pipeline Integration Tests', () => { }); it('should complete pipeline with piece name + skip-git + mock scenario', async () => { - // Use builtin 'minimal' piece + // Use builtin 'default-mini' piece // persona field: extractPersonaName result (from .md filename) // tag in content: [MOVEMENT_NAME:N] where MOVEMENT_NAME is the movement name uppercased setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementation is possible.' }, { persona: 'coder', status: 'done', content: 'Implementation complete' }, { persona: 'ai-antipattern-reviewer', status: 'done', content: 'No AI-specific issues' }, { persona: 'supervisor', status: 'done', content: 'All checks passed' }, @@ -239,7 +240,7 @@ describe('Pipeline Integration Tests', () => { const exitCode = await executePipeline({ task: 'Add a hello world function', - piece: 'minimal', + piece: 'default-mini', autoPr: false, skipGit: true, cwd: testDir, diff --git a/src/features/tasks/list/taskBranchLifecycleActions.ts b/src/features/tasks/list/taskBranchLifecycleActions.ts index 2d8fabe..7398f08 100644 --- a/src/features/tasks/list/taskBranchLifecycleActions.ts +++ b/src/features/tasks/list/taskBranchLifecycleActions.ts @@ -105,7 +105,7 @@ export function deleteBranch(projectDir: string, target: BranchActionTarget): bo try { if (worktreePath) { if (existsSync(worktreePath)) { - rmSync(worktreePath, { recursive: true, force: true }); + rmSync(worktreePath, { recursive: true, force: true, maxRetries: 3, retryDelay: 200 }); log.info('Removed worktree directory', { worktreePath }); } diff --git a/src/infra/task/clone.ts b/src/infra/task/clone.ts index 69cc1fb..9a2d393 100644 --- a/src/infra/task/clone.ts +++ b/src/infra/task/clone.ts @@ -217,7 +217,7 @@ export class CloneManager { removeClone(clonePath: string): void { log.info('Removing clone', { path: clonePath }); try { - fs.rmSync(clonePath, { recursive: true, force: true }); + fs.rmSync(clonePath, { recursive: true, force: true, maxRetries: 3, retryDelay: 200 }); log.info('Clone removed', { path: clonePath }); } catch (err) { log.error('Failed to remove clone', { path: clonePath, error: String(err) });