sweep reconcile: licence canonicalisation, test-suite repair, full Julia+TLC CI gating - #72
Merged
Merged
Conversation
Salvaged from an unpushed local AI sweep (sweep3, Mistral Vibe): MPL-2.0 Exhibit A URL http->https + trailing-whitespace cleanup; CC-BY-SA-4.0 replaced with the canonical creativecommons.org plaintext rendering. The same sweep's LICENSES/AGPL-3.0-or-later.txt is deliberately NOT taken: no file in this repo declares AGPL, and .machine_readable/6a2/ AGENTIC.a2ml policy forbids it (MPL-2.0 canon). The sweep's other payload (mise.toml, CODEOWNERS, GOVERNANCE.md, MAINTAINERS, ARCHITECTURE.md, funding.yml) is dropped too: generic boilerplate crediting a different account and describing directories this repo does not have. Co-Authored-By: Mistral Vibe <vibe@mistral.ai> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Three test-harness defects hid real results: * test_quandle_axioms.jl used '@testset label begin' with a bare variable (x9) — Julia hard-errors on this, so §3 onward (including both Reidemeister suites) never executed at all. * seam_test.jl never imported KRLLexError, erroring out Seam 1 and masking the remaining seams. * Evaluator: the max_rows cap was pushed down into the data provider as an exact limit, so truncation was silent (no warning possible) and, with a stage-free query, the cap never applied at all. Fetch one row past the cap and enforce it after source resolution, so 'row cap applied' warnings are always emitted when data was actually dropped. With the suite actually running, two genuine defects surfaced, both upstream in KnotTheory.jl, both now tracked with @test_broken (flips to a hard error the moment the fix lands, forcing marker removal): * r2_simplify removes a bigon without re-splicing the severed arcs (4 arc labels occur once instead of twice), so the trefoil's 5-colouring count comes out 25 instead of 5. * the alexander/conway/homfly segments of quandle_key are crossing-order sensitive (no canonical unit normalisation): 25/200 seeded BR-5 trials disagree after a crossing shuffle. Verified locally on Julia 1.12.6 with sibling KnotTheory/Skein/ AcceleratorGate checkouts: lexer, parser, sql, seam, query_explain all green; axioms + fuzz green with the two Broken marks reported. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Previously only lexer/parser/sql tests and the Agda proof ran in CI; the mathematical core (quandle axioms, R1/R2 invariance, BR-5 fuzz, EXPLAIN, integration seams) and the TLA+ specs ran nowhere — these are the tests READINESS.md cites as its evidence. * krl-tests: seam_test.jl joins the dependency-free fast step; the sibling KnotTheory.jl / Skein.jl / AcceleratorGate.jl repos are checked out under deps/ and symlinked to the ../../ layout that server/Project.toml [sources] expects; Pkg.instantiate; then the three server suites as separately-named steps. * tlaplus-model-check: TLC (pinned v1.7.4 jar, sha256-verified) checks TypeOK / IsEquivalence / SoundBelow / Confluent on MCEGraph. -deadlock disables deadlock reporting only (the merge sequence terminates by design); invariant violations still exit non-zero. Negative-tested locally: an injected false invariant exits 12. * header comment: repo does have a mix.exs (beam/mix.exs) — the GitLab 'exists:' rules just never match non-root paths. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jul 21, 2026
hyperpolymath
marked this pull request as ready for review
July 21, 2026 12:06
hyperpolymath
added a commit
that referenced
this pull request
Jul 21, 2026
…nicalize_presentation (#76) ## Summary Two follow-ups to #72 (squash-merged as 28505a5 with its first CI run still red): ### 1. CI: the new Julia job needs Julia ≥ 1.11 The `krl-tests` job added in #72 installed Julia **1.10**, but `server/Project.toml` resolves its unregistered sibling deps (`KnotTheory.jl` / `Skein.jl` / `AcceleratorGate.jl`) through a `[sources]` table — a **Pkg 1.11+** feature that 1.10 silently ignores. `Pkg.instantiate` therefore fell back to a registry lookup and died with `expected package KnotTheory [215268c9] to be registered` (observed on #72's CI run). Local verification had run on 1.12.6, which is why it passed there. CI now pins the 1.12 juliaup channel, with a comment explaining the floor. ### 2. `canonicalize_presentation` was not idempotent The single BFS-relabelling pass can change the very ordering it derived labels from, so `blob(canonicalize(p)) ≠ blob(canonicalize(canonicalize(p)))` — **measured at 95/200 seeded BR-5 trials** once the upstream KnotTheory.jl PD-integrity bugs (hyperpolymath/KnotTheory.jl#43) were fixed and the harness could see real diagrams. A fingerprint that changes when you canonicalise twice cannot serve as a semantic identity. Fix: iterate the pass, detect the inevitable cycle of serialised states, and return the **lexicographically minimal state on the cycle** — a fixed point reached from every presentation in its orbit. Where the old pass was already stable (the entire shipped test corpus), output is unchanged, so stored fingerprints remain valid. ## Verification BR-5 fuzz, 200 trials, against KnotTheory.jl with the #43 fixes applied: | Suite | Result | |---|---| | presentation well-formedness | 6752/6752 pass | | descriptor determinism | 800/800 pass | | crossing-order invariance | 600 pass + 1 expected Broken (11/200 `quandle_key` residual → upstream KnotTheory.jl#42) | | canonical-blob round-trip (incl. idempotency) | 600/600 pass — was 95/200 failing before the fix | ## Merge order This PR is independent of KnotTheory.jl#43 (it validates against both old and fixed KnotTheory — the idempotency fix only touches quandledb's own layer). Once #43 merges upstream, the `@test_broken` R2 marker in `test_quandle_axioms.jl` flips to "unexpected pass" by design; a marker-removal PR follows then. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
8 tasks
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.
Summary
Sitrep-driven remediation. Local
mainhad 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
httpsExhibit 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.a2mlforbids 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 ishyperpolymath) 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 beginwith a bare variable ×9 — Julia hard-errors, so §3 onward (including both Reidemeister suites) never executed.seam_test.jl:KRLLexErrornever imported — errored Seam 1, masking the rest.Evaluator.jl: themax_rowscap 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_simplifyremoves 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).quandle_keyare crossing-order sensitive (no canonical ±t^k unit normalisation): 25/200 seeded BR-5 trials disagree after a crossing shuffle, whilepresentation_hashand colouring counts agree.4. CI: the mathematical core is now gated
krl-verification.yml:seam_test.jljoins the dependency-free fast step (pure Julia + stdlib).KnotTheory.jl/Skein.jl/AcceleratorGate.jlare checked out underdeps/and symlinked to theserver/../../../layoutserver/Project.toml [sources]expects;Pkg.instantiate; then axioms / EXPLAIN / BR-5 fuzz as separately-named steps.tlaplus-model-checkjob: TLC (pinned v1.7.4, sha256-verified) checksTypeOK/IsEquivalence/SoundBelow/ConfluentonMCEGraph.-deadlockdisables deadlock reporting only (the merge sequence terminates by design).mix.exs.Verification
startup_failureworkflows (Secret Scanner, Governance, Mirror, Instant Sync, Push email, Pages) are pre-existing sharedhyperpolymath/standardsreusable rot — out of scope here.🤖 Generated with Claude Code