Ship the Studio server in the workspace image (CS-003 reopened) - #175
Conversation
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
CS-003, reopened. Deploy 4e33d620 built green off 01143ad and /opt/commonplace/studio-server was absent from the running container. Two independent defects, either one fatal alone. No COPY --from=studio-server existed anywhere. The stage wrote /out and the final image never took it, and BuildKit prunes a stage nothing copies from, so the fork was not merely uncopied, it was never compiled. That is why a build carrying the mangler patch finished without ever reaching the mangler. The gate shared a name with the runtime switch. Railway injects every service variable into whatever ARG a stage declares, so IDE_HOST set on the service to keep the runtime host on code-server during cutover would have switched the build off too. The safe-cutover shape this plan rests on, ship both binaries and flip a variable, was unreachable: pinning the variable deleted the binary from the next image. The stage is now gated on BUILD_STUDIO_SERVER, IDE_HOST is runtime only and the dead ARG in the base stage is gone, and the COPY exists. At BUILD_STUDIO_SERVER=0 the stage still writes /out so the COPY stays valid; what it omits is the launcher, which is the file entrypoint.sh probes with -x, so a skipped build falls back to code-server by itself. Proof is the container, not the Dockerfile. The previous done was read off the source, which is how this survived a green build.
95a87a6 to
cd43c3e
Compare
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
Warning Review limit reached
Next review available in: 50 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR fixes a production gap where the workspace image did not actually ship the Commonplace Studio server and strengthens the /IDE substrate wiring (pack + co-located editor API), including new doctor probes and an edge proxy to support WebSocket upgrades.
Changes:
- Ensure the workspace Docker image builds and copies the Studio reh-web server output into the runtime image, with a build-time gate that doesn’t conflict with runtime host selection.
- Add a co-located
commonplace-api“editor substrate” process + bootstrap flow to generateTHEOREM_EDITOR_*env for thetheorem-vscodepack, plus doctor probes for health/readiness. - Add a console-side edge proxy for
/IDE(WebSocket-capable) and update console views/tests/manifests to recognize the IDE surface.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/doctor.mjs | CLI doctor: route + substrate assertions |
| pnpm-lock.yaml | Workspace dependency graph updates for theorem-vscode + new packages |
| packaging/workspace/railway.toml | Railway deploy docs + watch patterns for IDE substrate inputs |
| packaging/workspace/patch-code-server-product.mjs | Patch code-server product.json for proposal grants |
| packaging/workspace/entrypoint.sh | Start chat + IDE + optional co-located substrate; host selection logic |
| packaging/workspace/Dockerfile | Build/copy Studio server + pack + editor substrate into workspace image |
| packaging/workspace/bootstrap-editor-substrate.mjs | Wait/health-check substrate; createProject; write env stamp |
| packaging/commonplace-studio/scripts/smoke-server.sh | Shell smoke for Studio server artifact + identity/telemetry/pack |
| packaging/commonplace-studio/scripts/ledger-gate.sh | Make built-tree checks honor STUDIO_BUILD_DIR |
| packaging/commonplace-studio/scripts/build.sh | Add server target; disk/path/node guards; pack staging options |
| packaging/commonplace-studio/RUNBOOK.md | Update web validation to use server smoke script + reh-web target |
| packaging/commonplace-studio/patches/0001-mangler-keep-session-changes-overrides-protected.patch | Build-break patch for upstream minify mangler visibility |
| packaging/commonplace-studio/LEDGER.md | Record new patch debt + reproduction details |
| packages/theorem-acp/src/hosted-client.ts | Allow explicit ws URL + token plumbing for hosted ACP |
| packages/block-view-contracts/package.json | Add @noble/hashes dependency |
| docs/plans/ide-substrate-wire/PLAN.md | New plan doc for IDE substrate wiring |
| docs/plans/ide-substrate-wire/FOLLOW-UP-CODE-SERVE-WEB.md | Follow-up doc for Studio serve-web cutover and findings |
| docs/plans/ide-substrate-wire/EXECUTE-REPORT.md | Execution report for IDE substrate wiring |
| docs/plans/console/SPEC-COMMONPLACE-OPENWORK-FORK-1.0.md | Spec amendment A14 documenting selectable IDE host |
| docs/learnings/2026-08-03-zero-collapse-panel-clips-its-own-toggle.md | New learning note (console UI gotcha) |
| docs/learnings/2026-08-03-stacked-ci-failures-mask-each-other.md | New learning note (CI diagnosis) |
| docs/learnings/2026-08-03-resolve-dep-versions-from-the-consuming-package.md | New learning note (pnpm resolution) |
| apps/theorem-vscode/test/substrate.test.ts | Tests for project_id + x-api-key behavior |
| apps/theorem-vscode/src/substrate/client.ts | Auth headers + SSE via fetch streaming fallback + project_id |
| apps/theorem-vscode/src/extension.ts | Resolve config via env overrides; refresh on save; EventSource gating |
| apps/theorem-vscode/src/config.ts | Central env/settings resolution for hosted pack |
| apps/theorem-vscode/src/agent/session-opener.ts | Switch to HostedAcpClient.connect and explicit ws/token |
| apps/theorem-vscode/package.json | Enable proposed APIs; update defaults + config descriptions; deps |
| apps/console/src/views/registry.tsx | Add IDE surface descriptor and register |
| apps/console/src/views/OpenworkChatRegister.tsx | Force full reload link for chat proxying |
| apps/console/src/views/IdeRegister.tsx | New IDE register fallback component |
| apps/console/src/views/CodeFileView.tsx | Clarify CM6 vs /IDE responsibilities in header comment |
| apps/console/src/lib/view-routing-retirement.test.ts | Add /IDE routing expectations |
| apps/console/src/lib/register-impl.ts | Map ide.surface → code-server.ide |
| apps/console/src/lib/rail/rail-model.ts | Add IDE to launch rail places |
| apps/console/src/lib/rail/rail-model.test.ts | Update rail tests for 6th place |
| apps/console/src/lib/chat/last-console-view.ts | Exclude /IDE from “last view” persistence |
| apps/console/src/editor-model/document-store.test.ts | Fix stub typing by spreading modelHost() |
| apps/console/src/components/shell/Sidebar.tsx | Add IDE icon mapping; update spec comment |
| apps/console/src/app/IDE/page.tsx | App Router fallback for /IDE with auth-aware messaging |
| apps/console/src/app/chat/page.test.tsx | Update chat route behavior assertions |
| apps/console/src/app/api/doctor/route.ts | Add shared probe helper + substrate probes; env contract adjustments |
| apps/console/src/app/api/doctor/route.test.ts | Unit tests for route probe redirect + auth behavior |
| apps/console/src/app/api/doctor/probe.ts | New probe helper for canonical redirects + impl stamping |
| apps/console/scripts/start-railway.mjs | Start Next on internal port and edge-proxy on public port |
| apps/console/scripts/edge-proxy.test.mjs | Unit tests for /IDE path stripping + upstream derivation |
| apps/console/scripts/edge-proxy.mjs | New WebSocket-capable edge proxy for /IDE with cookie auth |
| apps/console/package.json | Include edge-proxy unit test in npm test |
| apps/console/e2e/global-setup.ts | Add /IDE route to e2e route list |
| apps/console/e2e/console-sidebar.spec.ts | Assert IDE nav + update keyboard shortcut coverage to 1..6 |
| apps/console/e2e/cards.spec.ts | Update rail count assertion from 5 → 6 |
| .harness/checklists/ide-substrate-wire--plan-ide-substrate-wire-20260803a.json | New checklist projection for plan execution |
| .commonplace-canonical | Register/env contract updates to include IDE + workspace/substrate keys |
Suppressed comments (1)
packaging/workspace/Dockerfile:50
EDITOR_API_IMAGEis advertised as a supported fast-path, but it is never used anywhere in this Dockerfile, so the docs here are currently incorrect and the arg is dead. That can lead to false confidence that a prebuilt image override is taking effect when it isn’t.
# Prefer a digest-pinned prebuilt image (fast):
# --build-arg EDITOR_API_IMAGE=ghcr.io/.../commonplace-api@sha256:...
# Otherwise clone Theorem and build (slow, default when INCLUDE_EDITOR_SUBSTRATE=1).
ARG INCLUDE_EDITOR_SUBSTRATE=1
ARG EDITOR_API_IMAGE=
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
💡 Codex ReviewCommonPlace/packaging/workspace/Dockerfile Line 168 in 95a87a6 This newly invokes Any unexpired signed AGENTS.md reference: apps/console/AGENTS.md:L24-L31 CommonPlace/apps/console/scripts/edge-proxy.mjs Lines 274 to 277 in 95a87a6 When the IDE upstream returns HTML with CommonPlace/apps/theorem-vscode/src/config.ts Lines 55 to 58 in 95a87a6 When both documented credentials are configured and differ, CommonPlace/packaging/workspace/Dockerfile Line 271 in 95a87a6 Dockerfile AGENTS.md reference: AGENTS.md:L24-L31 CommonPlace/apps/theorem-vscode/src/substrate/client.ts Lines 310 to 318 in 95a87a6 When the fetch-backed SSE response ends or encounters a transient network error, CommonPlace/packaging/workspace/entrypoint.sh Lines 176 to 178 in 95a87a6 For CommonPlace/packaging/workspace/Dockerfile Lines 46 to 50 in 95a87a6 A repository-wide search finds CommonPlace/apps/console/src/lib/rail/rail-model.ts Lines 155 to 160 in 95a87a6
The new comments here and at line 182 introduce em dashes, but the scoped Console constitution explicitly forbids em or en dashes even in code comments. Replace both characters with permitted punctuation so the change complies with the app's merge-blocking writing rules. AGENTS.md reference: apps/console/AGENTS.md:L169-L172 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Deploy
4e33d620built green off01143ad5and/opt/commonplace/studio-serverwas absent from the running container. CS-003 was marked done by reading the Dockerfile; the container disagreed.Two independent defects, either one fatal on its own.
No
COPY --from=studio-server. The stage wrote/outand the final image never took it. BuildKit prunes a stage nothing copies from, so the fork was not merely uncopied, it was never compiled. That is why a build carrying the mangler patch finished without ever reaching the mangler.The build gate shared a name with the runtime switch. Railway injects every service variable into whatever
ARGa stage declares, soIDE_HOST=code-server, pinned on the service to hold the runtime host during cutover, would have switched the build off too. The safe-cutover shape the plan rests on, ship both binaries and flip a variable, was unreachable: pinning the variable deleted the binary from the next image.Changes
studio-serverstage gated onARG BUILD_STUDIO_SERVER=1;IDE_HOSTis runtime only, and the unusedARG IDE_HOSTin the base stage is gone.COPY --from=studio-server /out/ /opt/commonplace/studio-server/.--build-arg BUILD_STUDIO_SERVER=0, which still writes/outso the COPY stays valid and only the launcher is missing, which is the fileentrypoint.shprobes with-x. A skipped build falls back to code-server by itself.FOLLOW-UP-CODE-SERVE-WEB.md,SPEC-COMMONPLACE-OPENWORK-FORK-1.0.md, and.commonplace-canonical.Blast radius
None at runtime.
IDE_HOST=code-serverstays pinned on the service, so this image ships both hosts and keeps running stock code-server. If the Studio stage fails, the image fails and Railway holds the previous deploy.Validation
node scripts/check-register-manifest.mjs: ok, 8 registers, 37 registry ids..commonplace-canonicalparses as JSON.