Repository navigation
test(clone): S7 — prove the machinery imports without the partner - #165
Merged
Merged
Conversation
Closes #155. Epic #148. #153 separated partner-neutral machinery (contract/) from FAO's product (unfao/). Nothing then stopped the next contributor adding one convenient import back — and the boundary would be gone with NO SIGNAL, because everything would still work for FAO. It would break only for views-crafdapi and views-productionapi, in a repo nobody had cut yet. C-69's fix is one-shot; this is what makes it hold. tests/test_clone_readiness.py imports all 21 partner-neutral modules in a FRESH INTERPRETER and fails if views_postprocessing.unfao arrives with them. The subprocess matters: in-process the check is worthless, because pytest has already imported the whole package by collection time, so sys.modules would say yes regardless of what contract/ actually depends on. Same mechanism views-pipeline-core uses to keep pandas out of its frame path (their test_import_purity.py, #321); þing-02 recorded it as the pattern for turning a rule into a test rather than a promise. Second assertion: the machinery must not pull in views_pipeline_core either. Pinned while true — a clone writes its own manager against its own framework seam, and if the machinery dragged pipeline-core in, that choice would be made for it and C-40's blast radius would widen from one file to the package. Third: the guard proves ITSELF non-vacuous by importing the partner deliberately and asserting the detector sees it. Separately mutation-tested — a real import added to contract/wire/header.py failed both purity assertions, then reverted. docs/CLONING.md is the human half: what you get free (delivery/, contract/), the three files you must supply (product, appwrite_env, manager), and the hard rules with WHY each exists — including þing-02 S24(5)'s ban on importing views_pipeline_core.modules.{appwrite,datastore}, which is how a two-repo defect became three. ruff clean; 305 passed, 5 known local pyarrow byte-parity failures. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Aug 1, 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 #155 · Epic #148
Why a test and not a convention
#153 drew the boundary. Nothing then stopped the next contributor adding one convenient import back — and the boundary would be gone with no signal, because everything would still work for FAO. It would break only for views-crafdapi and views-productionapi, in a repository nobody had cut yet.
C-69's fix is one-shot. This is what makes it hold.
Why a subprocess
In-process, the check is worthless: by collection time pytest has imported the whole package, so
"views_postprocessing.unfao" in sys.modulesis true regardless of whatcontract/actually depends on.tests/test_clone_readiness.pyimports all 21 partner-neutral modules in a fresh interpreter and fails if the partner arrives with them. Same mechanism views-pipeline-core uses to keep pandas out of its frame path (theirtest_import_purity.py); þing-02 recorded it as the pattern for turning a rule into a test rather than a promise.Three assertions
views_pipeline_core— pinned while true. A clone writes its own manager against its own framework seam; if the machinery dragged pipeline-core in, that choice would be made for it and C-40's blast radius would widen from one file to the package.Separately mutation-tested: a real import added to
contract/wire/header.pyfailed both purity assertions; reverted, both pass.docs/CLONING.mdThe human half. What you get free, the three files you must supply (
product.py,appwrite_env.py, your manager), and the hard rules with why each exists — including þing-02 S24(5)'s ban on importingviews_pipeline_core.modules.{appwrite,datastore}, which is how a two-repo defect became three.Written to be read before cutting a repo, not after.
Verification
ruffclean · 305 passed, 41 xfailed · the 5 failures are the known local pyarrow byte-parity tests; CI authoritative.🤖 Generated with Claude Code