core/docs/adr/ADR-0005-language-pack-contract.md
Shay cbfc8ccbf7 feat(evals,tests,docs,adr): FA-1 ruled — cross-language holonomy does not discriminate meaning (NO-GO)
The CORE-Logos "Crown Proof" — ADR-0015's claim that cross-language holonomy
closure is THE validation gate of meaning — was measured against a criterion
registered before the run, and refused.

  G1  separation, all negatives      AUC 0.557   (chance 0.500, bar 0.80)   FAIL
  G2  hardest class, cross-pairing   AUC 0.664   (bar 0.75)                 FAIL
  G3  word-order sensitivity         0.644       (bar 0.90)                 FAIL
  G4  no collapse re-entry           0 lost      (bar: 0)                   PASS

G4 is the half that succeeded: the repairs work. The claim is what failed --
which is the outcome the registration called "worth as much as a GO", because
it retires the largest piece of unearned design in the system.

Both preconditions had to be BUILT before the question could be asked at all,
which is why the 2026-06-14 negative constrained nothing: the shipped compiler
collapsed 37-53 coordinates, and holonomy_encode never closed. Measured on the
repaired ground with a genuine loop, over 1,016 aligned pairs and 58,375
mechanically-generated negatives in three classes, nothing hand-picked.

Diagnosis, not just a number: the encoding reacts more strongly to REORDERING a
clause (median deviation 41.2) than to CHANGING WHAT IT IS ABOUT (32.2). It
measures path shape, not content -- and that follows from the algebra, since
permutation acts on an ordered product through non-commutativity, a first-order
effect, while substituting one of three factors perturbs it only through that
factor. The negative classes do order correctly by meaning-distance
(aligned 27.2 < lexical 32.2 < order 41.2 < cross-pair 53.2), so the geometry is
weak signal rather than noise -- a correlation where the design asked for a gate.

Consequences, all landed here:

  * ADR-0005 and ADR-0015 AMENDED to record the refusal. The three-language
    architecture, the pack contract, morphology-as-structure and Hebrew root
    folding into geometry all survive untouched; only the claim that alignment
    or closure VALIDATES meaning is retired.
  * tests/test_fa1_gate_verdict.py is the tripwire: if a future encoding makes
    the gate real, it fails, and the amendment is withdrawn in the same commit
    that replaces it with a proof. Two sabotages observed red.
  * allow_cross_language_recall RULED by measurement (work-order item 3): it
    gates vault-recall depth over field states, has no language argument and no
    cross-language path, and reaches only walk_surface, which runtime_contracts
    declares telemetry. Stays ON, reclassified DEPLOYMENT, flip condition
    recorded. G-25's own claim that it was "the pillar's own switch" is
    CORRECTED -- that read the flag's name instead of its call graph, which is
    the error the audit exists to find.
  * A sixth defect found while building the harness: en_collapse_anchors_v1
    declares role "collapse_anchor", which is not a LanguageRole member, so
    load_pack() raises. It is registered in the resolver, consumed by opening
    lexicon.jsonl on a raw path that bypasses the loader, and is the target of
    all 24 alignment edges that still resolve to nothing. The enum's own comment
    records the identical failure once before (ADR-0097, domain_seed).

The repairs cross to the keel on their own merit regardless of the verdict:
geodesic blending removes every coordinate collision, and mount-wide edge
resolution connects 39 of the 63 dead edges. The collapse was damaging English's
own vocabulary; seeing that required no theory of meaning.

FA-1 is CLOSED: all four work-order items discharged, L2 verdict recorded as
defective-but-repairable with its central design claim retired.

