Skip to content

Commit 28505a5

Browse files
hyperpolymathmistral-vibeclaude
authored
sweep reconcile: licence canonicalisation, test-suite repair, full Julia+TLC CI gating (#72)
## Summary Sitrep-driven remediation. Local `main` had drifted 4 ahead / 2 behind origin with three unpushed, unreviewed AI-generated "sweep" commits; the mathematical core of the test suite ran in no CI; and actually running that suite surfaced two genuine upstream bugs plus three test-harness defects. ### 1. Sweep reconciliation (minus the AGPL landmine) Only the licence-text canonicalisation survives review (MPL-2.0 `https` Exhibit A + canonical CC-BY-SA-4.0 plaintext). Deliberately dropped: - `LICENSES/AGPL-3.0-or-later.txt` — no file here declares AGPL and `.machine_readable/6a2/AGENTIC.a2ml` forbids it ("Never use AGPL license (use MPL-2.0)"). - `mise.toml` / `CODEOWNERS` / `funding.yml` / `MAINTAINERS` / `GOVERNANCE.md` / `ARCHITECTURE.md` — generic boilerplate crediting `@metadatastician` (this repo is `hyperpolymath`) and describing a directory layout this repo does not have. ### 2. Test-harness fixes (they were hiding real results) - `test_quandle_axioms.jl`: `@testset label begin` with a bare variable ×9 — Julia hard-errors, so **§3 onward (including both Reidemeister suites) never executed**. - `seam_test.jl`: `KRLLexError` never imported — errored Seam 1, masking the rest. - `Evaluator.jl`: the `max_rows` cap was pushed down as an exact provider limit, making truncation silent and — for stage-free queries — not applied at all. Now fetches one row past the cap and enforces it after source resolution, so the "row cap applied" warning fires whenever data was actually dropped. ### 3. Two genuine upstream KnotTheory.jl defects, tracked honestly Both marked `@test_broken` (reports "Broken"; **flips to a hard error the moment the upstream fix lands**, forcing marker removal): - `r2_simplify` removes a bigon without re-splicing the severed arcs (4 arc labels occur once instead of twice) → trefoil 5-colouring count 25 instead of 5. Repro: `r2_simplify(from_braid_word("s1.S1.s1.s1.s1").pd)`. - The alexander/conway/homfly segments of `quandle_key` are crossing-order sensitive (no canonical ±t^k unit normalisation): 25/200 seeded BR-5 trials disagree after a crossing shuffle, while `presentation_hash` and colouring counts agree. ### 4. CI: the mathematical core is now gated `krl-verification.yml`: - `seam_test.jl` joins the dependency-free fast step (pure Julia + stdlib). - Sibling `KnotTheory.jl` / `Skein.jl` / `AcceleratorGate.jl` are checked out under `deps/` and symlinked to the `server/../../../` layout `server/Project.toml [sources]` expects; `Pkg.instantiate`; then axioms / EXPLAIN / BR-5 fuzz as separately-named steps. - New `tlaplus-model-check` job: TLC (pinned v1.7.4, sha256-verified) checks `TypeOK` / `IsEquivalence` / `SoundBelow` / `Confluent` on `MCEGraph`. `-deadlock` disables deadlock *reporting* only (the merge sequence terminates by design). - Fixed the stale header claim that this repo has no `mix.exs`. ## Verification - All seven Julia suites run locally (Julia 1.12.6, sibling checkouts): lexer / parser / sql / seam / query_explain fully green; axioms + fuzz green with exactly the two documented Broken marks. - TLC: 8 distinct states, all four invariants, exit 0 in 2s. - **Negative-tested both new gate types**: a real test failure exits 1 (observed twice during diagnosis); an injected false TLA+ invariant exits 12. - The six `startup_failure` workflows (Secret Scanner, Governance, Mirror, Instant Sync, Push email, Pages) are pre-existing shared `hyperpolymath/standards` reusable rot — out of scope here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Mistral Vibe <vibe@mistral.ai> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 326d711 commit 28505a5

7 files changed

Lines changed: 497 additions & 132 deletions

File tree

.github/workflows/krl-verification.yml

Lines changed: 90 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
# SPDX-License-Identifier: MPL-2.0
22
# Copyright (c) 2026 Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
33
#
4-
# KRL Verification — runs the self-contained KRL lexer/parser/SQL test suite
5-
# (pure Julia: the `KRL` module pulls in no external packages, so it loads on
6-
# base Julia with no Pkg.instantiate) AND machine-checks the Agda proofs under
7-
# verification/proofs/agda.
4+
# KRL Verification — runs the KRL lexer/parser/SQL/seam test suites (pure
5+
# Julia: the `KRL` module pulls in no external packages, so those load on base
6+
# Julia with no Pkg.instantiate), the full server test suites (quandle axioms /
7+
# EXPLAIN / BR-5 fuzz — these need the sibling KnotTheory.jl / Skein.jl /
8+
# AcceleratorGate.jl checkouts that server/Project.toml [sources] points at),
9+
# machine-checks the Agda proofs under verification/proofs/agda, AND
10+
# model-checks the TLA+ specs under verification/proofs/tlaplus with TLC.
811
#
9-
# Why this exists: `.gitlab-ci.yml` only defines jobs gated on `Cargo.toml` /
10-
# `mix.exs`, neither of which this (Julia + ReScript) repo has — so the Julia
11-
# test suite was never executed by any CI gate. This workflow closes that gap
12-
# so lexer/parser regressions are caught in future.
12+
# Why this exists: `.gitlab-ci.yml` only defines jobs gated on root-level
13+
# `Cargo.toml` / `mix.exs` (this repo has only `beam/mix.exs`, which those
14+
# `exists:` rules never match) — so the Julia test suite was never executed by
15+
# any CI gate. This workflow closes that gap so regressions are caught.
1316

1417
name: KRL Verification
1518

@@ -45,14 +48,63 @@ jobs:
4548
- name: Julia version
4649
run: julia --version
4750

48-
- name: Run KRL test suite
51+
- name: Run KRL test suite (no package deps)
4952
run: |
5053
set -e
5154
# Each test file includes ../KRL.jl (or ../Lexer.jl) relative to its
5255
# own location; a top-level @testset throws on failure → non-zero exit.
56+
# These four are pure Julia + stdlib and run before instantiate so a
57+
# dependency-resolution breakage cannot mask a lexer/parser regression.
5358
julia --color=yes server/krl/test/lexer_test.jl
5459
julia --color=yes server/krl/test/parser_test.jl
5560
julia --color=yes server/krl/test/sql_test.jl
61+
julia --color=yes server/krl/test/seam_test.jl
62+
63+
# server/Project.toml [sources] resolves KnotTheory/Skein/AcceleratorGate
64+
# at server/../../../<name>.jl — i.e. two directories above the repo
65+
# checkout ($GITHUB_WORKSPACE/../../<name>.jl). actions/checkout cannot
66+
# write outside the workspace, so check out under deps/ and symlink.
67+
- name: Checkout KnotTheory.jl
68+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
69+
with:
70+
repository: hyperpolymath/KnotTheory.jl
71+
path: deps/KnotTheory.jl
72+
73+
- name: Checkout Skein.jl
74+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
75+
with:
76+
repository: hyperpolymath/Skein.jl
77+
path: deps/Skein.jl
78+
79+
- name: Checkout AcceleratorGate.jl
80+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
81+
with:
82+
repository: hyperpolymath/AcceleratorGate.jl
83+
path: deps/AcceleratorGate.jl
84+
85+
- name: Link sibling packages where server/Project.toml expects them
86+
run: |
87+
set -euo pipefail
88+
for p in KnotTheory.jl Skein.jl AcceleratorGate.jl; do
89+
ln -sfn "$GITHUB_WORKSPACE/deps/$p" "$GITHUB_WORKSPACE/../../$p"
90+
done
91+
92+
- name: Instantiate server project
93+
run: julia --color=yes --project=server -e 'using Pkg; Pkg.instantiate()'
94+
95+
# Each server suite is its own step so a failure names itself in the UI.
96+
# Two known-broken upstream KnotTheory.jl defects are tracked inside the
97+
# suites with @test_broken (r2_simplify arc re-splicing; polynomial
98+
# order-sensitivity in quandle_key) — @test_broken flips to a hard error
99+
# the moment the upstream fix lands, forcing the marker's removal.
100+
- name: Quandle axioms + Reidemeister invariance
101+
run: julia --color=yes --project=server server/test_quandle_axioms.jl
102+
103+
- name: KRL EXPLAIN (DB-6)
104+
run: julia --color=yes --project=server server/test_query_explain.jl
105+
106+
- name: BR-5 crossing-order fuzz
107+
run: julia --color=yes --project=server server/test_br5_fuzz.jl
56108

57109
agda-proofs:
58110
name: Agda proofs (--safe)
@@ -91,3 +143,32 @@ jobs:
91143
done
92144
if [ "$found" = "0" ]; then echo "No Agda proofs found"; exit 1; fi
93145
echo "PASS: all Agda proofs check under --safe"
146+
147+
tlaplus-model-check:
148+
name: TLA+ model check (TLC)
149+
runs-on: ubuntu-latest
150+
steps:
151+
- name: Checkout
152+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v4
153+
154+
# The ubuntu-latest image ships a Temurin JDK; TLC needs Java 11+.
155+
- name: Fetch TLA+ tools (pinned release, checksum-verified)
156+
run: |
157+
set -euo pipefail
158+
curl -fsSL -o tla2tools.jar \
159+
https://github.com/tlaplus/tlaplus/releases/download/v1.7.4/tla2tools.jar
160+
echo "936a262061c914694dfd669a543be24573c45d5aa0ff20a8b96b23d01e050e88 tla2tools.jar" \
161+
| sha256sum -c -
162+
163+
- name: Model-check MCEGraph (TypeOK / IsEquivalence / SoundBelow / Confluent)
164+
run: |
165+
set -euo pipefail
166+
test -f verification/proofs/tlaplus/MCEGraph.tla || { echo "::error::MCEGraph.tla missing — nothing was model-checked"; exit 1; }
167+
test -f verification/proofs/tlaplus/MCEGraph.cfg || { echo "::error::MCEGraph.cfg missing — nothing was model-checked"; exit 1; }
168+
# -deadlock disables deadlock REPORTING only (the merge sequence
169+
# legitimately terminates); every INVARIANT in the .cfg is still
170+
# checked and any violation exits non-zero.
171+
( cd verification/proofs/tlaplus && \
172+
java -XX:+UseParallelGC -cp "$GITHUB_WORKSPACE/tla2tools.jar" \
173+
tlc2.TLC -deadlock -config MCEGraph.cfg MCEGraph.tla )
174+
echo "PASS: TLC checked all invariants in MCEGraph.cfg"

0 commit comments

Comments
 (0)