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.

Constants§

CAIXA_DIALETO_WIRE_DESCONHECIDO
Canonical PascalCase variant-name byte-string the internal- classification CaixaDialeto::Desconhecido arm surfaces under. Peer of CAIXA_DIALETO_WIRE_PACOTE on the four-arm dialect- classification wire-form axis; see CAIXA_DIALETO_WIRE_PACOTE for the full lift rationale.
CAIXA_DIALETO_WIRE_MOLDE
Canonical PascalCase variant-name byte-string the internal- classification CaixaDialeto::Molde arm surfaces under. Peer of CAIXA_DIALETO_WIRE_PACOTE on the four-arm dialect-classification wire-form axis; see CAIXA_DIALETO_WIRE_PACOTE for the full lift rationale.
CAIXA_DIALETO_WIRE_MOLDE_POSICIONAL
Canonical PascalCase variant-name byte-string the internal- classification CaixaDialeto::MoldePosicional arm surfaces under. Peer of CAIXA_DIALETO_WIRE_PACOTE on the four-arm dialect- classification wire-form axis; see CAIXA_DIALETO_WIRE_PACOTE for the full lift rationale. The full-word (rather than abbreviated) spelling here is load-bearing — a format!("{:?}", …).to_lowercase() round-trip on the source-side Debug derive would collapse the multi-word arm to "moldeposicional" and desynchronize the tag from every peer substrate-side census-facing PascalCase axis.
CAIXA_DIALETO_WIRE_PACOTE
Canonical PascalCase variant-name byte-string the internal- classification CaixaDialeto::Pacote arm surfaces under — the per-arm &'static str payload every consumer that formats the dialect axis as census-facing text (the feira dialeto census counter output line, future feira dialeto --list-dialects / --filter <Pacote|Molde|MoldePosicional|Desconhecido> CLI-side enumerations, a future M4 mesh.pleme.io/v1alpha1/Manifesto CR materializer’s admission-webhook rejection body naming the accepted-dialect set, structured-log tracing::field::Value::Str per-dialect emits on the caixa-build pipeline’s per-file classify path) converges onto verbatim through the paired CaixaDialeto::as_str pub const fn accessor and the sibling CaixaDialeto::from_wire reverse-projection parser. Peer of CAIXA_DIALETO_WIRE_MOLDE / CAIXA_DIALETO_WIRE_MOLDE_POSICIONAL / CAIXA_DIALETO_WIRE_DESCONHECIDO on the four-arm dialect- classification wire-form axis.

Functions§

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