Files
SeedPass/js
thePR0M3TH3ANandClaude Opus 5 de43ace259 Type two functions to what they read, removing nine assertions
Nine of the gate's findings were not assertions at all in spirit — they were
two function signatures narrower than their callers, paid for at every call
site.

`recomputeIndex0Stats` took a bare `Dict` while all five of its callers hold
a real `Index0`, so each one laundered it through `as unknown as Dict`. It
reads exactly three fields, so it now says so: a Pick over events,
checkpoints and heads. Any Index0 satisfies it, a partial one still does, and
the five casts are gone.

`exportBackup` took `Record<string, unknown>` and is genuinely called two
ways: with a live VaultIndex from three places in the CLI and API, and with a
round-tripped backup payload from the tests. It treats either as an opaque
JSON document to canonicalize and encrypt, so the signature now names both
shapes instead of making the majority caller pretend to be the minority one.

No type surgery and no behaviour change: the same values reach the same code,
they just no longer have to lie about what they are on the way in. 44 -> 35.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Vtx94nXDmNgXEeThUZP4QN
2026-08-20 12:58:17 -04:00
..