Story: Remove workspaces from every component
Table of Contents
This page documents a story in Sprint 27, carried unfinished from Sprint 26. It captures the goal, current status, acceptance criteria, and the tasks that compose it.
1. Goal
No component carries a workspace: no table has a workspace_id, no request or session carries a workspace context, and ores.workspace is gone. Sandboxes and virtual books, which replaced workspaces in the trade shape design, are the only way to keep work apart from official data.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent sprint | Sprint 27 |
| Now | Nothing. |
| Waiting on | Nothing. |
| Next | Nothing. |
| Last touched | 2026-10-08 |
3. Acceptance
- No codegen profile or model sets has_workspace_id, and no generated or hand-written table has a workspace_id column.
- No request context, NATS header, session or database setting carries a workspace; ores_utility_live_workspace_id_fn and its kin are gone.
- The ores.workspace component, its tables, protocol, shell and web surfaces are removed, with no references left.
- Every component builds and its tests pass after each step; main is never half migrated.
- The trading part is done by the trade shape story, Split the trade into an anchor and its components; this story covers the rest.
4. Tasks
| Task | State | Start | End | Description |
|---|---|---|---|---|
| Scaffold story: Remove workspaces from every component | DONE | 2026-10-04 | 2026-10-04 | Story scaffolding rides this task: documents, sprint wiring, and the scaffold PR. Close it before merging that PR. |
| Inventory and sequence the workspace removal | DONE | 2026-10-05 | 2026-10-05 | Initial task for: Remove workspaces from every component |
| Drop the workspace column from every entity | DONE | 2026-10-05 | 2026-10-06 | Drop has_workspace_id from the remaining models and profiles in refdata, analytics, reporting and marketdata, and regenerate, so no table carries a workspace_id. |
| Remove the workspace from the request context | DONE | 2026-10-07 | 2026-10-08 | Remove the workspace from the database context, the NATS headers and client, the service request context and the ores.web client. |
| Remove the has_workspace_id feature from codegen | DONE | 2026-10-08 | 2026-10-08 | Once no model sets has_workspace_id, delete the feature from the codegen meta-model, templates, loader, profiles, scaffolding and modeling docs. |
| Remove the ores.workspace component | DONE | 2026-10-08 | 2026-10-08 | Delete ores.workspace, the ores.shell workspace part and scripts, the workspace SQL schema, grants and tenant seed, the live workspace utility functions, and the generated web protocol. |
5. Decisions
- Workspaces are removed, not reworked (owner's choice). Section 13 of Investigation: the trade shape replaced them with Sandboxes and virtual books, which shipped in Add sandboxes and virtual books. A layered workspace is an application-level database branch that pushes a workspace into every key, query and foreign key.
- Trading is removed by Split the trade into an anchor and its components, whose acceptance already requires that no trading entity carries a workspace. This story removes the rest and then the component.
- Workspaces: finish the feature is abandoned, with its open dependents (the ores.workspace model drift fix and the ores.workspace journeys extraction). It aimed to finish what this story removes.
- Nothing keeps work apart with workspaces today: no surface selects a workspace other than Live. Removing them loses no data a user can see.
6. Inventory
The current counts, with the command behind each, are in the
Inventory and sequence the workspace removal task's Measurements.
evidence/measure_workspaces.sh reruns them on any tree; each task
records it at its own head.
7. Sequence
A column goes before the function that defaults or validates it, so the columns go first and ores.workspace, which owns those functions, goes last. Each step is one task and one PR, listed in order in the Tasks table: drop the column, remove the request context, remove the codegen feature, remove the component.
8. Out of scope
- The trading tables and code, which Split the trade into an anchor and its components removes.
- Migrating rows of workspaces other than the live one: the databases are recreated, so no data is carried across.
9. Result
All four steps landed, each as its own merged pull request: the column dropped in #2701, the request context removed in #2799, the codegen feature removed in #2813 and the component deleted in the task that closes this story. No component carries a workspace. The measure script reports zero tables with a workspace_id, zero models or profiles setting the feature, zero component files, zero shell part files and zero callers. The only remaining hits are the frozen DSH-kanban fixtures and the trading part, which the trade shape story owns.
10. Decisions
- The owner chose to merge pull requests without the local check gate from 2026-10-08, running the checks on an hourly cadence instead. The gate was green for the request-context and codegen-feature tasks; the component removal merged on the counts alone, with no build, ctest or database recreation at its head.