Skip to content

fix(test): guard outputSchema access — unblocks Biome 2.5.5 bump (#336) - #363

Merged
mavaali merged 3 commits into
mainfrom
claude/daftari-dev-maturity-hzgmgk
Aug 9, 2026
Merged

fix(test): guard outputSchema access — unblocks Biome 2.5.5 bump (#336)#363
mavaali merged 3 commits into
mainfrom
claude/daftari-dev-maturity-hzgmgk

Conversation

@mavaali

@mavaali mavaali commented Aug 9, 2026

Copy link
Copy Markdown
Owner

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.ts as lint/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·ebase on #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 with npx @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) — clean
  • npx @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 pass

Invariants

  • Tests-only diff; no src/ changes; no invariant surfaces touched

🤖 Generated with Claude Code

https://claude.ai/code/session_017AMNJvRTNfnmkWa6Nk4Qx4


Generated by Claude Code

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
@mavaali
mavaali marked this pull request as ready for review August 9, 2026 19:28
Comment thread test/tools/curation.test.ts
@claude

claude Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review summary

Scope: single-commit, test-only diff (test/tools/curation.test.ts, +10/-4). No src/ changes, so none of the repo's hard invariants (frontmatter-as-metadata, derived SQLite index, git-as-version-layer, advisory-only curation, existence-disclosure rules, Result<T, Error>, no classes) are in play here, and no new tool is added so the "every tool needs a test file" rule doesn't apply.

Correctness: The fix itself is sound — (def?.outputSchema as {...}).properties and the explicit if (!schema) throw guard are behaviorally equivalent (both throw when outputSchema is missing), just with a named error instead of an implicit TypeError. However, per the PR description, the goal is to clear Biome 2.5.5's noUnsafeOptionalChaining rule so #336's gates go green. That same flagged shape — (x?.y as T).z, where the cast/parens break the ?. short-circuit — is still present, unfixed, in this same file at lines 206, 231, and 294 ((def?.inputSchema as { required?: unknown }).required). Left inline comment on this. If Biome 2.5.5 flags the two outputSchema occurrences this PR fixes, it should flag these inputSchema occurrences too, which would mean #336 stays red after rebasing onto this fix.

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
Comment thread test/tools/curation.test.ts Outdated
Comment thread test/tools/curation.test.ts
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
@mavaali
mavaali merged commit 8a87a7c into main Aug 9, 2026
9 checks passed
@claude claude Bot mentioned this pull request Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants