Invariant Encoding Check
@bixu/invariant-encoding-checkv2026.10.22.1
01README
Fail CI when a changed swamp extension model file leaves a known invariant unencoded in its zod schema — the mechanizable subset of 'make illegal states unrepresentable', plus a set of shared zod schemas for the shapes it enforces (Sha256Digest, Platform, SshFingerprint)
02Behaviors
@bixu/invariant-encoding-checkv2026.09.10.1invariant_encoding_check.ts
Global Arguments
| Argument | Type | Description |
|---|---|---|
| root? | string | Directory to scan, relative to the working directory. Only matters for baseRef and all modes. |
fn check(paths?: array, baseRef?: string, all?: boolean, root?: string)
Scan model files and fail (throw) when any known invariant is left unencoded in its zod schema. Modes: paths (explicit list) > all > baseRef (git diff, GITHUB_BASE_REF env fallback).
| Argument | Type | Description |
|---|---|---|
| paths? | array | Explicit file paths to scan. Overrides baseRef and all. |
| baseRef? | string | Git base ref to diff against (e.g. 'origin/main'). Falls back to GITHUB_BASE_REF env var when unset. |
| all? | boolean | Scan every .ts file under root. Overridden by paths. |
| root? | string | Override the globalArgs root for this call. |
Resources
report(infinite)— Findings from the invariant-encoding scan, plus scan metadata
03Stats
A
93 / 100
Downloads
5
Archive size
17.3 KB
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit1/2partial
- @std/fs--jsr:@std/fs@1 is a range; audited 1.0.24, the version the registry resolved
1 dependency found
- jsr:@std/fs@1 -- audited 1.0.24
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License2/2earned
- Verified public repository2/2earned
Repository
https://github.com/bixu/swamp-extensions04Platforms
05Labels