Skip to content

fix(ci): name both causes of an unpublished Railway preview - #1240

Merged
sydevs-bot merged 8 commits into
mainfrom
claude/fix-1230-unpublished-preview-error
Nov 21, 2026
Merged

sydevs-bot merged 8 commits into
mainfrom
claude/fix-1230-unpublished-preview-error

Conversation

@sydevs-bot

@sydevs-bot sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The unpublished ::error names both causes of a bare Success, not production alone.
  • The runbook owns the two-cause list; the four surfaces that copied it now point at it.
  • Joined: the error's remedy was the second cause's, which does not clear the first.

Change outline

The unpublished branch keeps its exit code and its classifier. What changed is what it tells the reader.

Behaviour — the unpublished branch

 outcome.kind === 'unpublished'                     scripts/get-railway-preview-url.ts
   ::error title=Railway preview has no URL
-    cause: base-environment configuration          # asserted as settled fact
-    "not a transient failure — re-running produces the same result"
-    fix: the runbook's production section
+    cause: production's domain, OR this PR environment's own — neither asserted
+    discriminator: a sibling PR's status, deployed around the same time
+    a bare re-run reads this same status, which Railway wrote at deploy time
+    which remedy: deferred to the runbook, because it differs by cause
   exportUrl(''); process.exit(1)                   # unchanged

Exit 1 on unpublished, and classifyStatuses, are untouched. Red is right under either cause.

Surfaces — one list, in the one file that owns it

Five surfaces stated a single cause. Each enumeration is a copy that goes stale on its own, and
which domain is missing changes nothing four of them do — so only the ::error, what an operator
reads in CI, still names both.

+RAILWAY_RUNBOOK.md                  # OWNS it: two ⚠ sections, each with its own remedy
 scripts/get-railway-preview-url.ts  # the ::error names both causes and the discriminator
-                                    # its module header named them too
+                                    # header: a missing domain, not an absent preview → runbook
-scripts/railway-preview-status.ts   # named the cause it classifies
-.github/workflows/ci.yml            # named it in the step comment a CI reader meets first
-tests/AGENTS.md                     # named it in the smoke lane's section
+scripts/railway-preview-status.ts   # a missing domain, not an absent preview → runbook
+.github/workflows/ci.yml            # a missing domain, not an absent preview → runbook
+tests/AGENTS.md                     # a missing domain, not an absent preview → runbook

Prose — the two slips the enumeration carried

The #661 breadcrumb had attached itself to "an absent preview"; what hid the dead smoke lane was
reading this status as one. And a Railway domain was called a configuration in four places. Both
go with the clause that carried them.

Preview

No preview surface

Test results

  • Lean gate: ✓ — lint, format:check, typecheck, typecheck:tests, test:unit (284 files, 3841 tests)
  • Targeted specs: tests/unit/railway-preview-status.spec.ts — 40 passed
  • Build: N/A

