Repository navigation
fix(ci): restore Railway preview URLs, fail closed when none is found - #703
Conversation
Railway can report `success` on a PR deploy while the service has no domain, so the commit-status description reads a bare `Success` with no host after it. Discovery treated that as "not ready yet": neither the success break nor the failure return fired, so it re-read the identical immutable status every 15s for the full 12-minute budget, then exported an empty `preview_url` and exited 0. `ci.yml` gates the smoke step on that value, so the step skipped and the job stayed green. The cost was silent and large. `Lint, Test & Smoke: pass` has meant "unit + integration passed" on every PR for weeks, and three specs — `cors-preflight`, `error-disclosure`, `images` — have never run in CI at all. **A deploy that succeeds without a host is broken configuration, not an absent preview.** PR services inherit a domain only from a base-environment service that has one, so this is terminal on the first poll and re-running changes nothing. Discovery now exits 1 with an `::error` naming the cause and the fix. The genuine skips are untouched and still exit 0: no status within the timeout, a failed or cancelled deploy, or missing env. Returning on the first terminal status also ends the 12-minute wait. A healthy PR now resolves in one poll. `scripts/railway-preview-status.ts` splits the decision out as a pure module — `classifyStatuses` plus `discoverPreview` over injected clock, sleep and fetch — so the unit lane can cover it without network or a direct-run guard on the CI entrypoint. The runner keeps env parsing, the GitHub fetch, the health check and the exit codes. Fixture note: the specs assume Railway posts context `sahajcloud - SahajCloud` with either `Success - <host>.up.railway.app` or a bare `Success`. Verified against the live statuses on #700 (host present) and #699 (bare), not inferred. The new specs were confirmed to fail before they passed: classifying success-with-no-host as `pending` again — the original behaviour, at the line that caused it — turns three of them red. Every exit path was also exercised end to end through `main()` with a stubbed fetch, since a passing unit spec is not evidence that its caller reaches the branch: unpublished exits 1 in ~1s, ready exits 0 with the URL exported, a failed deploy and missing env both exit 0 empty. Docs corrected in the same pass. `playwright.config.ts` and `tests/AGENTS.md` said the URL is "discovered via the Railway API"; it comes from the GitHub commit-status API. `RAILWAY_RUNBOOK.md` claimed PR previews need "no manual per-PR configuration" — the false premise behind this outage — and now states the coupling to production's domain, with the three quiet symptoms. `scripts/AGENTS.md` had no row for either script. Infra step 1 of the ticket was already applied on 2026-09-05: production's `SahajCloud` service has `sahajcloud-production.up.railway.app` on port 8080 beside the custom domain. Closes #661 Claude-Session: https://claude.ai/code/session_01QkaVUYxFsjHJd1aN8hYhVP Co-Authored-By: Claude Opus 5 <[email protected]>
Quality pass over the branch, plus two review findings worth fixing. - Never sleep past the deadline. The sleep after the last useful poll gated nothing, and an unclamped one overran the advertised budget by up to a full interval — 15s of dead CI clock on every timing-out run. The new assertion fails without the clamp: a 40s budget reported 45s. - Log the classification (`unpublished`, `pending`) rather than GitHub's raw state. Telling `unpublished` from `success` is the whole point of the change, so the log should say which. Drops the `statusState` helper and its type subtraction, and `state` off `unpublished`, where it is always `success` and so derivable from `kind`. - Make `last` and `elapsedMs` load-bearing instead of test-only: the timeout message now says whether a status ever appeared, or which state it never left. That was the diagnostic the docstring already promised and never delivered. - Trim the duplicated remediation from the `::error` string and its comment. RAILWAY_RUNBOOK.md owns the fix; a copy in a string literal is the one that goes stale while the runbook gets corrected. **A run where every statuses read failed now exits 1 too.** Review found the same silent green as #661 through another door: a revoked `statuses: read` scope makes every poll throw, `last` stays `absent`, and after 12 minutes the run reports "no preview" and exits 0 — indistinguishable from a PR that genuinely has none. `reads`/`errors` on the timeout outcome separate the two, and never having looked is not evidence of absence. A genuinely absent, failed, or still-building preview is untouched and still exits 0. Verified through `main()` with a stubbed fetch and a virtual clock, not just through the unit lane — a passing spec is no evidence that its caller reaches the branch. All reads failing: 48 requests over the full 720s budget, then exit 1. **Not taken.** Review argued that acting on the first `unpublished` is unsound, since a context can post a later status. The premise is right and the docstring overclaimed, so the rationale is corrected in place — but immediate failure is a resolved decision on #661, which named one grace re-poll as the alternative and chose immediate. Also left alone: sharing a `pollUntil` between this loop and `waitHealthy` (pre-existing, unchanged here), and shortening the budget for a never-seen status (#661 keeps the genuine skip paths as they are). Claude-Session: https://claude.ai/code/session_01QkaVUYxFsjHJd1aN8hYhVP Co-Authored-By: Claude Opus 5 <[email protected]>
The workflow comment is the first contract description a CI reader sees, and it still said the step "skips gracefully" with no mention that it can now fail the job — so someone debugging a red `Discover Railway preview URL` would read an adjacent comment telling them that step does not fail. `RAILWAY_RUNBOOK.md`'s CI section asserted the superseded rule five lines above the new section correcting it. Folded the correction into the paragraph it supersedes, rather than leaving a reader to hit the old contract first and the amendment second. The skip warning claimed "This PR has no preview environment", which is only one of the three cases that reach it — a failed deploy and one still building at the deadline also skip. It now points at the discovery step's own log instead of guessing. `scripts/AGENTS.md` records both non-zero exits. Claude-Session: https://claude.ai/code/session_01QkaVUYxFsjHJd1aN8hYhVP Co-Authored-By: Claude Opus 5 <[email protected]>
|
🚅 Deployed to the SahajCloud-pr-703 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
Holistic. The core matches #661 exactly: classify success-with-no-host as terminal, fail closed, stop re-reading an immutable status. The diff is much larger than that sentence (+443/-68 over 8 files), but most of the excess earns its keep — the entrypoint calls main() at import, so the decision could not be tested without splitting it out, and keeping the split module in scripts/ beside its single owner is what src/AGENTS.md prescribes, not a src/lib/ detour that lib-boundary.spec.ts would then have to except. No contract surface is crossed; this is CI-internal, and all three doc claims the ticket named are corrected (I grepped for survivors and found none). The one part genuinely outside the ticket is the second non-zero exit, which the body already offers for veto — my read is that it should come out, or fail fast, for the reason in the thread.
Findings
- should-fix —
scripts/get-railway-preview-url.ts:146: thereads === 0exit adds a second hard failure that #661 explicitly scoped out, with a transient trigger and a full 12-minute cost before it fires. Drop it, or carryres.statusso 401/403 fails fast. - consider —
scripts/railway-preview-status.ts:118: "the firstunpublishedis terminal" is evidenced at rest (#699, #700), not across the pending→success transition — the one shape that would redden a healthy PR. - consider —
tests/unit/railway-preview-status.spec.ts:45: theOTHERfixture's context is not the shape Railway emits, so the sibling-service case is not really covered.
What was checked
- Ticket vs diff. #661's Expected behaviour (3 items), Resolved decisions (4), Acceptance criteria (7) and Out of scope, measured against each file. Criterion 7 confirmed by grepping the repo for "Railway API" and "preview URL … automatic" — no survivors outside the corrected sentences. The ticket says
ci.ymlneeds no change; the change there is comments plus the skip-warning text, which is a fair reading, not scope creep. - Code read whole:
scripts/railway-preview-status.ts,scripts/get-railway-preview-url.ts(both, not just the diff),.github/workflows/ci.yml,tests/unit/railway-preview-status.spec.ts. - Placement rules, because a new single-caller module is the first thing to challenge:
src/AGENTS.md("supporting modules are single-owner code and stay in the folder — putting them insrc/lib/fails the one-consumer check") andtests/unit/lib-boundary.spec.ts'sscripts/carve-out. The location is right; I am not raising it. - Consumer side. The only out-of-repo caller of this script is
finalize-pr's Railway carve-out insydevs/claude-workflow(workflow/skills/finalize-pr/SKILL.md:220-221), which #661 listed as out of scope. It invokes the script with no env, so it exits at:103before either new failure path — the new exit codes do not reach it, and the fast terminal return is a straight improvement there. - Live evidence, not the PR body's account of it: the head SHA's combined status is
sahajcloud - SahajCloud/success/Success - sahajcloud-sahajcloud-pr-703.up.railway.app, andLint, Test & Smokeis green on run 33977872448. That is what grounds the fixture finding. - Spec run locally:
vitest run tests/unit/railway-preview-status.spec.ts— 14 passed, 427ms. I hand-traced the two clock assertions (45_000→ reads 3;40_000→ sleeps[15000, 15000, 10000]) againstdiscoverPreview's clamp rather than trusting green. - Type check by hand on
PreviewOutcome'sExclude<…>: it does resolve toready | failed | unpublished | timeout, somain()'s final narrowing toreadyis sound. - Reviewer profile read and applied. Nothing raised on style, naming, or test volume.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
Review of #703 found the `reads === 0` exit too blunt. It fired on any cause, including a transient statuses-API incident that outlasted the 12-minute deadline — turning every open PR red, clearable only by a full re-run — and it spent the whole budget before saying so. #661 resolved that the fail-open is correct for a PR with genuinely no preview, and scoped exactly one new hard failure. `fetchStatuses` collapsed every non-ok response into one opaque Error, so the loop could not tell a permanent 401/403 from a retryable 502. It now throws StatusFetchError carrying `res.status`, and discovery returns a `forbidden` outcome on the first 401/403 — terminal, like `unpublished`, because GitHub will not relent inside one run. That keeps the property worth keeping (never having looked is not evidence of absence) and drops both the transient trigger and the 12-minute cost. A budget spent entirely on transient errors now warns and skips instead of failing. The remaining causes are the ones that clear on their own. Also from review: the OTHER fixture used `mailpit - Mailpit`, a context Railway never posts. Railway's shape is `<project> - <service>`, so a sibling service is `sahajcloud - Mailpit`. The old fixture asserted against an impossible string; the new one covers the case that can occur, and records that the discrimination rests on `includes` being case-sensitive. And the `unpublished`-is-terminal docstring now records its evidence: settled-state only (#699, #700), bounded by discovery starting about six minutes into the job, so the status it reads is already minutes old. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY
The scripts guide still described the blanket `reads === 0` failure. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY
|
All three review findings applied, in The should-fix landed as the second option you offered. The two Lean gate green: 124 files, 1589 tests. Both new 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
…rule Adversarial review on #711 raised four threads. All four applied. The written rule in `docs/rules/access.md` was the deliverable #701 chose instead of a shared helper, and it said "on every request" while four hand-rolled admin fetches legitimately do not send a locale. A reader who greps `fetch('/api/` found four counter-examples with nothing to tell them apart, so the rule read as approximate. It now names the condition — the endpoint or collection runs a per-locale `hasPermission` — and tables every call site on each side of it. `docs/rules/admin-ui.md` carried the same overbroad claim and now defers to it. Of the three call sites the fix touches, only the loader's URL was pinned. The two carrying the user-visible half rested on inspection, with the manual browser pass skipped, on a Critical bug live in production. Both now build their URL in a pure module — `framesByNarratorKey` in the FrameEditor's existing `utils.ts`, `eventSubmissionActionUrl` in a new `EventSubmissions/urls.ts` — spec'd in `tests/unit/admin-locale-urls.spec.ts`. This is the reviewer's option 2; option 1 needs a browser this run has no dev server for. Both builders return `null` without a locale, which also settles the third thread: the same falsy `code` was handled three different ways, and the EventSubmissions site interpolated it unguarded. `?locale=undefined` is rewritten to the default locale by `sanitizeLocales`, so that path reproduced the #701 403 silently. It now reports the failure instead. Comment cleanups: the spec docblock's dangling `The` and its argument with the sentence it replaced, and `relationshipDocLoader.ts`'s stale "a single request per relationTo", which the batch-key comment below it contradicted. Every new assertion confirmed failing first, at its own site: dropping the locale from the frames key turns 4 red, dropping the guard from the submission URL turns 1 red. Gate: lint, typecheck, typecheck:tests, test:unit (125 files, 1601 tests). Rebased onto main after #703 merged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Po2VWfKLXuT5TtZRysSDmk
…711) * fix(admin): send the active locale on hand-rolled admin REST fetches Three admin components call the REST API with a hand-rolled fetch that sends no `?locale=`. Payload resolves such a request at the default locale, and every role gate then evaluates the manager's English roles. Since #668 made roles genuinely per-locale, a manager whose roles live only in another locale is denied on all three surfaces. Confirmed on the reported record: managers/504's `roles` is `{"fr":["path-editor","meditations-editor"]}` — no `en` key at all, so `roles['en'] || []` is empty and `hasPermission` returns false. - FrameEditor/hooks.ts — the locale joins the SWR key, so switching the admin locale refetches for free. - ThumbnailCell — the loader is a module singleton, not a hook, so the locale threads through `load()` and the batch key becomes `relationTo:locale`. Two locales must not share a batch: the response is gated per locale, so merging them would answer one locale's cells from the other's request. - EventSubmissionActions — both URLs carry it. DELETE is not locale-gated today, but consistency costs nothing. Fixed on the client, not the server: the gates are deliberate and documented, and Payload's own fetches already send the locale. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY * test(admin): cover the locale gate over the real REST pipeline The suite was green through the bug because nothing drove Payload's REST pipeline as a manager with roles only in a non-default locale. The handler-level specs build `req` by hand and hardcode `locale: 'en'`, so none of them could see how `req.locale` is derived — which is exactly where #701 lived. - restRequest: `createRestClientAs(env, manager)` logs in any manager, and the caller now takes a method and a JSON body. `createRestClient` keeps its signature and delegates. - frames-by-narrator: three REST cases for a French-only meditations-editor — no `?locale` → 403, `?locale=fr` → 200, `?locale=en` → 403. - event-submissions-review: the same three for an `atlas-manager` on `POST /:id/review`. A sibling file, not a suite in event-submissions.int.spec.ts, because `getPayload` caches per config and a second createTestEnvironment in one file returns the first. - relationshipDocLoader: locale forwarding, per-locale batching, and the default fetcher's URL — the code a comment called "not worth a unit test", where the defect was. Fixture pre-mortem: `testData.createManager` writes a per-locale roles object one locale at a time (verified in tests/utils/testData.ts), so `{ fr: [...] }` really does leave `roles.en` empty — checked against the reported production record, managers/504, whose roles carry no `en` key. `anchorRegion` must be a city or venue, so the review fixture anchors on a city under the managed country (prepareSubmission.ts:101). Every new assertion was confirmed failing first: flipping each fixture's locale to `en` turns all six REST cases red, dropping `locale` from the loader's query object turns the URL case red, and collapsing the batch key to `relationTo` turns the batching case red. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY * docs(access): a hand-rolled admin fetch must send the active locale The rule #701 turned on, stated where each audience reads: the role-scope section of the access rules, and the direct-Payload-access section of the admin UI rules. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY * fix(admin): pin the two unasserted locale call sites, and narrow the rule Adversarial review on #711 raised four threads. All four applied. The written rule in `docs/rules/access.md` was the deliverable #701 chose instead of a shared helper, and it said "on every request" while four hand-rolled admin fetches legitimately do not send a locale. A reader who greps `fetch('/api/` found four counter-examples with nothing to tell them apart, so the rule read as approximate. It now names the condition — the endpoint or collection runs a per-locale `hasPermission` — and tables every call site on each side of it. `docs/rules/admin-ui.md` carried the same overbroad claim and now defers to it. Of the three call sites the fix touches, only the loader's URL was pinned. The two carrying the user-visible half rested on inspection, with the manual browser pass skipped, on a Critical bug live in production. Both now build their URL in a pure module — `framesByNarratorKey` in the FrameEditor's existing `utils.ts`, `eventSubmissionActionUrl` in a new `EventSubmissions/urls.ts` — spec'd in `tests/unit/admin-locale-urls.spec.ts`. This is the reviewer's option 2; option 1 needs a browser this run has no dev server for. Both builders return `null` without a locale, which also settles the third thread: the same falsy `code` was handled three different ways, and the EventSubmissions site interpolated it unguarded. `?locale=undefined` is rewritten to the default locale by `sanitizeLocales`, so that path reproduced the #701 403 silently. It now reports the failure instead. Comment cleanups: the spec docblock's dangling `The` and its argument with the sentence it replaced, and `relationshipDocLoader.ts`'s stale "a single request per relationTo", which the batch-key comment below it contradicted. Every new assertion confirmed failing first, at its own site: dropping the locale from the frames key turns 4 red, dropping the guard from the submission URL turns 1 red. Gate: lint, typecheck, typecheck:tests, test:unit (125 files, 1601 tests). Rebased onto main after #703 merged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Po2VWfKLXuT5TtZRysSDmk --------- Co-authored-by: Claude <[email protected]>
Review of #703 found the `reads === 0` exit too blunt. It fired on any cause, including a transient statuses-API incident that outlasted the 12-minute deadline — turning every open PR red, clearable only by a full re-run — and it spent the whole budget before saying so. #661 resolved that the fail-open is correct for a PR with genuinely no preview, and scoped exactly one new hard failure. `fetchStatuses` collapsed every non-ok response into one opaque Error, so the loop could not tell a permanent 401/403 from a retryable 502. It now throws StatusFetchError carrying `res.status`, and discovery returns a `forbidden` outcome on the first 401/403 — terminal, like `unpublished`, because GitHub will not relent inside one run. That keeps the property worth keeping (never having looked is not evidence of absence) and drops both the transient trigger and the 12-minute cost. A budget spent entirely on transient errors now warns and skips instead of failing. The remaining causes are the ones that clear on their own. Also from review: the OTHER fixture used `mailpit - Mailpit`, a context Railway never posts. Railway's shape is `<project> - <service>`, so a sibling service is `sahajcloud - Mailpit`. The old fixture asserted against an impossible string; the new one covers the case that can occur, and records that the discrimination rests on `includes` being case-sensitive. And the `unpublished`-is-terminal docstring now records its evidence: settled-state only (#699, #700), bounded by discovery starting about six minutes into the job, so the status it reads is already minutes old. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY
…rule Adversarial review on #711 raised four threads. All four applied. The written rule in `docs/rules/access.md` was the deliverable #701 chose instead of a shared helper, and it said "on every request" while four hand-rolled admin fetches legitimately do not send a locale. A reader who greps `fetch('/api/` found four counter-examples with nothing to tell them apart, so the rule read as approximate. It now names the condition — the endpoint or collection runs a per-locale `hasPermission` — and tables every call site on each side of it. `docs/rules/admin-ui.md` carried the same overbroad claim and now defers to it. Of the three call sites the fix touches, only the loader's URL was pinned. The two carrying the user-visible half rested on inspection, with the manual browser pass skipped, on a Critical bug live in production. Both now build their URL in a pure module — `framesByNarratorKey` in the FrameEditor's existing `utils.ts`, `eventSubmissionActionUrl` in a new `EventSubmissions/urls.ts` — spec'd in `tests/unit/admin-locale-urls.spec.ts`. This is the reviewer's option 2; option 1 needs a browser this run has no dev server for. Both builders return `null` without a locale, which also settles the third thread: the same falsy `code` was handled three different ways, and the EventSubmissions site interpolated it unguarded. `?locale=undefined` is rewritten to the default locale by `sanitizeLocales`, so that path reproduced the #701 403 silently. It now reports the failure instead. Comment cleanups: the spec docblock's dangling `The` and its argument with the sentence it replaced, and `relationshipDocLoader.ts`'s stale "a single request per relationTo", which the batch-key comment below it contradicted. Every new assertion confirmed failing first, at its own site: dropping the locale from the frames key turns 4 red, dropping the guard from the submission URL turns 1 red. Gate: lint, typecheck, typecheck:tests, test:unit (125 files, 1601 tests). Rebased onto main after #703 merged. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Po2VWfKLXuT5TtZRysSDmk
Summary
successwhile publishing no host now fails CI instead of skipping the smoke lane and leaving the job green.Changes
scripts/railway-preview-status.ts— new.classifyStatuses(ready/unpublished/pending/failed/absent) plusdiscoverPreviewover an injected clock, sleep and fetch.StatusFetchErrorcarries GitHub's HTTP status, so a permanent refusal is distinguishable from a retryable onescripts/get-railway-preview-url.ts— keeps env parsing, the GitHub fetch, the health check and the exit codes; gains one non-zero exittests/unit/railway-preview-status.spec.ts— new, 17 casesRAILWAY_RUNBOOK.md,tests/AGENTS.md,scripts/AGENTS.md,playwright.config.ts,ci.ymlcomments — the corrections belowPreview
https://sahajcloud-sahajcloud-pr-703.up.railway.app
Four acceptance criteria are met by observation on this PR's own CI run, not by argument. This is the first PR opened since the production domain was added on 2026-09-05, and existing PR environments do not backfill — so it is the first commit that could ever satisfy them.
success Success - sahajcloud-sahajcloud-pr-703.up.railway.app, and therailway-appcomment links Web. #699's read a bareSuccessan hour earlierRun smoke specs against the Railway preview→ success, 53s. Step 12, the skip warning, did not fireThe Tier-3 smoke lane has now run on a PR for the first time since #653.
Test results
3551af8— lint, typecheck, typecheck:tests,pnpm test, discovery, smoke. Re-running on20e64c9pnpm lint,pnpm typecheck,pnpm typecheck:tests,pnpm test:unit(124 files, 1589 tests)railway-preview-status17 passedEvery new assertion was confirmed to fail first. Classifying success-with-no-host as
pendingagain — the original behaviour, at the line that caused it — turns three red. Removing the deadline clamp turns the budget assertion red (45s against a 40s budget). Removing the 401/403 branch turns the two newforbiddenassertions red.Each exit path was also exercised end to end through
main()with a stubbed fetch, because a passing unit spec is not evidence that its caller reaches the branch:success, no host::error, emptypreview_url, ~1ssuccesswith hosterror(cancelled)::error, on the first poll — measured at 1s::warningskip at the deadline is spec'd, not timedManual verification
Notes for reviewer
fetchStatusescarriesres.statusand a 401/403 alone is terminal on the first refusal, since GitHub will not relent inside one run. It keeps the property worth keeping: never having looked is not evidence of absence. A sustained transient failure now warns and skips. Still outside fix(ci): restore Railway preview URLs, fail closed when none is found #661's letter, so still yours to veto — the rest of the PR does not depend on it.unpublishedis deliberate, and its evidence is now written down. The rationale used to overclaim that GitHub could not revise the status. It can. The docstring now records what is actually known: the evidence is settled-state only (docs(claude): link tests/AGENTS.md, and correct whatpnpm testcovers #699, fix(migrations): drop the constraint drops that CASCADE already handled #700), bounded by discovery starting about six minutes into the job, so the status it reads is already minutes old. Behaviour unchanged — fix(ci): restore Railway preview URLs, fail closed when none is found #661 resolved immediate over one grace re-poll.SahajCloudservice already carriessahajcloud-production.up.railway.appon port 8080 beside the custom domain, and the table above is the evidence it took.Detail
What the bug actually was.
state === 'success'was true immediately, buturlwasnull, so neither the break nor the failure return fired. The loop re-read an identical, immutable status every 15s for the full budget, then exported an emptypreview_urland exited 0.ci.ymlgates the smoke step on that value, so the step skipped and the job reported success. All 17 most recent CI runs skipped smoke;cors-preflight,error-disclosureandimageshad never run in CI at all — until this run.Why the client, not the config. The Railway domain cannot be fixed in git. What CI owed was the ability to tell "there is no preview" from "the preview is broken", and that distinction is now a first-class classification rather than a
nullcheck.Fixture pre-mortem. The specs assume Railway posts context
sahajcloud - SahajCloud—<project> - <service>— with eitherSuccess - <host>.up.railway.appor a bareSuccess. Verified against the live commit statuses on #700 (host present) and #699 (bare), read through the GitHub statuses API. Review caught that the sibling-service fixture usedmailpit - Mailpit, a context Railway never posts; it is nowsahajcloud - Mailpit, which makes the case real and puts the load-bearing detail on the record — the discrimination rests onincludesbeing case-sensitive.Quality passes.
/simplifyover four angles and/code-reviewat high effort. Applied: the deadline clamp (15s of dead CI clock per timing-out run, and a budget that overran by up to one interval); logging the classification rather than GitHub's raw state, which drops thestatusStatehelper and a redundantstatefield; makinglast/elapsedMsload-bearing in the timeout message instead of test-only; trimming the remediation duplicated between the::errorstring and its own comment; folding the runbook correction into the paragraph it supersedes rather than appending below it; and fixing a skip warning I had made less accurate, which claimed "no preview environment" for three different causes.Then an adversarial review round, whose three findings are all applied above: narrowing the second hard failure to 401/403, recording the evidence behind the
unpublisheddecision, and correcting the sibling-service fixture.Dismissed: sharing a
pollUntilbetween this loop andwaitHealthy— real duplication, butwaitHealthyis pre-existing and untouched here, so it would widen the diff past the ticket. Shortening the budget for a status never seen at all — #661 keeps the genuine skip paths as they are. Raising "any skipped smoke lane fails the job" to a workflow-level rule — a fair altitude point, and the one place this fix stays an exception rather than a policy, but #661 resolved that the fail-open is correct for PRs with no preview. Worth its own ticket if a third variant appears.Pipeline notes.
/pr-review-toolkit:review-pr allis not installed in this environment, so/code-review highran instead — the pass the toolkit replaced./security-reviewwas gated off:securityReview.triggerPatternin.claude/workflow.jsonmatches none of the changed paths. Flagged so the substitutions are visible rather than assumed.Closes #661
🤖 Written by the sydevs autonomous loop — see what this is
🤖 Generated with Claude Code
https://claude.ai/code/session_012noYdvt78W3aLKqJpDpEQY