Task: Decommission the legacy controller SQL schema
Table of Contents
This page documents a task in the Collapse NATS config passthrough to a single environment-mapper fallback tier story. It captures the goal, current status, acceptance, and any notes or results.
1. Goal
No trace of the decommissioned controller process/architecture remains in the DB schema or SQL codebase.
2. Status
| Field | Value |
|---|---|
| State | DONE |
| Parent story | Collapse NATS config passthrough to a single environment-mapper fallback tier |
| Now | Nothing. |
| Waiting on | Wire systemd generate to the codegen model and strip redundant NATS CLI threading – the SQL schema can't be dropped while systemd_generate.py still queries it. |
| Next | Nothing. |
| Last touched | 2026-08-05 |
3. Acceptance
- grep for 'controller' across projects/ores.sql turns up nothing service-controller-related (Qt MVC controller classes elsewhere in the repo are unrelated and untouched); compass db recreate succeeds cleanly with the controller schema gone; every remaining service still starts and connects correctly end to end.
4. Plan
Implementation strategy, as executed:
- Inventory every controller trace in the SQL codebase: the three
controller/dirs underprojects/ores.sql/{create,drop,populate}(14 files), the\\irincludes increate.sql=/=drop.sqland the RLS orchestration files, the populate section + summary count infoundation_populate.sql, the_controller_serviceDB role indrop_roles.sql, the IAMControllerServicerole andcontroller::*permissions, thevalidation_ignore.txtentries, and the deadores_controller_prefix mapping inplantuml_er_parse_sql.py. - Classify every remaining 'controller' string across
projects/ores.sqlas unrelated before leaving it in place: the Qt MVCSettingGatedActionControllercomments (acceptance-exempt), the Greek LEI legal-name data (AIR TRAFFIC CONTROLLERS OF GREECE), and the syntheticcurve_feed_controllercomment. - Delete the dirs, strip the includes, remove the roles/grants, then
regenerate
ores_schema.puml/.png/.cmapxfrom the SQL viaplantuml_er_generate.sh(270 tables, 21 packages, 0 warnings). - Verify: grep clean,
compass db recreatesucceeds with zero controller mentions, all 22 services start and the Acme holding group provisions end to end.
5. Notes
The generated ores.wt.service unit still substitutes
ORES_CONTROLLER_SERVICE_WT_PORT (env_init.py emits it,
systemd_generate.py reads it) — genuinely out of scope for this
task; the sibling task "Rename still-functionally-used
ORES_CONTROLLER_SERVICE_* env vars" covers it.
6. Test Scenarios
Manual QA scenarios (scaffolded via compass add test_scenario, run
through the QA Validation Runner panel) that verify this task. Link
new ones here as they're created; the scenario doc itself links back
via its "Verifies task" field.
| Scenario | State | Notes |
|---|---|---|
7. PRs
| PR | Title |
|---|---|
| #1901 | [ores.sql] Decommission the legacy controller SQL schema |
8. Review
| Comment summary | File | Decision | Notes |
|---|---|---|---|
9. Result
Shipped in commit 6d2ecd070: the legacy controller SQL schema
is gone from the codebase. Deleted 14 files across the three
controller/ dirs (the five tables service_definitions,
service_dependencies, service_instances, service_events and
rls_policies, plus their drops and populates), removed the \\ir
includes from create.sql=/=drop.sql=/=rls_create.sql=/=rls_drop.sql,
the foundation populate section and its summary count, the
ores_<label>_controller_service role from drop_roles.sql, the IAM
ControllerService role and controller::* permissions, the
validation_ignore.txt entries, and the ores_controller_ prefix
mapping in plantuml_er_parse_sql.py; regenerated
ores_schema.puml.png=.cmapx= (270 tables, 21 packages, 0 warnings).
Acceptance met: grep for 'controller' across projects/ores.sql shows
only the four known-unrelated hits (Qt MVC comments, LEI data,
curve_feed_controller); compass db recreate succeeds cleanly
(schema 0.0.25, zero controller mentions in the run); all 22 service
units start and connect, and the Acme Corporation holding group
provisions end to end.