Repository navigation
Conversation
…e image The runtime image bundled every dist/docs snapshot, but at runtime only Addie's docs index reads dist/docs, and only the docs.json versions. Mintlify serves the docs site from git, and the artifact CDN answers /schemas, /compliance and /protocol from R2. Prune dist/docs/<X.Y.0-(beta|rc).N> once the X.Y line has a stable release, unless docs.json, hosted grading, a schema alias or a training checkpoint names that version. 3.3 prereleases stay until 3.3 goes GA. The pruned-tree check now also enforces the docs closure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
The runtime image bundles every
dist/docs/<v>snapshot. Nothing in the app reads most of them. This PR stops bundling docs snapshots of prereleases whose line has gone GA: a prereleaseX.Y.0-(beta|rc).Ncounts as superseded onceX.Yhas a stable release. It keeps a superseded snapshot whendocs.json,published-versions.json, a schema discovery alias orRETAINED_SCHEMA_BUNDLESnames that version. Every 3.3 prerelease stays, because 3.3 has no GA yet. Nothing is deleted from git, and the CDN and Mintlify keep serving everything.Draft: this change alone does not give rc.2 (#9091) the headroom we targeted. The numbers are below. Because the build hard-links identical files across snapshots, removing 21 snapshots frees only 134 MiB. The decision on how far to widen the prune is open.
Size
I measured with the image's own steps on a full clone of each tree:
npm run build:schemas,build:compliance,build:protocol-tarball, thenscripts/deduplicate-runtime-artifacts.cjs, then the prune. I compareddu -sm distunder main's prune script againstdu -sm distunder this PR's. The measurement skips only the protocol offload, which downloads from the CDN, and the offload is the same on both sides. The difference between main and rc.2 under main's script is 172 MiB, which matches the gate exactly (7538 − 7366). So the dist difference carries straight into the gate'sdu -sm /app.859ea919e8923135This passes the rc.2 gate, but only by 20 MiB. The next RC adds about 172 MiB, which would overflow it again.
Wider options, measured on the same rc.2 clone:
docs.jsonsnapshots (the only ones any runtime code reads)Consumer trace
dist/docs/<v>server/src/addie/mcp/docs-indexer.ts) reads only the snapshotsdocs.jsonnavigation.versionsnames. It cites Mintlify URLs. The "Production docs index smoke" job checks exactly those versions.docs.jsonversions are always kept. None of them is a superseded prerelease today (they are 2.5.3, 3.0.28, 3.1.32, 3.2.8, 3.3.0-beta.5 and 3.3.0-rc.0)./docs/<v>,/dist/docs/<v>on adcontextprotocol.orgdocs.adcontextprotocol.org/dist/docs/3.2.0-rc.7/…from git.dist/schemas/<v>schemas-middleware.tsserves/schemas. The training agent (schema-compat.ts) uses retained and preview bundles. Hosted compliance uses published bundles. The Addie indexer usesdocs.jsonversions.workers/artifact-cdnWorker answersadcontextprotocol.org/schemas/*,/compliance/*and/protocol/*from R2 before the app sees them. Checked live:/schemas/3.2.0-beta.0/index.jsonreturns 200 with an R2 strong ETag and nofly-request-id, though that directory is not in the image.dist/compliance/<v>hosted-compliance-version.ts(hostedComplianceOptions,bundledComplianceVersions) andforward-introduced-specialisms.ts.rewriteSchemaDiscoveryfiltersdist/schemas/index.jsonto the schema keep set.Superseded prereleases that a runtime list names are kept, docs snapshot included:
published-versions.json: 3.1.0-beta.7, 3.1.0-rc.4, rc.6, rc.7, rc.10, 3.2.0-beta.6 and 3.2.0-rc.0 through rc.7RETAINED_SCHEMA_BUNDLES: 3.2.0-beta.6 and 3.2.0-rc.7I didn't edit either list.
What's excluded
There are 21 docs snapshots: 3.0.0-beta.3; 3.0.0-rc.1 and rc.2; 3.1.0-beta.0, 1, 3 and 4; 3.1.0-rc.11, 13 and 15; 3.2.0-beta.0 through 5; and 3.2.0-beta.7 through 11.
Changes
scripts/prune-runtime-artifacts.cjs: addsmanifest.docsSnapshots, prunesdist/docsto it, and makesverifyPrunedTreeenforce the docs closure. A line counts as GA when any stableX.Y.zartifact exists. 3.2.0 shipped package-only, so the 3.2 line's first bundled stable is 3.2.1.tests/runtime-artifact-pruning.test.cjs: covers a superseded prerelease pruned, a prerelease on a pre-GA line kept, superseded prereleases named by hosted grading, training ordocs.jsonkept, a patch-only stable line, repeat runs, and a fail-closed check when a superseded snapshot survives.Dockerfile: comment only.There's no changeset, because this is build-only and must not change the pending rc.2 release.
Tests
npm run test:runtime-artifacts: 17 of 17 passed.docs-indexer,hosted-compliance-versionandtraining-agent-schema-compatunit tests: 75 of 75 passed.schema-routingintegration tests: 31 of 31 passed.artifact-cdn-workertests: 41 of 41 passed.npm run typecheckandnpm run precommitpassed.🤖 Generated with Claude Code