[Verification]: uv run core test --suite smoke -q -> 786 passed in 239.45s, EXIT=0
                (+4 tests, +15s vs the prior 782/224s -- the FA-1 pin's stated cost).
                Doc-parsing pins re-run after the ADR and register amendments:
                test_adr_status_governance + test_adr_index -> 321 passed;
                test_flag_register -> 6 passed.
2026-07-28 14:37:07 -07:00

185 lines
7.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ADR-0005: Language Pack Contract
**Date:** 2026-05-12
**Status:** Accepted
## Context
CORE operates on three foundational languages: English (default articulation
base), Hebrew (depth pack 1), and Koine Greek (depth pack 2). These are not
equivalent choices from a menu — they are the three specifically chosen
because of the range of depth they bring and because of the theological and
linguistic insight encoded in John 1:12, where the universe itself was spoken
into existence and John articulated that reality in both Hebrew and Greek.
This is why and how CORE finds its truth and power in design and
communication — being primary, being a core.
A loose plugin API is insufficient for these packs. The system needs a strict
contract that specifies what a language pack must provide, what invariants it
must satisfy, and what gates it must pass before activation.
## Decision
Adopt a **Language Pack Contract** as the canonical template for all CORE
language packs.
Each pack is a deterministic, versioned manifold bundle that defines:
- identity and normalization policy
- lexical inventory (lemma-first, not token-first)
- morphology
- syntax and frame templates
- semantic lift rules into CORE-native pressure
- readback rules from field state to surface language
- validation probes and alignment gates
The three canonical packs are:
| ID | Name | Role |
|-----|--------------------|-----------------------------|
| `en`| English | Default articulation base |
| `he`| Hebrew | Depth language pack 1 |
| `el`| Koine Greek | Depth language pack 2 |
Each pack must implement the same top-level contract and must target shared
field primitives. No pack may define private or opaque semantics that bypass
the shared field.
## Required Structure
```
packs/
common/
contracts/
language-pack.md
schema/
lemma.schema.json
morphology.schema.json
frame.schema.json
sense.schema.json
probe.schema.json
anchors/
trilingual-anchor-template.json
en/
pack.toml
orthography.yaml
lemmas.jsonl
morphology.jsonl
frames.jsonl
senses.jsonl
lift_rules.py
readback_rules.py
validators.py
probes/
corpora/
manifest.yaml
he/ (same structure)
el/ (same structure)
```
## Validation Gates
A pack is not considered active because files exist. A pack becomes active
only when it passes the following gates in order:
1. **Schema gate** — all data files validate against their JSON schemas
2. **Lexical gate** — lemma inventory is non-empty and internally consistent
3. **Morphology gate** — all surface forms trace to a known lemma
4. **Lift gate** — lift rules produce valid `CandidateGeometricPressure` for seed inputs
5. **Readback gate** — readback rules produce grammatical surface from seed field state
6. **Determinism gate** — all D0/D1 paths produce identical output on repeated runs
7. **Alignment gate** — pack publishes anchor records verifiable against trilingual template
8. **Coverage gate** — probe set covers minimum lexical and morphological surface
> **Amendment · 2026-07-28 — what gate 7 actually verified, measured.** The alignment gate
> presupposes that publishing anchor records establishes cross-language alignment. Measured at
> `472fc0a8`, the mechanism behind those records **destroyed** what it claimed to align:
> `packs.compiler._blend_feature_versors` ignored its strength argument and returned the target
> verbatim, so an "aligned" Hebrew token was *overwritten* by its Greek or English partner
> rather than drawn toward it, and mounting the depth packs removed 37 distinct coordinates
> (`docs/analysis/logos-substrate-collapse-2026-07-28.md`). The eight gates are also not
> enforced as a sequence anywhere in the loader — `gate_engaged` is a single manifest boolean
> consulted by `sensorium/registry.py`, and the seven other gates have no code that runs them.
>
> Two things follow, and only two. **(a)** Alignment must be *interpolation on the versor
> group*, never replacement — `algebra/rotor.py` has shipped that operation since the algebra
> layer's first commit. **(b)** Gate 7's stronger sibling — that alignment establishes
> resonance strong enough to *validate meaning* (ADR-0015's Crown Proof) — was measured and
> refused: `docs/analysis/fa1-holonomy-gate-verdict-2026-07-28.md`. The alignment data itself
> stands: 24 aligned concepts across three languages, and Hebrew root folding into geometry is
> unaffected. What is retired is the claim that alignment, by existing, proves anything.
## Design Rules
### 1. Lemma-first
Tokens are surface realizations. Lemmas are the stable lexical unit. The
ingest and field-state layers operate on lemmas, not tokens.
### 2. Deterministic normalization
Normalization must be deterministic and script-aware. Unicode normal form NFC
is the minimum. Script-specific rules (right-to-left, vowel pointing, accent
diacritics) are defined per pack in `orthography.yaml`.
### 3. Native morphology
Morphology is part of meaning-bearing structure, not optional metadata.
Hebrew stems (Qal, Niphal, Piel…) and Koine Greek aspects (aorist, perfect…)
are semantically load-bearing. Morphology is a first-class pack surface.
### 4. Shared field target
Semantic lift must target shared CORE field primitives. No pack-private
semantic space is permitted. What cannot be expressed in shared primitives
must be proposed as a new shared primitive, not hidden inside a pack.
### 5. Readback is owned locally
Each pack owns its articulation rules and ambiguity management. Readback is
not a global postprocessor — it is part of the pack contract.
### 6. Alignment is explicit
Packs must publish anchor records that are verifiable against the
trilingual anchor template. Cross-language coherence is a probe surface,
not an emergent hope.
## Runtime Boundary Honesty
Files that define a semantic boundary not yet fully specified must raise
`NotImplementedError` at exactly that boundary. This is not fake code — it
is an honest contract: the structure is real, the interface is real, the
unimplemented edge is visible and loud. Nothing is silently skipped.
## Rationale
This serves the three engineering pillars:
- **Mechanical Sympathy** — a small, explicit, cheap-to-validate pack surface
that integrates directly with the field-state model.
- **Semantic Rigor** — all packs target shared field primitives instead of
inventing language-private meanings. Exactness is non-negotiable.
- **Third Door** — standard token-plugin patterns were considered and
rejected. This contract is designed for CORE's geometry specifically.
## Consequences
**Easier:**
- Every future language pack follows the same geometry and QA path.
- English, Hebrew, and Koine Greek can be aligned by shared anchors and
deterministic probes.
- Gate failures are explicit and traceable.
**Harder:**
- Pack creation requires real morphology, lift, and readback logic.
- Shortcuts that bypass field primitives are structurally forbidden.
**Forbidden:**
- Opaque embedding tables.
- Black-box semantics.
- Pack-local meaning systems that bypass the shared field.
## Alternatives Considered
- **Loose plugin API:** Rejected. Too weak to enforce invariants.
- **Dictionary-only packs:** Rejected. Lexicons alone do not articulate or lift.
- **Tokenizer-first packs:** Rejected. Tokens are surface artifacts, not the
stable unit of design.
- **LLM-as-extraction-engine:** Rejected. Introduces a D3 nondeterministic
oracle into the normalization site. See ADR-0002 for the ingest-layer ruling
on determinism classification.