chore(cms-190): remove apps/studio-review and audit-confirmed dead code#112
Conversation
Repo-wide dead-code audit. Removes the retired studio-review app and
other code paths with no remaining consumers, then prunes the
supporting scripts, deps, docs, and specs so the repo still builds and
tests cleanly.
Removed
- apps/studio-review (entire app) + root studio:review npm scripts,
.changeset/config.json ignore entry, AGENTS.md row, apps/docs pages
that described it, and docs/specs/SPEC-012.
- docs/specs/SPEC-013 (orphan planning brief not in the spec catalog).
- apps/server OwnerInvariant* helpers in rbac.ts (superseded by
assertOwnerMutationAllowed).
- apps/cli action-catalog-adapter.ts plus its two tests and the
@elysiajs/eden / elysia deps that only existed to serve it.
- apps/cli credentials.clearCredentialsFile (zero callers).
- packages/studio legacy lib/ui/{button,utils}.tsx (superseded by
runtime-ui/), runtime-registry.{ts,test.ts} (never wired), and the
runtime-ui components editor-sidebar.tsx, mock-data.ts, calendar.tsx,
collapsible.tsx, checkbox.tsx plus the @radix-ui/react-checkbox,
@radix-ui/react-collapsible, @tiptap/extension-image,
@tiptap/extension-placeholder, @tiptap/extension-typography,
react-day-picker, and date-fns deps that only served them.
- packages/shared lib/shared.ts placeholder function + its index
re-export.
- Root devDeps @swc-node/register, @swc/core, @swc/helpers (no
references anywhere; repo uses Bun native + tsc).
Fixed
- docs/adrs/README.md moved ADR-006 from "Proposed" to "Accepted"
to match its own status: accepted frontmatter.
Verification
- bun run check (build + typecheck): passes
- bun run unit (514 tests across 58 files + studio embed smoke): passes
- bun run format:check: passes
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
📝 WalkthroughWalkthroughThe pull request removes the Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Reverts the CLI-side removal from the previous commit. The adapter looked dead (only tests imported it) but it is the planned plumbing for CLI adoption of the action catalog contract described in ADR-005, which names both Studio and CLI as consumers of /api/v1/actions*. The endpoint is implemented and Studio is already wired onto its own adapter; CLI just hadn't been migrated yet. Removing the scaffolding would have deepened the drift from ADR-005. Restores - apps/cli/src/lib/action-catalog-adapter.ts - The two createCliActionCatalogAdapter tests in cli.test.ts - @elysiajs/eden and elysia in apps/cli/package.json Follow-up tracked in CMS-208 (Wire CLI onto the Eden action-catalog adapter — ADR-005 alignment).
…spec The CMS-190 audit flagged SPEC-013 as an orphan because it wasn't in docs/specs/README.md. That framing was wrong: apps/docs is a live, maintained subsystem and by the repo's own standalone-spec rule it needs an owning spec. The missing index entry was the bug, not the spec. - Restores docs/specs/SPEC-013-mintlify-docs-site.md. - Adds it to docs/specs/README.md so the spec catalog reflects reality. - Drops the stale /Users/blazity/... local path leak from the overview and design-system sections. The spec now stands as generic product documentation instead of a construction brief.
…urface) The CMS-190 audit flagged runtime-registry.ts as dead because no production code imported buildStudioRuntimeRegistry — only its test. That was wrong. The registry is the spec-mandated Studio composition surface for routes, navItems, slotWidgets, fieldKinds, editorNodes, actionOverrides, and settingsPanels. It was delivered by CMS-60 (Done) as acceptance criterion #2 and is explicitly required by SPEC-002 ("Implement the remote Studio app and runtime composition registry in `module` mode.") and SPEC-006 ("Remote Studio runtime builds its internal composition registry and validates it before first render."). Downstream work in CMS-124 will register module-contributed routes/slots/fields into it. The absence of a production importer today means it isn't consumed by remote-studio-app.tsx yet — not that it is dead. Restoring it keeps the repo aligned with SPEC-002/SPEC-006 and preserves the CMS-60 deliverable.
Summary
CMS-190: repo-wide dead code / unused file audit and safe cleanup.
Audit ran a fan-out of parallel Sonnet agents across every workspace (server, CLI, studio-example, studio, shared, sdk, modules, docs/specs/skills, root configs), followed by an Opus verification pass with direct grep against the monorepo before deletion. Only items with no remaining consumers and no behavior-visible side effects were removed.
apps/studio-review(app retired) and every tracked reference (root npm scripts, changeset ignore entry, AGENTS.md row, docs pages, SPEC-012).apps/server—OwnerInvariant*helpers inrbac.ts(superseded byassertOwnerMutationAllowed) + matching tests.apps/cli—credentials.clearCredentialsFile(zero callers).packages/studio— legacylib/ui/{button,utils}.tsx(superseded byruntime-ui/);runtime-uieditor-sidebar.tsx,mock-data.ts,calendar.tsx,collapsible.tsx,checkbox.tsx; and the sevenpackage.jsondeps that only served them (@radix-ui/react-checkbox,@radix-ui/react-collapsible,@tiptap/extension-image,@tiptap/extension-placeholder,@tiptap/extension-typography,react-day-picker,date-fns).packages/shared—lib/shared.tsplaceholder function and its re-export.devDependencies—@swc-node/register,@swc/core,@swc/helpers(no references; repo uses Bun +@nx/js/typescript).docs/adrs/README.md: ADR-006 classification was out of sync with its ownstatus: acceptedfrontmatter.docs/specs/SPEC-013-mintlify-docs-site.mdindocs/specs/README.md(missing entry was the bug —apps/docsis a live subsystem that needs an owning spec), and drops a stale/Users/blazity/...local path leak from the spec.Scoped-out during review (kept after follow-up analysis)
Items the initial audit flagged as unused but kept after checking specs/tickets:
apps/cli/src/lib/action-catalog-adapter.ts+@elysiajs/eden/elysiadeps. Only tests import it today, but/api/v1/actions*is a live server endpoint and ADR-005 (accepted) names both Studio and CLI as consumers. Studio is already wired onto its own adapter; CLI just hasn't been migrated yet. Production consumer is tracked as CMS-88 (Implement CLI generic action runner, Epic CMS-152). Audit context added as a comment on CMS-88.packages/studio/src/lib/runtime-registry.{ts,test.ts}. Only the test importsbuildStudioRuntimeRegistrytoday, but it is the spec-mandated Studio composition surface (routes, navItems, slotWidgets, fieldKinds, editorNodes, actionOverrides, settingsPanels). Delivered by CMS-60 as acceptance criterion chore(deps): update dependency @types/node to v20.19.41 #2, mandated by SPEC-002 and SPEC-006, and CMS-124 will register module-contributed routes/slots/fields into it. Audit context added as a comment on CMS-60.docs/specs/SPEC-013-mintlify-docs-site.md. Audit flagged it as an orphan because it wasn't in the spec catalog README. The correct fix was to index it, not delete it —apps/docsis a live, maintained subsystem and by the repo's standalone-spec rule it needs an owning spec. Restored + indexed + stale local path cleaned up.Out of scope (flagged, kept)
Items surfaced by the audit that are technically unreferenced today but preserved for safety:
@mdcms/shared(public API surface for downstream consumers).packages/sdktypes (MdcmsListInput,MdcmsGetInput,MdcmsClientOptions) — scaffolded public API.packages/studiopackage.jsonexports (/action-catalog-adapter,/markdown-pipeline,/document-shell) — no in-repo consumer but part of the published surface.actionAliases/outputFormattersoncore.systemanddomain.content— data is collected and asserted by tests but never read in production. Removing would need a coordinated extensibility-contract refactor, out of scope here.packages/modulesfirst-party preflight hooks that are functionally redundant with earlier framework validation — live runtime paths, removing would change the execution trace.@playwright/test+playwright.config.ts+e2e/*.spec.ts— valid against the survivingstudio-exampleapp but no CI runner is wired up. Not dead; worth wiring up separately.Test plan
bun run check(build + typecheck, all 6 projects): passesbun run unit(514 tests across 58 files + studio embed smoke): passesbun run format:check: passesci:requiredgate (build + typecheck + unit + integration)Linked issues