#812 removes the narrowing idiom from the collections router and #813 removes it from the score sets and experiment sets routers. This issue proves it is gone and keeps it gone.
Why it matters independently
Verified on PG 15.17 with SQLAlchemy 2.0.49: assigning a narrowed list to a delete-orphan collection deletes the rows you dropped. Rows hidden by RLS are safe — they were never in collection history — but rows the caller could see and chose not to display are destroyed at the next flush.
Collection.score_set_associations, Collection.experiment_associations, ScoreSet.score_calibrations, and ExperimentSet.experiments all carry cascade="all, delete-orphan". Nothing persists the staged deletes today because get_db never commits — an invariant that held by accident and had no test until test_narrowing_associations_does_not_delete_them.
Scope
- Confirm no site assigns a filtered list to a mapped collection.
- Confirm no site assigns
None to a mapped scalar relationship for presentation (superseding_score_set), which lazy="raise" never blocked.
- Add a check that fails if the idiom reappears. A test that greps the routers is crude but honest; an event-based assertion that no delete is staged during a read request is stronger.
Acceptance criteria
#812 removes the narrowing idiom from the collections router and #813 removes it from the score sets and experiment sets routers. This issue proves it is gone and keeps it gone.
Why it matters independently
Verified on PG 15.17 with SQLAlchemy 2.0.49: assigning a narrowed list to a
delete-orphancollection deletes the rows you dropped. Rows hidden by RLS are safe — they were never in collection history — but rows the caller could see and chose not to display are destroyed at the next flush.Collection.score_set_associations,Collection.experiment_associations,ScoreSet.score_calibrations, andExperimentSet.experimentsall carrycascade="all, delete-orphan". Nothing persists the staged deletes today becauseget_dbnever commits — an invariant that held by accident and had no test untiltest_narrowing_associations_does_not_delete_them.Scope
Noneto a mapped scalar relationship for presentation (superseding_score_set), whichlazy="raise"never blocked.Acceptance criteria
routers/orlib/.test_narrowing_associations_does_not_delete_themstill passes, and its docstring is updated to reflect that nothing is assigned rather than nothing being committed.