Commit Graph

5 Commits

Author SHA1 Message Date
Fabio 2cc22fc8e2 Ingest: preserve duplicate U.S. Code section numbers; title-scoped tags
The Code genuinely contains distinct sections sharing one number (two
5 U.S.C. 5757, two 10 U.S.C. 130g, two 5 U.S.C. 3598). The ingest
silently overwrote the first with the second — data loss in a mirror.
Later occurrences now get a deterministic -N suffix.

The 'elections' tag was hardcoded from the Title 52 seed; it now
applies only to Title 52, with a per-title EXTRA_TAGS map. Makefile
gains TITLES override: make legal-us-code TITLES="7 10".

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 09:52:28 -04:00
Fabio 6c9990a115 Docs: document the Board pipeline + Artifact redeploy step
Add `make board` and docs/board.md so the Board's rebuild-and-redeploy flow
is a documented step, not tribal knowledge. Covers why the county data is
inlined (self-contained Artifact / CSP), that build_viz.py injects it into
board.html, and that a live Artifact must be REPUBLISHED (editing the repo
file doesn't update a deployed Artifact). README links it in both the make
list and the docs index.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-04 21:12:05 -04:00
Fabio ad7607856d Legal corpus: seed U.S. Code Title 52 2026-07-04 19:49:09 -04:00
Fabio 2e5197d1a3 The changelog engine: turn git diffs into a civic changelog
The diff is the product — now literally. generate_changelog.py reads a
git diff of the entity tree between any two refs and says, in plain
language, what changed in the government: entities added / modified /
removed, grouped by type and by jurisdiction, dated from the commit.

CHANGELOG.md is seeded from the real history so far:
  - initial load: +11,285 people across 51 states
  - institutional gap: +233 bodies, ~532 people enriched
  - elections + demographics: +2,494 candidates, +3,494 jurisdictions
    (TX +541, FL +396, CA +341 ...)

On an initial load every entity is an addition; on a re-sync of the same
source, only real government changes will surface — which is the whole
point. When nothing changed, it says so.

make changelog [BASE=.. HEAD=..]. No third-party deps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-04 08:28:50 -04:00
Fabio aefa65f5b3 Validation: JSON Schemas + validator (the discipline, enforced)
The README claimed 'validated by JSON Schema' — now it is true.

/schemas holds a JSON Schema for each entity type (Person, Body,
Candidate, Jurisdiction): a stricter profile over OKF's permissive
base, tolerating unknown keys by design.

scripts/validate.py checks all 17,506 files with no third-party deps
(hand-rolled frontmatter parser + minimal schema engine):
  1. OKF conformance — every file has frontmatter with a non-empty type
  2. Schema conformance — required fields, property types, enums
  3. Link integrity — internal /-rooted links resolve

Non-zero exit on failure, so it is a CI gate. Verified with a negative
test: it catches bad enums and dead links. All 17,506 files pass today.

Makefile ties it together: make build / validate / check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 23:43:56 -04:00