fix(test): guard outputSchema access — unblocks Biome 2.5.5 bump (#336) - #363
Conversation
Biome 2.5.5 (arriving in dependabot #336) flags the (def?.outputSchema as {...}).properties pattern as lint/correctness/noUnsafeOptionalChaining — correctly: if the chain short-circuited, the member access on the cast result would throw anyway. An explicit guard makes the failure mode a named error and passes both the current and incoming Biome. Unblocks #336's gates so its armed auto-merge can complete. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017AMNJvRTNfnmkWa6Nk4Qx4
Review summaryScope: single-commit, test-only diff ( Correctness: The fix itself is sound — Simplification/efficiency: Nothing to flag — the guard-clause pattern is idiomatic and minimal. One inline comment posted; no other findings. |
Review caught what my first pass missed: the same (x?.y as T).z shape at three inputSchema assertions. Continuing the chain with ?.required (cast widened to | undefined so the chain is meaningful) keeps the assertion identical and satisfies Biome 2.5.5. Whole-tree check now verified with an unmasked exit code — the first verification piped through tail and reported tail's status, not Biome's. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017AMNJvRTNfnmkWa6Nk4Qx4
Two review findings: the ?.required form asserted vacuously when inputSchema was missing — restored fail-loud with per-tool guard throws, matching the outputSchema style; and the guard-and-navigate block duplicated across both triageSideSchema tests is now one triageSideAProps helper. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017AMNJvRTNfnmkWa6Nk4Qx4
Summary
Dependabot #336 (npm minor/patch group) is red because the bumped Biome 2.5.5 flags an existing pattern in
test/tools/curation.test.tsaslint/correctness/noUnsafeOptionalChaining:(def?.outputSchema as {...}).properties— the rule is right; if the chain short-circuited, the member access on the cast result would throw a TypeError anyway. Auto-merge on #336 behaved correctly: armed, saw red gates, refused to merge.This replaces the two occurrences with an explicit guard (
if (!schema) throw ...) that names the failure and passes both the current Biome (2.5.2) and the incoming 2.5.5.After this merges: comment
·@·d·ependabot r·ebaseon #336 — the rebased branch picks up the fix, gates go green, and its armed auto-merge completes on its own.Note for the next nightly: Biome 2.5.5 also introduces 8 new non-blocking style warnings across
src/test(verified locally withnpx @biomejs/biome@2.5.5 check); they'll show up in the maintenance report once #336 lands and are candidates for a cleanup PR like #265.Test plan
npm run lint(Biome 2.5.2) — cleannpx @biomejs/biome@2.5.5 check src test— exits green (errors gone; 8 pre-existing-style warnings remain, non-blocking)npx vitest run test/tools/curation.test.ts— 37/37 passInvariants
src/changes; no invariant surfaces touched🤖 Generated with Claude Code
https://claude.ai/code/session_017AMNJvRTNfnmkWa6Nk4Qx4
Generated by Claude Code