From ab66b85c6c3e1ecc532ee189629c82fd2b70fd36 Mon Sep 17 00:00:00 2001 From: Jer Miller Date: Wed, 5 Aug 2026 16:22:48 -0600 Subject: [PATCH] pin the release oracle to its reference, not to HEAD The fixture recorded `git rev-parse HEAD`, so every unrelated commit in the repo made it stale and the gate went red for a reason that had nothing to do with the reference it guards. A gate that reds for non-product reasons is the defect. It now pins the last commit that touched any of the reference files the oracle reads its verdicts from, which goes stale exactly when the fixture should be regenerated and not otherwise. Verified live: HEAD moved twice while this was being written and the pinned revision did not. Found by re-running the gate at a moved HEAD rather than trusting the earlier green. --- core/fixtures/retention_release_oracle.json | 2 +- scripts/retention_release_oracle.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/core/fixtures/retention_release_oracle.json b/core/fixtures/retention_release_oracle.json index 0f4ecad67..a48d9fc6a 100644 --- a/core/fixtures/retention_release_oracle.json +++ b/core/fixtures/retention_release_oracle.json @@ -2,7 +2,7 @@ "_provenance": { "generator": "scripts/retention_release_oracle.py", "method": "the reference verdicts are OBSERVED by running the reference over constructed segments on a real filesystem; the unified verdicts are derived mechanically from one rule, not chosen per row", - "source_revision": "ba31b082b8588298a229df8d925cb42c1825a09d", + "source_revision": "6a3b35b269cd8fd5d1aea8d40ff63d1d215d0ad0", "reference": { "segment_gate": "solstone/think/retention.py:190", "state_derivation": "solstone/think/data_state.py:121", diff --git a/scripts/retention_release_oracle.py b/scripts/retention_release_oracle.py index 987599076..b43420f22 100644 --- a/scripts/retention_release_oracle.py +++ b/scripts/retention_release_oracle.py @@ -482,9 +482,19 @@ def tally(rows: list[dict]) -> dict[str, int]: def revision() -> str: + """The revision of the reference this oracle was read from. + + ⛔ Deliberately NOT ``rev-parse HEAD``. Pinning HEAD makes the committed + fixture stale on every unrelated commit in the repository, so the gate reds + for a reason that has nothing to do with the reference it guards -- which + means the gate is the defect. Pinning the last commit that touched the + reference files goes stale exactly when the fixture should be regenerated, + and not otherwise. + """ + sources = sorted({citation.split(":", 1)[0] for citation in REFERENCE.values()}) try: return subprocess.run( - ["git", "rev-parse", "HEAD"], + ["git", "log", "-1", "--format=%H", "--", *sources], cwd=REPO, capture_output=True, text=True, -- 2.51.2