# Progress, pause, and resume

Every executed CARBON pass must be durable.

## State rules

- Create a run directory before execution.
- Persist the full plan before the first test.
- Write status before and after each test and append an event with time, attempt, actual result, evidence, and error/blocker.
- Regenerate `report.html` after every state change.
- Register every tested page/state under `evidence/manifest.json`, copy the
  richest safely available artifacts into `evidence/pages/<page-id>/`, and
  regenerate the report after each evidence update.
- Use only: `planned`, `queued`, `running`, `passed`, `failed`, `blocked`, `skipped`, or `canceled`.
- A paused run keeps unfinished tests in their current safe state and records why, cleanup performed, resumable dependencies, and next action.
- Completion fails closed when a passed/failed browser test has no linked page
  bundle or a page channel is neither captured nor explicitly marked
  unavailable/privacy-withheld. An explicit cut line may preserve the run with
  those limitations as residual uncertainty.
- Resume from persisted state. Do not rerun passed tests unless the user requests it or their dependencies changed.
- Mark an interrupted `running` test `blocked` or return it to `queued` only after determining whether a side effect may have committed.

## Incremental report

The HTML report must show:

- mode, target, status, revision, start/update time, estimate, and scope;
- total and per-status progress;
- current and next tests;
- priority, reason, provenance, required data, estimated time, steps, oracle, and execution adapter;
- findings and evidence accumulated so far;
- blockers, unsafe/unexecuted cases, residual uncertainty, and resume command;
- Quick/Medium/Large next-cycle choices.
- a screenshot-rich page gallery, per-page evidence-channel matrix, artifact
  inventory/provenance, general cross-artifact issue signals, redaction notes,
  and explicit unavailable or withheld channels.

`scripts/carbon_run.py` regenerates a self-refreshing HTML file. Before execution,
`carbon_open_execution_plan` returns a protected `codexBrowserUrl`, Codex chat
and file links, and an embedded live-plan HTML artifact with an absolute
in-workspace Claude link. In Codex, navigate the built-in Browser directly to the protected
URL. In Claude, open the embedded artifact; it redirects to the same viewer.
Keep the page beside chat while it polls durable state once per second. Never
launch an operating-system browser unless explicitly asked.

## Honesty

Partial progress is useful evidence. Never discard it because a run did not finish. Never label a run complete while planned or running tests remain unless the report explicitly records the cut line and untested scope.
