Output Contracts と Quality Gates の実装 + 未使用コード検出ポリシー厳格化
Output Contracts を report 配下のネスト構造に変更し、Quality Gates をスキーマ・パーサーに追加。 未使用コード検出ポリシーから公開API例外ルールを削除し、AIが未使用コードを許容する抜け道を塞ぐ。
This commit is contained in:
parent
487b8bf235
commit
7ae4a78831
@ -42,6 +42,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -76,6 +77,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -97,6 +99,7 @@ movements:
|
||||
- condition: AI-specific issues found
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
@ -115,6 +118,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
|
||||
@ -40,6 +40,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -73,6 +74,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -94,6 +96,7 @@ movements:
|
||||
- condition: AI-specific issues found
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
@ -112,6 +115,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
|
||||
@ -84,6 +84,7 @@ movements:
|
||||
- {Question 2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
@ -104,6 +105,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
@ -140,6 +142,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -161,6 +164,7 @@ movements:
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -226,6 +230,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
@ -245,6 +250,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -296,6 +302,7 @@ movements:
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
|
||||
@ -79,6 +79,7 @@ movements:
|
||||
- {Question 2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
@ -99,6 +100,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
@ -134,6 +136,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -155,6 +158,7 @@ movements:
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -219,6 +223,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
@ -238,6 +243,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -288,6 +294,7 @@ movements:
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
report_formats:
|
||||
|
||||
@ -61,6 +61,7 @@ movements:
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -99,6 +100,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -120,6 +122,7 @@ movements:
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -187,6 +190,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
@ -205,6 +209,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -223,6 +228,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -242,6 +248,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -295,6 +302,7 @@ movements:
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -55,6 +55,7 @@ movements:
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -92,6 +93,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -113,6 +115,7 @@ movements:
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -179,6 +182,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
@ -197,6 +201,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -215,6 +220,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -234,6 +240,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -286,6 +293,7 @@ movements:
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -59,6 +59,7 @@ movements:
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -96,6 +97,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -117,6 +119,7 @@ movements:
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -183,6 +186,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
@ -201,6 +205,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -219,6 +224,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -238,6 +244,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -290,6 +297,7 @@ movements:
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -53,6 +53,7 @@ movements:
|
||||
- condition: Requirements are unclear and planning cannot proceed
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -89,6 +90,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -110,6 +112,7 @@ movements:
|
||||
- condition: AI-specific issues detected
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -175,6 +178,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
@ -193,6 +197,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -211,6 +216,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -230,6 +236,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -281,6 +288,7 @@ movements:
|
||||
- condition: Issues detected during final review
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -46,6 +46,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -67,6 +68,7 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -85,6 +87,7 @@ movements:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -45,6 +45,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -66,6 +67,7 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -84,6 +86,7 @@ movements:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -37,6 +37,7 @@ movements:
|
||||
instruction_template: |
|
||||
Do the task.
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
|
||||
@ -36,4 +36,5 @@ movements:
|
||||
instruction_template: |
|
||||
Do the task.
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
|
||||
@ -46,6 +46,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -67,6 +68,7 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -85,6 +87,7 @@ movements:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -45,6 +45,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -66,6 +67,7 @@ movements:
|
||||
- condition: No AI-specific issues
|
||||
- condition: AI-specific issues found
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -84,6 +86,7 @@ movements:
|
||||
- condition: All checks passed
|
||||
- condition: Requirements unmet, tests failing
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -72,6 +72,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
- name: security-review
|
||||
@ -90,6 +91,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 02-security-review.md
|
||||
format: security-review
|
||||
- name: ai-review
|
||||
@ -109,6 +111,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-ai
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
rules:
|
||||
@ -175,6 +178,7 @@ movements:
|
||||
- {Consolidated suggestions from all reviews}
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
|
||||
@ -156,7 +156,6 @@ AI tends to generate unnecessary code for "future extensibility", "symmetry", or
|
||||
| REJECT | Interfaces or options prepared for future extension |
|
||||
| REJECT | Exported but no usage found via grep |
|
||||
| OK | Implicitly called by framework (lifecycle hooks, etc.) |
|
||||
| OK | Intentionally exposed as public package API |
|
||||
|
||||
Verification approach:
|
||||
1. Grep to confirm no references to changed/deleted code remain
|
||||
|
||||
@ -42,6 +42,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -76,6 +77,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -97,6 +99,7 @@ movements:
|
||||
- condition: AI特有の問題あり
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
@ -115,6 +118,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
|
||||
@ -40,6 +40,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -73,6 +74,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -94,6 +96,7 @@ movements:
|
||||
- condition: AI特有の問題あり
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: arch-review
|
||||
@ -112,6 +115,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
|
||||
@ -84,6 +84,7 @@ movements:
|
||||
- {質問2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
@ -104,6 +105,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
@ -140,6 +142,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -161,6 +164,7 @@ movements:
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -226,6 +230,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
@ -245,6 +250,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -296,6 +302,7 @@ movements:
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
|
||||
@ -79,6 +79,7 @@ movements:
|
||||
- {質問2}
|
||||
instruction: plan
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: architect
|
||||
@ -99,6 +100,7 @@ movements:
|
||||
next: ABORT
|
||||
instruction: architect
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architecture.md
|
||||
format: architecture-design
|
||||
- name: implement
|
||||
@ -134,6 +136,7 @@ movements:
|
||||
interactive_only: true
|
||||
instruction: implement
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 02-coder-scope.md
|
||||
- Decisions: 03-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -155,6 +158,7 @@ movements:
|
||||
next: ai_fix
|
||||
instruction: ai-review
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -219,6 +223,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
- name: qa-review
|
||||
@ -238,6 +243,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -288,6 +294,7 @@ movements:
|
||||
next: plan
|
||||
instruction: supervise
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 07-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
report_formats:
|
||||
|
||||
@ -61,6 +61,7 @@ movements:
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -99,6 +100,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -120,6 +122,7 @@ movements:
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -187,6 +190,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
@ -205,6 +209,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -223,6 +228,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -242,6 +248,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -295,6 +302,7 @@ movements:
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -55,6 +55,7 @@ movements:
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -92,6 +93,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -113,6 +115,7 @@ movements:
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -179,6 +182,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-cqrs-es
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-cqrs-es-review.md
|
||||
format: cqrs-es-review
|
||||
- name: frontend-review
|
||||
@ -197,6 +201,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -215,6 +220,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -234,6 +240,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -286,6 +293,7 @@ movements:
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -59,6 +59,7 @@ movements:
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -96,6 +97,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -117,6 +119,7 @@ movements:
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -183,6 +186,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
@ -201,6 +205,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -219,6 +224,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -238,6 +244,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -290,6 +297,7 @@ movements:
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -53,6 +53,7 @@ movements:
|
||||
- condition: 要件が不明確で計画を立てられない
|
||||
next: ABORT
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 00-plan.md
|
||||
format: plan
|
||||
- name: implement
|
||||
@ -89,6 +90,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: ai_review
|
||||
@ -110,6 +112,7 @@ movements:
|
||||
- condition: AI特有の問題が検出された
|
||||
next: ai_fix
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: ai_fix
|
||||
@ -175,6 +178,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 04-architect-review.md
|
||||
format: architecture-review
|
||||
- name: frontend-review
|
||||
@ -193,6 +197,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-frontend
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-frontend-review.md
|
||||
format: frontend-review
|
||||
- name: security-review
|
||||
@ -211,6 +216,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 06-security-review.md
|
||||
format: security-review
|
||||
- name: qa-review
|
||||
@ -230,6 +236,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-qa
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 07-qa-review.md
|
||||
format: qa-review
|
||||
rules:
|
||||
@ -281,6 +288,7 @@ movements:
|
||||
- condition: 問題が検出された
|
||||
next: fix_supervisor
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 08-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
- name: fix_supervisor
|
||||
|
||||
@ -46,6 +46,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -67,6 +68,7 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -85,6 +87,7 @@ movements:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -45,6 +45,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -66,6 +67,7 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -84,6 +86,7 @@ movements:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -37,6 +37,7 @@ movements:
|
||||
instruction_template: |
|
||||
タスクをこなしてください。
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
policies:
|
||||
coding: ../policies/coding.md
|
||||
|
||||
@ -36,4 +36,5 @@ movements:
|
||||
instruction_template: |
|
||||
タスクをこなしてください。
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
|
||||
@ -46,6 +46,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -67,6 +68,7 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -85,6 +87,7 @@ movements:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -45,6 +45,7 @@ movements:
|
||||
requires_user_input: true
|
||||
interactive_only: true
|
||||
output_contracts:
|
||||
report:
|
||||
- Scope: 01-coder-scope.md
|
||||
- Decisions: 02-coder-decisions.md
|
||||
- name: reviewers
|
||||
@ -66,6 +67,7 @@ movements:
|
||||
- condition: AI特有の問題なし
|
||||
- condition: AI特有の問題あり
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
- name: supervise
|
||||
@ -84,6 +86,7 @@ movements:
|
||||
- condition: すべて問題なし
|
||||
- condition: 要求未達成、テスト失敗、ビルドエラー
|
||||
output_contracts:
|
||||
report:
|
||||
- Validation: 05-supervisor-validation.md
|
||||
- Summary: summary.md
|
||||
rules:
|
||||
|
||||
@ -72,6 +72,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-architect-review.md
|
||||
format: architecture-review
|
||||
- name: security-review
|
||||
@ -90,6 +91,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-security
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 02-security-review.md
|
||||
format: security-review
|
||||
- name: ai-review
|
||||
@ -109,6 +111,7 @@ movements:
|
||||
- condition: needs_fix
|
||||
instruction: review-ai
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 03-ai-review.md
|
||||
format: ai-review
|
||||
rules:
|
||||
@ -176,6 +179,7 @@ movements:
|
||||
- {全レビューからの統合提案}
|
||||
```
|
||||
output_contracts:
|
||||
report:
|
||||
- Review Summary: 04-review-summary.md
|
||||
- name: pr-comment
|
||||
edit: false
|
||||
|
||||
@ -156,7 +156,6 @@ AIは「将来の拡張性」「対称性」「念のため」で不要なコー
|
||||
| REJECT | 将来の拡張のために用意されたインターフェースやオプション |
|
||||
| REJECT | exportされているが、grep で使用箇所が見つからない |
|
||||
| OK | フレームワークが暗黙的に呼び出す(ライフサイクルフック等) |
|
||||
| OK | 公開パッケージのAPIとして意図的に公開している |
|
||||
|
||||
検証アプローチ:
|
||||
1. 変更・削除されたコードを参照している箇所がないか grep で確認
|
||||
|
||||
@ -76,6 +76,7 @@ movement 内では**キー名**で参照する(パスを直接書かない)
|
||||
edit: false
|
||||
instruction: review-arch
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 05-architect-review.md
|
||||
format: architecture-review
|
||||
rules:
|
||||
@ -132,12 +133,13 @@ rules:
|
||||
|
||||
## Output Contracts 定義
|
||||
|
||||
Movement の出力契約(レポート定義)。配列形式で指定する。
|
||||
Movement の出力契約(レポート定義)。`output_contracts.report` 配列形式で指定する。
|
||||
|
||||
### 形式1: name + format(フォーマット参照)
|
||||
|
||||
```yaml
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-plan.md
|
||||
format: plan # report_formats マップのキーを参照
|
||||
```
|
||||
@ -148,6 +150,7 @@ output_contracts:
|
||||
|
||||
```yaml
|
||||
output_contracts:
|
||||
report:
|
||||
- name: 01-plan.md
|
||||
format: | # インラインでフォーマットを記述
|
||||
# レポートタイトル
|
||||
@ -159,6 +162,7 @@ output_contracts:
|
||||
|
||||
```yaml
|
||||
output_contracts:
|
||||
report:
|
||||
- Summary: summary.md
|
||||
- Scope: 01-scope.md
|
||||
- Decisions: 02-decisions.md
|
||||
|
||||
@ -370,6 +370,7 @@ movements:
|
||||
instruction: review # 異なる WHAT(共有も可能)
|
||||
knowledge: architecture # 同じ CONTEXT — 再利用
|
||||
output_contracts:
|
||||
report:
|
||||
- name: review.md
|
||||
format: review # OUTPUT — report_formats.review を参照
|
||||
edit: false
|
||||
|
||||
@ -369,9 +369,10 @@ movements:
|
||||
policy: review # Different RULES
|
||||
instruction: review # Different WHAT (but could share)
|
||||
knowledge: architecture # Same CONTEXT — reused
|
||||
output_contracts:
|
||||
report:
|
||||
name: review.md
|
||||
format: review # OUTPUT — references output_contracts.review
|
||||
- name: review.md
|
||||
format: review # OUTPUT — references report_formats.review
|
||||
edit: false
|
||||
rules:
|
||||
- condition: Approved
|
||||
|
||||
@ -556,10 +556,12 @@ describe('section reference resolution', () => {
|
||||
name: 'plan',
|
||||
persona: 'planner',
|
||||
instruction: '{task}',
|
||||
output_contracts: [{
|
||||
output_contracts: {
|
||||
report: [{
|
||||
name: '00-plan.md',
|
||||
format: 'plan',
|
||||
}],
|
||||
},
|
||||
}],
|
||||
};
|
||||
|
||||
|
||||
@ -79,25 +79,34 @@ export const OutputContractItemSchema = z.object({
|
||||
});
|
||||
|
||||
/**
|
||||
* Output contracts field schema for movement-level definition.
|
||||
* Raw output contract entry — array item in output_contracts.report
|
||||
*
|
||||
* YAML formats:
|
||||
* output_contracts: # array of label:path entries
|
||||
* - Scope: 01-scope.md
|
||||
* - Decisions: 02-decisions.md
|
||||
* output_contracts: # array of objects (name + order + format)
|
||||
* - name: 00-plan.md
|
||||
* order: ...
|
||||
* format: plan
|
||||
*
|
||||
* Array items can be single-key objects or full item objects.
|
||||
* Supports:
|
||||
* - Label:path format: { Scope: "01-scope.md" }
|
||||
* - Item format: { name, order?, format? }
|
||||
*/
|
||||
export const OutputContractsFieldSchema = z.array(
|
||||
z.union([
|
||||
export const OutputContractEntrySchema = z.union([
|
||||
z.record(z.string(), z.string()), // {Scope: "01-scope.md"} format
|
||||
OutputContractItemSchema, // {name, order?, format?} format
|
||||
])
|
||||
).optional();
|
||||
]);
|
||||
|
||||
/**
|
||||
* 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
|
||||
* order: ...
|
||||
* format: plan
|
||||
*/
|
||||
export const OutputContractsFieldSchema = z.object({
|
||||
report: z.array(OutputContractEntrySchema).optional(),
|
||||
}).optional();
|
||||
|
||||
/** Quality gates schema - AI directives for movement completion (string array) */
|
||||
export const QualityGatesSchema = z.array(z.string()).optional();
|
||||
|
||||
@ -53,7 +53,7 @@ export { handleBlocked, type BlockedHandlerResult } from './engine/blocked-handl
|
||||
export { ParallelLogger } from './engine/parallel-logger.js';
|
||||
|
||||
// Instruction building
|
||||
export { InstructionBuilder, isOutputContractItem, isOutputContractLabelPath } from './instruction/InstructionBuilder.js';
|
||||
export { InstructionBuilder, isOutputContractItem } from './instruction/InstructionBuilder.js';
|
||||
export { ReportInstructionBuilder, type ReportInstructionContext } from './instruction/ReportInstructionBuilder.js';
|
||||
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './instruction/StatusJudgmentBuilder.js';
|
||||
export { buildEditRule, type InstructionContext } from './instruction/instruction-context.js';
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Assembles template variables and renders a single complete template.
|
||||
*/
|
||||
|
||||
import type { PieceMovement, Language, OutputContractLabelPath, OutputContractItem, OutputContractEntry } from '../../models/types.js';
|
||||
import type { PieceMovement, Language, OutputContractItem, OutputContractEntry } from '../../models/types.js';
|
||||
import type { InstructionContext } from './instruction-context.js';
|
||||
import { buildEditRule } from './instruction-context.js';
|
||||
import { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
||||
@ -18,13 +18,6 @@ export function isOutputContractItem(entry: OutputContractEntry): entry is Outpu
|
||||
return 'name' in entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if an output contract entry is the label-path form (OutputContractLabelPath).
|
||||
*/
|
||||
export function isOutputContractLabelPath(entry: OutputContractEntry): entry is OutputContractLabelPath {
|
||||
return 'label' in entry && 'path' in entry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Builds Phase 1 instructions for agent execution.
|
||||
*
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
* Instruction builders - barrel exports
|
||||
*/
|
||||
|
||||
export { InstructionBuilder, isOutputContractItem, isOutputContractLabelPath, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
||||
export { InstructionBuilder, isOutputContractItem, renderReportContext, renderReportOutputInstruction } from './InstructionBuilder.js';
|
||||
export { ReportInstructionBuilder, type ReportInstructionContext } from './ReportInstructionBuilder.js';
|
||||
export { StatusJudgmentBuilder, type StatusJudgmentContext } from './StatusJudgmentBuilder.js';
|
||||
export { escapeTemplateChars, replaceTemplatePlaceholders } from './escape.js';
|
||||
|
||||
@ -114,7 +114,6 @@ export {
|
||||
ParallelLogger,
|
||||
InstructionBuilder,
|
||||
isOutputContractItem,
|
||||
isOutputContractLabelPath,
|
||||
ReportInstructionBuilder,
|
||||
StatusJudgmentBuilder,
|
||||
buildEditRule,
|
||||
|
||||
@ -122,8 +122,9 @@ function isOutputContractItem(raw: unknown): raw is { name: string; order?: stri
|
||||
/**
|
||||
* Normalize the raw output_contracts field from YAML into internal format.
|
||||
*
|
||||
* Input formats (YAML):
|
||||
* Input format (YAML):
|
||||
* output_contracts:
|
||||
* report:
|
||||
* - Scope: 01-scope.md # label:path format
|
||||
* - name: 00-plan.md # item format
|
||||
* format: plan
|
||||
@ -131,15 +132,15 @@ function isOutputContractItem(raw: unknown): raw is { name: string; order?: stri
|
||||
* Output: OutputContractEntry[]
|
||||
*/
|
||||
function normalizeOutputContracts(
|
||||
raw: Array<Record<string, string> | { name: string; order?: string; format?: string }> | undefined,
|
||||
raw: { report?: Array<Record<string, string> | { name: string; order?: string; format?: string }> } | undefined,
|
||||
pieceDir: string,
|
||||
resolvedReportFormats?: Record<string, string>,
|
||||
): OutputContractEntry[] | undefined {
|
||||
if (raw == null || raw.length === 0) return undefined;
|
||||
if (raw?.report == null || raw.report.length === 0) return undefined;
|
||||
|
||||
const result: OutputContractEntry[] = [];
|
||||
|
||||
for (const entry of raw) {
|
||||
for (const entry of raw.report) {
|
||||
if (isOutputContractItem(entry)) {
|
||||
// Item format: {name, order?, format?}
|
||||
const item: OutputContractItem = {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user