Files
SeedPass/js
thePR0M3TH3ANandClaude Opus 5 0f59602622 Close every routes.ts mutation gap: seven unasserted API behaviours
routes.ts now reaches zero mutation survivors (30 mutants). The suite covered
what the API refuses very thoroughly and what it REPORTS almost not at all,
which is where all seven gaps were.

The one that could destroy data: DELETE /api/v1/fingerprint/:fingerprint
guards against deleting the profile the server is currently serving. Removing
that guard entirely left the suite green -- the fixture only ever had one
profile, so the guard was never exercisable. The test now seeds a second
profile and asserts the pairing: the served one is refused, another is
deleted. A refuse-everything implementation cannot pass it.

The rest report vault state that nothing checked:

- GET /api/v1/fingerprint's `current` flag. Inverted, every profile EXCEPT
  the served one is flagged, which a profile switcher shows straight to the
  user. Asserted as a pairing, since "at least one is current" survives the
  inversion.
- GET /api/v1/vault/status's `locked`. Inverted, it reports locked while
  unlocked; the test also confirms the flag tracks something real by checking
  a locked vault refuses secrets.
- GET /api/v1/high-risk/status, which had no test at all: the exact-expiry
  boundary, the tag-AND-unexpired conjunction (a stale expiry with no tag
  read as open), and the expires_at null decode. Built on its own context so
  the clock can be frozen.
- POST /api/v1/entry with an empty totp `secret` must DERIVE one, not import
  the empty string as a key. An entry that looks like a second factor and is
  keyed on nothing.
- GET /api/v1/totp/export must export a stored secret as stored and derive
  past a blank one. Inverted, every exported secret is still well-formed
  base32 -- so shape assertions pass while the codes are for another account.
  The fixture gains an entry with a present-but-empty secret, the shape a
  legacy or Python-written index can hold and the API cannot create.
- POST /api/v1/high-risk/unlock answers 409 not_configured rather than
  falling through to 401 factor_invalid, which tells someone who never set a
  factor that the one they just chose is wrong.

Two fixture counts were hardcoded literals; they now derive from the fixture,
so adding an entry cannot silently weaken "no secrets in the listing" into
"no secrets in an empty listing".

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