Skip to content

test(rivetkit): simplify sqlite efficiency coverage#5445

Merged
NathanFlurry merged 7 commits into
mainfrom
stack/test-rivetkit-simplify-sqlite-efficiency-coverage-spmlntnp
Jul 20, 2026
Merged

test(rivetkit): simplify sqlite efficiency coverage#5445
NathanFlurry merged 7 commits into
mainfrom
stack/test-rivetkit-simplify-sqlite-efficiency-coverage-spmlntnp

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

No description provided.

@claude

claude Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Review: test(rivetkit): simplify sqlite efficiency coverage

Small, well-scoped PR: adds an explanatory comment to clear_table_bounded and trims scaffolding from sql_efficiency.rs. A couple of notes:

1. Removed regression guard has no replacement (medium)

The deleted sql_efficiency_catalog_has_stable_unique_ids_and_documented_scans test enforced two invariants that no longer exist anywhere in the suite:

  • Uniqueness of query ids across the catalog (previously also checked against CORRECTNESS_ONLY_QUERIES/EXCLUDED_QUERIES, but the uniqueness check applied to query_catalog() itself too). A future duplicate id in query_catalog() will no longer be caught, it'll just silently produce a confusing/ambiguous failure message instead of a clear "duplicate id" assertion.
  • Minimum inventory size (original_len >= 50), which acted as a tripwire against someone accidentally deleting query cases over time without adding coverage elsewhere.

Given rivetkit-rust/packages/rivetkit-core/CLAUDE.md's policy that this suite is the enforcement mechanism for "every new/modified internal SQL statement needs coverage," losing this tripwire is a real reduction in the safety net, not just dead weight. Worth confirming this loss was intentional, or restoring a lightweight uniqueness/count check.

2. New top-of-file comment doesn't cover everything the deleted EXCLUDED_QUERIES explained (low)

The new comment:

// This suite covers SQL owned by rivetkit-core. User-provided SQL, including
// Actor Runtime Socket requests, is intentionally outside its scope.

only accounts for the actor_runtime_socket.sql exclusion. The other three removed EXCLUDED_QUERIES entries (inspector.schema_catalog, inspector.table_count, inspector.table_rows) were excluded for different reasons (schema metadata enumeration; user-selected table capped at 500 rows), those are core-owned SQL, not "user-provided SQL," so the new comment doesn't actually justify why they're absent from query_catalog(). A future reader auditing coverage has no way to tell whether these are intentionally excluded or just missing.

The 13 former CORRECTNESS_ONLY_QUERIES (singleton upserts/point inserts) are on firmer ground since the general policy in CLAUDE.md ("simple inserts... need correctness... but no plan assertion") already covers that class, so dropping their per-query reasons is a more defensible simplification.

3. Minor: duplicated comment (nit)

internal_storage.rs: the new comment on clear_table_bounded (private helper) largely restates the existing comment on its only caller, clear_imported_storage, a few lines up:

// Delete bounded sets of rows in separate commits. A single `DELETE FROM`
// over a large interrupted import can itself exceed depot's dirty-page
// limit, permanently preventing the importer from recovering.
...
async fn clear_table_bounded(...) {
	// An interrupted legacy import can leave enough data that one `DELETE FROM`
	// exceeds depot's dirty-page commit limit. Delete estimated-size chunks in
	// separate transactions so cleanup can always make progress.

Consider keeping the rationale in one place (probably on clear_table_bounded, since that's where the chunking actually happens) to avoid drift if the reasoning changes later.

Other

  • Verified no other references to the removed CORRECTNESS_ONLY_QUERIES/EXCLUDED_QUERIES/meta-test exist elsewhere in the tree, so the deletion doesn't leave dangling references.
  • No security or performance concerns, this is test-only plus a comment change.

@railway-app

railway-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-5445 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-inspector 😴 Sleeping (View Logs) Web Jul 20, 2026 at 7:02 am
frontend-cloud 😴 Sleeping (View Logs) Web Jul 20, 2026 at 7:01 am
kitchen-sink 😴 Sleeping (View Logs) Web Jul 20, 2026 at 7:01 am
website 😴 Sleeping (View Logs) Web Jul 20, 2026 at 7:00 am
ladle ✅ Success (View Logs) Web Jul 20, 2026 at 6:53 am
mcp-hub ✅ Success (View Logs) Web Jul 20, 2026 at 6:51 am

@NathanFlurry
NathanFlurry changed the base branch from stack/test-rivetkit-verify-core-sql-query-efficiency-lpzxlsxr to main July 20, 2026 08:37
@NathanFlurry
NathanFlurry merged commit 6e6798e into main Jul 20, 2026
10 of 12 checks passed
@NathanFlurry
NathanFlurry deleted the stack/test-rivetkit-simplify-sqlite-efficiency-coverage-spmlntnp branch July 20, 2026 08:39
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