Lifecycle state
The shapes of log.json and lifecycle.json, the task and phase state transitions, and the rule that only the Pocketto CLI writes these files.
Two files carry execution state, with a strict division of labor: log.json is the detailed task-execution projection; lifecycle.json is authoritative for lifecycle state, the event journal, and delivery state.
log.json
{
"header": {
"plan_dir": "…",
"plan_type": "phased",
"status": "DONE",
"date_started": "2026-08-15",
"date_completed": "2026-08-16",
"baseline_sha": "…",
"pipeline": 5,
"phase_branches": { "mode": "stacked" }
},
"phases": [
{
"order": 1,
"file": "execution-plan/phase-1.md",
"status": "REVIEW",
"tasks": [
{ "id": "T1", "name": "…", "status": "DONE", "depends": "…", "done_sha": "…" }
],
"corrections": [
{ "sha": "…", "files": ["…"], "for_task": "T4" }
]
}
]
}(Illustrative shape, fields abbreviated.)
Transitions
| Entity | From → To | Command |
|---|---|---|
| Task | WAITING → DONE | log update <plan_dir> <phase_file> DONE --task T1 --sha <audited_head> |
| Task | WAITING → BLOCKED | log update <plan_dir> <phase_file> BLOCKED --task T1 |
| Phase | WAITING → REVIEW | log update <plan_dir> <phase_file> REVIEW (after the phase pass records its result) |
| Phase | REVIEW → DONE | log update <plan_dir> <phase_file> DONE (closing only, never --task) |
| Plan | → DONE | log close <plan_dir> (verifies every phase DONE) |
| Phase (stacked) | handoff | log handoff <plan_dir> <phase_file>, after DONE, before log close |
The invariants
done_shais set only when a task is markedDONEwith--shaafter a passing audit, and it never moves afterwards; phase-level fixes are append-only--correctionrecords.DUPLICATE_DONE_SHAhard-errors when two tasks would share a merge commit (a parallel-group footgun; merge and log one task at a time).--allow-duplicate-shaexists only for tasks that legitimately produced no new commit.REVIEWis a phase-only status: a task is neverREVIEW.- The pipeline marker refuses state-changing commands against plans from an older pipeline generation (
PIPELINE_TOO_OLD). - The CLI is the only writer. A
log.jsonthat exists but fails to parse is refused (LOG_JSON_UNPARSEABLE), not silently treated as absent:--resetis the explicit way to discard it.
lifecycle.json
Managed by the lifecycle CLI (see Lifecycle events):
- root
schema: 2(Core also reads schema 1; above 2 fails closed) - plan state: normalized
plan_id, requiredspec_dir, optionalplan_dir, state snapshot, revision - the event journal: allowlisted events with deterministic IDs
<plan_id>:<type>:r<revision>, artifact refs, payload hashes, opaque proof references, delivery state - stacked plans record
phase_branchesincluding the root base branch
Commits are atomic: state and its event land together, before the projection update and long before any remote delivery.
Related documentation
Review reports
The review files Pocketto writes under reviews/: per-task verdicts, freshness rules, phase notes, and the phase-pass record that closeout requires.
Release surfaces
The surfaces.json manifest and its four release roles, Core and Enterprise for both Pi and Claude Code, which enforce the split at build time.