Skip to content

Fix false negative for nested schema types like HowTo#17

Merged
arberx merged 4 commits intomainfrom
arberx/fix-nested-howto
Mar 25, 2026
Merged

Fix false negative for nested schema types like HowTo#17
arberx merged 4 commits intomainfrom
arberx/fix-nested-howto

Conversation

@arberx
Copy link
Copy Markdown
Member

@arberx arberx commented Mar 25, 2026

Summary

  • Schema type detection (extractSchemaTypes and findSchemaByType) now recursively traverses nested objects, fixing false negatives for schemas like HowTo nested inside a parent (e.g. LocalBusiness.hasProcess)
  • Consolidated duplicate findSchemaByType from schema-completeness.ts and eeat-signals.ts into a shared recursive helper in helpers.ts
  • Added tests for nested HowTo detection at both the helper and analyzer levels

Test plan

  • pnpm run typecheck passes
  • pnpm test passes (17/17), including 2 new tests for nested schema detection

Closes AINYC/ainyc#87

🤖 Generated with Claude Code

arberx and others added 4 commits March 25, 2026 08:11
The structured data checker only inspected top-level @graph entries,
missing schemas nested inside parent objects (e.g. HowTo inside
LocalBusiness via hasProcess). Recursively traverse all nested objects
to collect @type values at any depth.

Consolidates duplicate findSchemaByType into a shared recursive helper
used by structured-data, schema-completeness, and eeat-signals analyzers.

Closes AINYC/ainyc#87

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add findTopLevelSchemaByType helper and update analyzeEeatSignals to use
it for Organization/LocalBusiness/ProfessionalService (top-level only),
and for Person use top-level + authorial properties (author, creator,
contributor) — catching Article.author patterns without inflating scores
from incidental nested references like Review.author or customer schemas.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@arberx arberx merged commit 51a8a02 into main Mar 25, 2026
2 checks passed
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.

1 participant