Sprint 003 전체 구현 — F2 (DoD 강제 실패) + F6 (환경 검증 누락) 해결: Core: - src/contract/schema.ts — SprintContract Zod schema 전체 (DodCheck, EnvPrereq, ValidationResult, CheckResult) - src/contract/validator.ts — 3단계 검증 파이프라인 1. 환경 prerequisites (실패 시 ABORT_PRECHECK) 2. Runtime validation commands 3. DoD checks → PASS/FAIL 집계 - src/contract/prerequisite.ts — 5가지 prereq kind (command_exists, port_open, env_var, file_exists, http_reachable) - src/contract/generator.ts — 스프린트 md 파싱 → draft contract - src/contract/store.ts — 파일 + Prisma contract 저장, freeze/loadContract Check handlers (9종): - file_exists, command_success, regex_in_file, regex_absent - http_status (native fetch), process_listening (TCP probe) - artifact_schema (Zod registry), db_query (Prisma raw) - manual (Sprint 006 스텁) CLI: - rails contract generate <sprint-md> -s <sprint-id> - rails contract freeze <id> - rails contract validate <id> - rails contract show <id> Tests (19 신규, 41 total pass): - 각 check kind 단위 테스트 - http_status: node http 서버 mock - validator integration: PASS / FAIL / ABORT_PRECHECK - generator + store round-trip 검증: tsc --noEmit ✓ | vitest 41/41 ✓ | build ✓ | CLI help ✓ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
13 KiB
13 KiB