TenantAtlas/specs/234-dead-transitional-residue/data-model.md
ahmido 603d509b8f
Some checks failed
Main Confidence / confidence (push) Failing after 58s
cleanup: retire dead transitional residue (#270)
## Summary
- remove deprecated baseline profile status alias constants and keep baseline lifecycle semantics on the canonical enum path
- retire the dead tenant app-status badge/default-fixture residue from the active runtime support path
- add the `234-dead-transitional-residue` spec, plan, research, data-model, quickstart, checklist, and task artifacts plus focused regression assertions

## Validation
- not rerun during this PR creation step

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #270
2026-04-23 16:54:48 +00:00

87 lines
2.6 KiB
Markdown

# Phase 1 Data Model: Dead Transitional Residue Cleanup
## Overview
This feature introduces no new table, enum, or persisted artifact. It narrows the active runtime language around two already-existing truth domains:
1. Baseline profile lifecycle truth should flow only through `BaselineProfileStatus`.
2. Tenant app-status should remain, at most, historical stored data, not active runtime/support truth.
## Persistent Source Truths
### BaselineProfile
**Purpose**: Workspace-owned baseline profile record.
**Key fields**:
- `id`
- `workspace_id`
- `name`
- `status`
- `capture_mode`
- `active_snapshot_id`
**Validation rules**:
- `status` is cast to `BaselineProfileStatus` and is the only active lifecycle contract for draft, active, and archived behavior.
- Deprecated alias constants on the model are not part of persistent truth and can be removed once no runtime caller depends on them.
### Tenant
**Purpose**: Tenant-owned lifecycle and management record.
**Key fields**:
- `id`
- `workspace_id`
- `name`
- `status`
- `rbac_status`
- `app_status` (historical legacy field)
**Validation rules**:
- `status` remains the active tenant lifecycle truth.
- `rbac_status` remains a separate active management truth.
- `app_status` may remain stored historically, but current runtime/support paths must not treat it as active default truth.
## Support Artifacts In Scope
### Deprecated alias layer
**Artifact**: `BaselineProfile::STATUS_DRAFT`, `STATUS_ACTIVE`, `STATUS_ARCHIVED`
**Role after cleanup**:
- removed from active runtime language
### Legacy badge layer
**Artifacts**:
- `BadgeDomain::TenantAppStatus`
- `BadgeCatalog` mapper entry for tenant app status
- `TenantAppStatusBadge`
**Role after cleanup**:
- removed if no runtime consumer remains
### Legacy default setup
**Artifacts**:
- `TenantFactory` default `app_status => 'ok'`
- `SeedBackupHealthBrowserFixture` default `app_status => 'ok'`
**Role after cleanup**:
- removed as ambient defaults
- legacy `app_status` becomes explicit per-test or per-scenario setup only
## Behavioral Rules
1. Removing dead residue must not change baseline profile archive/list/workspace behavior.
2. Removing dead residue must not change tenant lifecycle or RBAC truth behavior.
3. Tests that still need a legacy `app_status` value must set it explicitly in the scenario.
4. Historical schema and migrations remain historical artifacts, not cleanup targets in this slice.
## No New Persistence
- No new table is introduced.
- No new enum or reason family is introduced.
- No new derived readiness or cleanup artifact is introduced.
- No stored field is repurposed into a new active truth contract.