Manual verification

  1. Read the unpublished ::error at scripts/get-railway-preview-url.ts:131. It names both causes, asserts neither, and gives the sibling-PR observation that separates them.
  2. Read RAILWAY_RUNBOOK.md → "CI & Preview Environments". Both ⚠ sections now sit there: the production case (fix(ci): restore Railway preview URLs, fail closed when none is found #661) and the per-environment case, each with its own remedy. The second reconciles itself with the first's "only when the base service has one" rule, and says its own cause on chore(songs): retire the song duration backfill #1227 is unrecorded.
  3. Read the four pointers — railway-preview-status.ts:15, get-railway-preview-url.ts:17, ci.yml:70, tests/AGENTS.md. Each names a missing domain, not an absent preview, and sends the rest to the runbook.

Notes for reviewer

  • One judgement call worth checking. The ticket's approach said a re-run "does help once that domain exists." I did not write that: Railway writes the host into the commit status at deploy time, and discoverPreview re-reads whatever statuses that SHA already has, so a bare re-run reads the same bare Success under either cause. The runbook's per-environment section says to deploy that environment again; the message says only that a re-run alone changes nothing, and sends the remedy to the runbook. The ticket's criterion — stop claiming a re-run always produces the same result — holds either way.
  • Not built, deliberately: having the script detect which cause it hit by reading a sibling PR's statuses. That is a GitHub lookup and a heuristic added against a failure seen twice, and the ticket scoped it out ("leave the exit code and classification alone"). The message hands the reader the one observation instead.
  • No test added. Nothing in the diff changes a branch, a type or a return value — the only non-Markdown change is one string literal's content, and main pins no error wording. Making it assertable would mean exporting the string and asserting substrings of prose, which rots on the next rewording. railway-preview-status.spec.ts still pins the classification and the terminal-on-first-poll rule.
  • The cause on chore(songs): retire the song duration backfill #1227 is now recorded as unknown. The evidence proves production held its domain; nothing establishes why that environment had none, and nobody opened it in Railway before the PR was superseded. The runbook says so rather than implying a mechanism, and both remedies supply an observably absent domain, so neither waits on the reason.
  • No findings dismissed. /code-review high raised four, all fixed in 12effcb; the docs sweep found a fifth. The adversarial review's three are adopted in 410c154, 108334f and e5667d4.
Detail

scripts/AGENTS.md is no longer in the diff. It was the sixth surface, edited in one table row. #1235 then deleted that whole operator table from main in favour of intent-only prose, and the merge in c81098c took that rewrite: the false clause is gone with the sentence that carried it, and the replacement bullet asserts no cause at all. Re-adding the runbook pointer there would restore detail #1235 deliberately moved out.

The /simplify pass. Run inline rather than as four agents: the diff has no logic to simplify — one string literal's content plus Markdown. Reuse, efficiency and altitude found nothing. It did cost one clause: the unpublished comment said "so the message names both", which the string below it already shows.

On altitude. The root cause of the misdiagnosis is a message that asserted a cause it could not know, not a missing detector. HEALTH_ERRORS was considered as a home for the string — it is a map because pollHealth's verdict indexes it, and unpublished and forbidden are both handled inline in the entrypoint, so moving it would add an export for nothing.

Evidence, unchanged from the ticket, and what it does not establish. PR #1227 at 0f3c4ed posted Success with no host at 23:02Z; #1229 posted Success - sahajcloud-sahajcloud-pr-1229.up.railway.app at 23:09Z. Production therefore held its Railway-provided domain throughout, which is what makes a sibling PR's status the discriminator. It says nothing about why #1227's own service had no domain: a grant that silently failed and a domain removed afterwards both fit. Railway's inheritance rule is a necessary condition, so the second cause needs no contradiction of it.

Closes #1230

A bare `Success` with no host has two causes, and the commit status is
identical under either: production lost its Railway-provided domain, or
the `SahajCloud` service in that one `pr-<n>` environment has none. The
`::error` asserted the first as settled fact, so a fix-ci run on #1227
diagnosed production, where nothing was wrong.

Name both, and give the observation that separates them: another PR whose
preview deployed around the same time. #1229's status carried a host
seven minutes after #1227's did not, which rules production out.

The old message also promised a re-run would produce the same result.
Drop that, but do not replace it with "a re-run helps once the domain
exists" — Railway writes the host into the commit status at deploy time,
and `classifyStatuses` reads whatever statuses that SHA already has, so
a bare re-run reads the same bare `Success`. The environment has to
deploy again.

Classification and the exit code are untouched. Red is right either way.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjViTpaMwMtQMdPvN9W
…ept it

The `::error` is not the only place that named production as the cause of
a bare `Success`. The module header said the description carries a host
"only while the base environment's service holds a domain", so a reader
of the file was still sent to production 110 lines above the message that
now names both. `railway-preview-status.ts`, the smoke lane's guide and
the CI step comment each said the same in their own words.

The `::error`'s own remedy was the second cause's applied to both: the
runbook says existing PR environments do not backfill, so for the
production cause no redeploy of an open PR produces a host. It now says
only that a bare re-run reads the same status, and leaves which fix to
the runbook.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjViTpaMwMtQMdPvN9W
@railway-app

railway-app Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-1240 environment in sahajcloud

Service Status Web Updated
SahajCloud ✅ Success (View Logs) Web Nov 20, 2026 at 11:35 pm UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1240 November 20, 2026 22:51 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot

sydevs-bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor Author

🤖 no session running

recent dispatches
  • 23:24Z address-review · attempt 1 · session · done
  • 23:24Z address-review · attempt 1 · session
  • 23:16Z review-pr · attempt 1 · session · done
  • 23:16Z review-pr · attempt 1 · session
  • 22:53Z resolve-conflicts · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 20, 2026
One conflict, `scripts/AGENTS.md`. #1235 deleted the operator inventory
table this branch edited one row of, replacing it with intent-only prose
under "Warnings by script". Resolved to main's rewrite.

Nothing of this branch's intent is lost. The row's false clause — a bare
`Success` means base-environment misconfiguration — is gone because the
sentence carrying it is gone, and main's replacement bullet asserts no
cause at all, pointing at `railway-preview-status.ts` and #661 instead.
Re-adding the runbook pointer would restore detail #1235 deliberately
moved out of these guides. The two-cause statement still lives in the
five surfaces this branch changes that main did not touch.

The `<details>` note in the PR body about that row's 62-character
padding is moot: the table it padded no longer exists.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXLbjYeXGCjv97dg9Q
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

Merged main in. One conflict, scripts/AGENTS.md.

#1235 deleted the operator inventory table this branch edited one row of, replacing it with intent-only prose. Resolved to main's rewrite. The row's false clause went with the sentence that carried it, and the replacement bullet asserts no cause at all — it points at railway-preview-status.ts and #661. Re-adding the runbook pointer there would restore detail #1235 moved out on purpose. The two-cause statement stands in the five surfaces main did not touch.

Lean gate green on the merge result: 284 files, 3841 tests.

Body updated to match: the file list names five surfaces, and the <details> note about that row's Prettier padding is replaced, since the table it padded is gone.

Anomaly: two update_pull_request calls dropped the body's _Generated by [Claude Code]_ footer. Everything else read back as sent.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 20, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🧐 Adversarial review

The diff is the size of the ticket: five prose surfaces and one string literal, no new file, function, type or constant, so the ladder has nothing to walk. The four surfaces beyond the ticket's two are joined — each asserted the same false cause — so none is smuggled scope. No contract surface is touched, and all four acceptance criteria hold.

The judgement call you were asked to check is right. Railway writes the host into the status at deploy time and discoverPreview re-reads that SHA's statuses, so a bare re-run does read the same bare Success. The ticket's "a re-run does help once that domain exists" was wrong; the runbook's "deploy it again" is the remedy.

Findings

  • should-fix — the two-cause list now has four homes beside the runbook that owns it. Three should be pointers. scripts/railway-preview-status.ts:16
  • should-fix — the new section contradicts the "only when" rule one heading above it, and never says how this cause arises. RAILWAY_RUNBOOK.md:245
  • consider — the new comment misattributes #661 to an absent preview, and names a domain as a configuration. .github/workflows/ci.yml:72

What was checked. #1230's criteria against the diff. All five files read whole on the branch, plus the script's other four outcome branches and tests/unit/railway-preview-status.spec.ts — it pins classification, not wording, so "no test added" holds. "CI & Preview Environments" exists, so the ::error pointer resolves; the TOC lists only ## headings. Every path the body names is on the branch, and scripts/AGENTS.md's railway bullet does assert no cause, as the <details> claims. No preview surface is right: nothing in fixture.surfacePaths is touched. Grepped the repo for the single-cause claim — no surface left behind.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread scripts/railway-preview-status.ts Resolved
Comment thread RAILWAY_RUNBOOK.md Resolved
Comment thread .github/workflows/ci.yml Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 20, 2026
sydevs-bot and others added 5 commits November 20, 2026 23:26
The two-cause list had four homes beside the runbook that owns it. Each
copy goes stale independently, and which of the two domains is missing
changes nothing these three surfaces do: the classifier classifies, the
entrypoint header explains why the commit-status description is the
source, and the smoke-lane guide says the job fails. Each now carries the
substance a reader needs — a missing domain, not an absent preview — and
points at the runbook for which one and what clears it.

The entrypoint header also carried the pair unreconciled with the
runbook's "only when the base service has one" rule. Dropping the
enumeration removes the contradiction with it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWHVvNJVKxVURK3BqF
Two slips in one sentence. "which hid a dead smoke lane for weeks"
attached to "an absent preview"; what hid it was reading this status as
one. And a Railway domain is not a configuration, so "Two configurations
do that — production's domain" did not parse. The enumeration goes with
them: the runbook owns which domain is missing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWHVvNJVKxVURK3BqF
The section above states Railway's rule as "only when the base service
has one", which reads as "always when it does" — and the new section
asserted the opposite case without saying how it arises. Name the rule
for what it is: a necessary condition, not a guarantee.

Why #1227's environment had no domain was never established, so the
section now says so instead of implying a known mechanism. The remedy
supplies an observably absent domain, so it holds under either reason.

Also drops the last "configurations" where a domain was meant.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWHVvNJVKxVURK3BqF
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1240 November 20, 2026 23:32 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor Author

All three review threads adopted. Nothing rebutted, nothing deferred.

Merged main in (82648cf): clean.

Lean gate green — 284 files, 3841 tests. railway-preview-status.spec.ts: 40 passed.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot
sydevs-bot marked this pull request as ready for review November 20, 2026 23:43
@sydevs-bot
sydevs-bot requested a review from Ardnived November 20, 2026 23:43
@sydevs-bot
sydevs-bot enabled auto-merge November 20, 2026 23:43
@sydevs-bot sydevs-bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 20, 2026
@sydevs-bot
sydevs-bot added this pull request to the merge queue Nov 20, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 20, 2026
Merged via the queue into main with commit 891ed64 Nov 21, 2026
75 of 83 checks passed
@sydevs-bot
sydevs-bot deleted the claude/fix-1230-unpublished-preview-error branch November 21, 2026 00:02
@sydevs-bot sydevs-bot moved this from Pending to Done in SYDevelopers Technical Roadmap Nov 21, 2026

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1240 — 26768d8f Deployed Nov 20, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

fix(ci): the unpublished-preview error names only one of two causes

3 participants