Skip to content

test(clone): S7 — prove the machinery imports without the partner - #165

Merged
Polichinel merged 1 commit into
developmentfrom
feat/s7-clone-readiness-proof
Aug 1, 2026
Merged

Polichinel merged 1 commit into
developmentfrom
feat/s7-clone-readiness-proof

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

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.modules is true regardless of what contract/ actually depends on.

tests/test_clone_readiness.py imports 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 (their test_import_purity.py); þing-02 recorded it as the pattern for turning a rule into a test rather than a promise.

Three assertions

  1. The machinery imports without the partner — the load-bearing one.
  2. The machinery does not pull in 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.
  3. The guard proves itself non-vacuous — imports the partner deliberately and asserts the detector sees it, so a reader knows 1 and 2 aren't passing because the subprocess quietly did nothing.

Separately mutation-tested: a real import added to contract/wire/header.py failed both purity assertions; reverted, both pass.

docs/CLONING.md

The 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 importing views_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

ruff clean · 305 passed, 41 xfailed · the 5 failures are the known local pyarrow byte-parity tests; CI authoritative.

🤖 Generated with Claude Code

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>
@Polichinel
Polichinel merged commit ccefad6 into development Aug 1, 2026
4 checks passed
@Polichinel
Polichinel deleted the feat/s7-clone-readiness-proof branch August 1, 2026 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant