Drop retired compliance tables migration

Task 5321 · Done · Coder · created · updated

Part of epic 5303 "Living Governance foundation + Portfolio Compliance". Settled inputs: PRD = Task 5304 artifact `prd`; Architecture = Task 5305 artifact `architecture` §9 (C10). Epic vocabulary (verbatim): "Vocabulary decision: the unit is a Rule (not "norm"). A versioned set of rules is a Pack. A rule whose subject is the repo itself (rather than a change) is a structural rule. Portfolio Compliance = structural rules + packs + levels + the matrix + remediation." Design principles (verbatim, "binding for every child task"): - First result in about a minute, with zero configuration. Everything else is progressive disclosure. - Every red cell says why and has a fix action. No score without an explanation. - Rules are data, not prose: a rule without oracles cannot be enforced. - Stack-conditional expectations everywhere; "n/a for this stack" is a visible state. - The data model must be the general one (rules, graph, attestations, twin), even though the first product only uses structural rules. - Readable at phone width; the matrix and the per-repo view are the two screens that matter most. ## Requirement (verbatim) PRD §6.3: "Retire: the compliance_cell/compliance_sweep tables, ... projects.compliance enrollment (replaced by the project picker)". AC-27 (tables half): "the compliance_cell/compliance_sweep tables (dropped through an additive-safe migration per coding standards)". ## Scope One contract migration (next free id at build) dropping `compliance_cell`, `compliance_sweep` and the `projects.compliance` column. Precondition: the "Retire old compliance system code" child's release has reached dev (check dev's deployed version includes its merge commit) so no running release still reads them (coding-standards two-release rule). It is a destructive contract step, so it must carry the repo's `# additive-check: exempt — <reason>` marker (or whatever exemption form the migration-additivity check accepts) naming this two-release sequencing. Note in the PR body that it must not be promoted to `master` in the same promotion as the code-retirement child unless that child is already live on prod. ## Acceptance (AC-27, verbatim) "The old Compliance page, the /api/portfolio/* compliance-matrix/deficiencies/fix routes, the compliance_cell/compliance_sweep tables (dropped through an additive-safe migration per coding standards) and the matrix path of audit_all.py are removed. No dead links remain in the console or docs." Out of scope: Epic out of scope (verbatim): "Out of scope: change-level governance (session attestations, guards at tool-call time, the judge over transcripts), the simulator and back-testing, rule effectiveness and context budgeting, the rule miner, earned autonomy and trust bands, regulatory control mapping and evidence packs, the pack marketplace, exports to IDPs. Each of these is a later epic on the same foundation; the data model built here must not make any of them a rewrite." This child: no schema change beyond the three named objects; no code changes beyond what the drop requires; do NOT touch asset propagation, context routing, `maturity_sweep.py`, persona licences, or the task lifecycle state machine. Done means: - Migration upgrade and downgrade run clean in the test stack (cite). - `git grep -n "compliance_cell\|compliance_sweep"` shows only migration files (paste output). - Evidence (dev deployed version / commit) that the code-retirement child shipped to dev before this merges. - The migration-additivity check passes with the exemption marker; `./dc check full` green.

Outcome

Revision 0379 drops compliance_cell, compliance_sweep and projects.compliance; ORM classes removed too. Upgrade/downgrade clean, full gate green, PR #4655 merged; 5316 deployed to dev first. Do not promote to master until 5316 is live on prod.

Pull request

Artifacts

Activity

  • Draft
  • Ready
  • Runner started
  • Runner ended (done)