# AEG-X-004 Status Contract Correction Slice ## WBS / Scope - WBS ID: `AEG-X-004` - Slice: `shadow_run.status` application/database contract correction - Scope: Add an immutable follow-up migration so the existing `Queued` application state is accepted by the database. - Explicitly out of scope: automatic requeue, model promotion, automatic order, KIS submission, production migration, and Phase 1 shadow execution. ## Source - `src/KArtSell.Modules.ModelOperations/ShadowRun/Sql.cs` inserts `Queued`. - `src/KArtSell.Host/Features/ShadowRun/Handler.cs` creates and reports `Queued`. - `db/migrations/0022_model_operations_execution_schema.sql` rejects `Queued` through `check_status`. - `docs/CURRENT/PHASE-1_SHADOW_RUN_STATUS_CORRECTION.md` records the observed HTTP 500 and PostgreSQL `23514` evidence. - `docs/CURRENT/WBS_EXECUTION_PROCEDURES.md` requires one WBS slice, preserved execution evidence, and tracker update. ## Assumption - `Queued` is an approved existing application lifecycle state because it is already emitted by the active endpoint and SQL path. - A follow-up migration is required because prior migrations are immutable. ## Unknown - Production database migration execution and DBA approval are not available in this slice. - Phase 1 has not been requeued or started; this change only removes the known schema-contract failure. ## Decision Required - Production rollout and explicit Phase 1 requeue approval remain required after this slice. ## Acceptance Evidence - Migration applies on a fresh test database. - Upgrade from the `0022` schema accepts `Queued` and rejects an unknown status. - Re-running the follow-up migration is safe and preserves data. - Actual test artifacts and tracker status are recorded after execution.