Skip to main content

Module dialeto

Module dialeto 

Source
Expand description

defcaixa is spoken by two unrelated declarations. This module makes that a typed fact instead of an anonymous parse failure.

§The finding

Measured 2026-07-31 over the pleme-io org checkout (270 caixa.lisp / *.caixa.lisp files found with rg --no-ignore; a bare rg from the org root returns 0, which is how this stayed invisible), the corpus splits into two schemas that share zero required slots:

  • CaixaDialeto::Pacote — this crate’s crate::Caixa. :nome :versao :kind :deps :bibliotecas :exe :servicos + the supervisor/mesh slots. It declares a tatara-lisp package: the thing feira resolves, builds, links and publishes.
  • CaixaDialeto::Molde:name :kind :ecosystem :package {…} :workflows […] :ci-config {…} :files […]. It declares a repo’s generated surface: which foreign ecosystem (rust / go / python / …), that ecosystem’s own package metadata, the CI shims to emit, and byte-captured file bodies. Read by pleme-doc-gen, never by feira.

:package, :ecosystem, :supports and :profile have no counterpart in crate::Caixa at all — the theory doc’s own D4 note records the same thing: those manifests “are authored against a schema that does not exist in Rust”. They are not two spellings of one declaration. They are two domains that collided on one word, because caixa names a box and both are boxes.

§Why this is not a bug report about broken files

The Molde-dialect files are not malformed. They are correct inputs to their own consumer, and nothing in the shipped feira reads them, so nothing is failing today. The hazard is latent and certain: any new declarative surface written against “a .caixa.lisp is a crate::Caixa” meets a corpus where that is false for the large majority of files, and gets a flat unknown-keyword rejection that reads as “this manifest is broken” rather than “this manifest is not yours”.

§What this module does about it

classify is total: every (defcaixa …) form lands in exactly one CaixaDialeto, including CaixaDialeto::Desconhecido for one that matches neither. crate::Caixa::from_lisp runs it first, so a foreign dialect is [crate::ManifestError::DialetoEstrangeiro] — an error that names the dialect it found and the consumer that speaks it — rather than an unknown-kwarg error indistinguishable from a typo.

Tier-honest: this is parse-time rejection with a named cause, not unrepresentability. A caller that ignores the Err still gets nothing useful; what it can no longer do is mistake “wrong dialect” for “bad file”.

Enums§

CaixaDialeto
Which (defcaixa …) declaration a source speaks.
DialetoError
A source that is not a (defcaixa …) / (defmolde …) form at all.

Functions§

classify
Classify a manifest source without committing to either schema.
classify_form
classify over an already-read form.