Repository navigation
corpus: structural cross-prover identity keys + 256-dim structural embedder - #449
Conversation
Verification vocabulary was absent from every cross-prover dictionary. _wordnet_math (81 rows) and _conceptnet_seed (53 rows) cover undergraduate and competition pure mathematics, the same shape as the ProofNet and MiniF2F adapters; 21 of 23 probe concepts (zero_extend, wrapping_add, slice_disjoint, dioid, noninterference, ...) had no entry at all. * data/synonyms/_verification_systems.toml: 657 new rows in 12 families -- bitvectors, memory layout/ABI, ownership and slicing, separation and region framing, contracts and proof obligations, termination measures, refinement/semantics, resource algebras, information flow/epistemic, concurrency, toolchains, and estate layering. * estate policy encoded in the vocabulary: Idris2 ABIs, Zig APIs and FFIs, SNIF (not bare NIF) boundaries, Rust/Creusot, Julia, Chapel; no Python. * _msc2020.toml: 87 -> 177 codes. 68Qxx (26) and 68Nxx (10) are now complete, 03B/03C/03D/03F completed, 68M/68P/68T/68V/68W and 06B35 added. FIFTEEN pre-existing rows carried MSC2010 or transferred wording (03B15, 68T15 are MSC2010-only; all four 68V rows were mislabelled; 03D03, 03F50, 06A11, 18N10 were wrong) and are repaired with notes. * wiring: CrossProverDicts::verification_systems (Rust) and SaturationSynonyms.load_verification_systems (Julia), both exported and documented; state/meta manifests and prose counts updated. * docs/reports/2026-10-22-vocabulary-recon.adoc: the recon, including the finding that the dictionaries are loaded but have no ranking consumer yet, and that '250 codes in 68Q/68N/03B70' is impossible (those sections define 37 codes in total). Validated with a local mirror of schema.ncl (Nickel is not installed in this sandbox): 19 tables, 1357 rows, 0 failures, all reject fixtures still reject. CI must still run just lexicon-check. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…nd idris2 - CrossProverDicts::tables()/len()/is_empty(); SynonymTable::merge_cross_prover_dicts() - corpus crossquery now searches the 5 cross-prover dictionaries (--provers-only to opt out) and matches a canonical name directly, so 'crossquery 68Q60' works - run_training.jl preloads all 5 dictionaries; add SaturationSynonyms.load_disciplines - _msc2020.toml: 19 rows repaired against zbMATH, 4 codes added (18G35/18M05/18N45/18N60); 181 rows - idris2.toml 6 -> 26 rows: ABI-layer vocabulary (Fin/Vect/So/LTE/Bits/foreign_import/...) - tests/lexicon_v2_test.rs: assert the verification dictionary is non-empty, classes resolve, merge reaches them, and the estate layer vocabulary exists - docs: drop the invented with_msc2020()/with_wordnet()/with_conceptnet() API from the wikis; five-dictionary wording everywhere; CHANGELOG + recon report updated Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Three adapters for the languages the estate's own stack is written in, rather than for another public corpus. - src/rust/corpus/spark_ada.rs: *.ads/*.adb; packages, with/use clauses, Pre/Post/Contract_Cases/Global/Depends aspects, and the GNATprove escape hatches. pragma Assume (and the old --# assume form) is reported as a postulate; sparklib's Ghost Lemma_* convention is tagged sparklib:lemma. Spec and body are paired across files into one entry. - src/rust/corpus/creusot.rs: *.rs; folds #[requires]/#[ensures]/#[invariant] /#[variant]/#[logic]/#[predicate]/#[cfg(creusot)] into the statement and tags pearlite!/proof_assert!/unsafe/transmute/extern "C". #[trusted] is a postulate. #[test] items excluded. - src/rust/corpus/profile.rs + data/corpus-profiles/hyperpolymath-estate.toml: the hyperpolymath_estate profile. Every repo's src/abi Idris2 tree via a "*" rule, plus echo/epistemic/secret/tropical/choreographic-types (Agda). Sub-trees indexed by their own adapters, then merged with repo:: prefixes and repo:/layer: tags. - Corpus::reindex_links() split out of reindex() so a merge keeps the sub-adapters' discipline tags. - crates/echidna-core-creusot/src/estate_layers.rs: Creusot-annotated layer classification (PO-L1..L5) - stated, not proved, mirrored by tests. - tests/corpus_estate_adapters.rs + fixtures for both adapters. - _verification_systems.toml +8 rows for the syntax the adapters detect. - 17 -> 20 adapters across README/EXPLAINME/wikis/Justfile/capnp/a2ml. - Backlog re-ordered: iris + tlaps to the top, alphaproof + naproche to the bottom, with the reasons recorded next to each. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
The Zig/Julia/Chapel/BEAM boundaries have no corpus adapter, so returning a name for them made the round-trip test assert a mapping that does not exist (and failed CI). Those layers now return None. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…ent) Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…assertion Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…heckout Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
… behavior and errors
They served their purpose: they reported the real compiler output and committed the cargo fmt result. They also tripped the Hypatia baseline gate (external POSTs from a workflow), so they must not stay. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…l embedder E6 cross_prover_identity_key was the SHA-256 of a declaration's name tail, so two provers joined only when their authors happened to pick the same local name (`+-comm` vs `Nat.add_comm` vs `bvadd_comm`). It is now the SHA-256 of the *canonical shape of the type*: variables renamed v0,v1,..., module paths, operator spellings and binder keywords erased, sorts canonicalised (scheme dk-shape-v1). No dictionary is consulted. Some provers cannot state the same shape -- Isabelle elides binders, Why3 uses int where the others use nat -- so a second tier is emitted: cross_prover_skeleton_key (binders and sorts erased). Consumers join on tier 1 then tier 2; identity_scheme travels with every key and canonical_type keeps the rendered shape for debugging. E7 VectorModality moves from the 32-dim raw-text HashEmbedder to a 256-dim structural embedder: 1-3-grams of the canonical atom stream, L2-normalised, model echidna-corpus-structural-v2. corpus near canonicalises its query, so an SMT-LIB-shaped query retrieves Coq-shaped entries. HashEmbedder stays as compute_embeddings_legacy for GNN FEATURE_DIM parity and old octads. Also: echidna corpus identity <pattern> exposes the grouping; GraphPayload and QueryResultEntry carry the structural key; capnp gains crossProverSkeletonKey/identityScheme and documents embedderDim; docs, ADR, CHANGELOG, STATE and the wiki source pages say what is actually true. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Pushes made with GITHUB_TOKEN do not trigger workflows, so the style commit that the temporary ZZ fmt job pushed carries no CI signal. This empty commit exists only to run the normal gates against that tree. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Formatting is applied; the branch no longer needs a workflow that commits cargo fmt output, and the file should not land on main. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 55
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Add Carrot credits or activate Agent usage billing to use Autofix |
|
Open the task to resolve the delivery issue or retry. |
Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com>
💡 Codex Reviewechidna/src/rust/corpus/profile.rs Line 122 in c6a239b Each Agda rule includes both echidna/src/rust/corpus/canonical.rs Lines 1051 to 1054 in c6a239b For statements containing unrecognized short lowercase constants, this heuristic renames the constants as variables even though they are not binders. For example, echidna/src/rust/corpus/creusot.rs Lines 734 to 738 in c6a239b Ordinary Creusot contracts now add echidna/src/rust/corpus/creusot.rs Lines 599 to 601 in c6a239b For any Lines 1656 to 1657 in c6a239b When the index is produced by echidna/src/rust/corpus/query.rs Lines 230 to 239 in c6a239b
Lines 1652 to 1655 in c6a239b Groups are always keyed by the primary structural key, so declarations that are only supposed to match through the advertised skeleton fallback—such as Isabelle with elided binders or Why3 with a different numeric sort—remain in separate groups. The echidna/src/rust/corpus/profile.rs Lines 316 to 318 in c6a239b A sub-corpus module path is relative to the adapter base, but merging only prefixes the module name and leaves that path unchanged. For example, an ABI ingested from echidna/src/rust/corpus/creusot.rs Lines 104 to 108 in c6a239b The Creusot parser indexes functions inside traits and echidna/crates/echidna-core-creusot/src/estate_layers.rs Lines 150 to 152 in c6a239b
echidna/data/synonyms/_verification_systems.toml Lines 1042 to 1044 in c6a239b The new dictionary declares echidna/src/rust/corpus/spark_ada.rs Lines 412 to 416 in c6a239b For the standard package-level form echidna/src/rust/corpus/canonical.rs Lines 235 to 239 in c6a239b The declaration-header recognizer includes the word echidna/src/rust/corpus/octad.rs Lines 260 to 263 in c6a239b
echidna/src/rust/corpus/creusot.rs Lines 764 to 771 in c6a239b Hazards are searched in the original statement/body using unrestricted substring checks, even though the parser already has a comment- and string-cleaned source. A safe function containing a comment such as ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
`super::canonical` inside `mod tests` resolves to `corpus::octad::canonical`, which does not exist, so `cargo check --all-targets` failed on main after #449 merged. The module path is `crate::corpus::canonical`. Also drops the temporary diagnostics workflow. Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
# Conflicts: # src/rust/corpus/octad.rs Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
…#450) Follow-up to #449, which merged with a red `cargo check`. ## The bug `src/rust/corpus/octad.rs`, in `mod tests`: ``` error[E0433]: cannot find `canonical` in `super` --> src/rust/corpus/octad.rs:758:54 | assert_eq!(coq.graph.identity_scheme, super::canonical::SCHEME); ``` Inside `mod tests`, `super` is `corpus::octad`, not `corpus`. The path should be `crate::corpus::canonical::SCHEME`. Every other `super::canonical` in the tree is at module scope (`corpus::embed`, `corpus::octad`), where `super` *is* `corpus`, so those are correct and unchanged. This is the only compile error `cargo check --locked --workspace --all-targets` reported; `Cargo test` and `llvm-cov line coverage` were skipped/failing behind it, so this PR is also the first run that actually exercises the new tests. ## Also * Removes the temporary `zz-diag` workflow (this branch is prepared without a local Rust toolchain, so it used a throwaway job to get compiler output). * No Python, no new dependencies. ## Why it slipped #449 was prepared without a local `cargo`; the Rust was written and reviewed by hand and the gate that would have caught a one-line module-path error did not run before the merge. Nothing here changes behaviour — the structural identity keys and the 256-dim embedder are as described in #449. --------- Signed-off-by: Jonathan D.A. Jewell <6759885+hyperpolymath@users.noreply.github.com> Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: echidna fmt bot <fmt-bot@users.noreply.github.com> Co-authored-by: echidna-fmt-bot <echidna-fmt-bot@users.noreply.github.com>
What this does
Two things: it lands the fixes that were still sitting on the branch after #448
merged, and it replaces the corpus's name-based cross-prover identity with a
structural one.
1. Corpus identity is now the shape of the type, not the name
E6 GraphModality.cross_prover_identity_keyused to be the SHA-256 of adeclaration's name tail, so
+-comm(Agda),Nat.add_comm(Coq/Lean),addComm(Idris 2) andbvadd_comm(SMT-LIB) shared nothing. The newsrc/rust/corpus/canonical.rsnormalises the statement into a nameless prefixterm — variables renamed
v0, v1, …, module paths dropped, operatorspellings and binder keywords canonicalised, sorts mapped to
NAT/INT/TYPE, Isabelle ascriptions unwrapped, Dedukti's explicit sortargument dropped — and hashes it (scheme
dk-shape-v1). No dictionary isconsulted on the identity path.
Because some provers cannot state the same shape (Isabelle writes
lemma add_comm: "(x::nat) + y = y + x"with no binders; Why3 usesintwhere the others use
nat), a second tier is emitted:cross_prover_identity_keycross_prover_skeleton_keyidentity_schemedk-shape-v1)canonical_typecross_prover_idValidated against the fixtures before porting: Agda, Coq, Lean 4, Idris 2,
SMT-LIB and Dedukti agree on
(PI [NAT NAT] (EQ (ADD v0 v1) (ADD v1 v0)))foradd_comm; Isabelle and Why3 join on(EQ (ADD v0 v1) (ADD v1 v0));add_zeroagrees across four provers; associativity and commutativity stay distinct.
The unit tests pin all of it. Equational rewriting is deliberately not
applied —
x + yandy + xare different keys.2. The Vector octad is 256-dim and structural
StructuralEmbedderhashes 1–3-grams of the canonical atom stream into 256buckets (model
echidna-corpus-structural-v2), replacing the 32-dim raw-textHashEmbedderas the default.corpus nearcanonicalises the query too, so aquery written in SMT-LIB syntax retrieves entries written in Coq syntax
(tested).
HashEmbedderstays asCorpus::compute_embeddings_legacyfor GNNFEATURE_DIMparity and for replaying older octads; the capnpembedder/embedder_dimfields carry both and consumers are told to check them.New CLI:
echidna corpus identity <pattern> [--skeleton] [--cross-only].3. Carried fixes from earlier in the branch
estate_layers.rs::adapter_of_layeronly names layers that actually have anadapter (
creusot-coreis notspark_ada).SPARK_Moderather than the bareSPARKtheparser emits; the profile/creusot adapter tests no longer depend on the
checkout layout.
cargo fmtapplied (bot commit — this branch is prepared without a localRust toolchain, so formatting is done in CI).
4. Honesty pass over docs, ADR, wiki
docs/CORPUS.adoc,docs/architecture/VERISIM-ER-SCHEMA.adoc,docs/handover/STATE.adoc,CLAUDE.md,CHANGELOG.adoc, the 2026-04-28 ADR(annotated as superseded in part) and the wiki source pages
(
docs/wikis/{Home,Architecture}.md) now describe what the code actuallydoes — 20 adapters, 256-dim structural embeddings, two-tier identity. New ADR:
docs/decisions/2026-10-22-structural-cross-prover-identity.adoc.Notes for the reviewer
DeclGraph,GraphPayloadandQueryResultEntrygained fields; all are#[serde(default)], so existing octad JSONL still loads.old octads.
.github/workflows/zz-fmt.ymlis temporary scaffolding for this branch(no local toolchain) and is removed in a follow-up commit; it has no
uses:steps because newly added workflows in this repo fail at startup when they
reference an action.
the Rust module is the artefact of record.