다크 모드
dry-run / 체크포인트 / 멱등성
dry-run
--dry-run은 모든 mutating command와 preflight에서 사용할 수 있어요.
- local file write, checkpoint 생성, process spawn, server mutation, approval consumption, credential rotation/enrollment을 모두 금지해요. read-only 조회와 canonical plan 생성만 허용.
- dry-run의
operationobject는operation_ref=null,completion=synchronous이고effect_scope는 예상 effect를 표시해요. result는 실행 시와 같은 key set을 유지하되, server가 생성할 ref/url은null, 완료 boolean(rollback_complete,local_credential_deleted등)은true를 반환하지 않아요. file/step array는 "적용된 결과"가 아니라 계획된 action으로 채워요.- exact dry-run을 보장할 수 없는 command는 실행하지 않고 exit 8
dry_run_unsupported예요. "대략적인 dry-run"은 없어요. - preflight dry-run은 API 호출 없는 로컬 projection이에요. 이후 server 상태가 바뀌면 무효이며, execute는 explicit key로 새로 검증해요.
sh
pob integrate --plan-file .pob/plans/plan-1.json --dry-run --json로컬 체크포인트 (cli-checkpoint/v2)
로컬 mutation(init, plan --output, integrate)은 mutation 시작 전에 checkpoint를 만들어요.
- checkpoint 저장소: project 안의
.pob/checkpoints/<checkpoint_ref>/.checkpoint_ref는 정확히ckpt_+ lowercase hex 32자(128비트 CSPRNG). checkpoint_manifest.json과 backup file만 둬요.checkpoint_ref는 path separator/../symlink를 포함할 수 없어요.- affected file의
action은created/modified만. v7 CLI는 사용자 파일 삭제를 수행하지 않아요 — 삭제가 필요한 step은 blocked/skipped로 남겨요. - 파일 쓰기는 같은 directory의 temp 파일에 쓰고 flush/close 후 atomic rename. symlink/hardlink/project boundary escape는 거부.
- checkpoint 생성이 실패하면 mutation을 시작하지 않아요.
- backup bytes는 local에만 있고 서버로 전송/audit/log에 넣지 않아요. 사용자 파일은 secret을 포함할 수 있기 때문이에요.
- checkpoint는 local rollback 전용이며 server evidence나 implementation proof가 아니에요.
- scan inventory는
.pob전체를 제외해요.
복구는 rollback local의 exact conflict 검사를 따라요.
server idempotency — --idempotency-key 규율
server mutation(inspect --submit, verify --submit, preflight, deploy, publish, rollback preview, job cancel)에는 사용자가 명시한 --idempotency-key가 필요해요.
- 형식:
cliid_[A-Za-z0-9_-]{22,64}. CLI가 자동 생성하지 않아요. missing/malformed key는 credential exchange 전에 exit 2. - raw key를 stdout/log/evidence에 쓰지 않아요. 출력에는 SHA-256 fingerprint만.
- 같은 key + 동일 canonical payload의 terminal replay는 새 execution/approval consumption을 만들지 않아요. CLI는 stored outcome을 표시하며 "다시 실행했다"고 표현하지 않아요.
- 같은 key + 다른 payload는 exit 10
idempotency_key_reuse. 새 효과 없음. - network 단절로 outcome이 불명확하면 exit 12
operation_outcome_unknown+idempotency_key_fingerprint. 복구는 같은 canonical command/body와 같은 key로 재실행하는 것뿐이에요. 새 key로 대체하거나 payload를 바꾸지 마세요.
machine client(외부 에이전트)를 위한 실용 패턴
sh
# 1) key를 호출 측에서 결정론적으로 준비 (예: 작업 단위로 1개)
KEY="cliid_$(uuidgen | tr -d '-' | tr 'A-F' 'a-f' | cut -c1-22)"
# 2) mutation 실행
pob deploy --artifact-path dist \
--api-base-url https://api.test.pob.example \
--project-ref prj_example --environment test \
--idempotency-key "$KEY" --json
# 3) exit 12 또는 timeout이면 같은 KEY로 동일 명령 재실행 (bounded)bounded retry
retryable=true 오류(exit 9 계열, 일부 409)는 bounded retry만 허용해요:
- server
retry_after_seconds가 있으면 그 값을 존중. - 무한 재시도 금지. 같은 credential/같은 입력으로
retryable=false를 재시도해 통과할 것으로 기대하지 마세요. - concurrent mutation conflict(
concurrent_modification, exit 10)만 bounded retry 대상이에요.rotation_conflict는 같은 generation 재시도 절대 금지.
interruption/recovery
- approval consumption과 operation effect의 atomic 연결이 불명확하면 성공으로 추정하지 않고 exit 12.
- CLI는 같은 invocation에서 자동 mutation retry를 하지 않아요.
- local mutation에서 restore까지 실패하면 exit 12 + checkpoint ref를 남기고 성공/rollback 어느 쪽도 주장하지 않아요.