Commit Graph

2 Commits

Author SHA1 Message Date
Marcin Czarkowski f7af9b9b8e test: characterize content API seam (#8)
Co-authored-by: Claude <noreply@anthropic.com>
2026-07-28 01:12:01 +02:00
Claude 7d65048eaa test(coverage loop #3): characterize api-content bundle-signature contract
Overnight loop iteration 3. api-content.ts was the highest-churn untested lib
module (7 commits; the command layer tests mock it, so nothing exercised it).
Nine tests over the REAL path — no module mocks (bun mock.module leaks across
files), just a globalThis.fetch override + the documented BUNDLE_PUBLIC_KEYSET
dev override with a generated ed25519 key, so real api-client envelope and real
crypto run: valid triad accepted, fail-closed on tampered body / unknown key /
invalid signature / incomplete headers / missing signatures, API error envelopes
pass through, path+query encoding pinned.

LATENT BUG FOUND (pinned, not fixed — flagged for morning review): fetchHealth's
documented `code: "timeout"` is dead code — apiGet collapses the AbortError to
network_error first, so doctor.ts:159's timeout branch can never fire; on a hung
API doctor shows the generic network diagnostic instead of the timeout one.

Gate: typecheck OK; oxlint 2 warnings (baseline); bun test 463 pass (+9), exactly
the 8 pinned pre-existing failures. Map refreshed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GpGAGRG6UpHpCzxzgqXgMt
2026-07-28 00:38:32 +02:00