Skip to content

Comments

fix(coverage): reduce false positives in negative test isolation#5398

Merged
madskristensen merged 1 commit intoSchemaStore:masterfrom
miteshashar:fix-coverage-tool-type-inference
Feb 23, 2026
Merged

fix(coverage): reduce false positives in negative test isolation#5398
madskristensen merged 1 commit intoSchemaStore:masterfrom
miteshashar:fix-coverage-tool-type-inference

Conversation

@miteshashar
Copy link
Contributor

Summary

  • Fix negative test isolation heuristic overwriting type/pattern/enum constraints when the same property name appears at different schema nesting depths
  • Union all constraints per property name instead of last-write-wins
  • Infer types from anyOf/oneOf/allOf variants when no explicit type is declared
  • Update heuristic note to advise manual verification of flagged files

Context

The source property in claude-code-settings.json appears as both an object (marketplace source config) and a string (source type discriminator like "git", "url"). The old code kept only the last-seen type, causing false wrong_type violations in negative test files that were actually single-violation.

Test plan

🤖 Generated with Claude Code

The negative test isolation heuristic used name-based property matching
but overwrote constraints when the same property name appeared at
different schema depths (e.g., "source" as object at one level and
string at another). This caused false wrong_type violations.

Changes:
- Union all types, patterns, and enum values per property name instead
  of overwriting with last-seen value
- Infer types from anyOf/oneOf/allOf variants when no explicit type is
  declared on a property schema
- Update heuristic note to advise manual verification of flagged files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @madskristensen and @hyperupcall - if they write a comment saying "LGTM" then it will be merged.

@madskristensen madskristensen merged commit a10d372 into SchemaStore:master Feb 23, 2026
5 checks passed
@madskristensen
Copy link
Contributor

Awesome. Thanks

@miteshashar miteshashar deleted the fix-coverage-tool-type-inference branch February 23, 2026 20:01
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