test: the commit check starts every request clean, and the fence docs claim what it holds

The test's own writes are committed before a request, so a handler's Core DML can no longer hide
in a transaction the test had already opened. The entry-point probe answers on a marked line the
API's logging cannot mix into. A listed commit whose function no longer commits fails the fence.
CLAUDE.md and the backend README now name what an AST cannot see; the route-commit tests no longer
claim their read-back holds the commit.
This commit is contained in:
2026-10-20 01:56:31 +02:00
parent c5f121139b
commit 6ea750a698
6 changed files with 59 additions and 21 deletions
+7 -4
View File
@@ -62,10 +62,13 @@ The domain is four units, each owning its tables (`models.py` in its package):
All of it is held by `tests/test_unit_fences.py`, with no exemptions: the unit map, each unit's
packages and edges (`UNIT_PACKAGES`, `READS`) and what may commit (`UNIT_COMMITS`, `CORE_COMMITS`)
are listed there. It reads the code's AST: an inline owner filter in any form (an alias, `.in_()`,
`filter_by`), a model built or a statement write (`insert`/`update`/`delete` under any name) across
units, and a commit off the lists all fail it. An ORM attribute write on another unit's loaded row
is beyond it — review's to catch.
are listed there. It reads the code's AST, so it holds the forms written here: an owner column
compared inline (a model's, an import alias's or an `aliased()` one's, by `==`, `!=`, `.in_()`, or a
`filter_by(user_id=…)`), a model built or an `insert`/`update`/`delete` (under any import name, of a
model or its `__table__`) across units, and a `.commit()` call off the lists all fail it. What an AST
cannot tell is review's to catch: an ORM write on another unit's loaded row (an attribute, a
`db.delete`), SQL in `text()`, a column or model reached another way (bound to a variable, through
`__table__.c` or a module path), and a commit made by a `begin()` block or a `commit` handed in.
## Transaction ownership