Repository navigation
fix(runtime): drop superseded prerelease trees from the Fly image - #9405
Merged
Merged
Conversation
The runtime image measured 7471 MiB with the 3.3.4 forward merge, over the 7424 MiB ceiling. Every superseded prerelease shipped a full schema tree of about 147 MB, and consecutive versions share no files. prune-runtime-artifacts now computes the superseded set: a prerelease whose GA (same major.minor.patch) is in published-versions.json and that no docs snapshot, schema alias target or training bundle names. Its schema and compliance trees leave the image. They stay in Git and on the R2 CDN, and published-versions.json is unchanged. Every GA, every anchor and any prerelease line without a GA stays, and the closure check refuses to drop anything else. Hosted grading refuses a pin to a dropped version with SupersededComplianceTargetError. The message names the version, the GA line to use and the CDN URLs. The registry storyboard routes return it as a 400 with error_kind superseded_compliance_target, and Addie's tools return the same message. A checkout that still holds the trees keeps grading them. The image smoke now asserts the refusal for every dropped published version. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
30-day traffic check (condition 1), run against prod read-only (
No dropped version has real traffic, so every tree on the drop list can go. The condition is met. |
The frozen creative 3.3 sandbox validates against dist/schemas/3.3.0-beta.1, which the first round classed as superseded. Its first request in the image would throw, and every later request too. - prune-runtime-artifacts imports CREATIVE33_SCHEMA_VERSION and any configured TRAINING_AGENT_HOSTED_PREVIEW bundle from the TypeScript source, the way it imports RETAINED_SCHEMA_BUNDLES, and anchors them. The router's bundle constant now reads the catalog's. - verify-training-agent-runtime-assets resolves the creative 3.3 tree, so the final image fails to build without it. - A new pruning test finds every resolveRetainedSchemaRoot call site in server/src, imports the constants they read, and requires each one to stay in the runtime closure. - Runs recorded against a dropped prerelease read step metadata from their GA release's bundle through hostedComplianceOptionsForRecordedVersion, in compliance-testing, storyboard-skip-details and v4-readiness. - Addie tool descriptions and the OpenAPI compliance_target descriptions stop suggesting 3.3-beta. The three storyboard catalog routes document the 400 ComplianceTargetRejection body. The OpenAPI spec, the Addie tool-surface inventory and its reviewed profile hash are regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merge record. Brian O'Kelley, 6 Dec 2026: "Approve adcp #9405 on 728304d under my account and merge it; then land #9401, #9402 and #9403 in order." GitHub refused the approval because this PR is opened under Brian's own login, so it was admin-merged on head 728304d (merge 4168409). Before merging, the head had every required check green (63 checks) and the independent review's blocker (the creative33 sandbox's 3.3.0-beta.1 tree) fixed. Merged by the Storefronts & Supply orchestrator agent under Brian's account. |
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 Fly runtime image is over its 7424 MiB ceiling. With the 3.3.4 forward merge (#9401) it measures 7471 MiB, and "Production Docker build" and "Production docs index smoke" fail. The trend is 6882 MiB (Dec 4), then 7157 MiB (Dec 5), then 7471 MiB.
This PR stops shipping superseded prerelease schema and compliance trees in the image. A superseded prerelease is one whose GA (same major.minor.patch) is in
static/compliance/published-versions.jsonand that no runtime anchor names. The trees stay in Git and stay published on the R2 CDN, andpublished-versions.jsonis unchanged. Hosted grading refuses a pin to one of them by name.Measured locally on main + #9401 + this PR (head 728304d):
Runtime application size: 5714 MiB (limit: 7424 MiB). The baseline is CI's 7471 MiB on #9401, so this saves about 1.75 GiB. The first revision measured 5568 MiB; the difference is the 3.3.0-beta.1 tree, now kept for the creative 3.3 sandbox. The build useddocker build --build-arg SKIP_PRECLONE_REPOS=true, the same as the CI job. The combined branch was local only and was not pushed.Follow-up for the structural fix: #9404, "Lazy-load non-current schema/compliance bundles from R2 instead of shipping them in the Fly image" (4.0 milestone).
Keep and drop sets
The script computes both sets at build time; no version is hardcoded. On main + #9401 they are:
Dropped (schema and compliance trees leave the image; hosted grading refuses them):
3.1.0-beta.7, 3.1.0-rc.2, 3.1.0-rc.4, 3.1.0-rc.6, 3.1.0-rc.7, 3.1.0-rc.8, 3.1.0-rc.9, 3.1.0-rc.10, 3.1.0-rc.14, 3.3.0-beta.0, 3.3.0-beta.2 … 3.3.0-beta.6, 3.3.0-rc.0, 3.3.0-rc.2Compliance trees are also removed for unpublished superseded checkpoints that were never hosted:
3.1.0-rc.1, rc.3, rc.5, rc.11, rc.12, rc.13, rc.15and3.3.0-rc.1. Their schema trees were already pruned.Kept:
published-versions.json.aliases,latest,latest_stable,latest_by_major,latest_by_minor): 2.5.3, 3.0.28, 3.1.34, 3.2.12, 3.3.3, and 3.3.4 with Forward-merge 3.3.x → main #9401;docs.json;RETAINED_SCHEMA_BUNDLES: 3.2.0-beta.6, 3.2.0-rc.7 and 3.3.0-rc.3;CREATIVE33_SCHEMA_VERSION, 3.3.0-beta.1.fly.tomlenablesENABLE_ADCP_3_3_CREATIVE_ROUTE;TRAINING_AGENT_HOSTED_PREVIEWbundle when one is configured. None is configured today.3.3.0-rc.3and3.3.0-beta.1therefore stay hosted, so3.3-rc,3.3-rc.3and3.3-beta.1still grade.4.0.0-beta.Nis kept until4.0.0is published, then dropped automatically.latest, and the non-superseded compliance trees left as they were, for example the 3.2.0 prereleases, because 3.2.0 itself was never published.The script imports the sandbox and preview anchors from the same TypeScript constants the server reads, through
tsx, the way it already importsRETAINED_SCHEMA_BUNDLES.I checked that every dropped tree is served by the CDN without touching Fly. Each of
/schemas/3.3.0-rc.2/,/schemas/3.3.0-rc.0/,/schemas/3.1.0-beta.7/,/compliance/3.3.0-rc.2/,/compliance/3.3.0-beta.6/,/compliance/3.1.0-rc.14/,/compliance/3.1.0-rc.1/and/compliance/3.3.0-rc.1/returned 200 with an R2 ETag and nofly-request-id.Safety rails
verifyRequiredArtifactsrequires every hosted version, meaning published minus superseded, to have both its compliance and schema trees.verifyPrunedTreefails if any superseded compliance tree survives.verify-training-agent-runtime-assets, which runs on the final image, now also resolves the creative 3.3 sandbox tree. A missing tree fails the build instead of the sandbox's first request.resolveRetainedSchemaRootcall site inserver/srcand requires the list to match a reviewed set. It then imports the constants those sites read (CREATIVE33_SCHEMA_VERSION,RETAINED_SCHEMA_BUNDLE(S), the hosted preview) and asserts each one is in the runtime closure. A new exact-version reader fails the test until it is anchored.identity33, the proposal-negotiation profiles),hosted-grader,served-release-fields, which uses the SDK's bundles, the docs indexer, which reads docs versions, and thecanonicalSchemaBundleVersioncallers, all of which feedRETAINED_SCHEMA_BUNDLES.Refusal at a dropped pin
server/src/services/hosted-compliance-version.tsaddsSupersededComplianceTargetErrorwithcode: 'superseded_compliance_target'. It is thrown when a pin resolves to a superseded prerelease whose bundle isn't on disk. That covers an exact pin (3.3.0-beta.6), a wire pin (3.3-beta.6) and a channel alias whose newest checkpoint is gone (3.3-beta,3.1-rc,3.1-beta). Every path that loads hosted artifacts refuses the same way. Output from the built image:How each surface returns it:
/api/storyboards,/api/storyboards/{id},/api/storyboards/{storyboardId}/first-step):400in the existing{ error }shape, pluserror_kind: "superseded_compliance_target",requested_compliance_target,adcp_version,ga_compliance_target,schemas_urlandcompliance_url. This is documented in OpenAPI as theComplianceTargetRejection400 response on all three routes, andstatic/openapi/registry.yamlis regenerated. Before this change, a resolution failure at these routes collapsed into the generic invalid-target message.targetFromInput): aToolErrorwith the same message.compliance_targettool descriptions and the OpenAPIcompliance_targetdescriptions no longer suggest3.3-beta; they suggest3.3, or3.3-rcfor a prerelease. Because the tool descriptions changed, the Addie tool-surface inventory and its reviewed profile hash are regenerated, as in fix(addie): say health_check_url also covers buying agents with no endpoint #9338.Selection and historical runs:
compliance-testing.ts,storyboard-skip-details.tsandv4-readiness.tsre-resolve a stored run'sadcp_versionto look up step ids and required tools. They now usehostedComplianceOptionsForRecordedVersion, which falls back to the prerelease's GA release's bundle when the prerelease is retired. For example, a run recorded on 3.3.0-rc.2 reads 3.3.0.A checkout that still holds the trees, such as local development or the unit tests, keeps grading them. Only the image refuses.
30-day traffic check
Done against prod, read-only: #9405 (comment).
agent_compliance_runshad 3,599 runs from 55 agents in the last 30 days. Zero runs and zeroaddie_agent_quality_evaluationsrows were on a dropped pin (exact, wire form, or the3.3-beta/3.1-beta/3.1-rcaliases), excluding our own and localhost agents. The query below is the one that was run. Its list includes 3.3.0-beta.1, which this revision keeps.Query
Notes
forwardIntroducedSpecialismsreads every bundled compliance tree. Removing the 3.1 and 3.3 prereleases changes its answer only for a specialism that appeared in a prerelease and was removed before GA. 3.3.x and 3.1.x GA bundles remain to anchor everything else.Dockerfile: comment only. The 7424 MiB ceiling is unchanged..dockerignoreis unchanged.Tests
npm run test:runtime-artifacts: 22/22 passed. New tests cover:3.3.0-rc.3stay, and only superseded prereleases leave;4.0.0-beta.1and an unpublished superseded compliance tree;4.0.0GA: it fails closed until its trees exist, then retires4.0.0-beta.1;verifyRequiredArtifactsfailing when an anchored superseded tree is missing.server/tests/unit/hosted-compliance-superseded-prerelease.test.ts(8 tests): exact, wire and alias refusals; the exact message; every artifact-loading path; kept GA, rc.3 and an unshipped line; automatic selection skipping retired checkpoints; the historical-run GA fallback.server/tests/unit/registry-superseded-compliance-target-route.test.ts(5 tests): the 400 body on all three catalog routes, and the generic refusal unchanged.npm run test:addie-toolsandtsc --project server/tsconfig.json --noEmit: clean.verify:training-agent-runtimeverified the creative 3.3 sandbox schema (3.3.0-beta.1) in the builder and in the final image;ensureCreative33SchemaBundle()registered the bundle and thevalidate_inputvalidator resolved, and a recorded 3.3.0-rc.2 run read 3.3.0.🤖 Generated with Claude Code