Skip to content

docs: C-126 gains the other end of the rotation blind spot (views-appwrite C-27) - #372

Merged
Polichinel merged 2 commits into
developmentfrom
docs/368-rotation-crossref
Nov 29, 2026
Merged

Polichinel merged 2 commits into
developmentfrom
docs/368-rotation-crossref

Conversation

@Polichinel

Copy link
Copy Markdown
Collaborator

No code change. One amendment to register entry C-126, prompted by the views-models session during the #368 exchange.

What was missing

C-126 records that the audience connection cannot be rehearsed without arming a real delivery. It did not record the related gap that no guard on either side of the seam can close: nothing here can tell a current key from a stale, well-formed, distinct one.

  • appwrite_env.assert_env_declared checks a name resolves to something truthy and deliberately never reads the value — that is what lets it name the missing variables in an ERROR log when the tuple it was handed carries a secret slot.
  • contract/audience.assert_audience_is_not_the_shelf is the value-level complement, and the only thing it can establish is that the audience key differs from the shelf key.

A rotated-but-wrong key passes both. The first signal is a 401 after the contract resolution, every manifest download and the 888 KB GAUL lookup.

Why now

The views-models session reproduced the same blind spot in its own loader and told us, because the mechanism is not specific to them: their validator checked that a name was exported, so a function that sourced a dotenv file to read one variable silently replaced a freshly rotated APPWRITE_DATASTORE_API_KEY with the stale value the file still held — exit 0, no warning (their PR #758, then #760).

Nothing in this package can acquire that shape. Verified, not assumed:

  • tests/test_env_declaration.py::test_the_dotenv_borrow_is_dead enforces the [þing-01] Kill the implicit ensemble-dotenv borrow; entry validation per D6 #134 removal by AST parse rather than grep — it catches an import of dotenv or a call to load_dotenv / find_dotenv / dotenv_values anywhere in the package. Passes on development.
  • Exactly four modules read the environment, all os.getenv on one name at a time: the two appwrite_env.py and the two managers.
  • No tracked .py or .sh in this repository is matched by .gitignore, so the search above was not blind. (The shell's grep honours .gitignore even for tracked files, which is why this was checked explicitly.)

What the amendment adds

Where the design task actually lives, so the next reader finds it instead of re-deriving the problem:

thing where
the owning register entry views-appwrite C-27 — rotating a secret value has no propagation mechanism. Open.
the design task Appwrite Seam Contract §9 O1
the issue views-appwrite#9
the inventory and evidence views-appwrite docs/ADRs/platform/key_inventory_and_rotation.md, read at bf39b3c

The pin may move and the entry says so. bf39b3c is on the branch docs/handover-and-literature-close and is not merged, so the entry instructs the reader to re-resolve it rather than trust it.

The relayed identifier was wrong and is corrected here rather than repeated. The peer cited O1 as belonging to that document. It does not — O1 is a Seam Contract section which the document references, at its §7. Checked in the local views-appwrite checkout before citing. The foreign C-27 is namespaced per this register's own convention, which exists because a bare C-27 sends a reader searching this file for an entry that is not in it.

What it also records, to stop the entry re-opening a settled question

That document's §7 states two things this register should not relitigate:

  1. It is not a rotation mechanism and does not close views-appwrite C-27.
  2. It names this repository's tests/test_credential_expiry.py as already correct — firing 30 days before the earliest expiry, with an acknowledgement escape so it cannot hold the merge queue hostage — and says a second tripwire there would be "building the wrong thing to feel busy".

So the remedy for the expiry half stays C-84's date on a calendar rather than a validity preflight, and that verdict is now agreed across two repositories rather than asserted in one.

Verification

Suite on the supported interpreter (3.11.15): 654 passed, 3 skipped, 41 xfailed, identical to before this change, plus the one pre-existing failure — the poetry.lock drift tracked as views-models#757. Ruff clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9

Polichinel and others added 2 commits November 29, 2026 20:58
…write C-27)

Raised by the views-models session on 2026-11-29 after it reproduced the shape
in its own loader: a validator that checks a name is EXPORTED cannot see which
VALUE it carries, so a function sourcing a dotenv file to read one variable
silently replaced a freshly rotated APPWRITE_DATASTORE_API_KEY with the stale
value the file still held (their PR #758, then #760).

Nothing in this package can acquire that shape — verified, not assumed:
test_env_declaration.py::test_the_dotenv_borrow_is_dead enforces the #134
removal by AST parse rather than grep and passes; exactly four modules read the
environment, all os.getenv on one name at a time; and no tracked .py or .sh here
is hidden from a search by .gitignore.

What C-126 was missing is where the design task lives. The owning entry is
views-appwrite C-27 (rotation has no propagation mechanism, open); the Appwrite
Seam Contract §9 O1 owns the design and views-appwrite#9 owns the issue; the
inventory is docs/ADRs/platform/key_inventory_and_rotation.md, read at
bf39b3c. That commit sits on an unmerged branch, so the entry says the pin may
move and to re-resolve rather than trust it.

The peer cited O1 as belonging to that document. It does not — it is a Seam
Contract section the document references. Cited correctly here rather than as
relayed, and the foreign C-27 is namespaced per this register's convention.

Also records what that document settles so this entry does not re-open it: it is
not a rotation mechanism, and it names this repository's test_credential_expiry.py
as already correct, calling a second tripwire "building the wrong thing to feel
busy". So the expiry remedy stays C-84's date on a calendar, now agreed across
two repositories.

No code change. Suite unchanged: 654 passed, 3 skipped, 41 xfailed, 1 pre-existing
failure (the poetry.lock drift, views-models#757). Ruff clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9
…carry it

Sharpened after the views-models session gave the precise location. Verified in
the local views-appwrite checkout rather than relayed:

- the hazard is §3.1, "Sourcing a dotenv file to read one name silently
  reinstates every other name in it" — confirmed present at the pinned commit
- the pin moves bf39b3c -> 419b6e9, the current head of that branch
- the branch is the head of views-appwrite PR #217, OPEN against development,
  so the entry now names the PR as the durable handle and says both the commit
  and the section number may move

Two citation corrections, both in the direction of claiming less:

- the rule "assert the value that arrives, not that a name exists" appears in NO
  FILE at 419b6e9. It is that commit's subject line. Cited as a commit subject,
  because quoting it as a document rule would be inventing a citation.
- the "four independent instances of one shape" count is marked relayed rather
  than checked. This register has measured two: its own assert_env_declared and
  views-models' loader.

No code change. Suite unchanged.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ANY1CCy9Xo7zjMY4XJ69v9
@Polichinel
Polichinel merged commit f10b80c into development Nov 29, 2026
4 checks passed
@Polichinel
Polichinel deleted the docs/368-rotation-crossref branch November 29, 2026 20:38
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