feat(env): þing-01 P1 (#134) — kill the ensemble-dotenv borrow; declared fail-loud entry validation - #137
Merged
Conversation
…eclared fail-loud entry validation The manager no longer reaches into views-models' checkout for its environment (the load_dotenv(ensemble_path_manager.dotenv) borrow — the runtime edge of the þing-01 copy-chain, sáttmál S6). The launcher declares its env sourcing (views-models M3/#287, merged: run.sh reads the PLATFORM-001 coordinate registry; the secret stays the operator slot); this package now only validates. New unfao/appwrite_env.py declares the required names (registry connection + target classes + the one secret slot; dependency-light by design) and assert_env_declared() raises naming EVERY missing variable (verdict D6) — called before all three AppwriteConfig constructions. Guards pin the borrow dead, the declaration↔use match, and the D3 naming rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 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 #134 (þing-01 P1 — orð_09 §4 commitment, verdict D6; sequenced behind views-models M3/#287, merged — their
run.shnow reads the PLATFORM-001 coordinate registry and exports the coordinates; the secret stays the operator slot).Change
load_dotenv(dotenv_path=str(self.ensemble_path_manager.dotenv))(oldunfao.py:180) and thedotenvimport are deleted. This was the runtime edge of the þing-01 copy-chain (sáttmál S6ii): the manager reaching inside views-models' checkout for its environment. The launcher now declares its env sourcing; this package never loads one.unfao/appwrite_env.py— the required Appwrite-seam environment, DECLARED:CONNECTION_ENV+PROD_FORECASTS_ENV+UNFAO_ENV(names per the registry's connection/target classes, plus the one operator-issued secret slot), andassert_env_declared()which raises naming every missing variable (empty string counts as missing). Dependency-light by design — importable and testable without views-pipeline-core.AppwriteConfigconstruction sites validate first (prod-forecasts read path, contract-mode unfao store, legacy_save) — no partial config can half-work.Tests (7 new,
tests/test_env_declaration.py)Borrow-is-dead source guard (
load_dotenv/from dotenv/find_dotenvbanned; prose may mention the dead borrow); all-missing-names-in-message; only-the-missing named; complete env passes; empty-string counts as missing; declaration↔use drift guard (os.getenvreads in the manager == declared names, and all 3 sites validate); D3 naming-rule guard (exactly one declared secret, by suffix).Verification
EnvironmentErrornaming the variables, where before the borrow could silently paper over it (that papering is exactly what þing-01 retired). The production launcher path is covered by views-models#287's registry export + transitional.envfallback.Cross-refs: views-models#287 (M3, merged), views-models#280 (retargeting), PLATFORM-001 registry (
views-appwrite/docs/ADRs/platform/coordinate_registry.toml).🤖 Generated with Claude Code