Repository navigation
S2 (#359): characterize the model_path filter semantics - #366
Merged
Merged
Conversation
Story 2 of epic #359. Tests only — no production code changes. This repository sets `model_path = None` on a store after constructing it, in four places, with a comment saying it suppresses an automatic filter. That read like defensive tidying. It is not, and this story measures why. Driven on the REAL DatastoreModule, offline (its constructor builds an Appwrite client and makes no request, so the injection is reachable by replacing the file manager it holds): - with model_path carrying a truthy model_name, the store does not merely ADD a name filter — it OVERWRITES one the caller supplied. A delivery asking for name="un_fao" searches for "chrome_box", the views-models directory name, with nothing in the answer saying it was rewritten. That is C-77's hazard in its most expensive form: the query that looks most specific is the one silently replaced. - model_name = "" injects nothing (the rule tests truthiness, not presence), which is the case a substitute is most likely to get wrong, because suppression then looks like it is working when it is not - with model_path cleared, the delivery's own filters pass through exactly Also recorded, at the builder level: - only FOUR of the six store-construction sites clear model_path. The two that keep it are the partner WRITE stores, deliberately - what keeps that safe is narrower than it looks: upload_data falls back to model_path.model_name when `name` is None, and the port's signature stops `name` being OMITTED but not a None or empty value passed explicitly. What covers that is the three call sites passing a declared constant — real, but not a guard, and said so rather than overclaimed - the two partners' partner-builders take different arguments on purpose (crafd a prepared AppwriteConfig, unfao the path manager), which #362 keeps. Asserted, so unifying them is a visible decision Validation on the supported interpreter (3.11.15): - pytest -k model_path: 7 passed - tests/test_store_construction.py: 29 passed, was 18 - full suite: 636 passed, 1 failed, 3 skipped, 41 xfailed. The failure is test_the_installed_runtime_dependencies_match_the_lockfile, pre-existing and failing identically on clean development (views-models#757) - ruff 0.14.13: clean - each of the four `model_path = None` lines deleted in turn: each reddens exactly the test that should catch it, four for four Five findings from /code-review high, fixed rather than shipped: - the header cited pipeline-core line numbers from the INSTALLED 3.3.5 while this repo declares >=3.6.0, and told the reader the story's own citation had moved. No 3.6.0 copy exists on this machine to check either claim, so the line numbers are gone and the rule is quoted as code instead - the guard on `name` was described as closing a hazard it only half closes - the env helper did not clear pre-existing APPWRITE_* first, which C-81 records as having made tests here pass for the wrong reason twice; it now clears, and discovers the declared tuples by shape instead of by a hand-written per-partner list - the builder-shape helper keyed on a parameter name and would have produced one false diagnosis plus three TypeErrors on a rename; it now refuses to guess - three assertions used `.get("name") == None`, which accepts both "absent" and "present and null". Those are different outcomes — an injected null scopes every query to name == None and matches nothing. Now asserts absence, and the difference was measured with a subclass rather than by modifying anything in site-packages Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #361. Story 2 of epic #359. Tests only — no production code changed.
The finding
This repository sets
model_path = Noneon a store right after building it, in four places. The comment says it suppresses an automatic filter, which reads like defensive tidying.It is not. Driven on the real
DatastoreModule, offline:⭐ The injection does not add a filter — it overwrites the one the delivery asked for. A delivery that explicitly asks for
name="un_fao"searches forchrome_box, the views-models directory name, and nothing in the answer says it was rewritten. So without those four lines the delivery reads files it did not write, and the query that looks most specific is the one silently replaced. That is C-77's hazard in its most expensive form, and it was an argument until now rather than a measurement.Two more, from the same measurements:
model_name = ""injects nothing — the rule tests truthiness, not presence. This is the case a substitute is most likely to get wrong, because suppression then looks like it is working when it is not.model_pathcleared, the delivery's own filters pass through exactly. Both directions are needed: a store that dropped the name filter rather than leaving it alone would satisfy the first direction while being unscoped in a different way.No network is involved.
DatastoreModule.__init__builds an Appwrite client and makes no request, so the whole injection is reachable by replacing the file manager it holds. Reaching for that private attribute is deliberate and explained in the test: the alternative is a hand-written stand-in, which would test this file's understanding of pipeline-core rather than pipeline-core. It asserts the attribute exists with a message telling the next person what to do if it is renamed.At the builder level
model_path. The two that keep it are the partner write stores, deliberately — that store only uploads.upload_datafalls back tomodel_path.model_namewhennameisNone, and the port's signature stopsnamebeing omitted but not aNoneor empty value passed explicitly. What covers that today is the three call sites passing a declared constant — real, but not a guard. Validating the value in the port would close it properly; that is a behaviour change, so it is not in this story.AppwriteConfig, unfao the path manager — and S3 (#359): funnel the six store-construction sites into one factory per partner #362 keeps that. Asserted, so unifying them becomes a visible decision rather than a tidy-up. Confirmed sound: crafd really does resolve the audience connection once per delivery and pass the same config object to both the write store and the read-back, which is what vpp_018 §3 requires.Validation
On the supported interpreter (3.11.15 in
views-models/envs/views-postprocessing):pytest -k model_pathtests/test_store_construction.pyruff0.14.13model_path = Nonelines deleted in turnThe one failure is
test_the_installed_runtime_dependencies_match_the_lockfile, pre-existing and failing identically on cleandevelopment(views-models#757).Five findings from
/code-review high, fixed rather than shipped:262/:426-428from the installed 3.3.5 while this repository declares>=3.6.0with 3.6.0 in the lock — and told the reader that the story's own citation had "moved". There is no 3.6.0 copy on this machine to check either claim against, so neither was mine to assert. The line numbers are gone; the rule is quoted as code, for the reasonstore_port.uploadalready gives about its own citation. (One sub-claim in the review was itself wrong — the copy I read is 3.3.5, confirmed from its dist-info, not 3.3.4 — but its main point was right and is what mattered.)namewas described as closing a hazard it only half closes. Now states exactly what it does and does not prove, including thatname=""fails differently again — no fallback, and an artifact delivered with an empty metadata name.APPWRITE_*variables first. C-81 records that a populated shell has twice made tests here pass for the wrong reason, and the two fixtures this repository already has both clear first. It now clears — and discovers the declared coordinate tuples by shape rather than by a hand-written per-partner list, which was the same enumerationconftest.pyargues against.TypeErrors on a rename. It now refuses to guess and says what to do..get("name") == None, which accepts both "absent" and "present and null". Those are different outcomes: an injected null scopes every query toname == Noneand matches nothing — the wrongly-scoped failure wearing the costume of suppression. Now asserts absence. The difference was measured with a subclass, so nothing insite-packageswas modified.Noted, not done here
📌
tests/test_findability.py:137greps the builder's source text for the literal"store.model_path = None". The new behavioural test covers the same property and survives a harmless rewrite, which the source grep does not. Deleting the weaker guard is the right follow-up but it is another file's test and outside this story — flagging rather than doing it.📌
reports/falsification_2026-11-25_nothing_is_broken.pyremains untracked and is not in this PR.🤖 Generated with Claude Code
https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9