Skip to content

fix(showcase/ci): make the :latest tag monotonic so an older build cannot overwrite a newer one - #6174

Merged
jpr5 merged 10 commits into
mainfrom
ci/showcase-latest-tag-race
Jul 29, 2026
Merged

jpr5 merged 10 commits into
mainfrom
ci/showcase-latest-tag-race

Conversation

@jpr5

@jpr5 jpr5 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

The race, with evidence

Three PRs merged within 34 seconds on 2026-07-26. Showcase: Build & Push has no concurrency group (deliberately), so all three ran simultaneously and raced to push the same :latest tags.

run commit PR start → end
30190815370 7b28934387 #6162 06:18:05 → 06:29:44
30190823203 59f275eedc #6161 06:18:21 → 06:29:44
30190831480 db75a04837 #6158 06:18:39 → 06:29:13 ← newest, finished FIRST

The newest commit finished first, so the older builds overwrote its :latest. Per-service job completion times — older beating newer on every shared slot:

service newer (db75a04837) older (59f275eedc) older won by
shell-dashboard 06:25:33 06:25:34 +1s
showcase-harness 06:27:51 06:27:55 +4s
shell 06:27:17 06:27:28 +11s
shell-dojo 06:25:10 06:25:26 +16s

All three runs reported success. Staging served pre-#6158 code while CI, the redeploy gate and deploy verification all looked clean. Same failure class as #6171: a success that doesn't mean what it says.

What I verified in YAML vs took on trust

Verified by reading the files / querying the API:

  • Tagging — showcase_build.yml pushed :latest and :${{ github.sha }} in one depot/build-push-action step, in both the build and build-starters matrices. A per-commit sha tag already existed; confirmed in GHCR (showcase-shell-dashboard has digests tagged db75a04837…, 59f275eedc…, d28384a2eb…).
  • Nothing serialized the pushes. No concurrency group; confirmed the header comment states this is intentional.
  • Deploy consumes :latest — verify-railway-image-refs.ts is the SSOT assertion: staging is ghcr.io/copilotkit/<repo>:latest (mutable), prod is ghcr.io/copilotkit/<repo>@sha256:<digest> (already immutably pinned). So this race is staging-only; prod was never exposed.
  • Showcase: Verify Deploy structurally cannot catch it. It is a health probe; it asserts no digest or commit provenance anywhere. Its fix(showcase/ci): make a partially-cancelled build loud, and verify what it actually shipped #6171 per-commit concurrency key is about which run verifies, not what image is running. A stale-but-healthy service passes.
  • The racing runs build DISJOINT service sets (see below) — I pulled the actual job lists.

Taken on trust: nothing material. The issue description matched the API on every point I checked.

Why NOT a concurrency group

detect-changes builds a per-push, path-filtered matrix, so concurrent runs build overlapping but non-identical service sets:

  • 7b28934387 → ag2, agno, built-in-agent, claude-sdk-python, claude-sdk-typescript, crewai-crews, langgraph-fastapi, langgraph-python, langroid, llamaindex, mastra, pydantic-ai, shell-docs, spring-ai, strands (15)
  • db75a04837 → crewai-crews, llamaindex, shell, shell-dashboard, shell-docs, shell-dojo, showcase-harness (7)

cancel-in-progress: true would have cancelled the 7b28934387 run and the ~10 services only it builds would never have shipped — trading a stale-image bug for a never-shipped bug. Per GitHub's docs, cancel-in-progress: false is no better: "Any previously pending job or workflow in the concurrency group will be canceled" — with three rapid merges the middle commit's build is dropped outright. GitHub also does not guarantee FIFO ordering of queued runs.

Concurrent runs here are not redundant, so they must not be cancelled.

Re the #6171 interaction: this design does not use cancel-in-progress, so no build is ever superseded-and-cancelled and the cancelled-slot notifier is never tripped by this change. That interaction stays theoretical — deliberately.

The design

Make the one shared mutable resource monotonic instead of serializing the fleet.

  1. The build step pushes only the immutable :<sha> tag, plus an org.opencontainers.image.revision label.
  2. A guard resolves the commit behind the current :latest, asks GitHub compare/<theirs>...<ours>, and advances :latest (registry-side retag, no pull) unless ours is behind — i.e. :latest already holds a descendant and moving it would roll staging back.

Fails open by design. No :latest yet, unlabelled legacy image, unreachable API, diverged history → advance. A stuck :latest is the very failure being fixed, so it declines only on positive proof of regression.

Placement: in redeploy-staging / redeploy-staging-starters, immediately before the Railway pull that consumes :latest — not per build slot. Those jobs already have Node (build slots do not, so per-slot would mean an unpinned npx tsx fetch on ~50 parallel runners), and deciding right before the pull makes the window as narrow as possible. The image list is the same matrix ∩ build-success intersection that decides what gets redeployed, so a failed build can never move a tag.

Also adds showcase_build.yml to showcase_validate.yml's trigger paths — the new test asserts against that file's live text, and without the path a PR re-adding :latest would never run the test that catches it.

Tradeoffs / what stays open

  • Residual sub-second TOCTOU. GHCR has no compare-and-swap on tags, so two runs reading :latest simultaneously could still both advance. This narrows the window from the whole build (~10 min) to inspect→retag. Fully closing it means retiring the mutable staging tag and pinning staging to digests the way prod already is — a change to the Railway image-ref SSOT contract, not a workflow change. Recommended follow-up.
  • The guard is inert for one build per image. Today's :latest images carry no labels (verified: showcase-shell-dashboard:latest has no Labels at all), so the first post-merge build fails open and advances unconditionally — same as today. Protection starts from the second build of each image.
  • Failure to retag exits non-zero, redding the redeploy job and stopping the deploy. That is intended: redeploying against a tag that did not move is exactly the silent false green being fixed.

Proof

