Skip to content

ci(tla): coverage lint — spec/CI/corpus/docs drift fails loudly - #1693

Merged
robcohen merged 1 commit into
mainfrom
chore/tla-coverage-lint
Jul 2, 2026
Merged

robcohen merged 1 commit into
mainfrom
chore/tla-coverage-lint

Conversation

@robcohen

@robcohen robcohen commented Jul 2, 2026

Copy link
Copy Markdown
Member

FV backlog: restore the spring-cleaned tla_coverage.py intent as an enforced lint. The four FV layers reference each other by name (specs ↔ tla.yml loop ↔ corpora/replay ↔ RUST_MAPPING), and history shows the links rot silently — the counterexample converter vanished leaving a dead workflow step, and a stale trigger path stopped the models running on inventory changes entirely.

First run found four real drifts, each adjudicated

Finding Disposition
InductiveInvariants.cfg orphan (module never landed) removed
BuggyInventory never CI-checked by design — deliberate-bug teaching spec; allowlisted with reason
FIFOCheck never CI-checked historical pre-fix FIFO spec (source of tla_fifo_bug_test.rs); allowlisted
SimpleInventory never CI-checked ran TLC to adjudicate: its totalAdded/totalReduced are unbounded — TLC never terminates. Allowlisted with that reason (the tutorial spec is non-model-checkable as configured; a future opCount bound would fix it)

Checks

Orphan cfgs · loop membership with a reasoned KNOWN_UNCHECKED allowlist (staleness-checked both directions) · corpus ↔ spec ↔ generator registry ↔ replay ↔ docs cross-references · registry entries without corpora. Runs first in the TLA+ workflow; this PR triggers it, so the lint validates itself alongside the 16-spec loop.

🤖 Generated with Claude Code

Restores the intent of the spring-cleaned tla_coverage.py as an enforced
check: scripts/tla-coverage-check.py verifies every .cfg has a module, every
checkable spec is in tla.yml's model-check loop (with a reasoned
KNOWN_UNCHECKED allowlist, itself staleness-checked in both directions),
every behavior corpus has a spec + generator entry + replay interpreter +
RUST_MAPPING row, and every generator entry has a committed corpus. Runs as
the first step of the TLA+ workflow.

First run found four real drifts, each adjudicated:
- InductiveInvariants.cfg orphan (module never landed) — removed.
- BuggyInventory never CI-checked — correct by design (deliberate-bug
  teaching spec; TLC fails it on purpose) — allowlisted.
- FIFOCheck never CI-checked — historical pre-fix FIFO spec (source of
  tla_fifo_bug_test.rs) — allowlisted.
- SimpleInventory never CI-checked — investigated by actually running TLC:
  its totalAdded/totalReduced are UNBOUNDED, so TLC never terminates —
  allowlisted with that reason (the tutorial spec is non-model-checkable as
  configured; a future fix could add an opCount bound).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@robcohen
robcohen requested a review from a team as a code owner July 2, 2026 18:18
Copilot AI review requested due to automatic review settings July 2, 2026 18:18
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an enforced “coverage lint” to keep the TLA+ formal-verification layers (specs, CI loop, behavior corpora, and mapping docs) from silently drifting out of sync, and removes an orphaned config that no longer has a corresponding module.

Changes:

  • Delete orphan spec/tla/InductiveInvariants.cfg.
  • Add scripts/tla-coverage-check.py to validate spec/CI/corpus/docs cross-references (with a reasoned allowlist for intentionally-unchecked specs).
  • Run the new lint early in .github/workflows/tla.yml and trigger the workflow when the lint script changes.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
spec/tla/InductiveInvariants.cfg Removes an orphaned TLA+ config file that no longer matches a module on disk.
scripts/tla-coverage-check.py New Python lint enforcing cross-layer coverage invariants and detecting drift.
.github/workflows/tla.yml Adds the lint step and ensures workflow triggers include the new script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/tla-coverage-check.py Resolved
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

✅ Compatibility Test Results

Metric Result
Check Compatibility 100%
BQL Compatibility 100%
Full AST Match 100%
Total Files 792
What's tested
  • Check: Exit codes and error counts match bean-check
  • BQL: Query results match bean-query
  • Files: ~800 test files downloaded from 10+ beancount repositories

Full results available in workflow artifacts

@robcohen
robcohen merged commit 0817472 into main Jul 2, 2026
42 checks passed
@robcohen
robcohen deleted the chore/tla-coverage-lint branch July 2, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants