diff --git a/builtins/en/pieces/default-test-first-mini.yaml b/builtins/en/pieces/default-test-first-mini.yaml index aba8e2f..d858795 100644 --- a/builtins/en/pieces/default-test-first-mini.yaml +++ b/builtins/en/pieces/default-test-first-mini.yaml @@ -53,6 +53,8 @@ movements: rules: - condition: Tests written successfully next: implement + - condition: Cannot proceed because the test target is not implemented yet, so skip test writing + next: implement - condition: Cannot proceed with test creation next: ABORT - condition: User input required because there are items to confirm with the user diff --git a/builtins/en/pieces/default.yaml b/builtins/en/pieces/default.yaml index e3be2dd..abddca8 100644 --- a/builtins/en/pieces/default.yaml +++ b/builtins/en/pieces/default.yaml @@ -84,6 +84,8 @@ movements: rules: - condition: Tests written successfully next: implement + - condition: Cannot proceed because the test target is not implemented yet, so skip test writing + next: implement - condition: Cannot proceed with test writing next: ABORT - condition: User input needed for clarification diff --git a/builtins/ja/pieces/default-test-first-mini.yaml b/builtins/ja/pieces/default-test-first-mini.yaml index 66cf80f..14c6db1 100644 --- a/builtins/ja/pieces/default-test-first-mini.yaml +++ b/builtins/ja/pieces/default-test-first-mini.yaml @@ -53,6 +53,8 @@ movements: rules: - condition: テスト作成が完了した next: implement + - condition: テスト対象が未実装のためテスト作成をスキップする + next: implement - condition: テスト作成を進行できない next: ABORT - condition: ユーザーへの確認事項があるためユーザー入力が必要 diff --git a/builtins/ja/pieces/default.yaml b/builtins/ja/pieces/default.yaml index 99ceb34..9a5ac19 100644 --- a/builtins/ja/pieces/default.yaml +++ b/builtins/ja/pieces/default.yaml @@ -84,6 +84,8 @@ movements: rules: - condition: テスト作成が完了した next: implement + - condition: テスト対象が未実装のためテスト作成をスキップする + next: implement - condition: テスト作成を進行できない next: ABORT - condition: ユーザーへの確認事項があるためユーザー入力が必要 diff --git a/src/__tests__/it-piece-patterns.test.ts b/src/__tests__/it-piece-patterns.test.ts index dc048e9..e7817e0 100644 --- a/src/__tests__/it-piece-patterns.test.ts +++ b/src/__tests__/it-piece-patterns.test.ts @@ -182,6 +182,26 @@ describe('Piece Patterns IT: default piece (parallel reviewers)', () => { expect(state.status).toBe('completed'); }); + it('should continue to implement when tests cannot be written because target is not implemented', async () => { + const config = loadPiece('default', testDir); + + setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementable' }, + { persona: 'coder', status: 'done', content: 'Cannot proceed because the test target is not implemented yet, so skip test writing' }, + { persona: 'coder', status: 'done', content: 'Implementation complete' }, + { persona: 'ai-antipattern-reviewer', status: 'done', content: 'No AI-specific issues' }, + { persona: 'architecture-reviewer', status: 'done', content: 'approved' }, + { persona: 'qa-reviewer', status: 'done', content: 'approved' }, + { persona: 'testing-reviewer', status: 'done', content: 'approved' }, + { persona: 'supervisor', status: 'done', content: 'All checks passed' }, + ]); + + const engine = createEngine(config!, testDir, 'Test task'); + const state = await engine.run(); + + expect(state.status).toBe('completed'); + }); + it('should route to fix when any("needs_fix") in parallel review step', async () => { const config = loadPiece('default', testDir); @@ -211,6 +231,38 @@ describe('Piece Patterns IT: default piece (parallel reviewers)', () => { }); }); +describe('Piece Patterns IT: default-test-first-mini piece', () => { + let testDir: string; + + beforeEach(() => { + vi.clearAllMocks(); + testDir = createTestDir(); + }); + + afterEach(() => { + resetScenario(); + rmSync(testDir, { recursive: true, force: true }); + }); + + it('should continue to implement when tests cannot be written because target is not implemented', async () => { + const config = loadPiece('default-test-first-mini', testDir); + expect(config).not.toBeNull(); + + setMockScenario([ + { persona: 'planner', status: 'done', content: 'Requirements are clear and implementation is possible' }, + { persona: 'coder', status: 'done', content: 'Cannot proceed because the test target is not implemented yet, so skip test writing' }, + { 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' }, + ]); + + const engine = createEngine(config!, testDir, 'Test task'); + const state = await engine.run(); + + expect(state.status).toBe('completed'); + }); +}); + describe('Piece Patterns IT: research piece', () => { let testDir: string;