Skip to main content

Local-first, auditable usage ledger for Codex session artifacts.

Project description

Codex Ledger

Codex Ledger is a local-first, auditable CLI for importing Codex session artifacts into an event-level SQLite ledger, deriving deterministic reports, estimating reference USD cost at the event level, and rendering privacy-safe delivery artifacts from saved report JSON.

Status

The repository now includes the full v1 delivery layer:

  • immutable raw artifact archiving and canonical event ledger
  • workspace resolution with redaction, alias, and full-path modes
  • agent and subagent lineage plus observability diagnostics
  • deterministic event-level reference USD pricing
  • aggregate, workspace, agent, and explain report surfaces
  • deterministic report JSON artifact writing
  • offline schema validation for saved report JSON
  • PNG heatmap and static workspace HTML rendering from saved report JSON
  • read-only verify and reconcile diagnostics
  • release workflow scaffolding and release-readiness docs

Install

Local development uses uv and Python 3.12+.

uv sync --group dev
uv run codex-ledger --help

For local wheel validation before publication:

uv build
pipx install ./dist/codex_ledger-0.1.0-py3-none-any.whl

After the package is actually published, the intended install surface is:

pipx install codex-ledger

Quickstart

Inspect the current environment and migration status:

codex-ledger doctor

Import locally persisted rollout files:

codex-ledger sync

Import an explicit Codex JSON file:

codex-ledger import codex-json --input ./sample-report.json

Recalculate reference USD pricing:

codex-ledger price recalc --rule-set reference_usd_openai_standard_2026_04_07

Write a deterministic aggregate report JSON artifact:

codex-ledger report aggregate \
  --period month \
  --as-of 2026-04-30 \
  --output ./artifacts/aggregate.json

Render a heatmap from the saved report JSON:

codex-ledger render heatmap \
  --report ./artifacts/aggregate.json \
  --output ./artifacts/aggregate.png

Render static workspace HTML from a workspace report JSON artifact:

codex-ledger report workspace \
  --period month \
  --as-of 2026-04-30 \
  --output ./artifacts/workspaces.json

codex-ledger render workspace-html \
  --report ./artifacts/workspaces.json \
  --output ./artifacts/workspaces.html

Run read-only verification:

codex-ledger verify ledger
codex-ledger verify reports

Compare a reference summary against current derived totals:

codex-ledger reconcile reference --input ./reference-summary.json

Privacy Defaults

The ledger keeps raw provenance locally, including original source paths in SQLite. Default outward-facing report, explain, and render output stays redacted unless you explicitly request --redaction-mode alias or --redaction-mode full.

Rendered PNG and HTML artifacts are traced by sidecar JSON manifests that record report schema version, generator version, pricing rule-set selection, redaction mode, and source-report hashes without leaking absolute source paths by default.

Verification

The standard local verification suite is:

uv run ruff check .
uv run mypy src
uv run pytest
uv build
uv run ruff format --check .

Release-readiness details live in docs/RELEASE_READINESS.md.

Scope

The v1 scope is a Python CLI with deterministic local storage, pricing, reporting, rendering, explainability, and verification. Interactive web UI work is out of scope.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_ledger-0.1.0.tar.gz (47.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_ledger-0.1.0-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

Details for the file codex_ledger-0.1.0.tar.gz.

File metadata

  • Download URL: codex_ledger-0.1.0.tar.gz
  • Upload date:
  • Size: 47.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codex_ledger-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f0534d88a4a2883d2f83e589d6126cdc5d8b765d8339327ebf91de62c87d3dea
MD5 a7eb8d246a3175def781d672be599fb4
BLAKE2b-256 318f2755922f04e8a11afa2c1be4f89c9e8d14087f93e772585da491e41f51b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_ledger-0.1.0.tar.gz:

Publisher: release.yml on igneous-prose/codex-ledger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codex_ledger-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: codex_ledger-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 66.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for codex_ledger-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b18c6502ea5515401ecaeecaa594e57b991ea5eec2e3245424fb80f71e4d1f01
MD5 168939b552f63fd9c521645b03a1f10d
BLAKE2b-256 a2f17016f14e8babdf90d03e1212ab6d08117008edf2bff8674c52780b028a5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_ledger-0.1.0-py3-none-any.whl:

Publisher: release.yml on igneous-prose/codex-ledger

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page