Repository navigation
S3 (#359): funnel the six store-construction sites into one factory per partner - #367
Merged
Merged
Conversation
Story 3 of epic #359. Pure restructuring — Fowler's two hats, no behaviour change, no new behaviour tests. The same 636 tests pass before and after. A seam you cannot switch from outside the code is not a seam (Feathers, ch. 4). The store was constructed in six places, three per partner, so there was no single point at which a later change could choose a different implementation. Each partner now has one `_datastore(config, *, keep_model_path)`. `keep_model_path` has no default, deliberately. The two settings are two different query behaviours and the wrong one is silent: - False clears model_path, suppressing pipeline-core's automatic name == model_name filter, which OVERWRITES a name the caller supplied rather than narrowing it (C-77, measured on the real store in #361) - True keeps it, which only the two partner WRITE stores want, because upload_data falls back to model_path.model_name when name is None So adding a fourth store means deciding which it is, at the call site. The two partners are NOT unified, as the story requires: `_datastore` is defined separately in each package, nothing imports it across the boundary, and both copies of store_port.py are untouched and still byte-identical. Acceptance, all checked: - `grep -rn "DatastoreModule(" views_postprocessing` returns TWO sites, one per partner, down from six - full suite 636 passed / 1 failed / 3 skipped / 41 xfailed, the same counts as before the refactor. 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 - four mutations through the new factory, each caught by exactly the right test and the right partner: the factory never suppressing; the shelf reader asking to keep; the write store asking to clear; the read-back asking to keep - no new abstraction crosses the two partners Two consequences handled rather than worked around: - tests/test_findability.py asserted this property by searching the builder's SOURCE TEXT for `store.model_path = None`. Moving that line into the factory broke the check while changing no behaviour, which is the weakness of a textual guard. #361 already added a behavioural, mutation- verified test of the same property, so the textual assertion is replaced by a structural one on the call's argument — and that one fires where the behavioural test skips, which /code-review high pointed out would otherwise have left C-77 unguarded in an environment without pipeline-core. - the factory's docstring was condensed to stay inside the manager line budget rather than raising the budget a third time this month. The reasoning it used to repeat lives in tests/test_store_construction.py, which is where it is measured. Net lines are +33, not the "slightly negative" the story expected: the epic requires the two partners to share nothing, so the factory and its explanation exist twice. Said rather than massaged. 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 #362. Story 3 of epic #359, and the last. Pure restructuring — Fowler's two hats: no behaviour change, and no new behaviour tests. The same 636 tests pass before and after, which is the evidence that matters.
What changed
A seam you cannot switch from outside the code is not a seam (Feathers, ch. 4). The store was built in six places, three per partner, so there was no single point at which a later change could choose a different implementation. Each partner now has one:
keep_model_pathhas no default, deliberately. The two settings are two different query behaviours and the wrong one is silent:Falseclearsmodel_path, suppressing pipeline-core's automaticname == model_namefilter — which overwrites a name the caller supplied rather than narrowing it (C-77, measured on the real store in S2 (#359): characterize the model_path filter semantics #361).Truekeeps it, which only the two partner write stores want, becauseupload_datafalls back tomodel_path.model_namewhennameisNone.So adding a fourth store to either package means deciding which it is, in the open, at the call site.
Acceptance — all checked
grep -rn "DatastoreModule(" views_postprocessingruff0.14.13_datastoredefined separately in each package; nothing imports it across the boundarystore_port.pyuntouchedThe one failure is
test_the_installed_runtime_dependencies_match_the_lockfile, pre-existing and failing identically on cleandevelopment(views-models#757).Mutations: the factory never suppressing; the shelf reader asking to keep; the write store asking to clear; the read-back asking to keep.
Two consequences handled rather than worked around
⭐ The first two stories paid for themselves here.
tests/test_findability.pyasserted this property by searching the builder's source text forstore.model_path = None. Moving that line into the factory broke the check while changing no behaviour — the weakness of a textual guard, and/code-review highhad predicted this exact failure on #361 before the refactor existed. #361 had already added a behavioural, mutation-verified test of the same property, so the textual assertion is gone.It is replaced by a structural check on the call's argument rather than on a line of text. That matters for a reason review found: the behavioural test sits behind
importorskip("views_pipeline_core"), so deleting the textual guard outright would have left C-77 asserted by nothing in an environment without pipeline-core. The structural one needs no dependency, and I verified it fires by flipping the argument.tests/test_store_construction.py, where it is measured. The manager budget passes with four lines spare.One expectation missed, stated plainly
The story expected net lines slightly negative. They are +33. The epic requires the two partners to share nothing, so the factory and its explanation exist twice. I shortened the explanation to fit the budget but did not pretend the number.
Found by review, outside this story
/code-review highwidened to the whole unreleased diff and surfaced findings in code this story does not touch. Two are real and are mine, from #327, already released in 1.5.0 — filed separately rather than smuggled in here, since this is a pure-refactor commit:contract/audience.pyreports "distinct credentials" having compared nothing when both credentials are absent or blank — the same self-certifying polarity the project-id branch twenty lines above refuses. Measured and confirmed.One review finding I checked and rejected: it claimed this diff makes
regiona newly mandatory launch-config key that views-models does not declare.regiondid become mandatory, but in 1.5.0, not here — and both views-models postprocessors already declare it, derived from a single source with an assertion. No run is at risk. What survives is a documentation gap, filed separately.🤖 Generated with Claude Code
https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9