{
  "schema": "BACKLOG_ITEM.v1",
  "id": "result-json-writer-contract-atomic",
  "alias": "P0-b+1 / writer-contract task",
  "created_at": "2026-06-01",
  "severity": "operational (non-Critical7)",
  "title": "finish-task result.json writer atomic 완성 계약 (tmp→fsync→os.replace)",
  "split_reason": "회장 v3 결정 — P0-b 본체(OS-level driver 결선)와 같은 task 에 넣으면 범위/위험 확대. finish-task.sh 수정은 P0-b 에서 제외, 별도 후속으로 분리.",
  "requirement": "dev bot/finish-task 가 *.result.json 을 직접 쓰지 않고 tmp(*.result.json.tmp-$PID)→flush()+os.fsync()→os.replace(tmp, final) 원자 교체. P0-a task-2720+4 의 done_path atomic 패턴 재사용.",
  "interim_mitigation": "P0-b driver 가 소비 측에서 절단 파일 방어: final task-*.result.json 만 scan + size0/parse fail/schema fail/owner proof fail/self·foreign → quarantine. writer 비원자라도 wake 미발사로 안전.",
  "scope_when_approved": "scripts/finish-task.sh 의 result.json writer 1곳만 atomic 화. writer 외 수정 금지.",
  "depends_on": "P0-b(task-2721) 결선 이후 또는 병행 — 회장 승인 시 task ID 부여",
  "status": "DEFERRED — P0-b 와 분리, 회장 승인 전 진행 0"
}
