Skip to content

Commit 0e1bbb4

Browse files
committed
docs: de-conflate KRL from Tangle, restate the readiness grade honestly
The three projects are distinct and were built for different purposes. QuandleDB is the knot database. KRL is its resolution language, developed alongside it. Tangle is a separate, general language for knot mathematics that happens to share the subject matter. Documentation in this repository had fused KRL and Tangle into a single compilation pipeline that does not exist. README.md * Removed the claim that KRL "lowers through TangleIR into Tangle-level computation", and the layer table presenting Tangle as KRL's substrate. `TangleIR` appears 0 times in the KRL implementation; the struct definitions the README documented as "the single hardest-designed artifact in the stack" correspond to no code. * Removed `KRLAdapter.jl` as the named canonical implementation. It no longer exists. A short note records that both claims were false, so the correction is legible rather than silent. * Removed the `TanglePL` usage example, which imports packages that do not exist. * Restated what the repository actually holds, and what it does not: there is no parser here, so nothing in this tree can execute a KRL program. * Added the known divergence between this repository's grammar and QuandleDB's — disjoint on core vocabulary, with `|` bound to opposite meanings. * Restructured to a single <h1>. Ddraig SSG certifies pages against a decidable a11y predicate requiring exactly one <h1> and no heading-level skips; the old README had 8, which is why GitHub Pages was failing. Verified by compiling Ddraig locally and running it: old README FAIL (exit 1), new README ok (exit 0). READINESS.md * Grade D -> E. The entire evidence base for D was a parser, AST, lowering pass and 57-test matrix in `KRLAdapter.jl`, which no longer exists, so none of it can be checked. The CRG demotion table gives `D -> E` for "the scope narrows so far that the component barely does anything", which is what happened. * Replaced the evidence section with checks that were executed on 2026-07-21: grammar smoke 20/20, zig build test 3/3, aspect 4/4, e2e 4/4. * Documented the limitations plainly, including that no conformance suite exists, so "conforms to the KRL spec" is not currently a checkable claim. * Removed the duplicated "Path to C"/"Path to B" sections. ASSUMPTIONS.md * Added a Status column. Seven DESIGN assumptions named code in `KRLAdapter.jl`. A DESIGN assumption is defined in this file as "true by construction in our code" — with the code gone there is no construction left to be true by. * A-KR-1.1, 1.2, 2.1, 3.2, 4.1 marked UNANCHORED; A-KR-6.1 and 6.2 marked VOID (both presuppose two implementations, and only one exists). * Verified that no re-anchoring is possible: `sigma`, `cup`, `cap`, `r1_simplify` and any pretty-printer appear 0 times in `quandledb/server/krl/`. The braid generators these assumptions describe are implemented nowhere. * The four MATH assumptions are untouched — they rest on external theorems. TOPOLOGY.md * Was pure RSR-template residue describing the template itself, its dogfood gate, and "500+ RSR-based repositories" downstream. Replaced with KRL's actual topology: the three project boundaries, the ABI/FFI layering, and the spec/implementation seam that no conformance suite currently checks. * States that this repository exposes no Groove service and has no `.well-known/groove/manifest.json`, rather than implying one exists.
1 parent 75bad95 commit 0e1bbb4

4 files changed

Lines changed: 276 additions & 399 deletions

File tree

ASSUMPTIONS.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,38 @@ Cross-references use `[[A-KR-N.M]]` syntax, resolved here.
1717

1818
---
1919

