Skip to content

fix(showcase/railway): P3 promote gate skips non-staging-probe-eligible services - #5752

Merged
jpr5 merged 1 commit into
mainfrom
fix/showcase-promote-p3-probe-skip
Jun 28, 2026
Merged

jpr5 merged 1 commit into
mainfrom
fix/showcase-promote-p3-probe-skip

Conversation

@jpr5

@jpr5 jpr5 commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

The bug (CI run 28332775532, promote step)

bin/railway promote llamaindex expands to a tier-ordered fleet. It promoted aimock/pocketbase/dashboard/harness fine, then REFUSED on harness-workers:

[harness-workers] REFUSE: P3: staging is not green for harness-workers: verify-deploy crashed: service "harness-workers" is not probe-eligible for env "staging" (probe.staging=false in SSOT)

harness-workers is INTENTIONALLY not staging-probe-eligible (probe.staging=false in the SSOT — a queue worker with no HTTP surface). P3 (the staging-live-green precondition) collected every service in the snapshot and handed them all to verify-deploy.ts, which hard-errors on a --services entry that is not probe-eligible. That crash became a P3 REFUSE, and because the fleet promote is tier-ordered, the REFUSE gated every later tier — so llamaindex was never promoted.

The fix

showcase/bin/railway:

  • New SSOT-derived constant STAGING_PROBE_INELIGIBLE (services with probe.staging=false), sourced from the same railway-envs.generated.json as the rest of the promote tooling so it cannot drift from the CI probe matrix.
  • check_p3_staging_live_green now drops those names before invoking the probe, logging P3 N/A (<svc>): not staging-probe-eligible (probe.staging=false in SSOT) — skipped.
    • An ineligible-only set → no findings (clean skip, probe never called).
    • A mixed set → probes (and still gates on) only the eligible services.
  • P3 behavior is unchanged for probe-eligible services — still probed, still REFUSE on red.

Also renumbered the test_snapshot_ivar_lint.rb allowlist for the lines the new constant shifted.

Red → green (integration, real failure surface)

RED — the exact CI crash, reproduced against the real probe entrypoint (what pre-fix P3 invoked):

$ npx tsx scripts/verify-deploy.ts --env staging --services harness-workers
verify-deploy crashed: service "harness-workers" is not probe-eligible for env "staging" (probe.staging=false in SSOT)

GREEN — fixed check_p3_staging_live_green on a harness-workers-only snapshot, with the real un-stubbed probe:

P3 N/A (harness-workers): not staging-probe-eligible (probe.staging=false in SSOT) — skipped.
FINDINGS=[]
P3 PASS: no REFUSE, probe never crashed (harness-workers skipped as N/A)

REGRESSION — fixed P3 on an eligible service still probes and still gates:

PROBED=["showcase-llamaindex"]
FINDINGS=["REFUSE: P3: staging is not green for showcase-llamaindex: showcase-llamaindex: HTTP 502 (simulated)"]
REGRESSION PASS: eligible service still probed AND still gates (REFUSE on red)

Unit suite: ruby bin/spec/all_tests.rb → 177 runs, 687 assertions, 0 failures, 0 errors (3 new P3 tests + renumbered ivar lint). New tests fail (RED) against pre-fix code and pass (GREEN) with the fix.

Impact

Merging this unblocks the llamaindex prod promote (and any future tier-ordered fleet promote that includes harness-workers): P3 stops crash-REFUSing on the intentionally-unprobed worker and lets the rest of the tier through.

🤖 Generated with Claude Code

…le services

P3 (the staging-live-green precondition in `bin/railway promote`) handed
EVERY service in the snapshot to verify-deploy.ts, including services the
SSOT marks `probe.staging=false` (harness-workers). verify-deploy.ts
hard-errors on a `--services` entry that is not probe-eligible, so P3
surfaced "verify-deploy crashed: ... not probe-eligible" as a REFUSE.

In a tier-ordered fleet promote (`bin/railway promote llamaindex`) that
REFUSE gated every later tier, so llamaindex was never promoted (CI run
28332775532).

Fix: derive STAGING_PROBE_INELIGIBLE from the same SSOT, and in
check_p3_staging_live_green drop those names BEFORE invoking the probe,
logging "P3 N/A (<svc>): not staging-probe-eligible". An ineligible-only
set returns no findings (clean skip); a mixed set still probes — and
still gates on — the eligible services. P3 is unchanged for eligible
services.

Renumbered the snapshot-ivar-lint allowlist for the shifted lines.
@github-actions

Copy link
Copy Markdown
Contributor

📣 Social Copy Generator

Generate social media copies (Twitter/X, LinkedIn, Blog Post) for this PR using Claude.

  • Generate social media copies

@github-actions

Copy link
Copy Markdown
Contributor

Production Digest-Pinning Audit

All 41 services digest-pinned.

Run 2026-06-28 12:22:27 PDT — 0 finding(s).

@jpr5
jpr5 marked this pull request as ready for review June 28, 2026 19:24
@jpr5
jpr5 merged commit a2588d4 into main Jun 28, 2026
20 checks passed
@jpr5
jpr5 deleted the fix/showcase-promote-p3-probe-skip branch June 28, 2026 19:24
jpr5 added a commit that referenced this pull request Jun 28, 2026
…(prod verify-prod crash) (#5753)

## The crash

Promote CI run
[28333317081](https://github.com/CopilotKit/CopilotKit/actions/runs/28333317081)
PROMOTED llamaindex into prod successfully, but the `verify-prod` job
then crashed:

```
verify-deploy crashed: service "harness-workers" is not probe-eligible for env "prod" (probe.prod=false in SSOT)
```

exit 2 → the whole run was marked failed even though the promote itself
succeeded.

`verify-prod` runs `npx tsx verify-deploy.ts --env prod --services
"<promoted set>"`. That set includes `harness-workers`, which is
intentionally `probe.prod=false` (and `probe.staging=false`) in the
SSOT. `verify-deploy.ts` HARD-ERRORED (exit 2) on any `--services` entry
that wasn't probe-eligible for the target env.

Sibling fix #5752 fixed the **staging** path by passing an opt-in
`--skip-ineligible` flag from the promote staging precondition. But the
`verify-prod` job calls `verify-deploy.ts` **directly without that
flag**, so the prod path still crashed.

## The fix

Generalize the eligibility filter into `verify-deploy.ts` itself instead
of relying on each caller to remember a flag:

- `parseArgs` now defaults `skipIneligible` to **true**
(skip-by-default). A known-but-not-probe-eligible service for the
requested env is SKIPPED with an `N/A — not probe-eligible for env <env>
(probe.<env>=false in SSOT), skipped` status line, and only the eligible
subset is probed. Works for **any** `--env`, so it composes with #5752's
staging path and fixes the direct prod-verify call — no workflow change
needed.
- When **every** requested service is ineligible (e.g. the promoted set
is just `harness-workers`), `runVerify` exits **0** with a clear
"nothing to probe" note, distinct from the empty-filter vacuous-green
fault (which still fails loud).
- **Unknown (non-SSOT) names STILL hard-error** on every path — a typo
is a real fault, never a legitimate skip.
- Added `--strict-eligibility` to opt back into the old hard-refuse for
an explicit single-service probe. `--skip-ineligible` is kept as an
explicit no-op for back-compat with the #5752 staging-precondition
caller.

This completes #5752 for the prod path.

## Red → green (real surface, `showcase/scripts`)

**RED** (before):
```
$ npx tsx verify-deploy.ts --env prod --services harness-workers
verify-deploy crashed: service "harness-workers" is not probe-eligible for env "prod" (probe.prod=false in SSOT)
EXIT=2
```

**GREEN** (after):
```
$ npx tsx verify-deploy.ts --env prod --services harness-workers
  harness-workers                      N/A — not probe-eligible for env prod (probe.prod=false in SSOT), skipped
verify-deploy --env=prod targets=0 — nothing to probe (all requested services are not probe-eligible for env prod, skipped)
EXIT=0
```

**Regression — eligible service still probed and red-gated:**
```
$ npx tsx verify-deploy.ts --env prod --services harness-workers,showcase-llamaindex
  harness-workers                      N/A — not probe-eligible for env prod (probe.prod=false in SSOT), skipped
verify-deploy --env=prod targets=1
  showcase-llamaindex                  showcase-llamaindex-production.up.railway.app FAIL: agent: Railway GraphQL errors [...]: Not Authorized
1 service(s) failed verify in prod
```
`harness-workers` is skipped; `showcase-llamaindex` is resolved
(`targets=1`) and the live probe **runs** (reaches the Railway GraphQL
call). It reports red here only because the local env has **no
`RAILWAY_TOKEN`** ("Not Authorized") — that live-probe step is
env-blocked locally, but it proves the eligible service is still probed
and gates red, not silently skipped. `showcase-llamaindex` alone behaves
identically (`targets=1`, probe runs).

**Guards preserved:**
```
$ npx tsx verify-deploy.ts --env prod --services harness-workers --strict-eligibility
verify-deploy crashed: service "harness-workers" is not probe-eligible for env "prod" ...  (exit 2)

$ npx tsx verify-deploy.ts --env prod --services bogus-typo
verify-deploy crashed: unknown service "bogus-typo" (not in SSOT). ...  (exit 2)
```

## Tests

`npx vitest run __tests__/verify-deploy.test.ts` → **37 passed**.
Updated the default-flag assertions, added `--strict-eligibility` parse
coverage, and added a runVerify test for the all-ineligible "nothing to
probe" exit-0 path. (4 pre-existing `emit-railway-envs-json.test.ts`
failures are an unrelated `oxfmt` tooling issue — confirmed failing on
clean `origin/main` without this change.)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
pull Bot pushed a commit to justinlietz93/CopilotKit that referenced this pull request Jun 28, 2026
The promote workflow's verify-prod job calls verify-deploy.ts directly
(--env prod --services <promoted set>) without CopilotKit#5752's --skip-ineligible
flag, so a known-but-ineligible service (harness-workers, probe.prod=false)
hard-errored exit 2 and crashed the gate AFTER a successful promote
(CI run 28333317081: llamaindex landed, then verify-prod crashed).

Generalize the eligibility filter into verify-deploy.ts itself rather than
relying on each caller to pass a flag: flip skipIneligible to ON by default
in the CLI (parseArgs). A known-but-not-probe-eligible service for the
requested env is now SKIPPED with an `N/A — not probe-eligible ... skipped`
status line and the eligible subset is probed. Works for ANY --env, so it
composes with CopilotKit#5752's staging path and fixes the direct prod-verify call.

When EVERY requested service is ineligible (e.g. promoted set is just
harness-workers), runVerify exits 0 with a "nothing to probe" note instead
of the vacuous-green FAIL — distinct from the empty-filter fault, which
still fails loud. Unknown (non-SSOT) names STILL hard-error on every path
(a typo is a real fault). Added --strict-eligibility to opt back into the
hard-refuse; --skip-ineligible kept as an explicit no-op for back-compat.

Red: `verify-deploy.ts --env prod --services harness-workers` crashed
exit 2. Green: same command skips (N/A) and exits 0. Mixed set
harness-workers,showcase-llamaindex skips workers and still probes (and
red-gates) llamaindex.
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.

1 participant