Version: 0.2.0

ENGINE v0.2 Architecture & Editorial Methodology

1. Code Before AI

ENGINE treats large language models as a scarce, high-variance resource rather than a substitute for software architecture. Every structural validation, date calculation, referential check, and freshness threshold is enforced deterministically in TypeScript and Zod before any language model is ever considered.

2. Deterministic Pipeline

Data flows through five auditable stages:

  1. Code (Zod Contracts): Every JSON file in src/content/sources/ and src/content/states/ is parsed against strict Zod schemas. Malformed URLs, dates, or missing references fail the build immediately.
  2. Jev (Governance Engine): Jev evaluates source integrity, detects editorial conflicts (source_conflict), enforces a 72-hour staleness gate during the pre-election window (< 15 days before 2026-11-03), and switches cleanly to post-election archive verification after 2026-11-03.
  3. Context Packer (Deterministic RAG): Instead of a vector database, local records are filtered by jurisdiction, topic, and status: "accepted". Every packed payload records exact character counts and estimated tokens saved.
  4. LLM (Optional & Scoped): Reserved solely for bounded drafting when deterministic context is sufficient; never allowed to invent facts or bypass Zod/Jev.
  5. Human Review Gate: Items marked needs_review, pending, or conflicting are surfaced explicitly in the static UI and cannot be displayed as verified without human approval in Git.

3. Zero-DB Static-First Guarantee

Git is the single source of truth. Astro compiles all verified data and metrics into static HTML and CSS (output: 'static'), eliminating runtime database dependencies and shipping zero client-side JavaScript in this MVP.