fix: scope Context7 index to developer-facing folders and disambiguate spartan naming - #24768
Merged
Conversation
…e `spartan` naming
alejoamiras
approved these changes
Jul 17, 2026
alejoamiras
marked this pull request as ready for review
July 17, 2026 14:15
alejoamiras
enabled auto-merge
July 17, 2026 14:15
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.
Problem
An external developer's LLM agent, migrating to v5, latched onto "spartan" and treated it as a release channel — something to install or migrate to. Alex tasked Codex with investigating why, and it traced a contamination path through the AI context we ourselves recommend. The published docs are clean; the context they point agents at is not scoped.
The concrete findings, each verified against this repo:
context7.jsonhad no folder restrictions — just aurlandpublic_key. The Context7 Aztec index therefore covers the entire monorepo: ~1.95M tokens, ~23k snippets. Atopic=spartanquery returns deployment infrastructure prominently.spartan/is pure infrastructure — 272 YAML/Terraform/shell files, andspartan/README.mdopens with "The Spartan Kubernetes cluster is used to run Aztec's public-facing node infrastructure." None of it is relevant to building on Aztec, but it is all snippet fuel for the index.docs/docs-developers/ai_tooling.mddescribed Context7 as having "Aztec docs" — which was not what the index actually contained, so we were pointing developers at the whole monorepo while telling them it was docs.CLAUDE.mdteaches agentsmerge-train/spartanandmerge-train/spartan-v5without ever saying whatspartanis not. An agent cloning the repo for v5 work reads "spartan-v5" next to "v5 release line" and the conflation is an easy step to take.Changes
context7.json— scope the index to developer-facing surfaces viafolders, which is what actually cuts the 1.95M-token surface down:docs/docs,docs/docs-developers,noir-projects/aztec-nr,yarn-project/aztec.js,boxesexcludeFoldersadditionally names the infrastructure directories explicitly. With the allow-list in place this is belt-and-braces, but it records the intent durably so a later widening offoldersdoesn't silently pullspartan/back in — that being the specific thing Alex asked to have "entirely ignored". Drop it if you'd rather not carry redundant config.Three
rulesare added. The first directly counteracts the observed failure — it tells agents thatspartan,merge-train/*,next, andv5-nextare internal repo/infrastructure names and must never be handed to a user as something to install or migrate to. The other two mirror the failure modesai_tooling.mdalready calls out (version compatibility,aztecCLI over barenargo/bb).CLAUDE.md— one sentence after the merge-train table saying whatspartanis and, more importantly, what it isn't. The branch table itself is needed by internal contributors and is unchanged. (AGENTS.mdis a symlink toCLAUDE.md, so Codex picks this up too.)docs/docs-developers/ai_tooling.md— the Context7 bullet now describes what the index actually contains and says the infrastructure is deliberately excluded, instead of claiming "Aztec docs".Trade-offs and review questions
I'm not the owner here and Alex flagged that docs ownership is unclear, so the judgment calls are worth a look:
docs/docs-operateis not in the allow-list. It is curated, published operator documentation, so it's a much milder problem than raw Helm charts — but it is infrastructure-flavoured, andai_tooling.mdpoints app developers at Context7. I left it out to keep the index focused on the app-developer audience. Reasonable to add back if operators are meant to be served by this index.docs/developer_versioned_docs, 3.9M) are excluded by virtue of not being listed. That's deliberate — indexing several old versions alongside current ones invites exactly the version-confusion class of bug this PR is about — but it does mean Context7 won't serve older-version answers.spartan/but leave the whole ofyarn-project/andbarretenberg/indexed, which is still enormous and still not "docs". I went with the allow-list because it makes theai_tooling.mddescription true; tell me if that's too sharp a cut.Verification
context7.jsonvalidates against the published schema — every field used (folders,excludeFolders,rules,projectTitle,description,$schema) is real, anddescription(124 chars) andprojectTitleare within their length bounds. Field semantics were confirmed against the schema rather than assumed.Note that the index only shrinks once Context7 re-parses the repo — merging this does not retroactively clean the existing index. Worth confirming the re-index lands, and re-running the
topic=spartanquery above afterwards to check the infrastructure content is actually gone.This addresses the contamination path but can't prove the original agent's behaviour is fixed; Codex's own conclusion was an inference ("likely conflated repository/merge-train terminology with a release channel"), and there was no evidence of "latest spartan" coming from beta documentation content. So this closes the plausible route rather than a confirmed one.
Created by claudebox · group:
slackbot· Slack thread