Goal and prerequisites
Run the notes project, then inspect exactly the Session ID stored incontrol.json. default_reader selects the canonical journal while retaining explicit historical trace support. read_session reconstructs an observation view; it does not resume execution.
inspect_run.py reads snapshot pages and streams a public canonical export through owned staging. Its small re-import check compares every projected record. Re-import remains materializing. The lesson retains the empty selector directory required by the legacy replay/HTML CLI. The new canonical export takes a journal and run ID directly.
Use the CLI commands below to inspect, replay and export. Replay displays recorded execution; it does not call the model or repeat tools. Stop the read-only board with Ctrl-C.
Basic Python is required. The package declares Python ≥3.10; local qualification uses Python 3.12.7. Each chapter runs independently; reuse the environment and matching files when continuing your project. Commands below use a macOS/Linux shell.
Prepare the project
This lesson uses the integrated R1 implementation pinned below; a source install does not imply a PyPI release.Run and verify
Inspect the saved Session
Behavior and support boundaries
Inspect needs neither Docker nor credentials.read_page retains a page, one bounded frame and fixed I/O/SQLite caches; its temporary disk index grows with the journal. Every page still hashes all snapshot bytes. Complete read_run/read_session, legacy HTML export and re-import remain materializing. Public export declares loss and cannot replace private recovery data.
A cursor binds the query/view, source, committed head and byte boundary, and expires when its reader closes. Concurrent appends are excluded from that traversal. After the last page, poll with a fresh query whose after_sequence is the last page’s watermark. Changed queries, replaced/truncated sources and snapshot damage reject with typed errors. Historical and third-party sources without this capability raise BoundedReadUnsupported; old complete calls retain their existing behavior.
Exercise and answer
Compare private and public records without exposing private payloads. Equal record counts do not establish lossless payload equivalence.Common errors and cleanup
ModuleNotFoundError: activate the environment with the specified installation and save every file on this page. Existing run root: choose a new --root instead of overwriting evidence. Assertion failure: inspect the first failed tool or typed error, not only the final text. After all processes and the board stop, remove only this lesson’s newly created run directories if no longer needed; retain SQLite, journals and reports you want to debug.
Continuous iter_records and file export validate the full snapshot at the start and end, and each addressed frame during traversal. Iterator values are partial until exhaustion; early close releases resources but does not establish a completed traversal. File output is published only after final validation. Independent read_page calls retain full-history verification on every page.
Complete files: save in the project root
notes.py
agent.yaml
inspect_run.py
