test(fence): owner filters in any form, statement writes under any name, core commits by list

The owner-filter check missed an aliased() model, an import alias, .in_() and
filter_by; four live inline filters on aliased VideoState go through owned_by now.
Cross-unit writes are seen under any import name, through sa.update and via
__table__. Core modules may commit only where CORE_COMMITS names the reason;
trim_read and audit.gc flush now and their callers commit. The pin target, the
debug-session header and a link's target fetch through owned_row. The docs
claim what the fence holds, and say what is beyond it.
This commit is contained in:
2026-10-20 00:45:21 +02:00
parent e27656ee7e
commit 8206384c91
13 changed files with 215 additions and 90 deletions
+3 -2
View File
@@ -3,8 +3,9 @@
**Ownership.** A user-owned table says whose a row is in one column (`user_id`, or `to_user_id` for
something handed to them). Every read and write names that column through `owned_by` and fetches a
row by id through `owned_row`, never with an inline `Model.user_id == …`: the rule "a row owned by
someone else is answered like a missing one" then lives here, and a contract test
(`test_unit_fences.py`) holds every module to it, core included.
someone else is answered like a missing one" then lives here. A contract test
(`test_unit_fences.py`) holds every module, core included, to the filter's form; a rule this module
cannot say (own or shared, built-in or own) is written out where it applies, with its reason.
**Recipients.** "An active, non-suspended account" — the download share-by-email and the recipient
picker filter on it. Kept here so the two forms (SQL clauses for a query, a Python check for a loaded