Red/green on the live YAML. advance-latest-tag.test.ts parses the real showcase_build.yml (extending #6171's redeploy-guard.test.ts pattern). Reverting the workflow to its pre-fix state: 14 failed / 23 passed. With the fix: 37 passed. Full showcase/scripts suite: 2382 passed, 73 files.

The load-bearing predicate, verified live against the real incident commits:

compare/db75a04837...59f275eedc  => behind     (older run arriving late → DECLINE)
compare/59f275eedc...db75a04837  => ahead      (newer run → advance)
compare/db75a04837...db75a04837  => identical

Label reading, verified against a real multi-platform registry image — docker buildx imagetools inspect ghcr.io/astral-sh/uv:latest piped through extractRevisionLabel() returns 3010295ae7ff572de459987ad70db315a62ecd61, matching jq exactly. The platform-keyed shape is handled.

Shell/jq transforms exercised directly, including the empty-CSV edge case (empty → empty, step skipped by its if:).

Lint: actionlint finding counts byte-identical to the pre-change baseline (no new findings; the 11 pre-existing are unrelated). zizmor --min-severity low with the repo config: no findings.

Typecheck: both new files are in showcase/scripts/tsconfig.json's include set and produce zero errors. Worth stating plainly: nx run-many -t check-types does not reach showcase/scripts — the project isn't in the nx graph and has no check-types target (there are 9 pre-existing type errors in sibling files, which is how I confirmed it). So the typecheck above is mine, not CI's. The tests are gated: showcase_validate.yml runs bare pnpm exec vitest run in showcase/scripts, which auto-discovers the new file.

What I could NOT prove

I did not construct a real concurrent race on scratch branches. Doing it faithfully needs two builds pushing the same GHCR repo with controlled finish ordering, which means merging to main — the only branch the build workflow triggers on. No run IDs for a live race demonstration; I am not implying one.

Unproven until this runs on main: that docker buildx imagetools create retags cleanly under the runner's GHCR credentials, and that npx tsx behaves in the redeploy jobs (it is already the established invocation there — redeploy-env.ts — so this is low risk, not zero).

Normal single-merge builds are unaffected

No concurrency group is added, so nothing queues or cancels. A lone merge finds :latest at its own parent → ahead → advances, exactly as before. Cost is one imagetools inspect + one gh api + one registry-side retag per built service, in a job that already exists — no extra job, no extra checkout, no change to build parallelism.


Branched from db75a04837; #6156/#6159 landed after, so this will need main merged in before it goes green.

Probable conflict with the concurrent git lfs pull work in showcase_validate.yml — my edit there is only the top-level on: paths: list, so it should merge cleanly, but flagging it.

…nnot overwrite a newer one

Three merges landed on main within 34 seconds on 2026-07-26. The build
workflow has no concurrency group by design, so all three ran at once and
raced to push the same `:latest` tags. The NEWEST commit's build finished
FIRST, so the two older builds overwrote it:

  run 30190815370  7b28934  (#6162)  06:18:05 -> 06:29:44
  run 30190823203  59f275e  (#6161)  06:18:21 -> 06:29:44
  run 30190831480  db75a04  (#6158)  06:18:39 -> 06:29:13   <- NEWEST

Per-service, the older commit beat the newer one on every shared slot:
shell-dashboard (+1s), showcase-harness (+4s), shell (+11s), shell-dojo
(+16s). All three runs reported `success`. Staging served pre-#6158 code
while CI, the redeploy gate and deploy verification all looked clean.

A concurrency group is the wrong fix. `detect-changes` builds a per-push,
path-filtered matrix, so concurrent runs build overlapping but NON-IDENTICAL
service sets -- 7b28934 was the only run building ag2, agno, langroid,
spring-ai, strands and 10 others. `cancel-in-progress: true` would have
dropped those entirely, trading a stale-image bug for a never-shipped bug.
`cancel-in-progress: false` is no better: GitHub keeps at most one pending
run per group and cancels any previously-pending one.

Instead make the mutable pointer monotonic. The build step now pushes only
the immutable `:<sha>` tag plus an `org.opencontainers.image.revision`
label. A new guard then advances `:latest` unless the tag already points at
a DESCENDANT of the commit being built, which is exactly the regression
case. Every ambiguous state (no tag, unlabelled legacy image, unreachable
API, diverged history) advances -- a stuck `:latest` is the failure mode
being fixed, so the guard declines only on positive proof of regression.

The guard runs in redeploy-staging / redeploy-staging-starters, immediately
before the Railway pull that consumes `:latest`, over the same
matrix-intersect-build-success set that decides what gets redeployed. That
placement keeps the read->retag window minimal and avoids an unpinned
`npx tsx` fetch on ~50 parallel build slots that have no Node.

Also adds showcase_build.yml to showcase_validate.yml's trigger paths: the
new test asserts against that file's live text, and without the path a PR
re-adding `:latest` to the push step would never run the test that catches it.

Prod is unaffected -- verify-railway-image-refs.ts already pins prod to
`@sha256:<digest>`; only staging consumes the mutable tag.
@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 41 services digest-pinned.

Run 2026-07-28 07:15:33 PDT — 0 finding(s).

@github-actions

github-actions Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 1.19 MB

ℹ️ View Unchanged
Filename Size
packages/a2ui-renderer/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/a2ui-renderer/dist/a2ui-types.cjs 172 B
packages/a2ui-renderer/dist/a2ui-types.mjs 171 B
packages/a2ui-renderer/dist/index.cjs 842 B
packages/a2ui-renderer/dist/index.mjs 563 B
packages/a2ui-renderer/dist/index.umd.js 12.2 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.cjs 1.49 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/A2uiSurface.mjs 1.43 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.cjs 1.07 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/adapter.mjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.cjs 904 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/AudioPlayer.mjs 492 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.cjs 1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Button.mjs 596 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.cjs 829 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Card.mjs 419 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/CheckBox.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.cjs 799 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChildList.mjs 737 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.cjs 1.63 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/ChoicePicker.mjs 1.57 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.cjs 856 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Column.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.cjs 1.12 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/DateTimeInput.mjs 1.05 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.cjs 842 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Divider.mjs 432 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.cjs 877 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Icon.mjs 469 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.cjs 995 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Image.mjs 587 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.cjs 920 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/List.mjs 508 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.cjs 1.19 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Modal.mjs 1.13 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.cjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Row.mjs 801 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.cjs 1.06 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Slider.mjs 984 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.cjs 1.1 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Tabs.mjs 1.04 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.cjs 903 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Text.mjs 489 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/TextField.mjs 1.14 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.cjs 788 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/components/Video.mjs 378 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.cjs 928 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/index.mjs 855 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.cjs 579 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/basic/utils.mjs 556 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.cjs 982 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Button.mjs 580 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.cjs 800 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/ChildList.mjs 735 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.cjs 1.08 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Column.mjs 1.02 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.cjs 1.07 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Row.mjs 1.01 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.cjs 894 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/Text.mjs 839 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.cjs 1.21 kB
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/components/TextField.mjs 802 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.cjs 849 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/catalog/minimal/index.mjs 804 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.cjs 310 B
packages/a2ui-renderer/dist/react-renderer/a2ui-react/index.mjs 325 B
packages/a2ui-renderer/dist/react-renderer/catalog-utils.cjs 1.59 kB
packages/a2ui-renderer/dist/react-renderer/catalog-utils.mjs 1.52 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.cjs 1.5 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIProvider.mjs 1.42 kB
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.cjs 728 B
packages/a2ui-renderer/dist/react-renderer/core/A2UIRenderer.mjs 671 B
packages/a2ui-renderer/dist/react-renderer/create-catalog.cjs 1.35 kB
packages/a2ui-renderer/dist/react-renderer/create-catalog.mjs 1.28 kB
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.cjs 316 B
packages/a2ui-renderer/dist/react-renderer/hooks/useA2UI.mjs 309 B
packages/a2ui-renderer/dist/react-renderer/index.cjs 399 B
packages/a2ui-renderer/dist/react-renderer/index.mjs 515 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.cjs 236 B
packages/a2ui-renderer/dist/react-renderer/lib/utils.mjs 188 B
packages/a2ui-renderer/dist/react-renderer/styles/index.cjs 239 B
packages/a2ui-renderer/dist/react-renderer/styles/index.mjs 231 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.cjs 436 B
packages/a2ui-renderer/dist/react-renderer/theme/ThemeContext.mjs 381 B
packages/a2ui-renderer/dist/web-components/_virtual/_rolldown/runtime.cjs 260 B
packages/a2ui-renderer/dist/web-components/_virtual/_rolldown/runtime.mjs 258 B
packages/a2ui-renderer/dist/web-components/adapter.cjs 346 B
packages/a2ui-renderer/dist/web-components/adapter.mjs 335 B
packages/a2ui-renderer/dist/web-components/bound-component.cjs 670 B
packages/a2ui-renderer/dist/web-components/bound-component.mjs 662 B
packages/a2ui-renderer/dist/web-components/catalog/basic/audio-player.cjs 536 B
packages/a2ui-renderer/dist/web-components/catalog/basic/audio-player.mjs 492 B
packages/a2ui-renderer/dist/web-components/catalog/basic/button.cjs 647 B
packages/a2ui-renderer/dist/web-components/catalog/basic/button.mjs 604 B
packages/a2ui-renderer/dist/web-components/catalog/basic/card.cjs 448 B
packages/a2ui-renderer/dist/web-components/catalog/basic/card.mjs 402 B
packages/a2ui-renderer/dist/web-components/catalog/basic/check-box.cjs 743 B
packages/a2ui-renderer/dist/web-components/catalog/basic/check-box.mjs 695 B
packages/a2ui-renderer/dist/web-components/catalog/basic/choice-picker.cjs 1.27 kB
packages/a2ui-renderer/dist/web-components/catalog/basic/choice-picker.mjs 1.24 kB
packages/a2ui-renderer/dist/web-components/catalog/basic/column.cjs 474 B
packages/a2ui-renderer/dist/web-components/catalog/basic/column.mjs 431 B
packages/a2ui-renderer/dist/web-components/catalog/basic/components.cjs 482 B
packages/a2ui-renderer/dist/web-components/catalog/basic/components.mjs 424 B
packages/a2ui-renderer/dist/web-components/catalog/basic/date-time-input.cjs 756 B
packages/a2ui-renderer/dist/web-components/catalog/basic/date-time-input.mjs 714 B
packages/a2ui-renderer/dist/web-components/catalog/basic/divider.cjs 450 B
packages/a2ui-renderer/dist/web-components/catalog/basic/divider.mjs 404 B
packages/a2ui-renderer/dist/web-components/catalog/basic/icon.cjs 504 B
packages/a2ui-renderer/dist/web-components/catalog/basic/icon.mjs 455 B
packages/a2ui-renderer/dist/web-components/catalog/basic/ids.cjs 192 B
packages/a2ui-renderer/dist/web-components/catalog/basic/ids.mjs 190 B
packages/a2ui-renderer/dist/web-components/catalog/basic/image.cjs 624 B
packages/a2ui-renderer/dist/web-components/catalog/basic/image.mjs 578 B
packages/a2ui-renderer/dist/web-components/catalog/basic/index.cjs 465 B
packages/a2ui-renderer/dist/web-components/catalog/basic/index.mjs 526 B
packages/a2ui-renderer/dist/web-components/catalog/basic/list.cjs 534 B
packages/a2ui-renderer/dist/web-components/catalog/basic/list.mjs 483 B
packages/a2ui-renderer/dist/web-components/catalog/basic/modal.cjs 842 B
packages/a2ui-renderer/dist/web-components/catalog/basic/modal.mjs 800 B
packages/a2ui-renderer/dist/web-components/catalog/basic/row.cjs 471 B
packages/a2ui-renderer/dist/web-components/catalog/basic/row.mjs 427 B
packages/a2ui-renderer/dist/web-components/catalog/basic/slider.cjs 701 B
packages/a2ui-renderer/dist/web-components/catalog/basic/slider.mjs 653 B
packages/a2ui-renderer/dist/web-components/catalog/basic/tabs.cjs 780 B
packages/a2ui-renderer/dist/web-components/catalog/basic/tabs.mjs 730 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text-field.cjs 857 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text-field.mjs 814 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text.cjs 553 B
packages/a2ui-renderer/dist/web-components/catalog/basic/text.mjs 501 B
packages/a2ui-renderer/dist/web-components/catalog/basic/utils.cjs 484 B
packages/a2ui-renderer/dist/web-components/catalog/basic/utils.mjs 462 B
packages/a2ui-renderer/dist/web-components/catalog/basic/video.cjs 400 B
packages/a2ui-renderer/dist/web-components/catalog/basic/video.mjs 352 B
packages/a2ui-renderer/dist/web-components/catalog/children.cjs 302 B
packages/a2ui-renderer/dist/web-components/catalog/children.mjs 300 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/button.cjs 629 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/button.mjs 584 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/column.cjs 609 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/column.mjs 559 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/components.cjs 245 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/components.mjs 263 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/index.cjs 724 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/index.mjs 654 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/row.cjs 593 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/row.mjs 544 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text-field.cjs 874 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text-field.mjs 822 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text.cjs 509 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/text.mjs 477 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/utils.cjs 291 B
packages/a2ui-renderer/dist/web-components/catalog/minimal/utils.mjs 287 B
packages/a2ui-renderer/dist/web-components/create-catalog.cjs 1.89 kB
packages/a2ui-renderer/dist/web-components/create-catalog.mjs 1.83 kB
packages/a2ui-renderer/dist/web-components/define.cjs 440 B
packages/a2ui-renderer/dist/web-components/define.mjs 341 B
packages/a2ui-renderer/dist/web-components/index.cjs 960 B
packages/a2ui-renderer/dist/web-components/index.mjs 655 B
packages/a2ui-renderer/dist/web-components/node.cjs 1.05 kB
packages/a2ui-renderer/dist/web-components/node.mjs 1.04 kB
packages/a2ui-renderer/dist/web-components/surface.cjs 2.83 kB
packages/a2ui-renderer/dist/web-components/surface.mjs 2.81 kB
packages/core/dist/index.cjs 48.5 kB
packages/core/dist/index.mjs 48.1 kB
packages/core/dist/index.umd.js 51.8 kB
packages/react-core/dist/copilotkit-D_Ao1X-u.mjs 105 kB
packages/react-core/dist/copilotkit-DiLTL1ZM.cjs 107 kB
packages/react-core/dist/index.cjs 16.9 kB
packages/react-core/dist/index.mjs 16.8 kB
packages/react-core/dist/index.umd.js 64.3 kB
packages/react-core/dist/v2/context.cjs 1.55 kB
packages/react-core/dist/v2/context.mjs 1.47 kB
packages/react-core/dist/v2/headless.cjs 12.8 kB
packages/react-core/dist/v2/headless.mjs 12.3 kB
packages/react-core/dist/v2/index.cjs 1.26 kB
packages/react-core/dist/v2/index.mjs 1.11 kB
packages/react-core/dist/v2/index.umd.js 107 kB
packages/react-textarea/dist/index.cjs 18.1 kB
packages/react-textarea/dist/index.mjs 17.4 kB
packages/react-textarea/dist/index.umd.js 18.8 kB
packages/react-ui/dist/index.cjs 24.6 kB
packages/react-ui/dist/index.mjs 23.9 kB
packages/react-ui/dist/index.umd.js 25.8 kB
packages/runtime-client-gql/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/runtime-client-gql/dist/client/conversion.cjs 1.52 kB
packages/runtime-client-gql/dist/client/conversion.mjs 1.45 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.cjs 1.58 kB
packages/runtime-client-gql/dist/client/CopilotRuntimeClient.mjs 1.54 kB
packages/runtime-client-gql/dist/client/types.cjs 701 B
packages/runtime-client-gql/dist/client/types.mjs 642 B
packages/runtime-client-gql/dist/graphql/@generated/gql.cjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/gql.mjs 850 B
packages/runtime-client-gql/dist/graphql/@generated/graphql.cjs 2.4 kB
packages/runtime-client-gql/dist/graphql/@generated/graphql.mjs 2.36 kB
packages/runtime-client-gql/dist/graphql/definitions/mutations.cjs 740 B
packages/runtime-client-gql/dist/graphql/definitions/mutations.mjs 732 B
packages/runtime-client-gql/dist/graphql/definitions/queries.cjs 316 B
packages/runtime-client-gql/dist/graphql/definitions/queries.mjs 304 B
packages/runtime-client-gql/dist/index.cjs 679 B
packages/runtime-client-gql/dist/index.mjs 495 B
packages/runtime-client-gql/dist/index.umd.js 9.58 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.cjs 1.72 kB
packages/runtime-client-gql/dist/message-conversion/agui-to-gql.mjs 1.7 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.cjs 1.56 kB
packages/runtime-client-gql/dist/message-conversion/gql-to-agui.mjs 1.53 kB
packages/runtime-client-gql/dist/package.cjs 181 B
packages/runtime-client-gql/dist/package.mjs 116 B
packages/shared/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/shared/dist/a2ui-prompts.cjs 2.85 kB
packages/shared/dist/a2ui-prompts.mjs 2.85 kB
packages/shared/dist/attachments/utils.cjs 1.74 kB
packages/shared/dist/attachments/utils.mjs 1.7 kB
packages/shared/dist/constants/index.cjs 362 B
packages/shared/dist/constants/index.mjs 345 B
packages/shared/dist/debug.cjs 454 B
packages/shared/dist/debug.mjs 452 B
packages/shared/dist/finalize-events.cjs 1.05 kB
packages/shared/dist/finalize-events.mjs 1 kB
packages/shared/dist/index.cjs 1.99 kB
packages/shared/dist/index.mjs 1.66 kB
packages/shared/dist/index.umd.js 20.3 kB
packages/shared/dist/logger.cjs 112 B
packages/shared/dist/logger.mjs 112 B
packages/shared/dist/package.cjs 181 B
packages/shared/dist/package.mjs 116 B
packages/shared/dist/standard-schema.cjs 740 B
packages/shared/dist/standard-schema.mjs 737 B
packages/shared/dist/telemetry/lambda-client.cjs 1.14 kB
packages/shared/dist/telemetry/lambda-client.mjs 1.13 kB
packages/shared/dist/telemetry/telemetry-client.cjs 1.33 kB
packages/shared/dist/telemetry/telemetry-client.mjs 1.27 kB
packages/shared/dist/telemetry/utils.cjs 321 B
packages/shared/dist/telemetry/utils.mjs 277 B
packages/shared/dist/transcription-errors.cjs 951 B
packages/shared/dist/transcription-errors.mjs 944 B
packages/shared/dist/utils/clipboard.cjs 407 B
packages/shared/dist/utils/clipboard.mjs 405 B
packages/shared/dist/utils/conditions.cjs 540 B
packages/shared/dist/utils/conditions.mjs 536 B
packages/shared/dist/utils/console-styling.cjs 1.24 kB
packages/shared/dist/utils/console-styling.mjs 1.22 kB
packages/shared/dist/utils/errors.cjs 4.51 kB
packages/shared/dist/utils/errors.mjs 4.41 kB
packages/shared/dist/utils/index.cjs 1.39 kB
packages/shared/dist/utils/index.mjs 1.65 kB
packages/shared/dist/utils/json-schema.cjs 1.97 kB
packages/shared/dist/utils/json-schema.mjs 1.91 kB
packages/shared/dist/utils/random-id.cjs 618 B
packages/shared/dist/utils/random-id.mjs 559 B
packages/shared/dist/utils/requests.cjs 706 B
packages/shared/dist/utils/requests.mjs 704 B
packages/shared/dist/utils/types.cjs 161 B
packages/shared/dist/utils/types.mjs 160 B
packages/voice/dist/_virtual/_rolldown/runtime.cjs 516 B
packages/voice/dist/index.cjs 175 B
packages/voice/dist/index.mjs 95 B
packages/voice/dist/index.umd.js 1.5 kB
packages/voice/dist/transcription/transcription-service-openai.cjs 495 B
packages/voice/dist/transcription/transcription-service-openai.mjs 434 B
packages/web-inspector/dist/assets/inspector-logo-icon.cjs 499 B
packages/web-inspector/dist/assets/inspector-logo-icon.mjs 434 B
packages/web-inspector/dist/assets/inspector-logo.cjs 4.32 kB
packages/web-inspector/dist/assets/inspector-logo.mjs 4.23 kB
packages/web-inspector/dist/index.cjs 59.4 kB
packages/web-inspector/dist/index.mjs 59.4 kB
packages/web-inspector/dist/index.umd.js 77.5 kB
packages/web-inspector/dist/lib/context-helpers.cjs 862 B
packages/web-inspector/dist/lib/context-helpers.mjs 830 B
packages/web-inspector/dist/lib/persistence.cjs 1.2 kB
packages/web-inspector/dist/lib/persistence.mjs 1.16 kB
packages/web-inspector/dist/lib/telemetry.cjs 2.54 kB
packages/web-inspector/dist/lib/telemetry.mjs 2.44 kB
packages/web-inspector/dist/package.cjs 181 B
packages/web-inspector/dist/package.mjs 116 B
packages/web-inspector/dist/styles/generated.cjs 6.42 kB
packages/web-inspector/dist/styles/generated.mjs 6.36 kB

compressed-size-action

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@copilotkit/a2ui-renderer

pnpm add https://pkg.pr.new/@copilotkit/a2ui-renderer@6174

@copilotkit/agentcore-runner

pnpm add https://pkg.pr.new/@copilotkit/agentcore-runner@6174

@copilotkit/angular

pnpm add https://pkg.pr.new/@copilotkit/angular@6174

@copilotkit/channels

pnpm add https://pkg.pr.new/@copilotkit/channels@6174

@copilotkit/channels-core

pnpm add https://pkg.pr.new/@copilotkit/channels-core@6174

@copilotkit/channels-discord

pnpm add https://pkg.pr.new/@copilotkit/channels-discord@6174

@copilotkit/channels-intelligence

pnpm add https://pkg.pr.new/@copilotkit/channels-intelligence@6174

@copilotkit/channels-slack

pnpm add https://pkg.pr.new/@copilotkit/channels-slack@6174

@copilotkit/channels-teams

pnpm add https://pkg.pr.new/@copilotkit/channels-teams@6174

@copilotkit/channels-telegram

pnpm add https://pkg.pr.new/@copilotkit/channels-telegram@6174

@copilotkit/channels-ui

pnpm add https://pkg.pr.new/@copilotkit/channels-ui@6174

@copilotkit/channels-whatsapp

pnpm add https://pkg.pr.new/@copilotkit/channels-whatsapp@6174

@copilotkit/core

pnpm add https://pkg.pr.new/@copilotkit/core@6174

@copilotkit/react-core

pnpm add https://pkg.pr.new/@copilotkit/react-core@6174

@copilotkit/react-native

pnpm add https://pkg.pr.new/@copilotkit/react-native@6174

@copilotkit/react-textarea

pnpm add https://pkg.pr.new/@copilotkit/react-textarea@6174

@copilotkit/react-ui

pnpm add https://pkg.pr.new/@copilotkit/react-ui@6174

@copilotkit/runtime

pnpm add https://pkg.pr.new/@copilotkit/runtime@6174

@copilotkit/runtime-client-gql

pnpm add https://pkg.pr.new/@copilotkit/runtime-client-gql@6174

@copilotkit/sdk-js

pnpm add https://pkg.pr.new/@copilotkit/sdk-js@6174

@copilotkit/shared

pnpm add https://pkg.pr.new/@copilotkit/shared@6174

@copilotkit/sqlite-runner

pnpm add https://pkg.pr.new/@copilotkit/sqlite-runner@6174

@copilotkit/voice

pnpm add https://pkg.pr.new/@copilotkit/voice@6174

@copilotkit/vue

pnpm add https://pkg.pr.new/@copilotkit/vue@6174

@copilotkit/web-components

pnpm add https://pkg.pr.new/@copilotkit/web-components@6174

@copilotkit/web-inspector

pnpm add https://pkg.pr.new/@copilotkit/web-inspector@6174

commit: 7e3d06f

jpr5 and others added 7 commits July 26, 2026 21:21
… the retag set

Two Critical defects in the new "Advance :latest" guard, both of which would
have broken staging redeploys on this PR's own merge commit.

1. Registry auth missing. `redeploy-staging` and `redeploy-staging-starters`
   run `docker buildx imagetools create` (an authenticated GHCR WRITE) but
   declared only `permissions: contents: read` with no `docker/login-action`
   step. Every retag would 401, the guard would exit 1, the redeploy step
   would be skipped -- and since the build step no longer pushes `:latest`
   itself, `:latest` would freeze permanently and staging would never
   redeploy again. The same missing auth also 401s `imagetools inspect` on
   these private packages, which the guard treats as "unknown revision" and
   advances anyway: it would have failed OPEN and never actually guarded.

   Fixed by adding `packages: write` plus a GHCR login mirroring the `build`
   job's existing "Login to GHCR" step. Restores both the read and write path.

2. skip_build slots entered the retag list. The `images` CSV projection did
   not exclude `skip_build` slots. `webhooks` is built out-of-band, never
   pushes a `:<sha>` tag, yet reports job.status: success -- so it reached the
   guard, `imagetools create` failed with "manifest unknown", and the whole
   fleet's redeploy was blocked. Fires on `service=all` dispatch and via the
   `workflow_config` path filter.

   Fixed by carrying `skip_build` through the jq projection and filtering it
   out of `images` ONLY. It stays in `services`: bouncing webhooks so Railway
   re-pulls its out-of-band `:latest` is the documented intent (see the
   `webhooks` entry in showcase/scripts/railway-envs.ts).

Also, same file:
 - timeout-minutes 5 -> 20 on both jobs. The guard adds up to 3 serial
   round-trips per slot (~84 at full fleet width). An overrun concludes
   `cancelled`, which is invisible to both `if: failure()` and
   `if: cancelled()` downstream -- the alerting-suppression class this repo
   has been fixing.
 - `npx tsx` -> `npx --yes [email protected]` (the pnpm-lock-resolved version),
   matching the no-drift convention showcase_validate.yml enforces via
   `pnpm exec tsx`. `pnpm exec` is unavailable here: no workspace install.
 - Dropped the redundant GITHUB_SHA / GITHUB_REPOSITORY shadowing; the runner
   exports both and advance-latest-tag.ts reads them off process.env.

Deliberately NOT added: a `concurrency` group. Its absence is load-bearing --
detect-changes builds a path-filtered per-push matrix, so concurrent runs
build disjoint service sets and cancelling the older run would leave services
never shipped rather than merely stale.

RED/GREEN
---------
Workflow auth cannot be fully proven without merging, so the proof is scoped
to what is actually demonstrable locally. Both probes lift the code under test
VERBATIM out of the workflow at runtime rather than paraphrasing it.

Probe A -- the real jq projection, fed the real ALL_SERVICES array with a
`service=all` / `workflow_config` dispatch (every slot selected, every slot
status:success, which is exactly what the skip_build slot reports):

  RED   images  : ...,ghcr.io/copilotkit/showcase-eval-webhook   (28 entries)
        services: ...,webhooks
        -> webhooks IS in the retag set. imagetools create -> manifest unknown.

  GREEN images  : ends ...,ghcr.io/copilotkit/showcase-pocketbase (27 entries)
        services: ...,webhooks   (unchanged, still 28)
        -> webhooks OUT of images, STILL IN services. Exactly the split wanted.

Probe B -- structural parse of the workflow, over every job that runs
advance-latest-tag.ts:

  RED   redeploy-staging          permissions={'contents':'read'}  login=NO
        redeploy-staging-starters permissions={'contents':'read'}  login=NO
        VERDICT: 2 retag job(s) lacking GHCR auth

  GREEN redeploy-staging          permissions={'contents':'read',
                                               'packages':'write'} login=YES
        redeploy-staging-starters permissions={'contents':'read',
                                               'packages':'write'} login=YES
        VERDICT: 0 retag job(s) lacking GHCR auth

Lint (delta vs the pre-fix file, not raw counts)
------------------------------------------------
actionlint : 10 findings before, 10 after; 0 new, 0 removed (all pre-existing
             depot runner-label + SC2086 noise).
zizmor     : CI-equivalent (--min-severity low, default persona, repo config)
             reports "No findings" both before and after. Auditor persona at
             all severities is also identical before/after (1 concurrency-limits,
             1 template-injection, 3 undocumented-permissions, 6
             anonymous-definition, 9 secrets-outside-env) -- the two new
             `packages: write` entries carry trailing justification comments so
             they add no undocumented-permissions findings.
…e contract test

Reverts only the cosmetic third item from the previous commit. Dropping the
redundant GITHUB_SHA / GITHUB_REPOSITORY shadowing is functionally correct --
the runner exports both and advance-latest-tag.ts reads them off process.env
-- but showcase/scripts/advance-latest-tag.test.ts asserts those exact keys
are declared on the guard step, so removing them red "Validate Showcase".

RED (run 30238078822, "Validate Showcase" > Run build pipeline tests):

  Failed Tests 2
   FAIL advance-latest-tag.test.ts > showcase_build.yml - redeploy-staging job
        > runs the guard with the image list, sha, repo and a token
   FAIL advance-latest-tag.test.ts > showcase_build.yml - redeploy-staging-starters
        job > runs the guard with the image list, sha, repo and a token
   AssertionError: expected undefined to be '${{ github.sha }}'
     - Expected: "${{ github.sha }}"
     + Received: undefined
     advance-latest-tag.test.ts:424

GREEN (same six contract assertions per job, replicated against the YAML --
the test is pure yaml-parse, no runtime deps):

  redeploy-staging / redeploy-staging-starters
    PASS IMAGES   PASS GITHUB_SHA   PASS GITHUB_REPOSITORY
    PASS GH_TOKEN truthy   PASS guard `if`   PASS guard BEFORE redeploy

The test file is owned by a concurrent agent on this PR, so the assertions
cannot be relaxed here. If the redundancy is worth removing, the env keys and
the assertions must go together in one change.

Everything else from the previous commit is untouched and was already
validated by that CI run -- only these two assertions failed, so the GHCR
login, `packages: write`, the skip_build/images filter, the timeout bump and
the tsx pin all passed.

Lint unchanged: actionlint 10 findings before and after (0 new); zizmor
CI-equivalent reports "No findings" before and after.
…d digest drift

Targeted repairs around the decision logic, which is unchanged: the
compare direction, the `["behind"]`-only decline, and the fail-open
invariant are all preserved.

Digest/identity
- `already-current` keyed on the revision LABEL treated a rebuild of the
  same commit (CVE refresh, cache-miss, retry) as a no-op, stranding
  `:latest` on the older digest while digest-pinned prod moved. It now
  compares manifest DIGESTS, via a new `GuardIo.readDigest`, and only
  when the label claims we are already current — so the common path pays
  nothing.
- Retag passes `--prefer-index=false`. buildx carbon-copies a single
  index source (digest preserved) but WRAPS a bare manifest in a new
  index (digest changes) because `--prefer-index` defaults true. Our
  images are indexes only because provenance is enabled elsewhere; this
  pins the property regardless.

Observability — fail-open stays, silence does not
- `readLatestRevision` / `compare` no longer swallow the error. Failures
  are classified (absent / unauthorized / throttled / timeout /
  unavailable / unknown) and everything but a genuinely absent tag emits
  a `::warning` saying the guard has stopped guarding. Throttling is the
  likeliest failure under the concurrency this exists to handle and was
  previously indistinguishable from a clean first build.
- Annotations are properly escaped. Multi-line registry stderr was
  folding the real reason out of the annotation meant to report it;
  encoding newlines also makes an injected `::` inert.
- Subprocess timeout (60s, `ADVANCE_LATEST_TAG_TIMEOUT_MS`). A hung
  registry previously burned the job budget and concluded `cancelled`.
- The fleet result now names which images advanced, were unchanged, or
  declined — not just which failed.

Correctness / hygiene
- `extractRevisionLabel` collects every occurrence and answers only when
  they agree, so a multi-config payload no longer returns whichever label
  key ordering happened to surface last. Dropped the dead cycle guard.
- Flag parser no longer binds a following flag as a value (`--sha --repo
  x` yielded the literal `"--repo"` as the sha); `--flag=value` accepted;
  an empty `--images` is the documented no-op instead of exit 2.
- Entry guard canonicalises both sides, so a symlinked invocation runs
  instead of exiting 0 having done nothing.
- Docs: corrected the never-rethrown claim, the unreachable `identical`
  example, the self-contradicting `npx tsx` rationale, and the
  preconditions (a retag is a registry WRITE and needs `packages: write`
  plus a login, which the redeploy jobs do not currently have).
…t shape

The previous suite was 37/37 green against a workflow that could not have
run at all: the guard step had no `packages: write` and no GHCR login, so
every `imagetools create` would have 401'd. Asserting that a step EXISTS
proves nothing about whether it can succeed. Each change below was checked
by reintroducing the defect and confirming the test goes red.

Registry-auth precondition (the miss that let the above ship)
- Both redeploy jobs must declare `packages: write` AND a `docker/login-action`
  step for ghcr.io, ordered BEFORE the guard. Dropping either reds the suite.

The intersection, executed rather than restated
- The old test only checked that the string `images=` appears in the compute
  step; swapping its jq for the full matrix — so a FAILED build moves
  `:latest` — kept it green. The real `changed` shell now RUNS, against the
  real ALL_SERVICES matrix read out of the workflow, and the emitted
  $GITHUB_OUTPUT is asserted: a failed build is in neither set, and the
  `skip_build` slot is in `services` but NOT in `images` (handing it to the
  guard fails "manifest unknown" and blocks the redeploy for the whole fleet).
  Same treatment for the starter lane.

Fixtures joined to real registry output
- `extractRevisionLabel` was pinned to hand-written payloads that were never
  compared with reality. Since `readLatestRevision` maps every failure to
  null, and null ADVANCES, a parser that silently never matches yields a
  permanently-blind guard with a fully green suite. Both fixtures are now
  verbatim `docker buildx imagetools inspect --format '{{json .Image}}'`
  output (buildx v0.35.0), unformatted so key order survives: a platform-keyed
  multi-arch image carrying the label, and our own `:latest`, which turns out
  to be a bare config object with NO labels at all. The label key used in the
  injection test is read from the workflow's own `labels:` input, so parser
  and producer cannot drift apart silently.

Closed vacuities
- The `:latest` ban read one step's `tags` and was vacuously green on an empty
  list. It now covers every tagged step plus hand-rolled `docker push`/`docker
  tag`/`imagetools create`, and fails on an empty `tags`.
- The `cancel-in-progress` ban read only top-level config; a job-level
  `concurrency` on `build` reproduced the exact harm and stayed green. All
  jobs are checked now.
- `already-current` is keyed on the digest, matching the script.
- The unreachable `(null, "ahead")` row is labelled as the defensive
  input-space case it is, and a new test pins that the real flow never calls
  compare() with an unknown revision.

New coverage: classifyProbeFailure (incl. a REAL execFileSync timeout, and
the two precedence traps — gh's rate-limited 403 is throttling, not auth; a
registry's 404-with-denied is auth, not absent), readFlag, escapeAnnotationData
(a forged `\n::error::` stays inert), isDirectInvocation through a symlink,
the `::error` annotation on fleet failure, and the digest-mismatch advance.

Also: GITHUB_SHA / GITHUB_REPOSITORY are no longer shadowed in the workflow.
The runner exports both and the script reads process.env, so the old
assertions pinned a redundancy rather than a capability — removed together,
as the comment there required. Workflow-reading scaffolding duplicated with
redeploy-guard.test.ts is extracted and the YAML parse memoized.
The auto-format bot reflowed both captured registry payloads. Harmless this
time — oxfmt only rewraps arrays, it does not reorder keys — but the whole
value of these two files is that they are verbatim `imagetools inspect`
output. A formatter in the loop means the next re-capture churns, and the
"this is exactly what the registry emits" claim stops being checkable.

Exempt the fixture directory in .oxfmtrc.json, restore the captured bytes,
and say so in the provenance comment so nobody tidies them by hand.
@jpr5

jpr5 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

Parking this as a draft — record of two review rounds

This PR is being parked, not abandoned. It went through two full 7-reviewer rounds; both found Critical defects, and rather than run a third fix round we're leaving the findings on the PR so whoever picks it up starts from them. What follows is the synthesis of all 14 reports.

What this set out to fix, and why it's still real

Concurrent merges to main could move ghcr.io/copilotkit/<image>:latest backward: two runs build in parallel, the older one's push lands last, and :latest ends up pointing at the older commit's image. Staging then redeploys onto code that was already superseded. This was observed live, and the ugly part is that all three runs involved reported success — there was no red anywhere, because nothing in the system compared the incoming commit against the one :latest already held.

The fix: stop the build matrix from pushing :latest at all (push only the immutable :<sha> plus an org.opencontainers.image.revision label), and move :latest advancement into a guard step (showcase/scripts/advance-latest-tag.ts) that reads the revision label off the current :latest, asks the GitHub compare API whether our sha is behind it, and declines the retag if so.

Mitigating fact that made parking reasonable: prod is digest-pinned (verify-railway-image-refs.ts enforces @sha256: refs), so a backward :latest is a staging-only problem. Manually serializing merges has been sufficient in practice.

What's sound and should be kept

The decision core. A round-1 reviewer assessed decideLatestTagAction as genuinely well designed: pure, total over its input space, with the safety property stated as an iff ("decline-regression if and only if we have POSITIVE proof of regression") and then pinned by a test that filters the full compare-status set and asserts the declining set is exactly ["behind"] — that pins the complement of the rule, so a new status added to the enum cannot silently start blocking deploys. The compare direction (compare/<current>...<ours>, base = what :latest holds) is correct per GitHub's semantics and separately pinned, because inverting it silently inverts the entire guard.

The workflow-wiring assertions. Round 2 mutation-tested these and they held: 9 of 9 wiring mutations were caught — inverting the compare direction, also declining on diverged, skipping the digest probe, re-adding :latest to the build push step, renaming the parser's label constant, removing packages: write from redeploy-staging, having the changed step ignore the build-success set, dropping the skip_build exclusion from the images list, and moving the guard step after the Railway redeploy. Asserting against the live YAML rather than a mock is the right instinct and it demonstrably works. The related move of executing the real changed shell against the real matrix (instead of grepping the jq) is the correct pattern and should survive any rebuild.

The digest-preservation investigation — do not lose this. This is the most valuable artifact in the PR. The question was whether docker buildx imagetools create -t X:latest X:<sha> preserves the manifest digest, which matters because prod provenance ("which commit is live") is established by matching a running digest against GHCR's per-commit tags. Findings: buildx's imagetools create returns the original bytes when the source is an index (verified against util/imagetools/create.go, the single-source branch); our images are indexes only because Depot attaches a provenance attestation; and so --prefer-index=false was added to the retag so the property stops being contingent on that attestation continuing to exist. If someone later disables provenance on the Depot build, the flag is what keeps :latest and :<sha> sharing a digest. That chain of reasoning took real work and is not recoverable from the diff alone.

Also worth keeping: the incident reconstruction in the file header (run IDs, per-service timestamps, deltas) and the section explaining why a concurrency group is the wrong fix — it pre-empts the first objection any reviewer raises.


The blockers, grouped by root cause

1. Timeout composition — the per-call bound doesn't add up to a job bound, and the overrun is unalertable. Flagged independently by three round-2 reviewers (and by three round-1 reviewers in its earlier form, when there was no timeout at all).

SUBPROCESS_TIMEOUT_MS defaults to 60s per subprocess, and advanceLatestTags walks the fleet strictly serially with no aggregate deadline. The workflow's own sizing comment says ~28 slots × ~3 calls = ~84 serial calls. 84 × 60s = ~84 minutes against timeout-minutes: 20. It doesn't take a full outage — ~20 hung calls exhausts the budget, and a merely degraded registry averaging 10s/call gets to ~14 minutes before setup-node, the npx fetch, and the Railway redeploy loop that follows.

The reason this is Critical rather than a perf nit: a job killed by timeout-minutes concludes cancelled, and this workflow has measured (probe run 30166429073, documented inline) that a cancelled ancestor is invisible to both failure() and cancelled(). Reviewers traced every notifier: notify doesn't fire (failure() is false for a cancelled ancestor, any_success is 'true', any_cancelled describes build slots), notify-cancelled-builds doesn't fire (keyed on build-slot artifacts), notify-all-builds-failed doesn't fire. Net state: :latest advanced for the first N images and stale for the rest, no Railway redeploy, no redeploy-summary artifact (so showcase_deploy.yml reads "nothing redeployed" and skips its gate), and not one Slack message. That is the same silent-partial-failure class as the original incident, relocated one job downstream — and this PR is what creates it, since before the diff these jobs only POSTed to Railway.

Suggested shape: a step-level timeout-minutes (an overrun fails, which failure() can see) plus an in-script wall-clock deadline under it, so the script reports the overrun in its own voice instead of dying mid-loop.

2. defaultIo — the entire registry/API I/O layer — is exercised by no test. Two reviewers independently mutation-tested it; both landed on the same conclusion from different mutation sets.

The suite imports 11 symbols; defaultIo is not one of them, and nothing else reaches those ~120 lines. Mutations that leave the suite 109/109 green:

  • Retag pushes :stale instead of :latest. :latest never moves again, and because the build step no longer pushes it, staging freezes permanently on whatever image it last held. That mutation is the original P0 this PR exists to fix, shipping green.
  • Remove --prefer-index=false — kills the digest-identity invariant described above, and with it prod's provenance-by-digest.
  • Change the inspect template --format '{{json .Image}}' → '{{json .Manifest}}' — the parser then never finds a revision label, readLatestRevision returns null forever, null ADVANCES, and the guard is permanently blind. The test file's own header claims the fixtures exist specifically to rule this out; they pin the parser against real payloads but nothing pins the command that produces them.
  • Swap the digest template {{.Manifest.Digest}} → {{.Config.Digest}} — the same-commit-rebuild detection silently compares the wrong thing.
  • Inspect the wrong ref in readLatestRevision.
  • Degrade a failed-read ::warning to a ::notice — defeats the module's stated "ambiguity advances, but never silently" doctrine.
  • Change SUBPROCESS_TIMEOUT_MS default from 60_000 to 1.

Fix direction: export the argv builders as pure functions and assert the exact arrays, and/or give defaultIo an injectable exec seam. Bind the inspect template to the fixtures explicitly so fixture and command cannot drift.

3. Digest identity is load-bearing but never verified, and the tool it depends on is unpinned. The retag discards its output and returns void. Nothing reads back :latest and :<sha> to confirm they name the same manifest — even though readDigest is already implemented and it's one round-trip on an operation that already made three. Meanwhile neither redeploy job uses docker/setup-buildx-action, so the buildx version is whatever ubuntu-latest ships that week. The moment that behaviour changes, verify-railway-image-refs.ts's premise quietly stops holding and showcase_reconcile_staging.yml starts remediating drift that isn't real — with zero signal. This is the most expensive failure class in the change: not a missed deploy, but a wrong answer to "which commit is live in prod", surfacing months later during an incident.

Related: the code documents the --prefer-index floor as buildx v0.16; the flag actually landed in v0.17.0. The floor is also unenforced, and on an older buildx --prefer-index=false fails with unknown flag, which the classifier buckets as unknown, every retag fails, and (per #5 below) the whole fleet's redeploy is blocked by a one-word CLI error.

4. Command injection via the revision label. extractRevisionLabel accepts any non-empty trimmed string as currentRevision. That value comes off the org.opencontainers.image.revision label of whatever image currently holds :latest — the same trust class the file explicitly treats as attacker-adjacent for subprocess stderr. It then reaches two sinks:

  • Interpolated raw into the API path: gh api repos/${repo}/compare/${base}...${head}. execFileSync rules out shell injection but not path injection — a label containing /, ?, #, or ../ reshapes the request.
  • Written to stdout unescaped on the advance path. Only the decline branch goes through annotation(); io.log(decision.reason) does not, and every non-decline reason embeds ${currentRevision} verbatim. defaultIo.log is process.stdout.write(msg + "\n"), and a workflow command only has to start a line — so a newline in the label forges a workflow command. That's precisely the forgery vector the file goes to some length to close for stderr, left open on the label path.

Fix is cheap and preserves fail-open: require /^[0-9a-f]{7,40}$/i in the extractor, so a junk label yields null, which already means "unknown → advance."

5. Fail-closed blast radius. advanceLatestTags deliberately attempts every image and collects failures — correct. But main turns any non-empty failures into process.exit(1), which reds the step and skips Redeploy changed services in staging for the whole fleet. In a 20-image run where 19 retags succeed and the 20th 500s, 19 images now have :latest pointing at the new build and Railway is never told to pull any of them: :latest is ahead of running staging, and the divergence is only caught later and indirectly. The step comment's justification ("redeploying against a :latest that did not move would look like a fresh healthy deploy") is sound for the image that failed and wrong for the 19 that didn't. Compounding it, the failure summary prints Succeeded for 19 when the practical outcome is "0 deployed", and folds declined — a deliberate stand-down — into the success count.

6. Architectural: moving :latest advancement into redeploy-staging blinds the self-heal. Before this change the build matrix pushed :latest at build time, which made :latest an independent record of "what the newest successful build produced." That independence is exactly what showcase_reconcile_staging.yml relies on: every 15 minutes it compares each staging service's actually-deployed digest against the GHCR :latest digest and re-runs the redeploy when the deployed digest lags.

After this change, :latest only advances inside the same job that performs the redeploy. If redeploy-staging dies after the builds succeeded, :latest and staging lag the freshly-pushed :<sha> together, so deployedDigest === latestDigest, and reconcile classifies every service as "positively confirmed current" and exits 0. The 15-minute watchdog that used to catch this class no longer can — and this diff adds new ways for the job to die before the redeploy (the new GHCR login, the new guard's deliberate non-zero exit, and the 20-minute timeout whose overrun is the invisible cancelled from #1). The run does go red on most of those paths, so it isn't a silent false green, but the automated remediation path is gone and the residual state is "GHCR holds a newer :<sha> that no watchdog will ever notice." Options raised: teach reconcile-staging.ts to compare against the newest built :<sha>, or run the guard in its own job depending on aggregate-build-results and independent of the Railway redeploy.

7. Error-classification bugs. The classifier is the mechanism by which a degraded guard is supposed to be able to say what happened, so wrong answers here are real defects, not cosmetics:

  • Bare 429 in the throttling regex, while every other HTTP code is word-bounded (\b401\b, \b403\b, \b404\b, \b50[0234]\b). Registry stderr routinely echoes sha256: digests, and hex digests contain 429 often enough to matter. Because throttled is tested before absent, a genuine 404 on an image whose digest happens to contain 429 is reported as rate-limiting — a false incident signal claiming the exact concurrent-build pressure this guard exists to handle.
  • Any SIGTERM classified as timeout. GitHub signals the whole process tree on cancellation, and the OOM killer reaches children the same way, so those get the confident and wrong message "the command exceeded its 60000ms budget" — in precisely the scenario WIP: almost usable v0.1 #1 describes.
  • The unauthorized alternation includes the bare substring login, and runs ahead of the absent check. Docker and registries append "you may need to run docker login" to not-found errors, so a genuine first build on a new image repo reports an auth failure and sends an operator to inspect packages: write and the login step when both are fine. Repeated false warnings are how a ::warning-based guard gets tuned out, which defeats the file's own thesis.
  • Additionally: describeProbeFailure's text is written for the :latest-inspect call site but reused verbatim at three others, so a gh api .../compare 404 (force-push, deleted ref) renders as "the tag does not exist yet" — there is no tag in a compare — and a gh api 401 tells the operator to widen GHCR package permissions when the actual knob is GH_TOKEN / contents: read. Also: ENOENT (docker or gh not on PATH) classifies as unknown, and a malformed ADVANCE_LATEST_TAG_TIMEOUT_MS (60s, 60_000, abc) silently falls back to 60000 — the one place in the file where a degraded configuration does not announce itself.

8. Doc drift introduced across concurrent fixes. Both of these describe the code as it was two fix rounds ago and will actively mislead the next reader:

  • The script's "where this runs" section says these jobs invoke it through an unpinned npx tsx "exactly as the sibling redeploy-env.ts step does", and that pinning is "tracked separately." Both live call sites run npx --yes [email protected] — pinned, with an eight-line rationale block on the step. The redeploy-env.ts half is still true, which makes the wrong half easier to believe.
  • Two places state the image list is "the SAME matrix ∩ build-success intersection that decides what gets redeployed." The caller applies an additional map(select(.skip_build != true)) to images that services does not get, and the workflow documents that exclusion as load-bearing (webhooks is released by another repo, concludes success, and has no :<sha> from this run, so handing it to the guard fails with manifest unknown and blocks the whole fleet). The actual contract is images = (matrix ∩ build-success) − skip_build. A maintainer reading only the script would reasonably "simplify" the jq and reintroduce that outage.

Smaller items in the same drift class: a test comment claims a re-serialising formatter pass "would reorder keys" (it doesn't — the commit that added the comment says so itself; the real justification is byte-exact provenance); a fixture is described as having config.Labels null when the key is absent, and the assertion's ?? null makes the two indistinguishable so nothing catches it; and a test row labelled "identical trees under different shas" describes something GitHub's compare API cannot return (identical means the same commit).

Also open, smaller

main() and the entire documented exit-code contract have zero coverage (exit 2 on a valueless flag, exit 1 on partial retag failure — the value that stops a stale redeploy — exit 0 on empty --images, and the --images > --image > $IMAGES precedence chain). The workflow-wide :latest ban regexes are single-line-only, so a backslash-continued docker buildx imagetools create \ evades all three, as does docker buildx build --push -t …:latest and crane/regctl/skopeo. The absent classification is the only failure path that emits no annotation at all, and it's reachable by misclassification. Both compute steps' fail-loud exit 1 branches — the "we thought we shipped but didn't" guards — are never executed by any test, and the starter case hard-codes the one BUILD_STARTERS_RESULT value that gates both of them off.


Recommendation for whoever resumes this

946 lines of script plus 1,182 of test to express "don't move a tag backward" is what generated the defect list above. Each round fixed real problems and, in fixing them, added surface — a classifier, a summary layer, an annotation-escaping layer, an env-tunable timeout, a CLI — and most of the round-2 Criticals live in that added surface rather than in the idea.

A minimal rebuild is likely to land where this didn't: verify the digest after the retag, fail loud, drop the rest. No classifier, no probe-summary vocabulary, no env-tunable budget, no CLI surface beyond what the workflow actually passes. The regression check itself is worth keeping — it's the part that's correct and well pinned — but it can be a much smaller thing.

Two hard constraints on any resumption:

  1. Test defaultIo. That gap is what let a mutation reintroducing the original P0 (retag writes :stale) pass 109/109. A rebuild with the same seam and the same untested I/O layer would be no safer than this one.
  2. Bound the fleet, not just the call. Any design that walks N images serially with a per-call timeout and no aggregate deadline inherits blocker WIP: almost usable v0.1 #1, including the cancelled-is-unalertable part.

Two findings that are independent of this PR, handled separately

  • The starter lane still launders cancelled → skipped. The showcase lane's per-slot writer keeps cancelled distinct, with an emphatic comment explaining that collapsing it is exactly what made a partially-cancelled fleet build silent. The starter lane's writer still does the laundering, so a starter slot killed by its 20-minute budget records skipped, build-starters rolls up to cancelled, both starter fail-loud checks are gated off (they require BUILD_STARTERS_RESULT = success), the slug drops out of the CSV silently, and there is no starter analogue of notify-cancelled-builds. fix(showcase/ci): make a partially-cancelled build loud, and verify what it actually shipped #6171 only fixed the showcase lane. Getting its own PR.
  • showcase_build.yml:247 (the "Build service matrix" step) has no set -euo pipefail, unlike its structurally identical starter sibling and unlike the steps this PR added. If the jq pipeline fails, MATRIX becomes the empty string, slips past the [ "$MATRIX" = "[]" ] typo guard, and the step writes matrix= and has_changes=true and exits 0 — so build dies on fromJSON('') several jobs downstream of the real cause. Separate fix.

Comment on lines +283 to +285
latestIsSameImage === false
? `\`:latest\` is labelled ${sha} but holds a DIFFERENT manifest digest than \`:${sha}\` — the same commit was rebuilt and \`:latest\` still points at the older image. Advancing so staging and digest-pinned prod agree.`
: `\`:latest\` is labelled ${sha} but its digest could not be compared with \`:${sha}\` — advancing rather than assuming the two match.`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can't ever be true as there's an early exit on line 274

@AlemTuzlak AlemTuzlak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems right to me and the tests look right

@jpr5
jpr5 marked this pull request as ready for review July 29, 2026 18:36
@jpr5
jpr5 merged commit 8433f5b into main Jul 29, 2026
55 checks passed
@jpr5
jpr5 deleted the ci/showcase-latest-tag-race branch July 29, 2026 18:36
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.

2 participants