Expand description
Per-commit metric snapshots (ctx snapshot).
Exports one Parquet partition per commit (.ctx/snapshots/sha=<sha>/)
with per-file and per-symbol metrics, near-duplicate pairs, and metadata,
for longitudinal quality analysis via ctx sql --snapshots.
Each partition contains four files — symbols.parquet, files.parquet,
dup_pairs.parquet, and meta.parquet — every row denormalized with
commit_sha and committed_at so partitions can be unioned with a single
read_parquet('.ctx/snapshots/*/*.parquet') glob per table.
Partitions are written to a sha=<sha>.tmp staging directory and moved
into place with an atomic rename, so readers never observe a half-written
snapshot. The capture core requires the duckdb feature; option and
report types are available in every build so the CLI surface stays stable.
Structs§
- Backfill
Options - Options for
ctx snapshot backfill. - Capture
Options - Options for a single snapshot capture.
- Snapshot
Report - The result of one snapshot capture.
Enums§
- Capture
Mode - How a snapshot was captured, recorded as
capture_modeinmeta.parquet.
Constants§
- SNAPSHOTS_
DIR - Default output directory for snapshot partitions, relative to the project root.
- SNAPSHOT_
SCHEMA_ VERSION - Version of the snapshot Parquet schema, recorded in
meta.parquet.
Functions§
- backfill
- Backfill snapshots for historical commits.
- capture
- Capture a snapshot of the repository at
root(labeled with HEAD’s sha) intoopts.out_dir/sha=<sha>/. - partition_
dir_ name - The partition directory name for a commit (
sha=<sha>).