diff --git a/.github/workflows/trope-check.yml b/.github/workflows/trope-check.yml index 2727692..ef9614e 100644 --- a/.github/workflows/trope-check.yml +++ b/.github/workflows/trope-check.yml @@ -8,9 +8,15 @@ name: "🔴 Gate: Trope conformance" on: push: - paths: ['vocabulary/**', 'assets/**', 'README.adoc', 'tests/**', '.github/workflows/trope-check.yml'] + # No path filter. The stack gate reads every text file in this repository + # (documents, scripts, workflows, .machine_readable/, IR documents), so any + # list of paths here would leave some of its inputs unable to start it. 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 +26,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..8be8f50 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -8,6 +8,22 @@ 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`, 28 cases: one planted + disagreement per check, four cases from review, 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/docs/status/STATE-OF-THE-STACK.adoc b/docs/status/STATE-OF-THE-STACK.adoc index b664826..d4c58a2 100644 --- a/docs/status/STATE-OF-THE-STACK.adoc +++ b/docs/status/STATE-OF-THE-STACK.adoc @@ -63,7 +63,7 @@ job `examples-lower-to-valid-ir`, success 2026-11-04T22:51Z | hermeneia | implementation (M1) -| `invoke` end to end against the checker; the other six vokes parse and are +| `invoke` end to end against the checker; the other six vokes are recognised by keyword (their bodies are not parsed) and are refused as unimplemented; `show loss` refused (needs the checker's loss vector); stub store. | None of the calculus's; O2 as a producer, once it emits IR from a real store. diff --git a/tests/check-stack-coherence-selftest.sh b/tests/check-stack-coherence-selftest.sh new file mode 100755 index 0000000..089e2a3 --- /dev/null +++ b/tests/check-stack-coherence-selftest.sh @@ -0,0 +1,175 @@ +#!/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