declaring-invariants

Solid

Find tests that enumerate a domain by copying it, and declare the invariants a codebase depends on. Reports where a parametrize list, for-loop, or it.each iterates a hand-written subset of a dict/set/tuple/Enum that exists in the source, and names the members nothing covers. Use when reviewing tests, when a module gains a name-to-thing table, registry, enum, or dispatch map, before trusting a green suite as evidence a domain is covered, or when asked "is this test actually total", "does anything cover X", "what does this repo guarantee", "which invariants do we declare". Also for vacuous tests that pass over an empty collection, for a domain that has silently NARROWED (an enumeration cannot see that), and for recording the refutation that proves a claim can fail.

Code & Development 148 stars 5 forks Updated today MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
72
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# declaring-invariants Two scripts over one idea: **a test that enumerates a domain must loop the registry rather than a copy of it.** Someone also has to say which domains matter in the first place. ```bash python3 scripts/totality_lint.py <repo> # tests that copy a domain python3 scripts/claims.py <repo> # what the repo declares, and what backs it ``` Python only, stdlib `ast` only: no install, no config file, no network. ## The failure it catches A test that loops a hand-written list passes its runner and proves nothing about completeness. When the same members also exist as a registry in the source, the list is a copy, and the copy drifts the moment someone adds a member to the registry and not to the test. Nothing goes red. Measured on `oaustegard/remex`, 2026-08-24: adding a fourth member to `ROTATION_CODES` with no construction behind it left the **entire 267-test suite green**. Four separate tests looked total; each parametrized `["haar", "rht"]` against a three-member registry. Only a test that looped the registry itself caught it. Adapted from the meta-oracle in [`daniloc/coherence`](https://github.com/daniloc/coherence) (`src/oracle-domain.ts`), which classifies an oracle's iteration root as LIVE or LITERAL by parsing the oracle's own AST. That harness needs spec files, a claim grammar, a ledger and Node; the check does not. ## `totality_lint.py` — tests that copy a domain | finding | meaning | |---|---| | `sampled-domain` | a `parametrize` or `...

Details

Author
oaustegard
Repository
oaustegard/claude-skills
Created
10 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category