Skip to content

Commit dd85be1

Browse files
mpstatonclaude
andcommitted
refactor(shell, corpora-curator): Phase 5 — drop the legacy env-var reads, the rename now runs end to end
The two-name window existed because Railway supplied the STRATEGY_CURATOR spellings and both vars are inlined at build time. Railway now supplies only the CORPORA_CURATOR names and the legacy variables are deleted, so the middle term in each fallback chain is dead weight. All four files read one name. The infrastructure half of the rename was executed at the same time, against a project with no active users and a remote database, so the additive-domain dance in the plan was skipped for a straight cut: dockerfilePath and build command repointed at apps/corpora-curator, the service renamed, the old generated domain deleted and a new one generated, both PUBLIC_CORPORA_CURATOR_* variables set, both PUBLIC_STRATEGY_CURATOR_* variables deleted, and the stale RAILPACK_STATIC_FILE_ROOT corrected. Two things worth recording, both now in the refactor doc. A generated domain does NOT follow a service rename — it is its own object with its own ID, the service kept serving the old hostname after being renamed, and generate_domain is a no-op while any domain exists, so it has to be deleted and regenerated. And no Railway MCP tool renames a service; the CLI's `railway api` GraphQL passthrough does it via serviceUpdate, without the agent ever handling the auth token. `STRATEGY_CURATOR` now appears nowhere in the tree outside changelog entries, DESIGN.md's historical revisions, and the refactor doc that records the transition — all deliberate. Verified with a real docker build of the shell and corpora-curator images after the edits; both green. Files changed: - shell/rsbuild.config.ts, shell/Dockerfile - apps/corpora-curator/rsbuild.config.ts, apps/corpora-curator/Dockerfile - context-v/refactors/Rename-Strategy-Curator-To-Corpora-Curator.md — the sequence marked executed, plus the domain and MCP-gap findings Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PZJvZWco3z7SR2dEhFqEjA
1 parent 3b172bf commit dd85be1

5 files changed

Lines changed: 43 additions & 45 deletions

File tree

apps/corpora-curator/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ RUN pnpm install --frozen-lockfile
2424
ARG PUBLIC_WS_URL
2525
ARG PUBLIC_ID_BASE
2626
ARG PUBLIC_CORPORA_CURATOR_ASSET_PREFIX
27-
# Rename transition: Railway still passes the old name. Drop in Phase 5.
28-
ARG PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX
2927
ENV PUBLIC_WS_URL=$PUBLIC_WS_URL
3028
ENV PUBLIC_ID_BASE=$PUBLIC_ID_BASE
3129
ENV PUBLIC_CORPORA_CURATOR_ASSET_PREFIX=$PUBLIC_CORPORA_CURATOR_ASSET_PREFIX
32-
ENV PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX=$PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX
3330
RUN pnpm --filter @augment-it/corpora-curator build
3431

3532
FROM node:22-alpine

apps/corpora-curator/rsbuild.config.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';
1010
// the full rationale (a federated remote's sub-chunks resolve against
1111
// whatever assetPrefix it was compiled with, not the host's origin;
1212
// dev.assetPrefix alone doesn't cover production builds).
13-
// RENAME TRANSITION (Phase 4): the Railway service still passes the
14-
// STRATEGY_CURATOR name. Missing this one does not fail the build — it ships a
15-
// remote that loads and then breaks on its first async sub-chunk, because the
16-
// prefix falls back to localhost. Legacy name read second; drop it in Phase 5.
17-
const ASSET_PREFIX =
18-
process.env.PUBLIC_CORPORA_CURATOR_ASSET_PREFIX ||
19-
process.env.PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX ||
20-
'http://localhost:3017';
13+
// Missing this does not fail the build — it ships a remote that loads and then
14+
// breaks on its first async sub-chunk, because the prefix falls back to
15+
// localhost. `||` not `??`: an unset Docker ARG arrives as an empty string.
16+
const ASSET_PREFIX = process.env.PUBLIC_CORPORA_CURATOR_ASSET_PREFIX || 'http://localhost:3017';
2117

