Repository navigation
S6 (#187) — detect coordinate-registry drift; existence is not reachability - #202
Merged
Merged
Conversation
…not reachability The Appwrite Seam Contract's registry is the authority for the 13 environment names this package declares, and it is deliberately referenced, never copied — one owner, no duplicated values. That was always right. What C-57 named was the gap it left: nothing mechanical could tell you the two had diverged. appwrite_env now declares the edition it was verified against, SEAM_CONTRACT_VERSION and SEAM_CONTRACT_COMMIT. A version string and a sha are not coordinate values; what is recorded is WHICH EDITION WAS READ, and that is precisely what makes drift detectable. Bumping them is not bookkeeping — it asserts someone re-checked. Four checks, each mutation-proven with bytecode disabled: names + declared class rename a coordinate here -> 4 failures registry [meta] version pretend v1.2.0 -> 1 failure commit reachable from main pin the withdrawn b54928f -> 1 failure no value copied into code add a constant/dict/kwarg -> 1 failure each The reachability check exists because existence was not enough. #196: S3 pinned a commit resolved with `rev-parse HEAD` on a checkout sitting on an unmerged branch. The commit existed, both cited files existed at it, and every check anyone had written passed — but it had never reached main, declared a version never ratified, and was withdrawn. A pin is a claim about what the contract SAYS; only reachability supports that claim. The value-copy check took two wrong narrowings before the right one. A substring scan flagged three false positives — file_metadata is a FUNCTION NAME here, and the other two appear only in refusal labels and docstrings. Narrowing to assignments and defaults then caught neither a dict value nor a keyword argument, and the keyword argument is the shape this repo would actually produce: AppwriteConfig(bucket_id=...) is how every store is configured. The right axis was exact equality on string constants, not statement shape — it catches all three real shapes while the false positives fall out on their own. When a guard cries wolf, check whether the matching is wrong before assuming the scope is. Review also caught the expectation map deriving class from an _API_KEY suffix — the exact inference the registry forbids, inside the test enforcing the registry. Now written out, with a completeness check so an unclassified name fails. tests/conftest.py holds the sibling-repo resolution S7 (#188, C-46) will adopt for views-datafactory: declared env var, conventional sibling path, never an absolute path to one machine, and a skip that names what to set so the test is runnable rather than merely skippable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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 #187. Closes register C-57. Part of epic #181.
The gap
The registry is the authority for the 13 names
appwrite_envdeclares, and it lives in views-appwrite, referenced never copied. That is the right call — one owner, no drift-by-fork. What it left is C-57's gap: nothing mechanical could tell you the two had diverged.appwrite_envnow declares the edition it was verified against —SEAM_CONTRACT_VERSION = "1.3.0",SEAM_CONTRACT_COMMIT = "47172af". A version string and a sha are not coordinate values. What is recorded is which edition was read, which is exactly what makes drift detectable. Bumping them asserts someone re-checked.Checked 2026-08-02: no live drift today. This builds the detector while the answer is known-good, which is the cheap moment.
Four checks, each mutation-proven
APPWRITE_UNFAO_BUCKET_IDhere[meta] versionmatches the pinmainb54928fRun with
-Bafter discovering stale bytecode was lying mid-campaign: both shas are 7 characters, so the.pycsize+mtime check passed and Python served a cached module contradicting its own source. Everything was re-verified from clean.Existence is not reachability
That distinction is the point of this story, and it cost a merged PR three hours ago. #196: S3 pinned a commit resolved with
rev-parse HEADon a checkout sitting on an unmerged branch. The commit existed. Both cited files existed at it. Every check anyone had written passed. It had never reachedmain, declared a version never ratified, and was withdrawn.A pin is a claim about what the contract says. Only reachability supports that claim, and now something asserts it.
The value-copy check took two wrong narrowings
First: a substring text scan flagged three "leaks" —
file_metadata(a function name incontract/store_metadata.py),production_forecastsandunfao_bucket(only in refusal labels and docstrings). None was a copy. A guard failing ondef file_metadata(record)gets deleted, and then the real rule is unguarded.Second: narrowing to assignments and default arguments caught zero of these:
The kwarg is the shape this repo would actually produce —
AppwriteConfig(bucket_id=os.getenv(...))is how every store is configured, and swapping oneos.getenvfor a literal is the violation.Right axis: exact equality on string constants, not statement shape. Verified — it catches dict values, kwargs and constants, while all three false positives fall out on their own (a function name is not a
Constant;"unfao_bucket datastore"≠"unfao_bucket"; docstrings excluded).Review findings — all three addressed
F1 (warning) — the narrowing above. Fixed and re-proven.
F2 —
_EXPECTED_CLASSderived class from the_API_KEYsuffix: the exact inference the registry forbids ("class is DECLARED here, never inferred from a name's prefix"), inside the test enforcing the registry. Now written out, with a completeness check so an unclassified name fails rather than going unchecked.F3 —
tomllibis stdlib from 3.11 andpyprojectdeclares>=3.11; CI runs 3.11 and executes these. This box runs 3.10, below the declared floor, so they skip locally — the local suite is quietly weaker than a greenpytest -qsuggests. Recorded against C-46's residual, since "a gate that does not run" is what that entry is open for and S7 (#188) should decide the CI question once for both.tests/conftest.pySibling-repo resolution S7 will adopt for views-datafactory: declared env var, conventional path relative to this repo, never an absolute path to one machine, and a skip naming what to set. Second incident, which is this repo's named trigger for extracting.
Verification
Register: 74 concerns, 19 open, 55 resolved.
🤖 Generated with Claude Code