20-
| ID | Class | Statement | Cited by | Where it lives |
21-
|----|-------|-----------|----------|----------------|
22-
| A-KR-1.1 | DESIGN | Every `KRLExpr` AST variant has a matching arm in `KRLAdapter.jl::lower.jl` | KR-1 | `KRLAdapter.jl/src/parser/lower.jl` |
23-
| A-KR-1.2 | DESIGN | `KRLAdapter.jl/src/parser/ast.jl` defines the only AST shapes the parser produces | KR-1 | `KRLAdapter.jl/src/parser/ast.jl` + `parser.jl` |
24-
| A-KR-2.1 | DESIGN | Generator arity is fixed: `sigma i / sigma_inv i : in=i+1, out=i+1`; `cup i : in=0, out=2`; `cap i : in=2, out=0` | KR-2 | KRL grammar definitions; `KRLAdapter.jl/src/operations.jl` |
25-
| A-KR-2.2 | MATH | `arity_in(a \| b) = arity_in(a) + arity_in(b)` and same for output (monoidal-category tensor) | KR-2 | Standard categorical tangle definition |
26-
| A-KR-3.1 | MATH | Reidemeister's theorem: R1+R2+R3 generate isotopy equivalence on tangle diagrams | KR-3 | Reidemeister 1927; Kauffman _Knots and Physics_ ch. 1 |
27-
| A-KR-3.2 | DESIGN | `KRLAdapter.jl::r1_simplify` / `r2_simplify` / `r3_simplify` implement those moves faithfully (R3 is a current GAP — see `quandledb/PROOF-NARRATIVE.md` QD-2) | KR-3 | `KRLAdapter.jl/src/operations.jl` |
28-
| A-KR-4.1 | DESIGN | KRL pretty-printer's bracketing is unambiguous: `;` only inside parens; tensor `\|` has lower precedence than compose `;` inside parens | KR-4 | `KRLAdapter.jl` pretty; `spec/grammar.ebnf` |
29-
| A-KR-6.1 | DESIGN | `KRLAdapter.jl::parse_krl` and `quandledb/server/krl/Parser.jl::parse_any` both target `spec/grammar.ebnf` v0.1.0 | KR-6 | `spec/grammar.ebnf` |
30-
| A-KR-6.2 | DESIGN | Both implementations share the same `Token` enumeration: keyword set, identifier shape, integer/string literal shapes | KR-6 | `KRLAdapter.jl/src/parser/lexer.jl` and `quandledb/server/krl/Lexer.jl` |
31-
| A-KR-8.1 | MATH (partial) | Fundamental-quandle functor is faithful on prime alternating knots; partial in general | KR-8 | Joyce 1982; for partial cases see Eisermann _The number of knot group representations_ |
32-
| A-KR-8.2 | MATH | Two non-isomorphic quandles have distinct canonical presentations (true by definition of "canonical") | KR-8 | Standard algebraic-presentation result |
20+
| ID | Class | Status | Statement | Cited by | Where it lives |
21+
|----|-------|--------|-----------|----------|----------------|
22+
| A-KR-1.1 | DESIGN | **UNANCHORED** | Every `KRLExpr` AST variant has a matching arm in the lowering pass | KR-1 | was `KRLAdapter.jl/src/parser/lower.jl` — gone; no lowering pass exists anywhere |
23+
| A-KR-1.2 | DESIGN | **UNANCHORED** | The AST module defines the only AST shapes the parser produces | KR-1 | was `KRLAdapter.jl/src/parser/ast.jl` — gone. `quandledb/server/krl/Ast.jl` exists but encodes a *different* language (see below) |
24+
| A-KR-2.1 | DESIGN | **UNANCHORED** | Generator arity is fixed: `sigma i / sigma_inv i : in=i+1, out=i+1`; `cup i : in=0, out=2`; `cap i : in=2, out=0` | KR-2 | `spec/grammar.ebnf` only. No implementation defines these generators — `sigma`, `cup` and `cap` appear 0 times in `quandledb/server/krl/` |
25+
| A-KR-2.2 | MATH | holds | `arity_in(a \| b) = arity_in(a) + arity_in(b)` and same for output (monoidal-category tensor) | KR-2 | Standard categorical tangle definition |
26+
| A-KR-3.1 | MATH | holds | Reidemeister's theorem: R1+R2+R3 generate isotopy equivalence on tangle diagrams | KR-3 | Reidemeister 1927; Kauffman _Knots and Physics_ ch. 1 |
27+
| A-KR-3.2 | DESIGN | **UNANCHORED** | `r1_simplify` / `r2_simplify` / `r3_simplify` implement those moves faithfully | KR-3 | was `KRLAdapter.jl/src/operations.jl` — gone. No Reidemeister simplification exists in `quandledb/server/krl/` |
28+
| A-KR-4.1 | DESIGN | **UNANCHORED** | The pretty-printer's bracketing is unambiguous: `;` only inside parens; tensor `\|` has lower precedence than compose `;` inside parens | KR-4 | No pretty-printer exists in any current implementation |
29+
| A-KR-6.1 | DESIGN | **VOID** | Two independent parsers both target `spec/grammar.ebnf` v0.1.0 | KR-6 | Only one parser now exists (`quandledb/server/krl/Parser.jl`), and it targets `quandledb/spec/grammar.ebnf`, not this one |
30+
| A-KR-6.2 | DESIGN | **VOID** | Both implementations share the same `Token` enumeration | KR-6 | Only one lexer now exists (`quandledb/server/krl/Lexer.jl`); there is nothing to share with |
31+
| A-KR-8.1 | MATH (partial) | holds | Fundamental-quandle functor is faithful on prime alternating knots; partial in general | KR-8 | Joyce 1982; for partial cases see Eisermann _The number of knot group representations_ |
32+
| A-KR-8.2 | MATH | holds | Two non-isomorphic quandles have distinct canonical presentations (true by definition of "canonical") | KR-8 | Standard algebraic-presentation result |
33+
34+
### On the UNANCHORED and VOID rows
35+
36+
A DESIGN assumption is defined above as *"true by construction in our code
37+
(must remain true; flag if you change the named code)"*. Seven rows named code
38+
in `KRLAdapter.jl`, which no longer exists, so there is no construction left to
39+
be true by. They are recorded here rather than deleted, because the statements
40+
are still the design intent — but none of them is currently checkable, and none
41+
may be cited as discharged.
42+
43+
**UNANCHORED** means the statement stands as intent but names no live code.
44+
**VOID** means the statement presupposes two implementations, and only one
45+
exists.
46+
47+
Re-anchoring is blocked on the specification itself. `spec/grammar.ebnf` (here)
48+
and `quandledb/spec/grammar.ebnf` are disjoint on core vocabulary: the braid
49+
generators these assumptions describe appear only in the former, and only the
50+
latter is implemented. Until the two are reconciled and a conformance suite
51+
exists, these rows cannot be re-anchored to anything. See `READINESS.md`.
3352

