Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions builtins/en/pieces/review-takt-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: gather-review
Expand Down Expand Up @@ -52,7 +51,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-arch
Expand All @@ -75,7 +73,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-security
Expand All @@ -99,7 +96,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-qa
Expand All @@ -123,7 +119,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-test
Expand All @@ -147,7 +142,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: ai-review
Expand All @@ -169,7 +163,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-requirements
Expand Down
7 changes: 0 additions & 7 deletions builtins/ja/pieces/review-takt-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: gather-review
Expand Down Expand Up @@ -52,7 +51,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-arch
Expand All @@ -75,7 +73,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-security
Expand All @@ -99,7 +96,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-qa
Expand All @@ -123,7 +119,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-test
Expand All @@ -147,7 +142,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: ai-review
Expand All @@ -169,7 +163,6 @@ movements:
- Read
- Glob
- Grep
- Bash
- WebSearch
- WebFetch
instruction: review-requirements
Expand Down
50 changes: 50 additions & 0 deletions src/__tests__/review-takt-default-piece.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
import { parse as parseYaml } from 'yaml';
import { PieceConfigRawSchema } from '../core/models/index.js';

const RESOURCES_DIR = join(import.meta.dirname, '../../builtins');

function loadReviewTaktDefaultYaml(lang: 'en' | 'ja') {
const filePath = join(RESOURCES_DIR, lang, 'pieces', 'review-takt-default.yaml');
const content = readFileSync(filePath, 'utf-8');
return parseYaml(content);
}

type PieceMovementLike = {
name: string;
provider_options?: {
claude?: {
allowed_tools?: string[];
};
};
parallel?: PieceMovementLike[];
};

type PieceLike = {
movements: PieceMovementLike[];
};

function assertNoBashInReviewOnlyMovements(raw: PieceLike) {
const gather = raw.movements.find((movement: { name: string }) => movement.name === 'gather');
expect(gather.provider_options?.claude?.allowed_tools).not.toContain('Bash');

const reviewers = raw.movements.find((movement: { name: string }) => movement.name === 'reviewers');
for (const reviewer of reviewers.parallel ?? []) {
expect(reviewer.provider_options?.claude?.allowed_tools).not.toContain('Bash');
}
}

describe('review-takt-default piece', () => {
it.each(['en', 'ja'] as const)('should pass schema validation for %s', (lang) => {
const raw = loadReviewTaktDefaultYaml(lang);
const result = PieceConfigRawSchema.safeParse(raw);
expect(result.success).toBe(true);
});

it.each(['en', 'ja'] as const)('should not allow Bash in review-only gather and reviewer movements for %s', (lang) => {
const raw = loadReviewTaktDefaultYaml(lang) as PieceLike;
assertNoBashInReviewOnlyMovements(raw);
});
});
Loading