Skip to content

Expand parent type and definition tokens to subtypes via schema lineage - #157

Merged
arrry-hydraDB merged 1 commit into
hydra-db:mainfrom
kruschdev:fix/expand-tokens-subtypes
Nov 16, 2026
Merged

arrry-hydraDB merged 1 commit into
hydra-db:mainfrom
kruschdev:fix/expand-tokens-subtypes

Conversation

@kruschdev

@kruschdev kruschdev commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Reuse _lineage (lineage in TypeScript) with _entity_index (entityIndex) in expand_tokens (expandTokens) so matching an ancestor entity type or a definition owned by an ancestor type adds the tokens of every descendant subtype in schema.entities, without introducing a separate subtype map or cycle guard.
  • Align retrieve(..., seeds="synonyms") with check_answerable when stored entities use subtypes of a queried parent type or definition owner.
  • Add mirrored regression tests in tests/test_tiers.py, typescript/test/tiers.test.ts, and cross-language conformance (py_side.py / ts_side.ts).

Linked issue

Closes #153

AI Assistance

Model Effort
Gemini 4 Carbon / Hydrogen High

Checklist

  • Implements an issue a maintainer has /approved.
  • Small and scoped to that issue.
  • Breaking changes described below, or none.

Breaking changes

None.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown

This is PR 3 of 3 you may keep open at a time.

@arrry-hydraDB arrry-hydraDB left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arrry-hydraDB
arrry-hydraDB merged commit db1fe51 into hydra-db:main Nov 16, 2026
20 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.

expand_tokens ignores EntityType.parent subtypes, so retrieve(seeds='synonyms') returns 0 results for questions check_answerable marks 'answerable'

2 participants