Skip to main content

gaptrace-core

Shared kernel for the gaptrace observability system: the run-record schema, the single SQLite store, and the sNrN target parser. gaptrace-capture, gaptrace, and gaptrace-evaluate all depend on it — it depends on nothing.

You normally do not import this directly. Instrument pipelines with gaptrace_capture, evaluate with gaptrace_evaluate — both re-export the schema dataclasses. gaptrace_core exists so those packages share one store contract instead of three copies of it.

Zero-dependency guarantee

gaptrace_core imports only the Python standard library (sqlite3, dataclasses, json, re, pathlib, datetime). This is enforced by a test (tests/test_zero_deps.py) that imports the package in a subprocess and asserts nothing outside the stdlib was loaded.

What lives here

Module Contents
gaptrace_core.schema RunRecord and its child dataclasses (ChunkRecord, TokenBudget, TokenUsage, Turn, CacheEvent, ToolCallRecord), all tolerant of unknown kwargs
gaptrace_core.store store location, schema + migrations, and every persistence primitive (runs, eval scores, benchmark, policies)
gaptrace_core.targets parse_target_id("s4r3") -> (4, 3) — the one sNrN parser

Environment setup contract

gaptrace_core.store.connect() guarantees the environment before returning a connection:

  1. ~/.gaptrace/ exists (created if missing),
  2. ~/.gaptrace/runs.db exists (created if missing),
  3. the schema is at the latest version — fresh databases are created directly at the latest version; databases written by older package versions are migrated in place.

Any entry point — a library call, a CLI command, an example script — works on a fresh machine with no prior CLI invocation.

Schema version + migration story

One constant, gaptrace_core.store.SCHEMA_VERSION (currently "3"), recorded in the meta table. The migration chain walks old databases forward on first connect:

  • v1 → v2: adds eval_scores / risk_score / evaluated_at columns to runs; creates the benchmark and policies tables.
  • v2 → v3: creates the runs_fts FTS5 index over run queries (with insert/update/delete sync triggers, backfilled from existing rows) and drops the now-redundant idx_runs_query index.

A database reporting a version this package doesn't know raises RuntimeError rather than guessing.

DB location and layout

The store lives at ~/.gaptrace/runs.db (SQLite, WAL mode).

Table Columns
meta key, value — holds schema_version
sessions session_id, title, pipeline, created_at
runs session_id, run_seq, query, pipeline, created_at, run_data (JSON RunRecord), eval_scores (JSON), risk_score, evaluated_at
benchmark pipeline, factor, threshold, correlation, sample_count, updated_at
policies pipeline, policy_data (JSON), updated_at
runs_fts FTS5 index over runs.query

Runs are addressed as s{session_id}r{run_seq} (e.g. s2r3) everywhere — "run" is the data noun; capturing is the verb, and belongs to gaptrace-capture.

Metadata

Release files for gaptrace-core 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gaptrace-core 0.1.0
File Size Uploaded Provenance Actions
gaptrace_core-0.1.0.tar.gz 25.2 kB Without provenance Details for gaptrace_core-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gaptrace-core 0.1.0
File Interpreter ABI Platform Actions
gaptrace_core-0.1.0-py3-none-any.whl Python 3 none any Details for gaptrace_core-0.1.0-py3-none-any.whl

Total release size: 42.1 kB

Release files / gaptrace_core-0.1.0.tar.gz

Download URL gaptrace_core-0.1.0.tar.gz
Size 25.2 kB
Tags Source
SHA-256 checksum
How to use checksums
896cd1ac1ff188b0ebd3e51dd1b9c91acf10425547345aa6de118653707cbf6e
BLAKE2b-256 checksum
How to use checksums
4b4963c66db2060840802692d2cfac34ffd5e7a83ad63158160bd53d25eb6d49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gaptrace_core-0.1.0-py3-none-any.whl

Download URL gaptrace_core-0.1.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39ea2e49194f5c739e81bd84a7c32849816544ccef00a7d4f2b888bbf86a446b
BLAKE2b-256 checksum
How to use checksums
d0c8ec5ca868eda5fa56a20ec0514b0e1d5fb99ff9587407d653a6cef79f01b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gaptrace-core 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page