refactor: trim over-engineering (ponytail-audit)
- ws → devDependencies (src uses type-only; runtime comes via @fastify/websocket) - delete bot/index.ts barrel; import casual-brain/driver directly - untrack tsconfig.tsbuildinfo (already gitignored) - vanillaCandidates: push-loop → .map() 94 tests pass, build clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,11 +27,7 @@ function vanillaCandidates(game: Game, color: Color): CandidateMove[] {
|
||||
const moves = game.chess.moves({ verbose: true }) as Array<{
|
||||
from: Square; to: Square; promotion?: PromotionType;
|
||||
}>;
|
||||
const out: CandidateMove[] = [];
|
||||
for (const m of moves) {
|
||||
out.push({ from: m.from, to: m.to, promotion: m.promotion });
|
||||
}
|
||||
return out;
|
||||
return moves.map((m) => ({ from: m.from, to: m.to, promotion: m.promotion }));
|
||||
}
|
||||
|
||||
function blindCandidates(game: Game, color: Color): CandidateMove[] {
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
export type {
|
||||
Brain, BrainInput, BrainAction, BrainInitArgs,
|
||||
CandidateMove, AttemptHistoryEntry,
|
||||
} from './brain.js';
|
||||
export { CasualBrain } from './casual-brain.js';
|
||||
export { BotDriver } from './driver.js';
|
||||
export { legalCandidates } from './candidates.js';
|
||||
@@ -12,7 +12,8 @@ import {
|
||||
} from './games.js';
|
||||
import { attachSocket } from './ws.js';
|
||||
import { createGameSchema } from './validation.js';
|
||||
import { CasualBrain, BotDriver } from './bot/index.js';
|
||||
import { CasualBrain } from './bot/casual-brain.js';
|
||||
import { BotDriver } from './bot/driver.js';
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user