WS7 review fixes: company-number validation, profile type guard, key-precedence docs

↗ view on GitHub · sloth-ninja · 2026-07-19 · b83a1e4d

- /companies routes: reject company numbers that aren't strictly
  alphanumeric after normalisation (400, fixed detail) so crafted input
  with path/query metacharacters never reaches the Companies House URL;
  validateCompanyNumber exported + tested.
- company-search page: guard profile narrowing with typeof "object".
- Docs truth fix: key resolution is env-first with per-user BYO fallback
  (userApiKeys.ts seeds env keys first) - corrected CLAUDE.md env
  registry, BUILD_LOG wording and the route header comment. Precedence
  behaviour itself unchanged (open owner decision, PR #25 review).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Repository Sloth-ninja/JessicaOSS
Author sloth-ninja <ezanahaddis@gmail.com>
Authored
Parents e258501a
Stats 5 files changed , +58 , -13
Part of WS7: Company Search panel + saves/status trains

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-b83a1e4d.md from inside the repo you want the change in.

⬇ Download capture-commit-b83a1e4d.md