Run records
Records
A record is what a phase leaves behind for later: on a phax/records/v1 branch, one commit per phase, holding its manifest, its gate results and the surfaces they verified, its file reconciliation, its diff, its handoff and logs, and the agent's transcript if you keep it. A headless authoring session leaves one too, and so do every phax artifact decide session, every phax artifact revise session and every finding's fate. With records on, each compliance review a run generates is kept too, as a review entry <runId>/compliance-review/ beside the run's phase records: its compliance-review.json and a record.json. An accepted code-review.json is kept as a <runId>/code-review/ entry, as the compliance review's file is. A later review of the run replaces the file, and the earlier one stays in the branch's history. phax records list shows the entry, and phax records status lists it while it is unpushed. Worktrees come and go; the records stay, and they travel with a clone.
The branch can live in the same repository or in a separate one. Transcripts can hold anything the agent read, so phax refuses to keep them on a public repository's own records branch, and on one it cannot tell is private (the refusal quotes gh's first line: retry after a network or authentication failure, or confirm the repository is private with records.destination.acknowledgedUnknownVisibility). records explain takes --prompt, --diff, --transcript or --gates to print each part in full. A phase that stopped for a person's review, declared or held, records its stop too (mode, cause, outcome, closer and sessions, never a transcript's content): see The record of a stop. To read records from another tool, see Read phax files from code.
The default view lists each gate attempt under the gates line with its duration, then each step's command, surface, result and duration, then the protected-paths check. This is where the gate time went and what each fix attempt cost. The times come from the gate attribution of each attempt, checks-attempt-NN.attribution.json. The profile line above it names the gate profile that gated the run, or (not recorded) for a record written before phax recorded it.
A duration under a second shows in milliseconds. A record written before times were recorded shows time unknown. A skipped acceptance step shows not run. An attempt with no readable step record shows steps unknown. With --json, the answer's gateAttempts holds the same attempts, steps and times, and its gateProfile the profile's id, or null when the record did not record it.
When the records branch and its remote disagree
A record lands on top of the records remote's tip as phax last fetched it, so a branch that lags its remote catches up in the same step that writes the record. phax records status compares the local phax/records/v1 with the remote's and reports one of seven states:
- in sync: both tips are the same commit.
- ahead: the local branch holds records the remote does not. They are pending; push them.
- behind: the remote holds records the local branch does not.
- diverged: each side holds records the other lacks.
- unrelated: the two branches share no commit.
- missing locally: the remote has a records branch and this clone has none.
- not on the remote yet: the local branch exists and the remote has none.
phax records sync fetches the remote, then acts on the state:
- missing locally: it creates the local branch at the remote's tip.
- behind: it fast-forwards the local branch to the remote's tip.
- ahead, in sync, not on the remote yet: it moves nothing and says where the branch stands.
- diverged or unrelated: it refuses and names
phax records sync --replay.
--replay recommits each local-only record, oldest first, onto the remote's tip. A replayed record keeps its tree, its message and its author name, email and date; only its parent, committer and sha change. A local-only record the remote already holds, file for file, is left out and counted. One whose key the remote also holds with other content (a decision taken under the same number on two machines) is replayed all the same and its key is named: both stay on the branch, and readers take the newest. The previous tip is printed, and Git's reflog keeps it. In any other state --replay does what plain sync does and says there is nothing to replay. It works for a dedicated records repository and for the in-repo destination, where the records branch is fetched from publish.remote.
phax never forces the records branch: no push uses --force or a + refspec. A push that the remote refuses leaves the records pending and names the state and the sync command to run.
For example, a clone whose records branch was started again, so that it shares no commit with origin's:
The next push, whether the next record's or the git push printed above, fast-forwards the remote.