Refactor indexing methods for clarity ahead of "transitive" indexing - #1066
Merged
myronmarston merged 2 commits intoMar 4, 2026
Merged
Conversation
Renames `index_def` to `own_index_def` to clarify it returns nil for types that inherit indexing from abstract parents. Splits `indexed?` into `has_own_index_def?` (checks for own index definition) and `root_document_type?` (checks if queryable at document root). This makes the semantic intent clearer at each call site and prepares the codebase for transitive indexing support. Related to #1029 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
marcdaniels-toast
requested review from
BrianSigafoos-SQ,
bsorbo,
jwils,
jwondrusch and
myronmarston
as code owners
March 4, 2026 01:01
myronmarston
requested changes
Mar 4, 2026
myronmarston
left a comment
Collaborator
There was a problem hiding this comment.
💯 Thanks for taking the time to spin this off. Left a few minor suggestions!
Updates terminology and naming throughout the codebase based on PR #1066 review feedback to use "root document type" consistently instead of "indexed" where semantically appropriate. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
myronmarston
approved these changes
Mar 4, 2026
myronmarston
left a comment
Collaborator
There was a problem hiding this comment.
LGTM! I'll merge once the build passes.
2 tasks
jwils
added a commit
that referenced
this pull request
Apr 23, 2026
Distills the patterns Myron Marston applies when reviewing merged PRs (naming at the caller's level of abstraction, respond_to? as a code smell, wrapper-class DI pattern, load-bearing tests, RBS/YARD hygiene, etc.) into an edit-first skill. Invoked as /myron-polish, the skill walks the current branch's diff against main and applies fixes directly rather than producing review comments. It loops — re-scan, apply edits, run script/lint --fix / script/spellcheck -w / script/type_check / script/run_gem_specs — until a full iteration makes zero edits and every verification command passes. Capped at 8 iterations. Source material: Myron's review bodies and inline comments on merged PRs #974, #973, #1067, #1066, #1108, #1120, #1131, #1134, #1144, #1107. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors indexing-related methods to clarify their semantic intent ahead of transitive indexing support (related to #1029).
Changes
index_deftoown_index_defto clarify it returns nil for types that inherit indexing from abstract parentsindexed?into two more precisely-named methods:has_own_index_def?- checks if a type has its own index definition (not inherited)root_document_type?- checks if a type is queryable at the document root in the datastoreContext
This prep work makes the distinction between "has own index" vs "is queryable at root" explicit. When we implement transitive indexing (letting a parent type's index setting cascade to its subtypes),
root_document_type?will expand to also return true for types that inherit indexing from their parents. Today it already returns true for abstract types whose subtypes are indexed; with transitive indexing, it will also return true for concrete subtypes that inherit their parent's index.The intent is we can keep the semantics consistent during the implementation of this feature:
root_document_type?means "is this type queryable at the document root?" regardless of whether that's via its own index, inherited from a parent, or because its subtypes are indexed.