Proposed — parser proven (PR #688), layered architecture emerging
ATS has the semantics of a language but no formal grammar. Query, creation, and subscription are three separate code paths with ad-hoc string processing. The current Rust parser in crates/qntx-core is a hand-rolled state machine. The classifier and expander are structural transformations. These are language problems.
Separately, database operations are migrating from Go to Rust (PR #691+). Rust is not being replaced — it is expanding into the engine layer.
kern (OCaml) is the innermost layer — parser, classifier, expander. Rust is the engine — database, enforcement, query execution. Go is the shell — HTTP, plugins, UI.
Parser via menhir, AST as algebraic types, classifier and expander as pattern matches. Build with dune.
kern currently runs as a gRPC plugin (same model as loom). The gRPC path works but adds latency for what should be a function call. The end state depends on how kern integrates with the Rust engine layer — see "Database ownership" below.
See ADR-012.
Fuzzy matching (qntxwasm build tag, Rust WASM module) is deprecated. Semantic search supersedes it. Once fuzzy is removed, the Rust WASM dependency drops entirely — kern becomes the only parser and qntxwasm is no longer needed as a build tag. If fuzzy matching is ever needed again, it can be a plugin.
Dual build tags coexist: kern for parsing, qntxwasm for the fuzzy matcher (until deprecated). kern wins via build tag priority — dispatch_kern.go is //go:build kern, dispatch_qntxwasm.go is //go:build qntxwasm && !kern. Once fuzzy is removed, qntxwasm drops from the tag list entirely.
kern only parses — it returns a JSON AST and the Go side does everything else (temporal resolution, case normalization, query execution). The "core engine" isn't in kern yet. Only the grammar is.
.messages files for exhaustive error reporting — not wired up.protoc --ocaml_out is run by hand. There's no Makefile target or Nix derivation for regenerating the OCaml proto when domain.proto changes. Loom has the same problem — both have 3000-line checked-in generated files.am.toml. It should always be loaded. The plugin system doesn't have a concept of required/system plugins yet.The hard question. To move beyond parsing into classification and expansion, kern needs to read and write attestations. Three paths: