Commit graph

132 commits

Author SHA1 Message Date
Shay
db7eabd62f Wire alignment graph into load_pack as post-compilation correction pass
- VocabManifold.update(): replace a stored versor in-place (grade-norm
  enforced, KeyError if word missing)
- compile_entries_to_manifold() now also returns entry_id->surface map
  as a second return value; callers that only need the manifold use [0]
- _alignment_nudge_rotor(): slerp-style rotor that rotates source toward
  target by edge.weight * ALIGNMENT_NUDGE_STRENGTH (0.06) — small enough
  to preserve intra-pack geometry, large enough to pull cross-lang pairs
  into proximity
- load_pack(): after both manifolds are built, loads alignment.jsonl,
  resolves entry_id->surface on each side, applies nudge to source versor
  using the already-compiled target versor as the attractor
- _is_hebrew_root() guard retained; _triliteral_root() Hebrew-only
2026-05-13 15:40:33 -07:00
Shay
5e75d46323 Fix Greek triliteral rotor bleed and update structured-morphology baseline test
- Guard _triliteral_root() rotor to Hebrew-script roots only; Greek/other
  scripts now use the root: rotor alone (0.17) — no spurious uppercase
  Unicode blade collision from the romanization fallback path
- test_structured_morphology_improves_same_root_hebrew_resonance: replace
  tag_only baseline (now empty since legacy tags stripped) with no_morphology
  baseline (domain+pos+lemma+surface only), which is the honest comparison
  for what structured morphology contributes post-migration
2026-05-13 15:24:38 -07:00
Shay
400cc031ce Remove legacy root-tag guard; compiler now single-path structured morphology 2026-05-13 15:21:14 -07:00
Shay
645eebd076 Migrate Greek lexicon to structured morphology; remove _uses_legacy_root_tags guard
- Strip root: tags from all 7 grc_logos_micro_v1 lexicon entries
- Refresh grc_logos_micro_v1 manifest checksum
- Remove _uses_legacy_root_tags() and _apply_morphology_tags() from compiler
- _entry_to_coordinate() now has a single morphology path: structured when
  morphology_id resolves, tag fallback only for packs with no morphology data
