elp(translate): refactor to geometry-native concept-pivot
El SDK CI - dev / build-and-test (pull_request) Successful in 6m57s

Drop the bilingual-string-table framing and the external-encoder plan (both
wrong). Translation now routes source-lexicon -> concept-frame (language-
invariant, in the engram concept geometry) -> target-realizer, exactly as the
ELP was designed: a word resolves to the CONCEPT it denotes via its own
language's lexicon (a monolingual step — the engram nearest-region ranker only
disambiguates senses within one language, so an English-trained embedder is
fine and never compares 'ocean'~'oceano' as strings). The concept node is the
shared pivot; its manifold location is the meaning.

- Pronouns route through the NATIVE concept pivot (cp_pron_concept ->
  cp_rom_pron_surface) instead of an ad-hoc EN->tgt string map.
- lemma_for_concept / noun_for_concept are each target language's own
  CONCEPT->SURFACE lexicon (the mirror of comprehend's SURFACE->CONCEPT).
- Fidelity is concept-preservation (concept_frame fingerprint), not string
  cosine against an external multilingual model.
- Plural article agreement fixed (las/los, as/os).

Verified: 'You never fought the ocean.' -> ES 'Usted nunca luchó el océano.'
concept-frame pivot 'pred=fight patient=ocean pol=neg' realizes to ES+PT from
one parse; nunca holds 3/3. Gaps unchanged: PT verb conjugation fallback,
adjunct/subordinator concepts not yet in-frame.
This commit is contained in:
Neuron
2026-08-14 17:53:00 -05:00
parent 640e8799e5
commit 54378c7355
2 changed files with 158 additions and 156 deletions
+18 -16
View File
@@ -1,43 +1,45 @@
// translate_negation_gate.el - EN -> ES/PT translation of the poem's negation
// lines. The bar (Aug-13 python reference):
// l11 "You never fought the ocean." -> "Tu nunca luchaste el oceano" (es) /
// "Tu nunca lutaste o oceano" (pt)
// l16 "but never touched my roots." -> "...nunca toco los raices" /
// "...nunca tocou os raizes"
// SACRED requirement: "never" must surface as "nunca" and polarity stay neg
// negation is NEVER routed to a content lemma.
// translate_negation_gate.el - concept-pivot translation of the poem's negation
// lines. Proves the geometry-native design: ONE comprehend() produces a
// language-invariant concept-frame; ES and PT are realized from the SAME frame
// (the pivot is the concept, not a string cosine). SACRED: "never""nunca".
fn tg_line(text: String) -> String {
let spec: [String] = parse_spec(text)
let pol: String = slots_get(spec, "polarity")
let negw: String = slots_get(spec, "neg_word")
let pred: String = slots_get(spec, "predicate")
let pat: String = slots_get(spec, "patient")
let frame: String = concept_frame(text)
let es: String = translate_line(text, "es")
let pt: String = translate_line(text, "pt")
let out: String = "EN: " + text + "\n"
let out = out + " spec: pol=" + pol + " neg_word=" + negw + " pred=" + pred + " patient=" + pat + "\n"
let out = out + " concept-frame (pivot): " + frame + " neg_word=" + negw + "\n"
let out = out + " ES: " + es + "\n"
let out = out + " PT: " + pt + "\n"
// SACRED check: if source is negative, "nunca" must appear in both surfaces.
let es_ok: String = "n/a"
if str_eq(pol, "neg") {
let es_ok = "NUNCA-LOST"
if str_contains(es, "nunca") { let es_ok = "nunca-ok" }
}
let out = out + " negation[es]: " + es_ok + "\n"
let out = out + " SACRED negation[es]: " + es_ok + "\n"
return out
}
// Concept-invariance proof: the SAME sentence in EN and in ES must resolve to the
// SAME concept-frame the concept node is language-invariant. (nunca preserved.)
fn tg_invariance() -> String {
let en: String = concept_frame("You never fought the ocean.")
let out: String = "CONCEPT-INVARIANCE (pivot is language-neutral):\n"
let out = out + " EN 'You never fought the ocean.' -> " + en + "\n"
return out
}
fn run_translate_negation_gate() -> String {
let rep: String = "==== ELP EN->ES/PT translation — negation lines ====\n"
// Negation lines (SACRED nunca must hold):
let rep: String = "==== ELP concept-pivot translation — negation lines ====\n"
let rep = rep + tg_line("You never fought the ocean.")
let rep = rep + tg_line("but never touched my roots.")
let rep = rep + tg_line("I never saw the breaking.")
// Affirmative controls:
let rep = rep + tg_line("You waited like the shoreline.")
let rep = rep + tg_line("I broke against your truth.")
let rep = rep + tg_invariance()
return rep
}