[lenny] fix(db): validate deletion catalog at schema head, not 0044 - #41
Conversation
Migration 0046 (task system) added `tasks` and `task_events` to EXPECTED_SCOPED_TABLES, but this test validated the catalog while the DB was still pinned at 0044, so validation always reported `missing=task_events,tasks`. The catalog describes the fully-migrated schema; migrate to head before validating. The NIP-FI absence assertions stay at 0044 — dropped tables cannot come back. Verified against a real PostgreSQL 16: fails before, passes after.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
VerificationCI differential (authoritative):
Remaining reds, all proven pre-existing on trunk:
Local gates: |
Problem
PostgreSQL Testsis red on product/main and every PR branched from it. One test fails:Root cause
Migration 0046 (task system) added
tasksandtask_eventstoEXPECTED_SCOPED_TABLES. This test pins the DB atrun_to(44)and then validates the deletion catalog — so the catalog correctly expects the task tables while the schema predates them. The catalog is right; the test's stop-point was stale.This is not an agent-homes regression: it reproduces on trunk (run 34625409103) and blocks #15/#16.
Fix
Migrate to head before validating. The NIP-FI absence assertions stay at 0044 — dropped tables cannot come back, so moving validation forward loses no coverage.
Verification
Real PostgreSQL 16 (not a mock),
cargo test -p buzz-db --lib ... -- --ignored:FAILED. 0 passed; 1 failed—missing=task_events,tasksok. 1 passed; 0 failedDifferential confirmed by stashing and re-running in the same container.