- load_pack() registry loading made unconditional for packs with morphology.jsonl
2026-05-13 15:20:15 -07:00
Shay
5c952a9f9d Migrate Hebrew lexicon to structured morphology 2026-05-13 15:15:15 -07:00
Shay
9e415a0bdf Wire morphology operator composition (PR #2)
- _apply_morphology(): ordered root→prefix→stem→inflection→suffix chain
- _resolved_morphology(): gates on _uses_legacy_root_tags(), preserving
  existing calibrated Hebrew/Greek entries on tag path
- דברים (he-008) is first migrated form; structured path proves
  higher resonance with singular than tag-only compilation
- 231 passed
2026-05-13 15:06:32 -07:00
Shay
3168e73ace Wire morphology operator composition 2026-05-13 15:02:52 -07:00
Shay
8d09c2a8c1 Add morphology registry for language packs 2026-05-13 14:50:36 -07:00
Shay
a4b4d22987 Add alignment graph, cross-language edges, and HolonomyAlignmentCase tests
alignment/graph.py
  Lightweight in-memory alignment graph. Loads AlignmentEdge records from
  a pack's alignment.jsonl. Exposes edges_from(), aligned_pairs(), and
  load_alignment(). No external deps — pure schema + stdlib.

language_packs/data/he_logos_micro_v1/alignment.jsonl
language_packs/data/grc_logos_micro_v1/alignment.jsonl
  Seven bidirectional cross-language edges per pack encoding the semantic
  resonances already implicit in the lexicon semantic_domains:
  דבר↔λόγος, ראשית↔ἀρχή, אור↔φῶς, חיים↔ζωή, אמת↔ἀλήθεια, רוח↔πνεῦμα, ברא↔κτίζω

tests/test_alignment_graph.py
  Four tests:
  - load returns AlignmentEdge instances with correct structure
  - דבר↔λόγος edge weight >= 0.9
  - aligned_pairs() filters by relation prefix
  - HolonomyAlignmentCase formal proof: positive triple closer than
    negative triple, wrapping the geometry already proven in
    test_holonomy_resonance.py into the schema's crown proof type
2026-05-13 14:43:17 -07:00
Shay
3affd29a82 Remove stale grc_logos_v1 pack files 2026-05-13 14:40:10 -07:00
Shay
594ca5503e Remove stale grc_logos_v1 pack files 2026-05-13 14:40:03 -07:00
Shay
c8c0f489ef Remove stale he_logos_v1 pack files 2026-05-13 14:39:46 -07:00
Shay
b28e8e064e Remove stale he_logos_v1 pack files 2026-05-13 14:39:37 -07:00
Shay
08794408d3 Remove stale he_logos_v1 and grc_logos_v1 packs (broken checksums, superseded by *_micro_* packs) 2026-05-13 14:39:21 -07:00
Shay
966b35efa3 Remove stale he_logos_v1 and grc_logos_v1 packs
These were the pre-rename originals superseded by he_logos_micro_v1 and
grc_logos_micro_v1. Their manifests have checksum mismatches (visible via
`python -m language_packs list`) because the lexicon content was updated
without re-checksumming before the rename.

No tests reference these pack IDs. No code loads them. Leaving broken
packs in data/ creates false noise in `list` output and risks a future
agent loading the wrong pack by prefix match.
2026-05-13 14:38:58 -07:00
Shay
4c447dea81 Add language_packs CLI: python -m language_packs compile/verify/list
Three subcommands:
  compile <pack_id>  — compile a pack, verify checksum, print manifold stats
  verify  <pack_id>  — checksum-only verification without full compilation
  list               — list all available packs with role and entry count

Checksum rule (AGENTS.md) is enforced by design: the CLI reads bytes from
disk via read_bytes() as the single source of truth, never from in-memory
strings. This makes the compiler an auditable D0 instrument — not just an
importable function.

Exit codes: 0 = success, 1 = checksum mismatch or pack not found.
2026-05-13 14:37:36 -07:00
Shay
d997b88d32 Tighten session node tracking and generation selection 2026-05-13 14:35:31 -07:00
Shay
4c3004c73a Improve chat runtime and probe REPL 2026-05-13 14:30:36 -07:00
Shay
f8113a38ba Restore FieldState slots in determinism proof 2026-05-13 14:26:24 -07:00
Shay
4e7c29b84a Fix field state introspection and pack manifold geometry 2026-05-13 14:24:29 -07:00
Shay
52de2218b7 Stabilize contracts: FieldState slots=True; fix README vocab layer; add checksum rule to AGENTS.md
Three items from the post-assessment stabilization slice:

1. field/state.py: restore frozen=True, slots=True
   slots=True closes __dict__ on FieldState instances, preventing
   incidental attribute injection that frozen=True alone does not block.
   The holonomy field works cleanly with slots because ndarray | None
   is a valid slotted field type in Python 3.12.

2. README.md: correct vocab/ layer description
   Was: 'Word-to-versor manifold, edge rotors'
   Now: 'Surface-token manifold points; indexed access for algebraic
         transition construction'
   Edge rotors are constructed by algebra/, not stored in vocab/.
   This exact confusion caused vocab.edge_rotor() drift in earlier work.

3. AGENTS.md: add language-pack checksum rule
   Manifest checksums MUST be computed by reading back the bytes
   written to disk (Path(f).read_bytes()), never from in-memory strings
   before serialization. Unicode-escaped JSON on disk != Python str.
2026-05-13 14:18:08 -07:00
Shay
e6bf8ade5e Fix he/grc micro pack manifest checksums to match actual on-disk bytes
Permanent lesson: checksums must be computed from bytes-on-disk after
git writes the file (unicode-escaped JSON lines), not from in-memory
Python strings before serialization. The compiler CLI must do:
  checksum = hashlib.sha256(Path(lexicon_path).read_bytes()).hexdigest()
after writing the file, not before.

he_logos_micro_v1: ea1ac85d...
grc_logos_micro_v1: 1fea9d9c...
2026-05-13 14:15:55 -07:00
Shay
c7e23c7a97 Fix triple-alignment test: unique first domains per Logos word; rename packs to micro
Root cause: all 7 Logos words shared 'logos.core' as first domain, making
them cluster into a single blob. The misaligned triple (word ↔ ראשית,
word ↔ πνεῦμα, דבר ↔ ἀρχή) scored 0.379 vs aligned 0.299 because
cross-language 'spirit' and 'beginning' were geometrically indistinguishable
from 'word' when logos.core dominated the rotor composition.

Fix: each Logos word now has a UNIQUE leaf domain as its FIRST (highest-
weight) domain that it shares ONLY with its cross-language counterparts:
  word/דבר/λόγος      → logos.utterance.word
  beginning/ראשית/ἀρχή → logos.genesis.origin
  light/אור/φῶς       → logos.illumination.photon
  life/חיים/ζωή       → logos.vitality.animate
  truth/אמת/ἀλήθεια   → logos.aletheia.verity
  spirit/רוח/πνεῦμα   → logos.pneuma.breath
  create/ברא/κτίζω    → logos.ktizo.formation

logos.core retained as second domain (background cohesion, lower weight).
divine.revelation removed from spirit/רוח/πνεῦμא (was polluting alignment).

Packs renamed: he_logos_v1 → he_logos_micro_v1, grc_logos_v1 → grc_logos_micro_v1
(test expects *_micro_* IDs).

All three manifests updated with correct D0 checksums.
2026-05-13 14:13:11 -07:00
Shay
1f5e0eb1a5 Fix en_minimal_v1 manifest checksum; fix probe/repl.py import path
- manifest checksum updated to match actual bytes-on-disk
  (eca36a3d... — line endings differ between Python serialization and git)
- probe/repl.py: add sys.path.insert so it resolves language_packs
  from repo root when run directly
2026-05-13 14:08:58 -07:00
Shay
93578f685b Enrich en_minimal_v1 domains; add he_logos_v1 and grc_logos_v1 micro-packs
- en_minimal_v1: all 60 entries enriched from 1-2 flat domain labels to
  3-5 layered domain strings encoding semantic proximity. Key shared
  strings: logos.core (all 9 Logos words), divine.revelation (light,
  truth, word, spirit, life), knowledge.ground (truth, know, reason,
  mean, answer), logos.genesis (beginning, create, begin, form),
  communication.articulation (word, say, speak, ask, answer, mean),
  logic.polarity (yes, no, not, cannot), agency.subject (pronouns).

- he_logos_v1: 7-entry Hebrew Logos micro-pack. Domain strings
  intentionally cross-aligned with English counterparts so nearest()
  across packs resolves to the same geometric neighborhood. Morphology
  tags carry root triliteral (root:דבר, triliteral:D-B-R, etc).

- grc_logos_v1: 7-entry Koine Greek Logos micro-pack. Same cross-
  alignment strategy. Morphology tags carry declension class, case,
  aspect, and root (root:λεγ, alpha_privative, etc).

Manifests created with SHA-256 checksums, D0 determinism class,
gate_engaged: true, oov_policy: fail_closed.
2026-05-13 14:06:11 -07:00
Shay
d07ca21690 Add ignore rules for generated artifacts 2026-05-13 14:00:49 -07:00
Shay
a87c7a9c6f Fix full test suite after cognitive runtime 2026-05-13 13:52:11 -07:00
Shay
71e99c5c51 Build first cognitive response path 2026-05-13 13:40:06 -07:00
Shay
b9cd6684f5 Assert session vault contains assistant final state 2026-05-13 13:17:47 -07:00
Shay
d781ba71db Avoid identity stalls in generation loop 2026-05-13 13:16:48 -07:00
Shay
defd7a9a53 Use true versor fixture in engine loop proof 2026-05-13 13:15:22 -07:00
Shay
99c0e31bbe fix(INV-02): replace normalize_to_versor with unitize_versor at construction sites
algebra/rotor.py and persona/motor.py were calling normalize_to_versor()
which is the gate-only injection primitive. Both are construction-time
sites (building rotors and motors from raw arrays), so the correct call
is unitize_versor().

Also tightens TestINV02 to scan for normalize_to_versor violations only —
unitize_versor has its own legitimate call sites and is not under the
same single-site restriction. Adds a new TestINV02b that verifies
unitize_versor is NOT called inside propagation, generation, or vault
recall paths.

Fixes: INV-02 architectural invariant test failure.
2026-05-13 13:14:59 -07:00
Shay
2e842341b3 Restore text projection default OOV policy 2026-05-13 13:14:41 -07:00
Shay
58092112c3 Document language pack manifold contract 2026-05-13 13:13:06 -07:00
Shay
dbdc606937 Add language pack roles and OOV policy 2026-05-13 13:12:35 -07:00
Shay
d186da7a7d Add language pack roles and OOV policy 2026-05-13 13:11:44 -07:00
Shay
c9052ef4b0 Add language pack schema foundation 2026-05-13 13:10:50 -07:00
Shay
48947db9d4 Add language pack schema foundation 2026-05-13 13:10:05 -07:00
Shay
0431bdf655 Align holonomy tests with indefinite metric 2026-05-13 12:59:32 -07:00
Shay
2303c68f6a Constrain closure fixture to positive unit reflectors 2026-05-13 12:59:15 -07:00
Shay
62501b6730 Use true versor fixtures in holonomy tests 2026-05-13 12:55:41 -07:00
Shay
bacf1f4084 Use true versor fixtures in closure tests 2026-05-13 12:55:20 -07:00
Shay
fca6216e3f Stabilize holonomy accumulation 2026-05-13 12:54:53 -07:00
Shay
ba45158f8e Fix CGA null embedding convention 2026-05-13 12:51:49 -07:00
Shay
4fe19c08ba Fix Python Cl41 blade product table 2026-05-13 12:51:26 -07:00
Shay
5b34b72158 Fix versor condition residual 2026-05-13 12:49:53 -07:00
Shay
3abae93e73 Fix FieldState identity assertion in engine proof 2026-05-13 12:39:34 -07:00
Shay
c4ee81f315 Add deterministic engine loop proof 2026-05-13 12:37:46 -07:00
Shay
1731ca6500 Add deterministic engine loop proof 2026-05-13 12:37:21 -07:00
Shay
3620c967b9 fix: route production hot paths through algebra.backend (Commit 2)
Three surgical import changes. No behavior change. No new semantics.
Backend decides Rust vs pure-Python transparently.

- field/propagate.py: versor_apply <- algebra.backend
- vocab/manifold.py: cga_inner    <- algebra.backend
- vault/store.py:    recall loop replaced with vault_recall() from
  algebra.backend; public result shape preserved ({versor, score,
  metadata, index}). null_project stays on algebra.cga (not the
  recall hot path). store() and reproject() unchanged.

Rust path for vault_recall uses Rayon parallel scan and releases
the GIL. Python fallback is sequential and behaviorally identical.
No batching introduced; that is Commit 3+.
2026-05-13 12:35:22 -07:00