Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Ledger source-data changes require PolicyEngine core review.
# Chronicle source-data changes require PolicyEngine core review.
* @PolicyEngine/core-developers

# Source contracts, source packages, and governance metadata are especially
# sensitive because downstream Populace and Thesis builds consume them directly.
# sensitive because downstream Microcosm and Thesis builds consume them directly.
/packages/** @PolicyEngine/core-developers
/ledger/** @PolicyEngine/core-developers
/policyengine_ledger/** @PolicyEngine/core-developers
/chronicle/** @PolicyEngine/core-developers
/policyengine_chronicle/** @PolicyEngine/core-developers
/docs/** @PolicyEngine/core-developers
/.github/ledger-agents.yml @PolicyEngine/core-developers
/.github/chronicle-agents.yml @PolicyEngine/core-developers
/AGENTS.md @PolicyEngine/core-developers
32 changes: 16 additions & 16 deletions .github/ledger-agents.yml → .github/chronicle-agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ approved_agents:
purpose: Add or update source packages that emit raw publisher-backed facts.
allowed_paths:
- packages/**
- ledger/jurisdictions/**
- ledger/sources/**
- tests/test_ledger_*.py
- chronicle/jurisdictions/**
- chronicle/sources/**
- tests/test_chronicle_*.py
- tests/test_source_*.py
- tests/test_etl_*.py
required_deterministic_checks:
Expand All @@ -22,27 +22,27 @@ approved_agents:
- id: ledger-target-profile-author
purpose: Add source-backed target profiles and model measurement contracts without target values.
allowed_paths:
- policyengine_ledger/target_profiles/**
- ledger/targets/**
- tests/test_policyengine_ledger_target_profiles.py
- policyengine_chronicle/target_profiles/**
- chronicle/targets/**
- tests/test_policyengine_chronicle_target_profiles.py
- tests/test_us_poverty_target_coverage.py
required_deterministic_checks:
- no embedded target values
- sum-only operation
- selector references raw Ledger facts
- selector references raw Chronicle facts
required_judges:
- ledger-target-profile
- ledger-boundary
- id: ledger-contract-maintainer
purpose: Change Ledger schemas, identity, provenance, or consumer contracts.
purpose: Change Chronicle schemas, identity, provenance, or consumer contracts.
allowed_paths:
- ledger/core.py
- ledger/consumer_contract.py
- policyengine_ledger/**
- chronicle/core.py
- chronicle/consumer_contract.py
- policyengine_chronicle/**
- docs/schemas/**
- tests/test_ledger_consumer_contract.py
- tests/test_ledger_core.py
- tests/test_policyengine_ledger_imports.py
- tests/test_chronicle_consumer_contract.py
- tests/test_chronicle_core.py
- tests/test_policyengine_chronicle_imports.py
required_deterministic_checks:
- schema validation
- consumer-contract validation
Expand All @@ -57,6 +57,6 @@ required_judges:
ledger-target-profile:
verdict: PASS if profiles contain selectors and measurement contracts only, with no target values or active calibration decisions.
ledger-contract:
verdict: PASS if schema or identity changes preserve source provenance and do not move Populace responsibilities into Ledger.
verdict: PASS if schema or identity changes preserve source provenance and do not move Microcosm responsibilities into Chronicle.
ledger-boundary:
verdict: PASS if reconciliation, aging, imputation, support-aware activation, and solver construction remain outside Ledger.
verdict: PASS if reconciliation, aging, imputation, support-aware activation, and solver construction remain outside Chronicle.
6 changes: 3 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## Summary

## Ledger Governance
## Chronicle Governance

For any source package, target profile, consumer contract, schema, or source-data
boundary change:

- Approved Ledger agent role:
- Approved Chronicle agent role:
- `ledger-source-ingestor`
- `ledger-target-profile-author`
- `ledger-contract-maintainer`
Expand All @@ -16,6 +16,6 @@ boundary change:
- `ledger-contract`:
- `ledger-boundary`:

If this PR does not touch the Ledger source-data boundary, say so here.
If this PR does not touch the Chronicle source-data boundary, say so here.

## Tests
40 changes: 20 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
push:

jobs:
ledger:
name: Ledger checks
chronicle:
name: Chronicle checks
runs-on: ubuntu-latest

steps:
Expand All @@ -24,24 +24,24 @@ jobs:
- name: Install dependencies
run: uv sync --locked --all-extras

- name: Lint Ledger surface
- name: Lint Chronicle surface
run: >
uv run ruff check
ledger
policyengine_ledger
chronicle
policyengine_chronicle
db
scripts
tests

- name: Test Ledger surface
- name: Test Chronicle surface
run: >
uv run pytest -q

- name: Build source input database
run: |
uv run ledger --db /tmp/ledger-targets-ci.db init
uv run ledger --db /tmp/ledger-targets-ci.db load all
uv run ledger --db /tmp/ledger-targets-ci.db stats
uv run chronicle --db /tmp/chronicle-targets-ci.db init
uv run chronicle --db /tmp/chronicle-targets-ci.db load all
uv run chronicle --db /tmp/chronicle-targets-ci.db stats

- name: Build wheel
run: |
Expand All @@ -51,23 +51,23 @@ jobs:
- name: Test wheel install
run: |
wheel_path="$(find dist -name '*.whl' -print -quit)"
uv venv /tmp/ledger-wheel-smoke --python 3.14
uv pip install --python /tmp/ledger-wheel-smoke/bin/python "$wheel_path"
uv venv /tmp/chronicle-wheel-smoke --python 3.14
uv pip install --python /tmp/chronicle-wheel-smoke/bin/python "$wheel_path"
cd /tmp
/tmp/ledger-wheel-smoke/bin/python - <<'PY'
import policyengine_ledger
import policyengine_ledger.normalization
import policyengine_ledger.sources
import policyengine_ledger.target_profiles
import policyengine_ledger.targets
from policyengine_ledger.schema import (
/tmp/chronicle-wheel-smoke/bin/python - <<'PY'
import policyengine_chronicle
import policyengine_chronicle.normalization
import policyengine_chronicle.sources
import policyengine_chronicle.target_profiles
import policyengine_chronicle.targets
from policyengine_chronicle.schema import (
CONSUMER_FACT_SCHEMA_SHA256,
consumer_fact_schema,
)

assert policyengine_ledger.__name__ == "policyengine_ledger"
assert policyengine_chronicle.__name__ == "policyengine_chronicle"
# The pinned consumer-fact schema must ship inside the wheel.
assert consumer_fact_schema()["title"] == "Ledger consumer fact contract row"
assert len(CONSUMER_FACT_SCHEMA_SHA256) == 64
PY
/tmp/ledger-wheel-smoke/bin/ledger --help >/dev/null
/tmp/chronicle-wheel-smoke/bin/chronicle --help >/dev/null
8 changes: 4 additions & 4 deletions .github/workflows/thesis-facts-append.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Thesis facts append gate

# Deterministic review for every change to the observation ledger. Resolver
# Deterministic review for every change to the observation chronicle. Resolver
# appends arrive as pull requests targeting codex/thesis-ledger-facts; this
# gate enforces the immutable frozen prefix, an append-only diff against the
# PR base, the witnessed release chain, per-row schema and binding requirements,
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Enforce append-only ledger invariants
- name: Enforce append-only chronicle invariants
run: |
set -euo pipefail
if [ "${{ github.event_name }}" = "pull_request" ]; then
Expand Down Expand Up @@ -166,10 +166,10 @@ jobs:
- name: Install dependencies
run: uv sync --locked --all-extras

- name: Ledger observation invariants
- name: Chronicle observation invariants
run: >
uv run pytest
tests/test_policyengine_ledger.py
tests/test_policyengine_chronicle.py
tests/test_release_chain.py
tests/test_thesis_append_adversarial.py
-q
14 changes: 7 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Ledger Agent Rules
# Chronicle Agent Rules

Ledger is a source-backed fact store. It may parse publisher artifacts, normalize
Chronicle is a source-backed fact store. It may parse publisher artifacts, normalize
representation, preserve provenance, and declare target-profile contracts.

Every fact value must trace to a publisher. The boundary is who asserted the
value, not level versus projection: a publisher's own projection (CBO baseline,
BFP outlook, SSA trustees, TPC/JCT score) is a fact typed
`assertion: source_projection`. PolicyEngine-computed values — aged, uprated,
forecast, or reconciled levels — are never Ledger facts.
forecast, or reconciled levels — are never Chronicle facts.

Do not put Populace work in Ledger:
Do not put Microcosm work in Chronicle:

- no cross-source reconciliation
- no aging to a build year
Expand All @@ -20,9 +20,9 @@ Do not put Populace work in Ledger:
- no PolicyEngine-computed values stored as facts

Resolving profile targets at a period other than a fact's reference period
requires the consumer's explicit `PeriodAlignmentDeclaration`; Ledger records
requires the consumer's explicit `PeriodAlignmentDeclaration`; Chronicle records
the declaration and returns the published level, never the aligned number.

Only approved Ledger agent roles in `.github/ledger-agents.yml` should add or
Only approved Chronicle agent roles in `.github/chronicle-agents.yml` should add or
modify source packages, target profiles, or contract schemas. Source-data PRs
need deterministic validation plus the listed Ledger judge reviews before merge.
need deterministic validation plus the listed Chronicle judge reviews before merge.
Loading
Loading