Repository navigation
fix(tests): repair master drift from schema v15→v17 changes (#1208) - #1288
Conversation
Eleven pre-existing failures on master from #1113 (v16: non-conv mark targets) and #1114 (v17: identity-preserving marks/annotations) plus adjacent additions to the runtime operation catalog, maintenance targets, verify pipeline, and the artifact-graph topology projection. - tests/infra/test_storage_records.py: monkey-patch the new _repoint_user_state_by_identity_sync helper for the in-memory TrackingConnection test, mirroring the existing pattern for _upsert_conversation_stats_sync (#1114). - tests/unit/architecture/test_surface_storage_boundary.py: add polylogue/api/user_state_resolver.py to the allow-list — it accepts ConversationRepository via TYPE_CHECKING (#1113). - devtools/build_topology_projection.py: register message_type_backfill.py in STORAGE_ROOT_KEEP so the new module is classified as a storage-root cross-cutting helper instead of the malformed storage-domain owner. - Regenerate docs/plans/topology-target.yaml + docs/topology-status.md. - Update snapshot-shaped assertions to track the live runtime catalogs: - query-productivity-rollups operation - productivity-rollup-query-loop and tool-usage-query-loop paths - message_embeddings maintenance target - verify-witness-coverage verify-quick step Ambitious-expansion lint (per #1208): - devtools/verify_test_infra_currency.py: new lint that collects every table declared by polylogue/storage/sqlite/schema_ddl_*.py and asserts every table referenced from tests/infra/*.py exists in that set. AST-walks helpers, skips docstrings, restricts to SQL-shaped literals, and ignores SQLite built-ins. Wired into devtools verify --quick so the next SCHEMA_VERSION bump that leaves a stale helper reference fails the local gate immediately instead of waiting for testmon to invalidate the affected tests. Verification: - pytest -q --ignore=tests/integration → 7928 passed (one pre-existing hypothesis deadline flake in test_filter_chain_never_crashes_on_build passes on rerun, unrelated). - devtools verify --quick → exit_code 0, 19 gates green. Closes #1208 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (18)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Summary
Restore a green master baseline by fixing 11 pre-existing pytest failures introduced by #1113 (v15→v16 non-conv mark targets) and #1114 (v16→v17 identity-preserving marks/annotations), plus drift from adjacent runtime-catalog / verify-pipeline additions. Adds the
devtools verify-test-infra-currencylint from the issue's ambitious-expansion section so this drift class fails the local gate immediately on the next SCHEMA_VERSION bump.Closes #1208
Problem
After #1179 (#1113) and #1188 (#1114) landed,
pytest -q --ignore=tests/integrationonorigin/masterreports 12 failures (issue cited ~11; one is the canonicaltests/infra/storage_records.py:620 no such table: user_marks). The git pre-push hook runsdevtools verify --quickwhich doesn't trip them because affected tests aren't in the testmon-selected set for typical changes — the cliff is only exposed once an unrelated change invalidates testmon.The failures cluster:
tests/infra/test_storage_records.py::test_store_records_commits_within_lockexercisesstore_recordsagainst a:memory:SQLite connection that has no schema. The newly-added_repoint_user_state_by_identity_synchelper (mirroring asyncrepoint_user_state_by_identity) issuesUPDATE user_marks .../UPDATE user_annotations ...and crashes withOperationalError: no such table.polylogue/api/user_state_resolver.pyacceptsConversationRepositoryvia TYPE_CHECKING, which the surface→storage boundary lint rejects without an allow-list entry.polylogue/storage/message_type_backfill.pywas unclassified bydevtools build-topology-projection(target=TBD, owner=storage-domain), which the topology-projection witness tests flag.query-productivity-rollupsoperation,productivity-rollup-query-loop+tool-usage-query-loopartifact paths,message_embeddingsmaintenance target, and theverify-witness-coveragequick-verify step. Their pinning assertions intests/unit/{operations,core,devtools}/...were left out of sync.Solution
tests/infra/test_storage_records.py: monkey-patch_repoint_user_state_by_identity_syncfor the in-memoryTrackingConnectiontest. Mirrors the existing comment + monkey-patch for_upsert_conversation_stats_sync. ProductionConversationBuilderflows already run the full schema bootstrap so they're unaffected — the in-memory unit test is the only consumer that needs the suppression.tests/unit/architecture/test_surface_storage_boundary.py: extend the docstring +ALLOWEDfrozenset withpolylogue/api/user_state_resolver.py. The import is TYPE_CHECKING-only and the file is a typed resolver, not a back-channel into storage.devtools/build_topology_projection.py: addmessage_type_backfill.pytoSTORAGE_ROOT_KEEPso it classifies as a storage-root cross-cutting helper.docs/plans/topology-target.yaml,docs/topology-status.md,docs/test-quality-workflows.md,docs/devtools.md,AGENTS.md: regenerated viadevtools render-all.tests/unit/operations/test_specs.py,tests/unit/devtools/test_scenario_coverage.py,tests/unit/core/test_artifact_specs.py,tests/unit/core/test_artifact_graph.py,tests/unit/devtools/test_artifact_graph.py,tests/unit/core/test_maintenance_targets.py,tests/unit/devtools/test_verify.py— each updated to track the live catalog. No production behavior changed.Ambitious-expansion lint
devtools/verify_test_infra_currency.py(new): collects every CREATE TABLE / CREATE VIRTUAL TABLE name frompolylogue/storage/sqlite/schema_ddl_*.py, then AST-walks every non-test module undertests/infra/and scans only string literals that look like SQL (contain a SQL verb, skip docstrings). For everyFROM/UPDATE/INSERT INTO/DELETE FROM/JOINtable reference found, asserts the table exists in the current schema. SQLite built-ins (sqlite_master, ...) are allowlisted.build_verify_stepssodevtools verifyanddevtools verify --quickrun it.devtools/command_catalog.pyand documented in the regenerateddocs/devtools.md.user_marksfrom the schema reproduces the lint failure pinpointingtests/infra/storage_records.py:622.Verification
One pre-existing hypothesis deadline flake in
tests/unit/core/test_filters_props.py::test_filter_chain_never_crashes_on_buildpasses on rerun; unrelated to this change.