Skip to content

[lenny] fix(db): validate deletion catalog at schema head, not 0044 - #41

Merged
mfethe1 merged 1 commit into
product/mainfrom
fix/tasks-catalog-drift
Sep 11, 2026
Merged

[lenny] fix(db): validate deletion catalog at schema head, not 0044#41
mfethe1 merged 1 commit into
product/mainfrom
fix/tasks-catalog-drift

Conversation

@mfethe1

@mfethe1 mfethe1 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Problem

PostgreSQL Tests is red on product/main and every PR branched from it. One test fails:

migration_0044_drops_populated_nip_fi_ledger_cleanly
deletion catalog validates after migration 0044:
  DeletionSafety("community deletion catalog drift (missing=task_events,tasks, unknown=)")

Root cause

Migration 0046 (task system) added tasks and task_events to EXPECTED_SCOPED_TABLES. This test pins the DB at run_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:

  • without the patch: FAILED. 0 passed; 1 failedmissing=task_events,tasks
  • with the patch: ok. 1 passed; 0 failed

Differential confirmed by stashing and re-running in the same container.

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.
@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 59094270-af7f-489f-bde2-db2dcbf05b33

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mfethe1

mfethe1 commented Sep 11, 2026

Copy link
Copy Markdown
Owner Author

Verification

CI differential (authoritative):

migration_0044_...nip_fi_ledger_cleanly workflow_send_message_binds_authority...
trunk run 34633835213 FAIL FAIL
trunk run 34633421760 FAIL FAIL
trunk run 34625409103 FAIL FAIL
this PR (34635947995) PASS FAIL

PostgreSQL Tests on trunk fails two tests (382-filtered + 1165-filtered suites). This PR eliminates the first and does not touch the second. Strict reduction, no new failures.

Remaining reds, all proven pre-existing on trunk:

  • PostgreSQL Testsworkflow_sink::postgres_tests::workflow_send_message_binds_authority_to_authored_mentions (workflow_sink.rs:1369, mention authority resolves to []). Separate bug, tracked separately.
  • Windows Rustblocked_recovery_write_is_bounded_and_retains_loss, regression from the [lenny] sync: merge upstream/main (24 commits) into product/main #39 upstream sync.
  • Desktop Smoke E2E (3) → known baseline.

Local gates: cargo fmt -p buzz-db --check clean; cargo clippy -p buzz-db --all-targets -- -D warnings clean.

@mfethe1
mfethe1 merged commit fc73774 into product/main Sep 11, 2026
56 of 64 checks passed
@mfethe1
mfethe1 deleted the fix/tasks-catalog-drift branch September 11, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant