Skip to content

fix(runtime): drop superseded prerelease trees from the Fly image - #9405

Merged
bokelley merged 2 commits into
mainfrom
bokelley/drop-superseded-prerelease-trees
Dec 6, 2026
Merged

bokelley merged 2 commits into
mainfrom
bokelley/drop-superseded-prerelease-trees

Conversation

@bokelley

@bokelley bokelley commented Dec 6, 2026 •

Copy link
Copy Markdown
Contributor

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.json and that no runtime anchor names. The trees stay in Git and stay published on the R2 CDN, and published-versions.json is 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 used docker 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.2

Compliance 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.15 and 3.3.0-rc.1. Their schema trees were already pruned.

Kept:

  • Every GA in published-versions.json.
  • Runtime anchors, kept with both trees whatever their release state:
    • schema-index alias targets (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 snapshots from docs.json;
    • training RETAINED_SCHEMA_BUNDLES: 3.2.0-beta.6, 3.2.0-rc.7 and 3.3.0-rc.3;
    • the creative 3.3 sandbox bundle CREATIVE33_SCHEMA_VERSION, 3.3.0-beta.1. fly.toml enables ENABLE_ADCP_3_3_CREATIVE_ROUTE;
    • the training agent's TRAINING_AGENT_HOSTED_PREVIEW bundle when one is configured. None is configured today.
  • 3.3.0-rc.3 and 3.3.0-beta.1 therefore stay hosted, so 3.3-rc, 3.3-rc.3 and 3.3-beta.1 still grade.
  • Any prerelease line without a GA. A future 4.0.0-beta.N is kept until 4.0.0 is 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 imports RETAINED_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 no fly-request-id.

Safety rails

  • verifyRequiredArtifacts requires every hosted version, meaning published minus superseded, to have both its compliance and schema trees.
  • Every superseded version must be a prerelease whose own GA is hosted and that no anchor names. Every published version must be exactly one of hosted or superseded. If either check fails, the build fails before anything is deleted.
  • Registering a new GA without its trees fails the build, so the new GA's prereleases can't be pruned early.
  • verifyPrunedTree fails 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.
  • A new test finds every resolveRetainedSchemaRoot call site in server/src and 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.
  • I grepped for other exact-version readers and found no others. Covered: lab sandboxes (identity33, the proposal-negotiation profiles), hosted-grader, served-release-fields, which uses the SDK's bundles, the docs indexer, which reads docs versions, and the canonicalSchemaBundleVersion callers, all of which feed RETAINED_SCHEMA_BUNDLES.
  • Protocol offload is unchanged. Dropped prereleases are long published to R2, so their archives already pass the existing R2 discovery check.

Refusal at a dropped pin

server/src/services/hosted-compliance-version.ts adds SupersededComplianceTargetError with code: '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:

AdCP compliance target "3.3-beta" (3.3.0-beta.6) is a superseded prerelease: AdCP 3.3.0 has shipped, so 3.3.0-beta.6 is no longer graded on the hosted service. Use the GA line instead (compliance_target "3.3"). The 3.3.0-beta.6 bundles are still published at https://adcontextprotocol.org/schemas/3.3.0-beta.6/ and https://adcontextprotocol.org/compliance/3.3.0-beta.6/.

How each surface returns it:

  • Registry storyboard catalog routes (/api/storyboards, /api/storyboards/{id}, /api/storyboards/{storyboardId}/first-step): 400 in the existing { error } shape, plus error_kind: "superseded_compliance_target", requested_compliance_target, adcp_version, ga_compliance_target, schemas_url and compliance_url. This is documented in OpenAPI as the ComplianceTargetRejection 400 response on all three routes, and static/openapi/registry.yaml is regenerated. Before this change, a resolution failure at these routes collapsed into the generic invalid-target message.
  • Addie compliance tools (targetFromInput): a ToolError with the same message.
  • Suggested targets: the generic invalid-target hint, the Addie compliance_target tool descriptions and the OpenAPI compliance_target descriptions no longer suggest 3.3-beta; they suggest 3.3, or 3.3-rc for 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:

  • Automatic target selection (heartbeat, canonical, profile-based) already skips targets that don't resolve. An agent that advertises only a dropped checkpoint is now treated like one that advertises no hosted target and falls back to the default line, which is how unpublished prereleases already behave.
  • Historical runs. compliance-testing.ts, storyboard-skip-details.ts and v4-readiness.ts re-resolve a stored run's adcp_version to look up step ids and required tools. They now use hostedComplianceOptionsForRecordedVersion, 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.
    • Those lookups match by step id or by an unambiguous title+task pair. A step the GA kept resolves; a step it renamed or dropped comes out undefined, as it did before.
    • The fallback is used for metadata only, never for grading.

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_runs had 3,599 runs from 55 agents in the last 30 days. Zero runs and zero addie_agent_quality_evaluations rows were on a dropped pin (exact, wire form, or the 3.3-beta / 3.1-beta / 3.1-rc aliases), 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
BEGIN READ ONLY;
WITH dropped(v) AS (VALUES
  ('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.1'),('3.3.0-beta.2'),
  ('3.3.0-beta.3'),('3.3.0-beta.4'),('3.3.0-beta.5'),('3.3.0-beta.6'),('3.3.0-rc.0'),('3.3.0-rc.2')),
pins(v) AS (
  SELECT v FROM dropped
  UNION SELECT regexp_replace(v, '^(\d+\.\d+)\.0-', '\1-') FROM dropped   -- wire form, e.g. 3.3-beta.1
  UNION VALUES ('3.3-beta'), ('3.1-beta'), ('3.1-rc'))                     -- refused channel aliases
SELECT 'agent_compliance_runs' AS source, COALESCE(r.adcp_version, '-') AS version,
       COALESCE(r.requested_compliance_target, '-') AS requested, r.triggered_by,
       COUNT(*) AS runs, COUNT(DISTINCT r.agent_url) AS agents
FROM agent_compliance_runs r
WHERE r.tested_at >= NOW() - INTERVAL '30 days'
  AND (r.adcp_version IN (SELECT v FROM dropped) OR r.requested_compliance_target IN (SELECT v FROM pins))
  AND r.agent_url NOT ILIKE '%adcontextprotocol.org%'   -- our training/test agents
  AND r.agent_url NOT ILIKE '%localhost%' AND r.agent_url NOT ILIKE '%127.0.0.1%'
GROUP BY 1, 2, 3, 4
UNION ALL
SELECT 'addie_agent_quality_evaluations', '-', e.compliance_target, '-', COUNT(*), COUNT(DISTINCT e.agent_url)
FROM addie_agent_quality_evaluations e
WHERE e.started_at >= NOW() - INTERVAL '30 days'
  AND e.compliance_target IN (SELECT v FROM pins)
  AND e.agent_url NOT ILIKE '%adcontextprotocol.org%'
GROUP BY 1, 2, 3, 4
ORDER BY 1, 2, 3;
ROLLBACK;

Notes

  • forwardIntroducedSpecialisms reads 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.
  • No changeset. This is deployment and operational work under the playbook's changeset rule, and the comparable runtime-image PR fix(runtime): offload CDN-verified protocol archives and retired docs snapshots from the Fly image #8814 shipped without one.
  • Dockerfile: comment only. The 7424 MiB ceiling is unchanged. .dockerignore is unchanged.

Tests

  • npm run test:runtime-artifacts: 22/22 passed. New tests cover:
    • the repo keep set: every GA, every alias target, docs snapshots, training bundles and 3.3.0-rc.3 stay, and only superseded prereleases leave;
    • the independent exact-version reader check described above;
    • sandbox and preview anchor parsing, which fails closed;
    • a superseded version that the creative sandbox reads keeps both of its trees;
    • a fixture with anchored superseded versions (docs, alias, training), an unshipped 4.0.0-beta.1 and an unpublished superseded compliance tree;
    • a future 4.0.0 GA: it fails closed until its trees exist, then retires 4.0.0-beta.1;
    • verifyRequiredArtifacts failing 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.
  • Related server suites, 21 files and 363 tests, all passed. They cover:
    • hosted compliance, storyboards, the compliance heartbeat and target discovery;
    • route storyboards, forward specialisms, dashboard refresh and the verification profile;
    • storyboard-skip-details and v4-readiness;
    • the three creative33 suites;
    • compliance-openapi and openapi-coverage.
  • npm run test:addie-tools and tsc --project server/tsconfig.json --noEmit: clean.
  • In the image (main + Forward-merge 3.3.x → main #9401 + 728304d):
    • verify:training-agent-runtime verified the creative 3.3 sandbox schema (3.3.0-beta.1) in the builder and in the final image;
    • "Load every hosted bundle": 54 published versions graded and 17 superseded prereleases refused, each with its name, GA line and CDN URLs asserted;
    • docs index smoke: 5 configured versions;
    • in a container, ensureCreative33SchemaBundle() registered the bundle and the validate_input validator resolved, and a recorded 3.3.0-rc.2 run read 3.3.0.

🤖 Generated with Claude Code

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>
@bokelley

bokelley commented Dec 6, 2026

Copy link
Copy Markdown
Contributor Author

30-day traffic check (condition 1), run against prod read-only (BEGIN READ ONLY; … ROLLBACK;), using the query in this PR's body.

  • Context: agent_compliance_runs has 3,599 runs from 55 distinct agents in the last 30 days.
  • Runs with adcp_version on the drop list, or requested_compliance_target on a dropped pin (exact, wire form, or the 3.3-beta / 3.1-beta / 3.1-rc channel aliases), excluding our own and localhost agents: 0.
  • addie_agent_quality_evaluations with compliance_target on a dropped pin, same exclusions: 0.

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>
@bokelley
bokelley merged commit 4168409 into main Dec 6, 2026
63 checks passed
@bokelley
bokelley deleted the bokelley/drop-superseded-prerelease-trees branch December 6, 2026 18:34
@bokelley

bokelley commented Dec 6, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lazy-load non-current schema/compliance bundles from R2 instead of shipping them in the Fly image

1 participant