2218
export default defineConfig({
2319
plugins: [

context-v/refactors/Rename-Strategy-Curator-To-Corpora-Curator.md

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -128,35 +128,51 @@ Only **two** of the seventeen remotes are deployed at all — the curator and
128128
`chat`; the other fifteen are still pointed at `localhost` in the shell's
129129
federation config, deliberately, per the build order.
130130

131-
### The transition fallbacks already in the tree
131+
### The transition fallbacks — added in Phase 4, removed in Phase 5
132132

133-
Because these vars are inlined at **build** time, a build that lands before the
134-
dashboard is updated would fall through to `localhost` and 404 in production.
135-
Four files therefore read the **new** name first and the **old** name second:
133+
Because these vars are inlined at **build** time, a build that landed before the
134+
dashboard was updated would have fallen through to `localhost` and 404'd in
135+
production. Four files therefore read the **new** name first and the **old**
136+
name second for the length of the transition.
137+
138+
**That window is now closed** (2026-08-15). Railway supplies only the
139+
`CORPORA_CURATOR` names, the legacy variables are deleted, and all four files
140+
read a single name:
136141

137142
| File | Reads |
138143
|---|---|
139-
| `shell/rsbuild.config.ts` | `PUBLIC_CORPORA_CURATOR_REMOTE` `PUBLIC_STRATEGY_CURATOR_REMOTE` |
140-
| `shell/Dockerfile` | both `ARG`/`ENV` declared |
141-
| `apps/corpora-curator/rsbuild.config.ts` | `PUBLIC_CORPORA_CURATOR_ASSET_PREFIX` `PUBLIC_STRATEGY_CURATOR_ASSET_PREFIX` |
142-
| `apps/corpora-curator/Dockerfile` | both `ARG`/`ENV` declared |
144+
| `shell/rsbuild.config.ts` | `PUBLIC_CORPORA_CURATOR_REMOTE` |
145+
| `shell/Dockerfile` | one `ARG`/`ENV` |
146+
| `apps/corpora-curator/rsbuild.config.ts` | `PUBLIC_CORPORA_CURATOR_ASSET_PREFIX` |
147+
| `apps/corpora-curator/Dockerfile` | one `ARG`/`ENV` |
143148

144-
This means **the current tree deploys correctly with the dashboard untouched.**
145-
The asset-prefix one matters most: missing it does not fail the build, it ships
149+
The asset-prefix one mattered most: missing it does not fail the build, it ships
146150
a remote that loads and then breaks on its first async sub-chunk.
147151

148-
### Sequence
149-
150-
1. Update the Railway service's `dockerfilePath` to
151-
`apps/corpora-curator/Dockerfile`. Dashboard change; Railway builds on push,
152-
so land it near the merge. Out of order in either direction costs one failed
153-
build — recoverable, but expect it rather than discover it.
154-
2. Add `corpora-curator-production.up.railway.app` as an **additional** domain
155-
on the existing service. Both hostnames now serve.
156-
3. Add `PUBLIC_CORPORA_CURATOR_REMOTE` / `PUBLIC_CORPORA_CURATOR_ASSET_PREFIX`
157-
as service variables, redeploy, verify in a real browser.
158-
4. Only then rename the Railway service and retire the old domain.
159-
5. Update `DEPLOYMENT.md`'s hostname table last, once it is true.
152+
### Sequence — executed 2026-08-15
153+
154+
The plan below was written expecting a careful dashboard dance. It was executed
155+
instead against a project with **no active users and a remote database**, where
156+
downtime was explicitly acceptable, so the additive-domain step was skipped in
157+
favour of a straight cut.
158+
159+
| # | Step | Result |
160+
|---|---|---|
161+
| 1 | `dockerfilePath``apps/corpora-curator/Dockerfile`, build command → `pnpm --filter @augment-it/corpora-curator build` ||
162+
| 2 | Rename the Railway service `strategy-curator``corpora-curator` | ✅ via `serviceUpdate`**no MCP tool covers this**; the Railway CLI's `railway api` GraphQL passthrough does |
163+
| 3 | Old generated domain deleted, new one generated |`corpora-curator-production.up.railway.app` |
164+
| 4 | `PUBLIC_CORPORA_CURATOR_*` set on both services; `PUBLIC_STRATEGY_CURATOR_*` deleted; `RAILPACK_STATIC_FILE_ROOT` corrected ||
165+
| 5 | Phase 5 — legacy reads dropped from all four files ||
166+
| 6 | `DEPLOYMENT.md` hostname table | ✅ already correct — Phase 1 wrote the post-rename hostname, which only became true at step 3 |
167+
168+
**A generated domain does not follow a service rename.** After renaming, the
169+
service still served `strategy-curator-production.up.railway.app`. The domain is
170+
its own object with its own ID; it must be deleted and regenerated, and
171+
`generate_domain` is a no-op while any domain already exists.
172+
173+
**`RAILWAY_PRIVATE_DOMAIN` still reads `strategy-curator.railway.internal`**
174+
Railway-managed, expected to refresh on the next successful deploy. Nothing
175+
in this repo consumes it (private networking is unused between the frontends).
160176

161177
## 6. Phase 5 — retire
162178

shell/Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,13 @@ RUN pnpm install --frozen-lockfile
2626
ARG PUBLIC_WS_URL
2727
ARG PUBLIC_ID_BASE
2828
ARG PUBLIC_CORPORA_CURATOR_REMOTE
29-
# Rename transition: Railway still passes the old name. Drop in Phase 5.
30-
ARG PUBLIC_STRATEGY_CURATOR_REMOTE
3129
ARG PUBLIC_CHAT_REMOTE
3230
ARG PUBLIC_ORG_WORKBENCH_REMOTE
3331
ARG PUBLIC_SEARCH_AND_ADD_REMOTE
3432
ARG PUBLIC_SEARCH_RESULTS_REMOTE
3533
ENV PUBLIC_WS_URL=$PUBLIC_WS_URL
3634
ENV PUBLIC_ID_BASE=$PUBLIC_ID_BASE
3735
ENV PUBLIC_CORPORA_CURATOR_REMOTE=$PUBLIC_CORPORA_CURATOR_REMOTE
38-
ENV PUBLIC_STRATEGY_CURATOR_REMOTE=$PUBLIC_STRATEGY_CURATOR_REMOTE
3936
ENV PUBLIC_CHAT_REMOTE=$PUBLIC_CHAT_REMOTE
4037
ENV PUBLIC_ORG_WORKBENCH_REMOTE=$PUBLIC_ORG_WORKBENCH_REMOTE
4138
ENV PUBLIC_SEARCH_AND_ADD_REMOTE=$PUBLIC_SEARCH_AND_ADD_REMOTE

shell/rsbuild.config.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,8 @@ import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';
2323
// produced "TypeError: object null is not iterable" deep in rspack's
2424
// Module Federation remote-info resolution — an empty remote URL, not a
2525
// missing one.
26-
// RENAME TRANSITION (corpora-curator, Phase 4). The deployed Railway service
27-
// still supplies PUBLIC_STRATEGY_CURATOR_REMOTE, and this var is inlined at
28-
// BUILD time — so a shell built after the rename but before the dashboard is
29-
// updated would silently fall through to localhost and 404 in production.
30-
// Reading the legacy name second keeps both worlds building.
31-
// DELETE the middle term in Phase 5, once Railway supplies the new name.
3226
const CORPORA_CURATOR_REMOTE =
33-
process.env.PUBLIC_CORPORA_CURATOR_REMOTE ||
34-
process.env.PUBLIC_STRATEGY_CURATOR_REMOTE ||
35-
'http://localhost:3017/remoteEntry.js';
27+
process.env.PUBLIC_CORPORA_CURATOR_REMOTE || 'http://localhost:3017/remoteEntry.js';
3628
const CHAT_REMOTE = process.env.PUBLIC_CHAT_REMOTE || 'http://localhost:3006/remoteEntry.js';
3729
// Augment-from-DB remotes — deployed for the reach-edu opening (#69);
3830
// localhost fallbacks keep local dev unchanged.

0 commit comments

Comments
 (0)