---
task_id: task-2454
type: plan
scope: task
created: 2026-05-05
updated: 2026-05-05
status: in-progress
---

# 계획서: task-2454 — Start Guard + Handoff Automation MVP (Phase 1)

**task**: task-2454
**목표**: 봇 작업 시작 단계에서 silent corruption(잘못된 workspace/branch, mixed commit, handoff 부재 takeover)을 코드로 차단하는 가드 시스템 MVP 구축
**승인**: 회장 → 아누 → dev4팀 (한정승인, 2026-05-05)
**근거**: `memory/tasks/task-2454.md` (회장 직접 진단 + task-2451/2452 silent corruption 사고 raw 증거)

---

## 목표

회장 명시 8개 합격 기준 모두 PASS:
- 차단 6 케이스 (메인 워크스페이스 시작, main 아닌 메인, branch 불일치, handoff 없는 takeover, dirty tree, cancelled task)
- 허용 2 케이스 (정상 worktree+branch+clean, handoff JSON valid)

## 범위

### 포함 (Phase 1 MVP)
- `scripts/start_task_guard.py` — 8개 검증 항목 + lock 생성 + evidence 저장 + RUNNING 전이(`taskctl run` subprocess)
- `scripts/create_handoff.py` — handoff JSON 생성 + self-validation
- `memory/specs/handoff-schema.json` — JSON Schema Draft 2020-12
- `memory/specs/handoff-schema.md` — 사람용 가이드
- `memory/specs/start-guard-spec.md` — 호출 강제 설계 (dispatch.py STEP 0 템플릿, Phase 2 적용 계획)
- `tests/start_guard/**` + `tests/handoff/**` — pytest
- §6.1~6.5 라이브 시나리오 검증

### 제외 (Phase 2 이후)
- `dispatch.py` 자동 STEP 0 주입 (forbidden_paths)
- `taskctl takeover` 명령
- mixed commit 자동 복구 (회장 명시 — 절대 금지, Phase 1은 freeze만)
- session-watchdog/memory/heartbeats 통합 (별도 task)
- git pre-commit hook

## 위임 계획

- **카르티케야 (백엔드)**: `scripts/start_task_guard.py` 전체 구현 (8개 검증, lock JSON, mixed commit 감지/freeze, cleanup-stale, heartbeat update)
- **사라스바티 (프론트)**: `scripts/create_handoff.py` + `memory/specs/handoff-schema.json`/`md` (4000자 token 제한 + path 분리)
- **락슈미 (UX/UI)**: `memory/specs/start-guard-spec.md` (호출 강제 설계, dispatch STEP 0 템플릿, Phase 2 통합 계획)
- **하누만 (테스터)**: `tests/start_guard/**` + `tests/handoff/**` pytest + §6.1~6.5 라이브 시나리오 raw 로그 캡처

## 검증 기준

- pytest: `tests/start_guard/`, `tests/handoff/` 모두 PASS
- §6.1 정상흐름: exit 0 + lock + evidence 생성
- §6.2 차단 6 케이스: 모두 exit 1
- §6.3 mixed commit: `.frozen` 마커 생성 + evidence
- §6.4 handoff schema valid: jsonschema validate PASS
- §6.5 cleanup-stale: stale lock 해제 + evidence
- Codex G1 PASS (재실행 후), Gemini G2 PASS, G3 독립 검증 PASS