3453
---
3554

@@ -65,3 +84,4 @@ file with the date and reason.
6584
| Date | Change | By |
6685
|------|--------|-----|
6786
| 2026-06-01 | Initial registry, scoped to KRL surface obligations | Audit |
87+
| 2026-07-21 | Added Status column. Marked A-KR-1.1, 1.2, 2.1, 3.2 and 4.1 UNANCHORED and A-KR-6.1, 6.2 VOID: all seven named code in `KRLAdapter.jl`, which no longer exists. Verified that no replacement exists — `sigma`, `cup`, `cap`, `r1_simplify` and any pretty-printer appear 0 times in `quandledb/server/krl/`. The four MATH rows are unaffected. | Audit |

READINESS.md

Lines changed: 82 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -7,130 +7,117 @@ Copyright (c) Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>
77
# Component Readiness — KRL
88

99
**Standard:** [CRG v2.0 STRICT](https://github.com/hyperpolymath/standards/tree/main/component-readiness-grades)
10-
**Current Grade:** D
11-
**Assessed:** 2026-04-12 (promoted ED after iteration 2)
10+
**Current Grade:** E
11+
**Assessed:** 2026-07-21 (demoted DE)
1212
**Assessor:** Jonathan D.A. Jewell
1313

1414
---
1515

16-
## Grade rationale (evidence for D — promoted from E)
16+
## Why the grade moved D → E
1717

18-
Grade D criterion: "Works on some inputs, test matrix present."
18+
The previous assessment (2026-04-12) recorded Grade D on the strength of a
19+
parser, AST, recursive-descent implementation and a 57-test matrix, all of
20+
which lived in `KRLAdapter.jl`. **That repository no longer exists** — it was
21+
discarded, deliberately and not recoverably.
1922

20-
### Evidence
23+
None of the D evidence can be checked. Under the CRG demotion table, `D → E`
24+
applies when *"the scope narrows so far that the component barely does
25+
anything"*, which is precisely what happened: with the adapter gone, nothing in
26+
this repository can parse or execute a KRL program.
2127

22-
- **Parser implemented:** `KRLAdapter.jl/src/parser/` (Julia, Option B decision 2026-04-12)
23-
- `lexer.jl` — full lexer with position tracking, `KRLLexError`
24-
- `ast.jl` — all AST node types (`KRLProgram`, `KRLBinding`, `KRLGenerator`,
25-
`KRLCompose`, `KRLTensor`, `KRLPrefixOp`, `KRLParenExpr`, `KRLIdentifier`,
26-
`KRLQuery`, `KRLFilter`, `KRLIntValue`, `KRLStrValue`, `KRLIdentValue`)
27-
- `parser.jl` — recursive descent, full v0.1.0 grammar
28-
- `lower.jl` — AST → TangleIR lowering with `KRLLowerError`
29-
- **Grammar ambiguity resolved:** `;` as sequential composition only fires
30-
inside parenthesised expressions (`in_parens=true`); at statement level `;`
31-
is the terminator.
32-
- **Test matrix:** `KRLAdapter.jl/test/parser_test.jl` — 5 testsets, 57 tests
33-
- Lexer: keywords, identifiers, integers, strings, operators, punctuation,
34-
comments stripped, position tracking, lex error, unterminated string
35-
- Parser: 20 grammar cases including all generators, let bindings, sequential
36-
compose (with parens), tensor product, prefix ops, queries with `and` chains
37-
- Parser errors: missing `;`, unrecognised token, missing index, zero index
38-
- Example .krl files: all 4 examples in `krl/examples/` parse without error
39-
- Lowering: sigma/sigma_inv → TangleIR, compose, trefoil, mirror, let binding,
40-
unbound identifier error, query → KRLQueryPlan
41-
- **5577 tests pass** (full KRLAdapter.jl suite including parser tests)
42-
43-
### Grammar coverage
44-
45-
The implemented grammar (v0.1.0):
46-
47-
| Construct | Status |
48-
|-----------|--------|
49-
| `let` binding ||
50-
| `sigma`, `sigma_inv`, `cup`, `cap` generators ||
51-
| Sequential composition `(a ; b)` ||
52-
| Tensor product `a \| b` ||
53-
| `close`, `mirror`, `simplify`, `normalise`, `classify` ||
54-
| `find where` queries with `and` ||
55-
| Parenthesised sub-expressions ||
56-
| Identifier references (let-bound) ||
57-
| Line comments `--` ||
58-
| String, integer, identifier filter values ||
59-
60-
### What is NOT yet implemented (documented gaps — D grade)
61-
62-
- **No typechecker.** Port-arity compatibility (e.g. composing a 2-strand
63-
braid with a 3-strand tangle) not verified at parse time.
64-
- **R2 simplification across compose() boundaries.** `simplify_ir` detects
65-
R2 bigons by arc-index overlap, but `compose()` renumbers arcs so adjacent
66-
sigma/sigma_inv pairs are not detected. Tracked in `KRLAdapter.jl` issues.
67-
- **No pretty-printer.** `KRLProgram → string` round-trip not yet implemented.
68-
- **No RESOLVE family.** `classify` is parsed and lowered (identity) but
69-
not dispatched to the query layer.
28+
This is a correction to the record, not a regression in the work. The grade was
29+
restated rather than left standing on evidence nobody can inspect.
7030

7131
---
7232

73-
## Grade E rationale (retained for history)
74-
75-
Grade E criterion: "At least 1 test, documented failures."
76-
77-
### Evidence (iteration 1)
78-
79-
- Grammar drafted: `spec/grammar.ebnf`, `spec/grammar-overview.md`
80-
- 4 examples in `examples/`
81-
- Shell smoke test: `tests/smoke/grammar_smoke.sh` (16 lexical assertions)
33+
## Grade rationale (evidence for E)
8234

83-
---
35+
Grade E criterion: *"Does something slight … there is a kernel of value … at
36+
least one successful test case demonstrating the kernel of functionality, and
37+
documentation of known failures and limitations."*
8438

85-
## Path to C (alpha-stable)
39+
Every item below was executed on 2026-07-21, not inferred from documentation.
8640

87-
After D: typechecker (port-arity + generator index validity), deeper TangleIR
88-
compilation correctness, annotation per-directory, dogfooding by parsing 20+
89-
KRL programs from the knot table. Fix R2 simplification across compose()
90-
boundaries.
41+
### Evidence
9142

92-
## Path to B (beta)
43+
| Artefact | Check | Result |
44+
|---|---|---|
45+
| `spec/grammar.ebnf` | 114-line EBNF, v0.1.0 | present |
46+
| `examples/*.krl` | 4 example programs | present |
47+
| `tests/smoke/grammar_smoke.sh` | lexical conformance of examples to the grammar | 20 checks, all pass |
48+
| `src/interface/ffi/` | `zig build test` | 3/3 pass |
49+
| `src/interface/ffi/` | `zig build` | produces `libkrl.a` |
50+
| `src/interface/Abi/` | `%foreign` declarations | 4, all covered by 11 Zig exports |
51+
| `tests/aspect_tests.sh` | SPDX, banned constructs, ABI/FFI correspondence | 4/4 pass |
52+
| `tests/e2e.sh` | full local pipeline | 4/4 pass, negative-controlled |
53+
54+
The kernel of value is the specification plus a set of examples that provably
55+
conform to it at the lexical level, over a C ABI that compiles and is tested.
56+
57+
### Known failures and limitations
58+
59+
- **No parser, and therefore no execution.** Nothing in this repository can
60+
read a `.krl` program and produce a result. `grammar_smoke.sh` is lexical
61+
only and says so in its own header.
62+
- **The specification is contested.** `spec/grammar.ebnf` here and
63+
`quandledb/spec/grammar.ebnf` both claim to be KRL v0.1.0 and are disjoint on
64+
core vocabulary; `|` is bound to opposite meanings in the two. See README.
65+
- **No conformance suite.** There is no executable artefact that an
66+
implementation can be tested against, so "conforms to the KRL spec" is not
67+
currently a checkable claim.
68+
- **Proof obligations are unmet.** `PROOF-STATUS.md` records 0 of 8 obligations
69+
proven, 2 partial.
70+
- **`rust-ci.yml` gates nothing** — it calls the shared Rust reusable, but this
71+
repository contains no `Cargo.toml`.
9372

94-
After C: 6+ diverse external targets (knot researchers, DSL authors,
95-
topology educators) write KRL programs and report back.
73+
---
9674

97-
## Path to C (alpha-stable)
75+
## Rework needed to reach D
9876

99-
After D: typechecker (port-arity + generator index validity), compiler
100-
to TangleIR via KRLAdapter.jl, deep annotation per-directory, real
101-
dogfooding by parsing 20+ KRL programs representing knots from the
102-
knot table.
77+
Grade D requires a matrix of tested scenarios and at least one test per claimed
78+
capability. Concretely:
10379

104-
## Path to B (beta)
80+
1. **Reconcile the two grammars** into one normative specification, resolving
81+
the `|` collision.
82+
2. **Write an executable conformance suite** — programs plus expected results —
83+
so that spec conformance becomes testable rather than asserted.
84+
3. **Run that suite against `quandledb/server/krl/`**, the actual
85+
implementation (3,035 lines of Julia plus 1,732 lines of tests). One passing
86+
test per claimed capability is the D bar.
10587

106-
After C: 6+ diverse external targets (knot researchers, DSL authors,
107-
topology educators) write KRL programs and report back.
88+
Until at least (1) and (2) exist, this repository specifies a language nobody
89+
can be shown to implement.
10890

10991
---
11092

11193
## Iteration history
11294

113-
### Iteration 0 (X grade — 2026-04-05 initial scaffold)
114-
Templated from rsr-template-repo. Zero KRL-specific content.
95+
### Iteration 0 — X (2026-04-05)
96+
Templated from `rsr-template-repo`. Zero KRL-specific content.
97+
98+
### Iteration 1 — promoted to E (2026-04-05)
99+
- `spec/grammar.ebnf` (v0.1.0 EBNF) and `spec/grammar-overview.md`
100+
- 4 `examples/` programs
101+
- `tests/smoke/grammar_smoke.sh` (16 lexical assertions)
115102

116-
### Iteration 1 (promoted to E — 2026-04-05)
117-
- spec/grammar.ebnf (v0.1.0 EBNF)
118-
- spec/grammar-overview.md
119-
- 4 examples/ programs
120-
- tests/smoke/grammar_smoke.sh (16 lexical assertions, all passing)
103+
### Iteration 2 — promoted to D (2026-04-12) — **evidence since lost**
104+
Decision "Option B — Julia in `KRLAdapter.jl`"; lexer, AST, recursive-descent
105+
parser and lowering implemented there, with 57 dedicated parser tests. The
106+
repository holding all of it has since been discarded, so none of this is
107+
verifiable. Retained here as history, not as evidence.
121108

122-
### Iteration 2 (promoted to D — 2026-04-12)
123-
- Decision: Option B — Julia in KRLAdapter.jl
124-
- Implemented: lexer, AST, recursive-descent parser, lowering (KRLAdapter.jl)
125-
- Grammar ambiguity fixed: `;` as compose only inside parentheses
126-
- 57 dedicated parser tests + all 4 example files parse cleanly
127-
- 5577 total KRLAdapter.jl tests pass
109+
### Iteration 3 — demoted to E (2026-07-21)
110+
- Grade restated against what is actually present and runnable in this tree.
111+
- Zig FFI shim repaired: it had never compiled (`opaque` type with fields).
112+
- Three vacuous or false gates repaired (`aspect_tests.sh`, `e2e.sh`).
113+
- False `TangleIR` lowering claims and dead `KRLAdapter.jl` references removed
114+
from the README.
128115

129116
## Review cycle
130117

131-
Reassess on typechecker implementation or when 20+ knot-table programs
132-
have been parsed successfully.
118+
Reassess when a conformance suite exists and has been run against
119+
`quandledb/server/krl/`.
133120

134121
---
135122

136-
## Run `just crg-badge` to generate the shields.io badge for your README.
123+
Run `just crg-badge` to generate the shields.io badge for the README.

0 commit comments

Comments
 (0)