Docs/Reference

Reference

Artifact inspection: check-artifact-inspection

A trajectory may run again only once the session has looked at what its last run left behind. tama hook check-artifact-inspection <label> <command> <transcript> answers that question for pre-bash's trajectory counter: a first run needs WELES_FIRST_RUN=1 or written notes, and a later run needs evidence that an artifact of the label was opened since.

A trajectory may run again only once the session has looked at what its last run left behind. tama hook check-artifact-inspection <label> <command> <transcript> answers that question for pre-bash's trajectory counter: a first run needs WELES_FIRST_RUN=1 or written notes, and a later run needs evidence that an artifact of the label was opened since.

#What counts as looking

The evidence is a read-tool call in the session transcript (Claude's Read, OMP's read) on a file that exists in one of the places a run of the label writes its artifacts: recordings/<label>/, .work/<label>/, a page capture under .work/ whose name holds the label and outerHTML, or a -diag/ folder of the label under .work/. Whatever format the run wrote there counts; no list of file extensions decides it. A frame (.work/<label>/frame_<digest prefix>_…) is tied to its recording by the digest prefix and must still hold the content the marker recorded. Reading a file the run never wrote, a file elsewhere, or naming an artifact in a shell command is not looking at it.

#Which transcript it reads

The transcript named as the third argument, else CLAUDE_TRANSCRIPT_PATH, else the most recently modified .jsonl transcript of the repository's Claude Code project folder, found by the same locator check-failure-inspection uses. A project with no transcript folder has no evidence. The run is held, naming the path and the cause, when a named transcript cannot be read, CLAUDE_TRANSCRIPT_PATH cannot be read, the project folder or one of its entries cannot be listed, or a transcript's modification time cannot be read. It is read record by record by the shared JSON Lines reader: a complete line that is no record holds the run with the byte that line starts at, because the reads it held would otherwise be missing from the verdict; only a last line still being written is set aside. A frame the session read that cannot be read again to compare with its marker is said on stderr and is no evidence.

#Failure snapshots

check-failure-inspection holds a claim that a run failed until the turn has read that run's failure snapshot or frames. They are read by Weles' run layout and their names — .weles/runs/<label>/failure_state_<digest>.<any suffix> and frame_<digest>_… — whatever kind of file the recorder wrote; no list of suffixes decides. The journey cargo test --manifest-path rust/Cargo.toml -p tama-cli --test failure_inspection_artefacts -- --ignored (with TAMA_TEST_FAILURE_JUDGE=1, because whether an answer claims a failure is the judge's reading) requires a read .webp snapshot to admit the claim and an unread one to hold it.

#Where it comes from

Source: rust/crates/tama-hook-tools/src/ports/check_artifact_inspection/. The journey cargo test --manifest-path rust/Cargo.toml -p tama-cli --test artifact_inspection_locations builds a repository with a recording, a frame and a text artifact on disk, and requires a read of each, in Claude's and OMP's transcript records, to admit the next run, and a read of an unwritten recording or of README.md to hold it.