fix(shopify): parse malformed llms.txt#3
Draft
Jadenzzz wants to merge 3 commits into
Draft
Conversation
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.
🧰 Changes
The llms.txt extractor was silently dropping the majority of links on many real docs sites. Importing https://shopify.dev/docs produced 2 off-origin "Deploy to Fly.io / Render" pages as if they were the entire Shopify site, instead of the ~hundreds of actual Shopify references the file contains.
Five layered fixes to
parseLlmsTxt/fetchLlmsTxt, plus one thread-through in the prompt builder.Fixes
*and+bullets, not just-sinceCommonMarkallows all three; thellms.txtspec doesn't pin one. Shopify uses*; under the old regex 16/18 of its bullets were silently dropped.##–####as section starts — Shopify's file has only 2##headings, with 18###and 54####carrying the real structure. The old h2-only check collapsed everything into a single mega-section.[text](url)links from paragraph prose — Some files (Shopify, again) keep most refs in narrative text rather than bullet lists. Added a second sweep that runs on non-bullet, non-code-fence lines. Items dedupe by URL across the parse.**Extension targets**,*italic*,__bold__, and combined forms like**_x_**are unwrapped. Asymmetric input (**foo) is left untouched.🧬 QA & Testing
Provide as much information as you can on how to test what you've done.
Loom
https://www.loom.com/share/4bacf2d0195040f4a10bd2efaaf1dff4