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.

Goal

No trace of the decommissioned controller process/architecture remains in the DB schema or SQL codebase.

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

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.

Plan

Implementation strategy, as executed:

  1. Inventory every controller trace in the SQL codebase: the three controller/ dirs under projects/ores.sql/{create,drop,populate} (14 files), the \\ir includes in create.sql=/=drop.sql and the RLS orchestration files, the populate section + summary count in foundation_populate.sql, the _controller_service DB role in drop_roles.sql, the IAM ControllerService role and controller::* permissions, the validation_ignore.txt entries, and the dead ores_controller_ prefix mapping in plantuml_er_parse_sql.py.
  2. Classify every remaining 'controller' string across projects/ores.sql as unrelated before leaving it in place: the Qt MVC SettingGatedActionController comments (acceptance-exempt), the Greek LEI legal-name data (AIR TRAFFIC CONTROLLERS OF GREECE), and the synthetic curve_feed_controller comment.
  3. Delete the dirs, strip the includes, remove the roles/grants, then regenerate ores_schema.puml/.png/.cmapx from the SQL via plantuml_er_generate.sh (270 tables, 21 packages, 0 warnings).
  4. Verify: grep clean, compass db recreate succeeds with zero controller mentions, all 22 services start and the Acme holding group provisions end to end.

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.

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
     

PRs

PR Title
#1901 [ores.sql] Decommission the legacy controller SQL schema

Review

Comment summary File Decision Notes
       

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.

Emacs 29.3 (Org mode 9.6.15)