From caeaa0705e6927df3dc5eff4c82bac941055d347 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 17 Nov 2026 12:42:57 +0000 Subject: [PATCH 1/5] test(stack): a gate that the five trope-stack repositories agree Each repository of the stack describes the others, and nothing compared the descriptions. Read on the five main branches on 2026-11-17: hermeneia said in several places that Vocarium does not exist while vocarium's store engine was built and gated; haec kept an ordering the calculus replaced in IR 0.2; two repositories carried the mint template's identity; coordination had two values; the shared scan workflow was pinned at two revisions. tests/check-stack-coherence.sh reads the five repositories and fails on ten kinds of disagreement, printing both sides. It writes nothing. Superseded statements live in a register, tests/stack-coherence/ retired-claims.tsv, each with what superseded it and where history may keep it. Against today's main branches it reports 6 of 10 checks in disagreement (S4 to S9). Those fixes belong to the siblings, so the live gate runs on pushes to main, weekly and on demand, and not on pull requests, where it would fail for reasons the pull request cannot fix. tests/check-stack-coherence-selftest.sh builds a coherent scratch stack, shows the gate passes, then plants one disagreement per check and requires that check alone to fail: 19 cases, with three controls for what must not fail. It runs on every pull request. Co-Authored-By: Claude Fable 5.2 Claude-Session: https://claude.ai/code/session_01J4QvDim4mMEfCer9SiAV4H --- .github/workflows/trope-check.yml | 27 +++ CHANGELOG.adoc | 15 ++ Justfile | 12 ++ tests/check-stack-coherence-selftest.sh | 135 +++++++++++++ tests/check-stack-coherence.sh | 236 +++++++++++++++++++++++ tests/stack-coherence/retired-claims.tsv | 14 ++ 6 files changed, 439 insertions(+) create mode 100755 tests/check-stack-coherence-selftest.sh create mode 100755 tests/check-stack-coherence.sh create mode 100644 tests/stack-coherence/retired-claims.tsv diff --git a/.github/workflows/trope-check.yml b/.github/workflows/trope-check.yml index 2727692..8e9c21c 100644 --- a/.github/workflows/trope-check.yml +++ b/.github/workflows/trope-check.yml @@ -11,6 +11,10 @@ on: paths: ['vocabulary/**', 'assets/**', 'README.adoc', 'tests/**', '.github/workflows/trope-check.yml'] pull_request: workflow_dispatch: + schedule: + # Mondays 05:23 UTC: the live stack gate reads four other repositories, + # which change without any push here. + - cron: '23 5 * * 1' permissions: contents: read jobs: @@ -20,3 +24,26 @@ jobs: - uses: actions/checkout@v7.0.1 - name: Nine effects consistent (vocabulary / trainer / map / README) run: bash tests/check-vocabulary.sh + # The gate's own controls: one planted disagreement per check, on a scratch + # stack. Runs everywhere, so a change that breaks the gate fails its own PR. + stack-coherence-selftest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + - name: The stack coherence gate can fail (planted disagreements) + run: bash tests/check-stack-coherence-selftest.sh + # The live gate: the five trope-stack repositories agree about shared facts. + # It reads the siblings' default branches, so its result does not depend on + # the change under review. It therefore runs on pushes to main, weekly, and + # on demand, and not on pull requests or their branches, where it would fail + # for reasons the pull request cannot fix. When it is red, a sibling + # disagrees; the log names both sides. + stack-coherence: + if: >- + github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + || (github.event_name == 'push' && github.ref == 'refs/heads/main') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7.0.1 + - name: The five repositories agree (IR version, map, pins, retired claims, identity) + run: bash tests/check-stack-coherence.sh --fetch diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index f49f934..87908d8 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -8,6 +8,21 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning]. === [Unreleased] +==== Added + +* A stack coherence gate (`tests/check-stack-coherence.sh`, `just + stack-coherence`). It reads the five trope-stack repositories and fails when + they disagree about a shared fact: the IR schema and version, the five-repo + map, the checker commit each sibling builds against, the revision of the + shared scan workflow, root documents a README cites, template identity left + in a repository's description, the `coordination` value, and any claim listed + in `tests/stack-coherence/retired-claims.tsv`. It writes nothing. Run on the + five `main` branches on 2026-11-17 it reports 6 of 10 checks in disagreement; + the fixes belong to the sibling repositories. The live gate runs on pushes to + `main`, weekly and on demand. Its self-test + (`tests/check-stack-coherence-selftest.sh`, 19 cases: one planted + disagreement per check, three controls) runs on every pull request. + ==== Changed * The repository is now documentation only. The inherited RSR template diff --git a/Justfile b/Justfile index f1d2930..6fdbbf3 100644 --- a/Justfile +++ b/Justfile @@ -17,3 +17,15 @@ check: estate-rules: bash scripts/check-root-shape.sh . bash scripts/check-no-md-in-docs.sh . + +# The five trope-stack repositories agree about shared facts (siblings in ../) +stack-coherence: + bash tests/check-stack-coherence.sh + +# The same, against the siblings' default branches (clones them) +stack-coherence-fetch: + bash tests/check-stack-coherence.sh --fetch + +# The stack coherence gate can fail: one planted disagreement per check +stack-coherence-selftest: + bash tests/check-stack-coherence-selftest.sh diff --git a/tests/check-stack-coherence-selftest.sh b/tests/check-stack-coherence-selftest.sh new file mode 100755 index 0000000..86bc946 --- /dev/null +++ b/tests/check-stack-coherence-selftest.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) +# +# The stack coherence gate can fail: one planted disagreement per check. +# +# tests/check-stack-coherence.sh compares five repositories. This suite builds a +# small coherent stack in a scratch directory, shows the gate passes on it, then +# plants one disagreement at a time and requires the gate to fail on the check +# that owns it. Three controls show what must NOT fail: history kept in a +# changelog, a line that reports a claim as past, and a README citing documents +# its repository has. The coherent stack also holds a checker fixture at an older +# accepted IR version, which must pass. +# +# A gate whose canary does not fire cannot fail, and is not a gate. +# Exit 0 = every case behaved, 1 = a case did not. + +set -uo pipefail +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +GATE="$HERE/tests/check-stack-coherence.sh" +PASS=0; FAIL=0 +ok() { printf ' ok %s\n' "$1"; PASS=$((PASS+1)); } +bad() { printf ' FAIL %s\n' "$1"; FAIL=$((FAIL+1)); } + +WORK="$(mktemp -d)"; trap 'rm -rf "$WORK"' EXIT +PIN_A=$(printf 'a%.0s' $(seq 40)); PIN_B=$(printf 'b%.0s' $(seq 40)) +SCAN_A=$(printf 'c%.0s' $(seq 40)); SCAN_B=$(printf 'd%.0s' $(seq 40)) +MAP='Store/query track: haec → vocarium → hermeneia → trope-checker (verdict).' + +# build : a coherent five-repository stack. +build() { + local d=$1 r + rm -rf "$d"; mkdir -p "$d" + for r in trope-checker vocarium hermeneia haec trope-particularity-workbench; do + mkdir -p "$d/$r/.github/workflows" "$d/$r/.machine_readable/6a2" + printf '= %s\n\n%s\n' "$r" "$MAP" > "$d/$r/README.adoc" + printf 'jobs:\n scan:\n uses: metadatastician/standards/.github/workflows/hypatia-scan-reusable.yml@%s\n' "$SCAN_A" \ + > "$d/$r/.github/workflows/hypatia-scan.yml" + printf 'project = "%s"\ncoordination = "standards"\n' "$r" > "$d/$r/.machine_readable/6a2/ECOSYSTEM.a2ml" + done + mkdir -p "$d/trope-checker/schemas" "$d/trope-checker/tests" "$d/haec/design" "$d/vocarium/tests" "$d/hermeneia/docs" + printf '{"properties":{"version":{"enum":["0.1","0.2"]}}}\n' > "$d/trope-checker/schemas/trope-ir.schema.json" + cp "$d/trope-checker/schemas/trope-ir.schema.json" "$d/haec/design/trope-ir.schema.json" + printf '{"version":"0.1"}\n' > "$d/trope-checker/tests/old-v0.1.ir.json" + printf '{"version":"0.2"}\n' > "$d/vocarium/tests/slice.ir.json" + printf 'TROPECHECK_PIN="%s"\n' "$PIN_A" > "$d/vocarium/tests/slice.sh" + for r in hermeneia haec; do + printf 'jobs:\n t:\n steps:\n - uses: actions/checkout@v7.0.1\n with:\n repository: hyperpolymath/trope-checker\n ref: %s\n path: tc\n - run: true\n' "$PIN_A" \ + > "$d/$r/.github/workflows/check.yml" + done + printf '= Notes\n\nThe adapter does not exist yet.\n' > "$d/hermeneia/docs/SPEC.adoc" +} + +run() { STACK_ROOT="$1" bash "$GATE" > "$WORK/out" 2>&1; } + +# expect_fail