fix: make phantoms cover descendant paths and remove skip cap#3375
Open
theletterf wants to merge 2 commits into
Open
fix: make phantoms cover descendant paths and remove skip cap#3375theletterf wants to merge 2 commits into
theletterf wants to merge 2 commits into
Conversation
Phantoms now correctly cover all descendants, not just direct children. The hard cap on phantom-skipped files is removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <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.
Why
Declaring a phantom for a TOC path (e.g.
elasticsearch://reference/ingest-processor) is the intended way to unblock a content-repo PR that adds a new TOC before it's wired intonavigation.yml. But two bugs made this fail in practice:Exact-match instead of prefix match. The checker computed the direct parent directory of each file and compared it to the phantom set with
==. A file atingest-processor/subdir/file.mdproducedpathUri = elasticsearch://reference/ingest-processor/subdir, which does not equal the declared phantomelasticsearch://reference/ingest-processor. Only files exactly one level deep in the phantom namespace were ever skipped; anything nested deeper generated errors.Hard cap of
_phantoms.Count * 3triggered errors on real TOC trees. With the current six phantoms the limit was 21. Shaina's ingest-processor PR has 22 files directly in the phantom directory, which is why the phantom was added in #3306, caused CI to emitToo many items are being marked as part of a phantom this looks like a bug. (22), and had to be reverted twice.What
p == pathUriexact comparison withIsPhantomOrDescendant, which checks that the candidate URI shares the same scheme and host as the phantom and that its path starts with the phantom's path. This means a single phantom entry covers all files nested under that path.skippedPhantomscounter and the> _phantoms.Count * 3error guard entirely. The guard was a rough heuristic that fired on legitimate large TOC trees; with proper prefix matching there is no meaningful upper bound to enforce.Order of operations for Shaina's work (after this merges)
Shaina is trying to move the processor reference docs from
enrich-processortoingest-processor(docs-content#1171). Her current approach (the "copy first" strategy in #3367) is:elasticsearch://reference/ingest-processorback to thephantoms:section ofnavigation.ymlin a small docs-builder PR and merge it.ingest-processor/are covered by the phantom.phantoms:totoc:with apath_prefix, wiring up the new docs in the nav.enrich-processor, clean up stub).