6. Check Eko Invariants
Purpose: Scan for violations of Eko's core system invariants (fact-first, verification-before-publication, source attribution, schema conformance, cost-bounded AI, topic balance). Run after changes to the fact pipeline or before merging core data flow PRs.
Prerequisites: None
Cost / Duration: $0 | ~30 sec
Prompt
Check for Eko invariant violations.
Step 1 — Run the invariant checker:
```bash
bun run check-invariants
```
Scans source files for patterns that violate Eko invariants:
- Fact-first: facts are the atomic unit
- Verification before publication: no fact reaches feed without validation
- Source attribution: every fact traces to source articles
- Schema conformance: output validates against fact_record_schemas
- Cost-bounded AI: all AI calls have model routing and budget caps
- Topic balance: daily quotas prevent content monoculture
Step 2 — Warn-only mode (optional, exits 0 even with violations):
```bash
bun scripts/check-invariants.ts --warn-only
```
Useful during active refactoring when known violations are being addressed.
Expected: Exit code 0 — no invariant violations.
Verification
-
bun run check-invariantsexits with code 0 - No "Fact published without validation" violations
- No "Missing source attribution" violations
- All warnings reviewed and justified if using
--warn-only
Related Prompts
- Full CI Validation — Invariant checks as part of full CI
- Run Drift Detection — Content quality drift detection