- probe guard now inspects execute, fetch_one, fetch_all AND
execute_many calls, so bypasses through read/many paths are caught
- bare Name('raises') trusted only when the file's actual ImportFrom
nodes bind 'raises' from pytest; competing imports shadowing
'raises'/'pytest' from other modules fail closed
- every raw statement naming either table in a sanctioned function must
be exactly that function's expected-table probe (cross-table inserts
rejected); per-function count still enforces exactly one
- bare Name('raises') is trusted only when the file imports it from
pytest (from pytest import ... raises); other import bindings
rejected
- raises block: func must be Attribute pytest.raises or a bare Name
'raises'; matcher must be a Name/Attribute chain whose final segment
is exactly IntegrityError (fake.IntegrityError/NotIntegrityError fail)
- insert target matching tokenizes the leading identifier, strips
quotes/brackets, and takes the last dot-segment, so INSERT OR IGNORE
INTO "main"."children" and attached-qualified spellings all count
as table inserts requiring the raises block
- raises block must be pytest.raises (func attr check) with matcher
exactly naming IntegrityError (dotted-name boundary match, so
NotIntegrityError fails)
- INSERT OR IGNORE/quoted/qualified table spellings normalized before
matching so they cannot bypass the raises-block requirement
- probe count is per-function (each of the two sanctioned functions
must hold exactly one probe), not an aggregate
- task-instances matrix test asserts same row id + rewritten due_time
+ pre-refresh None (the vacuous refreshed_same_id walrus is gone)
- compensating guard parses the two sanctioned functions' ASTs: each
must contain its raw INSERT (children NOT NULL, admin_users PK),
lexically inside a pytest.raises block, and no other raw SQL may
name these tables anywhere else in the matrix file