From c6cd0c12bb430f04c25874c4b07770bb85064a48 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:16:17 -0700 Subject: [PATCH 01/30] feat(english): construct glyph geometry through pinned UCNS ordinal affixiation --- .../english_gonol/ordinal_construction.py | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 human/english/english_gonol/ordinal_construction.py diff --git a/human/english/english_gonol/ordinal_construction.py b/human/english/english_gonol/ordinal_construction.py new file mode 100644 index 0000000..1ff2ca2 --- /dev/null +++ b/human/english/english_gonol/ordinal_construction.py @@ -0,0 +1,290 @@ +# === MODULE_BUILD === +# id: uchc_english_ordinal_ucns_consumer +# module_name: ordinal_construction +# module_kind: consumer +# summary: exact glyph instantiation from the UCNS Public Gonol carrier and ordinal-affixiation geometry +# owner: Erin Spencer +# public_surface: construct_glyph_gonol, geometry_record, OrdinalStructuralField, OrdinalGeometryError +# internal_surface: pinned UCNS module integrity and exact corpus receipts +# auth_boundary: pinned UCNS source bytes and immutable Public Gonol arrangement +# storage_boundary: verified structural corpus read-only; geometric records returned without DB mutation +# network_boundary: none +# user_data_boundary: caller source remains in local computation +# admin_only: false +# tests: tests/test_ordinal_construction.py +# rollout: use the new OrdinalStructuralField for geometry; historical StructuralField receipts remain immutable +# rollback: remove consumer module and its explicit API; do not modify UCNS or sealed corpus artifacts +# requires: ucns.ordinal_affixiation, ucns.public_gonol, english_gonol.structural_query +# since: 2026-10-19 +# unresolved: non-Public-Gonol scalar angles and higher-scale word-carrier angular attachment +# === END MODULE_BUILD === +# +# === CONTRACTS === +# id: uchc_ordinal_ucns_is_the_sole_geometry_authority +# given: any UCHC glyph construction +# then: it uses exact pinned UCNS Carrier, Participant and affixiate objects with no local angular or radial formula +# class: correctness +# +# id: uchc_ordinal_glyph_occurrences_preserve_geometry +# given: an ordered sequence of admitted Public Gonol glyphs +# then: every occurrence preserves UCNS turn, exact halving exponent, multiplicity, order and replay receipt +# class: correctness +# +# id: uchc_ordinal_no_fabricated_angles +# given: an unadmitted glyph, changed UCNS producer, or unverified corpus origin +# then: geometric construction refuses without allocating a replacement angle or changing corpus evidence +# class: safety +# +# id: uchc_ordinal_query_consumes_verified_word_interiors +# given: an admitted verified English structural query and Public Gonol glyphs +# then: returned glyph geometry and each word's recoverable interior come from UCNS without inventing a parent word carrier +# class: correctness +# === END CONTRACTS === + +"""Executable English glyph geometry, consuming UCNS instead of reimplementing it. + +Usage with exact UCNS producer installed: + python -m english_gonol.ordinal_construction word + +Use OrdinalStructuralField for a verified English corpus. The older +StructuralField remains the immutable historical-replay surface. +The Public Gonol fixes angular ordering; UCNS computes turns, radial halvings, +closure and receipts. Hyperspace before instantiation is NOT a gonol. +""" +from __future__ import annotations + +import argparse +from functools import lru_cache +from hashlib import sha1 +import importlib +import json +from pathlib import Path + +from english_gonol.structural_query import StructuralField + +SCHEMA = "uchc.english-ordinal-geometry" +VERSION = "1.0.0" +UCNS_COMMIT = "ed0b0760f05cd975a7a811f8abeb70a11d09f00b" +UCNS_ORDINAL_BLOB = "9fa84ef20f19fe0c04df680f49b50ea307e6d624" +UCNS_PUBLIC_BLOB = "c1955e46e2dc918fb657cb346e42106d71937e91" +PUBLIC_GONOL_SHA256 = "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5" + + +class OrdinalGeometryError(ValueError): + """Named refusal rather than a local substitute for UCNS geometry.""" + + def __init__(self, code: str, glyphs: tuple[str, ...] = ()): + self.code = code + self.glyphs = glyphs + super().__init__(code) + + +def _git_blob_sha1(source: bytes) -> str: + """Verify exact Git blob bytes; a digest is integrity, not authentication.""" + return sha1(b"blob " + str(len(source)).encode("ascii") + b"\0" + source).hexdigest() + + +@lru_cache(maxsize=1) +def _ucns(): + """Load the exact UCNS producer before admitting any geometric construction.""" + try: + ordinal = importlib.import_module("ucns.ordinal_affixiation") + public = importlib.import_module("ucns.public_gonol") + except ImportError as exc: + raise OrdinalGeometryError("UCNS_ORDINAL_PRODUCER_REQUIRED") from exc + for module, expected in ( + (ordinal, UCNS_ORDINAL_BLOB), + (public, UCNS_PUBLIC_BLOB), + ): + path = getattr(module, "__file__", None) + if not path or not Path(path).is_file(): + raise OrdinalGeometryError("UCNS_PRODUCER_SOURCE_UNAVAILABLE") + if _git_blob_sha1(Path(path).read_bytes()) != expected: + raise OrdinalGeometryError("UCNS_PRODUCER_DRIFT") + if ( + public.PUBLIC_GONOL_SHA256 != PUBLIC_GONOL_SHA256 + or public.public_gonol_sha256() != PUBLIC_GONOL_SHA256 + or len(public.PUBLIC_GONOL_157) != 157 + or public.PUBLIC_GONOL_157[0] != " " + ): + raise OrdinalGeometryError("PUBLIC_GONOL_CARRIER_DRIFT") + carrier = ordinal.Carrier( + tuple(public.PUBLIC_GONOL_157), + "ucns:public-gonol-157:" + PUBLIC_GONOL_SHA256, + ) + return ordinal, public, carrier + + +def construct_glyph_gonol(text: str, *, source: str = "uchc:english.ordinal/1"): + """Construct every glyph instance through UCNS with exact local-frame placement. + + All glyphs must have positions on the pinned Public Gonol. In particular, + an unknown Unicode scalar cannot be silently assigned a Unicode-order, + hash-derived or locally invented bearing. + """ + if not isinstance(text, str) or not text: + raise OrdinalGeometryError("NONEMPTY_GLYPH_SEQUENCE_REQUIRED") + if any(0xD800 <= ord(glyph) <= 0xDFFF for glyph in text): + raise OrdinalGeometryError("UNICODE_SCALAR_REQUIRED") + if not isinstance(source, str) or not source: + raise OrdinalGeometryError("SOURCE_IDENTITY_REQUIRED") + ordinal, public, carrier = _ucns() + missing = tuple(dict.fromkeys( + glyph for glyph in text if public.public_gonol_position(glyph) is None + )) + if missing: + raise OrdinalGeometryError("PUBLIC_GONOL_ANGLE_UNAVAILABLE", missing) + construction = ordinal.affixiate( + text, + tuple(ordinal.Participant.atom(carrier, glyph) for glyph in text), + origin="SPACE", + relation="english.ordinal/1:glyph-instantiation", + source=source, + ) + if construction.recover() != tuple(text): + raise OrdinalGeometryError("UCNS_CONSTRUCTION_RECOVERY_MISMATCH") + return construction + + +def geometry_record(construction) -> dict: + """Transport the actual UCNS geometry and receipt, not derived local coordinates.""" + ordinal, _public, _carrier = _ucns() + if not isinstance(construction, ordinal.Construction): + raise OrdinalGeometryError("UCNS_CONSTRUCTION_REQUIRED") + return { + "schema": SCHEMA, + "version": VERSION, + "geometry_authority": { + "repository": "The-Interdependency/ucns", + "commit": UCNS_COMMIT, + "ordinal_blob": UCNS_ORDINAL_BLOB, + "public_gonol_blob": UCNS_PUBLIC_BLOB, + "public_gonol_sha256": PUBLIC_GONOL_SHA256, + }, + "construction": construction.record(), + "receipt": construction.receipt, + "recovered_glyphs": list(construction.recover()), + } + + +def _refusal(code: str, glyphs: tuple[str, ...] = ()) -> dict: + return { + "standing": "refused", + "code": code, + "unplaced_glyphs": list(glyphs), + "edges": [], + } + + +class OrdinalStructuralField(StructuralField): + """Verified structural English field using the selected UCNS glyph geometry. + + Preserves the historical structural artifact and its replay byte-for-byte. + Only a verified complete corpus can bind its glyph identifiers to the + canonical Public Gonol; partial fixtures cannot claim that binding. + """ + + def _word_geometry(self, surface: str, word: dict): + if not self.complete_corpus: + raise OrdinalGeometryError("COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL") + return construct_glyph_gonol( + surface, + source=( + "uchc:english.structural/1:" + + self.manifest["receipt_sha256"] + + ":word:" + + str(word["word_id"]) + ), + ) + + def word(self, surface: str) -> dict: + result = super().word(surface) + constructed = self._word_geometry(surface, result) + result["gonal_order"] = constructed.record() + result["geometry_receipt"] = constructed.receipt + result["geometry_state"] = "constructed" + return result + + def geometry(self, record: dict, *, operation: str) -> dict: + if operation != "ordinal-affixiation": + return super().geometry(record, operation=operation) + graph = self.replay(record) + if not self.complete_corpus: + return _refusal("COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL") + if graph["refusals"]: + return _refusal("PARTICIPANT_ADMISSION_REQUIRED") + if not graph["source"]: + return _refusal("NONEMPTY_GLYPH_SEQUENCE_REQUIRED") + try: + glyph_frame = construct_glyph_gonol( + graph["source"], + source="uchc:english.structural-query:" + graph["receipt_sha256"], + ) + interiors: dict[str, dict] = {} + word_order = [] + for part in graph["parts"]: + if part["kind"] != "word": + continue + surface = graph["source"][part["start"]:part["end"]] + key = str(part["identity"]) + if key not in interiors: + interior = self.word(surface) + interiors[key] = { + "word_id": part["identity"], + "source": surface, + "construction": interior["gonal_order"], + "receipt": interior["geometry_receipt"], + } + word_order.append({"ordinal": part["ordinal"], "word_id": part["identity"]}) + except OrdinalGeometryError as exc: + return _refusal(exc.code, exc.glyphs) + return { + "standing": "constructed", + "operation": "ordinal-affixiation", + "source_receipt": graph["receipt_sha256"], + "glyph_frame": geometry_record(glyph_frame), + "word_interiors": list(interiors.values()), + "ordered_word_references": word_order, + "higher_word_frame": "hmmm:WORD_CARRIER_ANGLE_NOT_SELECTED", + "edges": [], + } + + def compose(self, record: dict, *, relation: str) -> dict: + result = super().compose(record, relation=relation) + if result["standing"] != "logically-closed": + return result + geometry = self.geometry(record, operation="ordinal-affixiation") + if geometry["standing"] != "constructed": + result["geometry_state"] = "hmmm:" + geometry["code"] + result["geometry_refusal"] = geometry + return result + result["geometry_state"] = "constructed-glyph-frame;higher-word-frame-hmmm" + result["glyph_geometry"] = geometry["glyph_frame"] + result["word_interiors"] = geometry["word_interiors"] + return result + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("text") + parser.add_argument("--source", default="uchc:english.ordinal/1") + parser.add_argument("--state-dir", help="verified complete structural corpus") + args = parser.parse_args() + try: + if args.state_dir: + with OrdinalStructuralField(args.state_dir) as field: + record = field.geometry( + field.construct(args.text), + operation="ordinal-affixiation", + ) + else: + record = geometry_record(construct_glyph_gonol(args.text, source=args.source)) + record["standing"] = "constructed" + except OrdinalGeometryError as exc: + record = _refusal(exc.code, exc.glyphs) + print(json.dumps(record, ensure_ascii=False, indent=2)) + return 0 if record["standing"] == "constructed" else 2 + + +if __name__ == "__main__": + raise SystemExit(main()) From 4dcf6d590d7c2210759cc1d36ef2afea1c7d30c1 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:18:00 -0700 Subject: [PATCH 02/30] test(english): witness exact UCNS ordinal geometry, replay and refusals --- tests/test_ordinal_construction.py | 200 +++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) create mode 100644 tests/test_ordinal_construction.py diff --git a/tests/test_ordinal_construction.py b/tests/test_ordinal_construction.py new file mode 100644 index 0000000..ef9c695 --- /dev/null +++ b/tests/test_ordinal_construction.py @@ -0,0 +1,200 @@ +# === CHECKS === +# id: check_ordinal_ucns_exact_prefixes +# proves: uchc_ordinal_ucns_is_the_sole_geometry_authority, uchc_ordinal_glyph_occurrences_preserve_geometry +# call: self::test_word_prefixes_and_exact_positions +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none +# id: check_ordinal_repeated_glyphs +# proves: uchc_ordinal_glyph_occurrences_preserve_geometry +# call: self::test_repeated_glyphs_keep_angle_and_distinct_radii +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none +# id: check_ordinal_missing_public_angles +# proves: uchc_ordinal_no_fabricated_angles +# call: self::test_missing_public_gonol_angles_fail_closed +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none +# id: check_ordinal_source_drift +# proves: uchc_ordinal_no_fabricated_angles +# call: self::test_source_drift_refuses +# requires: python3, pytest +# timeout: 30 +# mutates: filesystem +# cleanup: pytest_tmp_path +# id: check_ordinal_partial_corpus +# proves: uchc_ordinal_no_fabricated_angles, uchc_ordinal_query_consumes_verified_word_interiors +# call: self::test_partial_corpus_refuses_public_binding +# requires: python3, pytest +# timeout: 60 +# mutates: filesystem +# cleanup: pytest_tmp_path +# id: check_ordinal_reconstruction +# proves: uchc_ordinal_glyph_occurrences_preserve_geometry +# call: self::test_all_short_sequences_match_independent_append_oracle +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +"""UCHC consumer contract: run with pinned UCNS installed (no UCNS stubs).""" +from fractions import Fraction +from itertools import product +import importlib +from pathlib import Path + +import pytest + +from english_gonol.ordinal_construction import ( + OrdinalGeometryError, + OrdinalStructuralField, + _ucns, + construct_glyph_gonol, + geometry_record, + PUBLIC_GONOL_SHA256, + UCNS_COMMIT, +) +from english_gonol.language.source import LexemeRecord, SenseRecord, SynsetRecord, WordnetSnapshot +from english_gonol.structural_construct import build + +ordinal = importlib.import_module("ucns.ordinal_affixiation") +public = importlib.import_module("ucns.public_gonol") + + +def test_word_prefixes_and_exact_positions(): + assert public.public_gonol_position(" ") == 0 + cases = ("w", "wo", "wor", "word") + for source in cases: + result = construct_glyph_gonol(source) + assert isinstance(result, ordinal.Construction) + assert result.origin == "SPACE" + assert result.recover() == tuple(source) + assert [result.placement(i).radius() for i in range(len(source))] == [ + Fraction(1, 2 ** (len(source) - i)) for i in range(len(source)) + ] + assert [result.placement(i).turn for i in range(len(source))] == [ + Fraction(public.public_gonol_position(glyph), 157) for glyph in source + ] + + word = construct_glyph_gonol("word") + assert [word.placement(i).radius() for i in range(4)] == [ + Fraction(1, 16), Fraction(1, 8), Fraction(1, 4), Fraction(1, 2) + ] + record = geometry_record(word) + assert record["geometry_authority"]["commit"] == UCNS_COMMIT + assert record["geometry_authority"]["public_gonol_sha256"] == PUBLIC_GONOL_SHA256 + assert record["recovered_glyphs"] == list("word") + assert [p["radius"]["power_of_two_denominator"] for p in record["construction"]["placements"]] == [4, 3, 2, 1] + assert record["receipt"] == word.receipt + + +def test_repeated_glyphs_keep_angle_and_distinct_radii(): + obj = construct_glyph_gonol("wow") + assert obj.participants[0].identity == obj.participants[2].identity == "w" + assert obj.placement(0).turn == obj.placement(2).turn + assert obj.placement(0).radius() == Fraction(1, 8) + assert obj.placement(2).radius() == Fraction(1, 2) + assert obj.recover() == ("w", "o", "w") + assert construct_glyph_gonol("wow", source="v1").receipt != construct_glyph_gonol("wow", source="v2").receipt + + +def test_all_short_sequences_match_independent_append_oracle(): + for n in range(1, 6): + for chars in product("wo", repeat=n): + obj = construct_glyph_gonol("".join(chars)) + radii = [] + for _ in chars: + radii = [old / 2 for old in radii] + [Fraction(1, 2)] + assert [obj.placement(i).radius() for i in range(n)] == radii + assert obj.recover() == chars + + +def test_missing_public_gonol_angles_fail_closed(): + for invalid, code in ( + ("", "NONEMPTY_GLYPH_SEQUENCE_REQUIRED"), + (None, "NONEMPTY_GLYPH_SEQUENCE_REQUIRED"), + ("\ud800", "UNICODE_SCALAR_REQUIRED"), + ("w🦄", "PUBLIC_GONOL_ANGLE_UNAVAILABLE"), + ("é", "PUBLIC_GONOL_ANGLE_UNAVAILABLE"), + ): + with pytest.raises(OrdinalGeometryError) as exc: + construct_glyph_gonol(invalid) + assert exc.value.code == code + with pytest.raises(OrdinalGeometryError) as exc: + construct_glyph_gonol("word", source="") + assert exc.value.code == "SOURCE_IDENTITY_REQUIRED" + assert public.public_gonol_sha256() == PUBLIC_GONOL_SHA256 + + +def test_source_drift_refuses(tmp_path, monkeypatch): + fixture = tmp_path / "forged.py" + fixture.write_text("def affine_radius(i): return 17\n", encoding="utf-8") + with monkeypatch.context() as patch: + patch.setattr(ordinal, "__file__", str(fixture)) + _ucns.cache_clear() + with pytest.raises(OrdinalGeometryError) as exc: + construct_glyph_gonol("word") + assert exc.value.code == "UCNS_PRODUCER_DRIFT" + _ucns.cache_clear() + assert construct_glyph_gonol("word").recover() == tuple("word") + + with monkeypatch.context() as patch: + patch.setattr(public, "PUBLIC_GONOL_SHA256", "0" * 64) + _ucns.cache_clear() + with pytest.raises(OrdinalGeometryError) as exc: + construct_glyph_gonol("word") + assert exc.value.code == "PUBLIC_GONOL_CARRIER_DRIFT" + _ucns.cache_clear() + + +def test_partial_corpus_refuses_public_binding(tmp_path): + source = WordnetSnapshot( + lexemes=(LexemeRecord("word", "n", (), (SenseRecord("s1", "n1", ()),)),), + synsets=(SynsetRecord("n1", "n", ("word",), ("word",), ()),), + source_tree_sha256="0" * 64, + source_file_count=1, + ) + state = tmp_path / "partial" + build(source, out_dir=state, public_position=lambda _c: None, + producer={"standing": "fixture-only"}) + with OrdinalStructuralField(state) as field: + graph = field.construct("word") + assert graph["logical_state"] == "closed" + result = field.geometry(graph, operation="ordinal-affixiation") + assert result["standing"] == "refused" + assert result["code"] == "COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL" + logical = field.compose(graph, relation="ordered-text") + assert logical["standing"] == "logically-closed" + assert logical["geometry_state"] == "hmmm:COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL" + with pytest.raises(OrdinalGeometryError) as exc: + field.word("word") + assert exc.value.code == "COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL" + assert field.geometry(graph, operation="displacement")["code"] == "UCNS_OPERATION_REQUIRED" + + +def test_ucns_nested_construction_retains_word_interior(): + first = construct_glyph_gonol("word") + # No higher-order English angle is asserted: the word carrier is an + # explicitly supplied test relation, and UCNS owns its geometry. + carrier = ordinal.Carrier(("word", "other"), "test:explicit-word-carrier") + sentence = ordinal.affixiate( + "test:word-twice", + (ordinal.Participant.closed(carrier, first), + ordinal.Participant.closed(carrier, first)), + origin="SPACE", relation="test:declared", source="test:nesting", + ) + assert sentence.recover() == tuple("wordword") + assert sentence.participants[0].interior is first + assert sentence.participants[1].interior is first + + +def test_geometry_record_refuses_fake_construction(): + with pytest.raises(OrdinalGeometryError) as exc: + geometry_record({"receipt": "made-up"}) + assert exc.value.code == "UCNS_CONSTRUCTION_REQUIRED" From 855d7a57dffcc7a4c9d50fbc8cf5b98894281ccd Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:18:54 -0700 Subject: [PATCH 03/30] docs: pin UCNS-to-UCHC ordinal geometry authority and refusal boundaries --- .../english-ordinal-geometry-v1.json | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 docs/work-graphs/english-ordinal-geometry-v1.json diff --git a/docs/work-graphs/english-ordinal-geometry-v1.json b/docs/work-graphs/english-ordinal-geometry-v1.json new file mode 100644 index 0000000..29402ff --- /dev/null +++ b/docs/work-graphs/english-ordinal-geometry-v1.json @@ -0,0 +1,43 @@ +{ + "schema": "the-interdependency.stack-manifest", + "version": "1.0.0", + "repositories": [ + { + "repository": "The-Interdependency/ucns", + "commit": "ed0b0760f05cd975a7a811f8abeb70a11d09f00b", + "authority": "Public Gonol glyph carrier and exact ordinal-affixiation geometric operations", + "relation": "pinned producer; runtime verifies public_gonol.py and ordinal_affixiation.py Git blob identities" + }, + { + "repository": "The-Interdependency/stack", + "commit": "faf265422011a7a705c712886d4369136fdbc7eb", + "authority": "active English construction research forge pending UCHC graduation", + "relation": "untouched compatibility and lifecycle authority; historical corpus receipts preserved" + }, + { + "repository": "The-Interdependency/uchc", + "commit": "45f50ebce04235611223fda13cf67e1a71d45dba", + "authority": "verified English structural consumer and extracted candidate baseline", + "relation": "input baseline; proposed new consumer in branch feat/english-ordinal-ucns-consumer-20261019" + }, + { + "repository": "The-Interdependency/skill-lib", + "commit": "83aef7813dbd040a67ddc07bbb8845f51eb38a3e", + "authority": "WDLL, gonol construction, cross-repository evidence and audit discipline", + "relation": "governing skills consumed; no geometry authority" + } + ], + "boundaries": { + "authority_transfer": false, + "proof_status_transfer": false, + "measurement_status_transfer": false, + "semantic_mapping": "UCHC admits exact glyphs; UCNS defines geometry; semantic evidence and corpus membership remain external.", + "agent_scope": "uchc-english-ordinal-geometry-consumer", + "hmmm": [ + "Non-Public-Gonol Unicode scalars have no licensed public angular bearing in this selected 157-glyph carrier.", + "Higher-order angular carrier for closed word identities and cross-origin transport are not selected; no invented word angle.", + "The immutable historical UCHC English corpus receipts and Stack-to-UCHC graduation are unchanged." + ] + }, + "work_graph_sha256": "00e40c52cc7a522696665d5db40eb59706bd33e7a5a2ad689d1f3ac3329cabb4" +} From c550b387db9c6f75eddeb09bc2c9e4fc4dbee2b9 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:20:35 -0700 Subject: [PATCH 04/30] docs(english): document executed UCNS ordinal geometry and refusal boundaries --- human/english/docs/ordinal-geometry.md | 76 ++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 human/english/docs/ordinal-geometry.md diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md new file mode 100644 index 0000000..864ee95 --- /dev/null +++ b/human/english/docs/ordinal-geometry.md @@ -0,0 +1,76 @@ +# English ordinal geometry — executable UCNS consumer + +**Status:** New UCHC consumer of existing UCNS geometry. The sealed English corpus and Stack's forge authority do not change. + +## Construction + +Hyperspace is undifferentiated equidistant potential, **not a gonol**. Instantiating glyphs constructs a gonol. The Public Gonol supplies their angular bearings relative to SPACE. UCNS ordinal affixiation supplies their instance radii and exact closure. + +For glyph instance i in an n-glyph sequence, with zero-based i: + + radius(i) = R / (2 ** (n - i)) + +Appending a glyph places it at R/2 and halves every earlier glyph's radius. Repeating a glyph repeats its public angle but not its occurrence radius. UCNS owns the formula, the carrier, the construction objects and receipts; UCHC calls those objects rather than implementing parallel geometry. + +For 'word', the final positions are w=R/16, o=R/8, r=R/4, d=R/2, with the four prefixes 'w', 'wo', 'wor', 'word'. + +The selected UCNS ordinal Carrier uses the exact 157-position Public Gonol ordering. Its normalized-turn projection is the new ordinal-affixiation operator's angular choice, **not** a retroactive reinterpretation of old Public Gonol artifacts. + +## Executable UCHC + +Install exact UCNS producer and UCHC, then run: + + python -m pip install 'git+https://github.com/The-Interdependency/ucns.git@ed0b0760f05cd975a7a811f8abeb70a11d09f00b' + python -m pip install . + python -m english_gonol.ordinal_construction word + +This prints the real UCNS placements, exact rational turns, symbolic halving exponents, source and producer identities, recovered glyphs, and a replay receipt. + +Python usage: + + from english_gonol.ordinal_construction import construct_glyph_gonol, geometry_record + gonol = construct_glyph_gonol("word") + assert [gonol.placement(i).exponent for i in range(4)] == [4, 3, 2, 1] + assert gonol.recover() == tuple("word") + evidence = geometry_record(gonol) + +To consume a complete **verified** structural English corpus: + + from english_gonol.ordinal_construction import OrdinalStructuralField + with OrdinalStructuralField("/path/to/verified/structural-corpus") as field: + word = field.word("word") + query = field.construct("word") + geometry = field.geometry(query, operation="ordinal-affixiation") + composition = field.compose(query, relation="ordered-text") + +The new OrdinalStructuralField is the geometry-enabled API. The historical StructuralField remains available for byte-identical verification of its immutable artifacts. The new consumer does not rewrite historical database rows or receipts. + +The geometry API constructs a raw glyph frame for verified admitted text and separately preserves the ordered internal geometry of each closed word identity. It does **not** assign an invented angular carrier to the higher word frame; that separate geometry remains hmmm. Other operations, such as displacement, retain their explicit refusal. + +## Evidence and failure + +The new consumer: + +- imports the actual UCNS Carrier, Participant, Construction and affixiate objects; +- pins and validates the exact Git blobs of UCNS ordinal_affixiation.py and public_gonol.py; +- rejects missing Public Gonol glyph bearings rather than inventing coordinates; +- refuses unverified/partial English corpus bindings; +- preserves source order, repetition, provenance, closure and immutable corpus receipts. + +The hosted workflow uses a pinned actual UCNS checkout, runs independent append-oracle and source-drift tests, and verifies the clean-installed UCHC wheel. + +Machine authority graph: [english-ordinal-geometry-v1.json](../../docs/work-graphs/english-ordinal-geometry-v1.json). + +## DONE WHEN / PROVEN BY / FAILS IF + +**DONE WHEN:** UCHC constructs real UCNS glyph geometry for admitted sequences and exposes it in a corpus-aware consumer. + +**PROVEN BY:** word = R/16, R/8, R/4, R/2; repeated glyphs have unchanged angles and different radii; complete recovery and UCNS-native objects; named refusal for missing angle, source drift and unverified corpus; a clean installed wheel passing cross-repository tests. + +**FAILS IF:** UCHC synthesizes local bearings/radii, calls undifferentiated potential a gonol, silently admits missing glyphs, falsifies a higher-order frame, or rewrites a sealed corpus. + +## hmmm + +1. The public 157-glyph carrier does not yet give every Unicode scalar in the broader English corpus a licensed angular bearing. Unsupported glyphs refuse; an explicitly specified expanded public angular carrier is needed for complete coverage. +2. Angular attachment of closed words to a higher carrier and transport between word/definition frames are not selected. +3. This consumer does not by itself complete Stack-to-UCHC graduation, full-corpus geometric census, native Möbius lift, or semantic measurement. From f797c81e2c4164dddfdcf3914a02d6b0c35adab7 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:21:12 -0700 Subject: [PATCH 05/30] build: version ordinal UCNS consumer separately from sealed a2 wheel --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f34a28a..51217b3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "uchc" -version = "0.1.0a2" +version = "0.1.0a3" description = "Unit Circle Hyperspace Constructs: exact language construction and receipt-bound inference inputs" readme = "README.md" requires-python = ">=3.12" From c4475e526d630aa4c5ee37bac047ccd3fc774ecd Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:21:24 -0700 Subject: [PATCH 06/30] docs: expose runnable UCHC English ordinal geometry at repository entrypoint --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 2d4172e..9cec89c 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ UCHC is the implementation repository for **Unit Circle Hyperspace Constructs**. Applications consume UCHC; applications do not define UCHC. +## Executable English ordinal geometry + +UCHC provides an executable, UCNS-backed English glyph construction API in [ordinal_construction.py](human/english/english_gonol/ordinal_construction.py). Run the clean-installed package with the pinned UCNS producer: + + python -m english_gonol.ordinal_construction word + +The result contains UCNS turns, exact per-instance radial-halving exponents, and a recoverable receipt. The new OrdinalStructuralField supplies geometry for complete verified English corpus queries; the original StructuralField remains immutable for historical replay. See the [construction law and refusals](human/english/docs/ordinal-geometry.md). + +**hmmm:** glyphs outside the 157-position Public Gonol and higher-scale word-carrier angular attachment require additional selected geometry; neither receives a fabricated bearing. + ## Domains ```text From 578f7b592303cecd6eb7875421b66379c36e101f Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:21:34 -0700 Subject: [PATCH 07/30] docs(english): identify UCNS-backed ordinal construction entrypoint --- human/english/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/human/english/README.md b/human/english/README.md index 9ebb961..27ba841 100644 --- a/human/english/README.md +++ b/human/english/README.md @@ -1,3 +1,10 @@ +## Current UCNS-backed ordinal geometry consumer + +The executable [ordinal-geometry contract](docs/ordinal-geometry.md) constructs admitted glyph instances through UCNS ordinal_affixiation and the Public Gonol angular registry. For 'word', it returns radii R/16, R/8, R/4, R/2, real UCNS placements and exact source recovery. + +Use OrdinalStructuralField for verified English corpus geometric queries; legacy StructuralField remains the immutable historical replay API. No replacement coordinates are fabricated. + +--- # English Gonol Construction ## Structural profile v1 — new construction entrypoint From 36c051a325b6db72f1a48a40a79fe67fd5798ec9 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:22:46 -0700 Subject: [PATCH 08/30] ci: verify pinned UCNS glyph geometry through source and clean-installed UCHC --- .../workflows/english-ordinal-geometry.yml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 .github/workflows/english-ordinal-geometry.yml diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml new file mode 100644 index 0000000..207146f --- /dev/null +++ b/.github/workflows/english-ordinal-geometry.yml @@ -0,0 +1,105 @@ +name: English ordinal UCNS geometry +on: + pull_request: + paths: ['human/english/english_gonol/ordinal_construction.py', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] + push: + branches: [main] + paths: ['human/english/english_gonol/ordinal_construction.py', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] +permissions: + contents: read +jobs: + installed-geometry: + runs-on: ubuntu-24.04 + env: + SOURCE_DATE_EPOCH: '1790308800' + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/ucns + ref: ed0b0760f05cd975a7a811f8abeb70a11d09f00b + path: _deps/ucns-ordinal + persist-credentials: false + - uses: actions/setup-python@v7.0.0 + with: + python-version: '3.12.14' + - name: Verify immutable producer and work graph + shell: bash + run: | + set -euo pipefail + test "$(git -C _deps/ucns-ordinal rev-parse HEAD)" = ed0b0760f05cd975a7a811f8abeb70a11d09f00b + test "$(git -C _deps/ucns-ordinal hash-object src/ucns/ordinal_affixiation.py)" = 9fa84ef20f19fe0c04df680f49b50ea307e6d624 + test "$(git -C _deps/ucns-ordinal hash-object src/ucns/public_gonol.py)" = c1955e46e2dc918fb657cb346e42106d71937e91 + python - <<'PY' + import json, hashlib + from pathlib import Path + graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) + assert graph['schema'] == 'the-interdependency.stack-manifest' and graph['version'] == '1.0.0' + ucns = next(r for r in graph['repositories'] if r['repository'] == 'The-Interdependency/ucns') + assert ucns['commit'] == 'ed0b0760f05cd975a7a811f8abeb70a11d09f00b' + payload = {key: graph[key] for key in ('repositories', 'boundaries')} + assert hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':'), ensure_ascii=True).encode()).hexdigest() == graph['work_graph_sha256'] + assert graph['boundaries']['authority_transfer'] is False + PY + - name: Install exact native producer and test tools + run: | + python -m pip install ./_deps/ucns-ordinal + python -m pip install pytest==8.3.5 PyYAML==6.0.2 setuptools==82.0.1 wheel==0.46.3 packaging==26.0 + - name: Execute source consumer tests without geometry mocks + env: + PYTHONPATH: human/english + run: | + mkdir -p _state + python -m pytest -q tests/test_ordinal_construction.py --junitxml=_state/source.xml + python -m english_gonol.ordinal_construction word > _state/word-source.json + - name: Build and clean-install UCHC with UCNS + run: | + python -m pip wheel --no-deps --no-build-isolation . -w _state/dist + python -m venv _state/clean + _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 + _state/clean/bin/python -m pip install ./_deps/ucns-ordinal + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl + mkdir -p _state/isolated-tests + cp tests/test_ordinal_construction.py _state/isolated-tests/test_ordinal_construction.py + _state/clean/bin/python -I -m pytest -q _state/isolated-tests --junitxml=_state/installed.xml + _state/clean/bin/python -I -m english_gonol.ordinal_construction word > _state/word-installed.json + - name: Verify exact end-to-end artifact, receipt and test outcomes + run: | + python - <<'PY' + from fractions import Fraction + from pathlib import Path + import hashlib, json, xml.etree.ElementTree as ET + left = json.loads(Path('_state/word-source.json').read_text()) + right = json.loads(Path('_state/word-installed.json').read_text()) + assert left == right and right['standing'] == 'constructed' + assert right['recovered_glyphs'] == list('word') + positions = right['construction']['placements'] + assert [p['radius']['power_of_two_denominator'] for p in positions] == [4,3,2,1] + assert all(p['carrier_receipt'] == positions[0]['carrier_receipt'] for p in positions) + assert right['geometry_authority']['commit'] == 'ed0b0760f05cd975a7a811f8abeb70a11d09f00b' + for name in ('source', 'installed'): + cases = list(ET.parse('_state/' + name + '.xml').getroot().iter('testsuite')) + totals = {k: sum(int(x.get(k,0)) for x in cases) for k in ('tests','failures','errors','skipped')} + assert totals['tests'] >= 7 and totals['failures'] == totals['errors'] == totals['skipped'] == 0, totals + wheel = Path('_state/dist/uchc-0.1.0a3-py3-none-any.whl') + evidence = {'ucns_commit': right['geometry_authority']['commit'], + 'uchc_source': right['receipt'], + 'installed_identical': left == right, + 'wheel_sha256': hashlib.sha256(wheel.read_bytes()).hexdigest(), + 'standing': 'executed pinned UCNS ordinal geometry; no domain graduation'} + Path('_state/ordinal-evidence.json').write_text(json.dumps(evidence, sort_keys=True, indent=2) + '\n') + print(json.dumps(evidence)) + PY + - uses: actions/upload-artifact@v7.0.1 + if: always() + with: + name: uchc-ordinal-geometry + path: | + _state/ordinal-evidence.json + _state/word-source.json + _state/word-installed.json + _state/source.xml + _state/installed.xml + if-no-files-found: warn From 43fa966244141c05d15361962675455f7f9cb953 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:23:36 -0700 Subject: [PATCH 09/30] ci: preserve sealed a2 wheel identity while verifying new ordinal-geometry a3 wheel --- .../workflows/english-structural-profile.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 4385774..5b6ffc8 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -91,6 +91,13 @@ jobs: } assert json.dumps(receipt, sort_keys=True, separators=(',', ':')) == json.dumps(expected_extraction, sort_keys=True, separators=(',', ':')) PYTHON + # Preserve the exact sealed a2 wheel as independent historical evidence. + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/uchc + ref: 45f50ebce04235611223fda13cf67e1a71d45dba + path: _deps/uchc-a2 + persist-credentials: false - uses: actions/setup-python@v7.0.0 with: python-version: '3.12.14' @@ -110,10 +117,11 @@ jobs: env: SOURCE_DATE_EPOCH: '1790308800' run: | + python -m pip wheel --no-deps --no-build-isolation ./_deps/uchc-a2 -w _state/historical-dist python -m pip wheel --no-deps --no-build-isolation . -w _state/dist python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a2-py3-none-any.whl + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl mkdir -p _state/isolated-tests cp ./human/english/tests/test_structural_profile.py _state/isolated-tests/ _state/clean/bin/python -I -m pytest -q _state/isolated-tests --junitxml=_state/installed.xml @@ -189,8 +197,10 @@ jobs: assert verification['source_evidence_sha256'] == manifest['metadata']['source']['evidence_sha256'] assert verification['work_graph_sha256'] == graph['work_graph_sha256'] assert verification['forge_source_commit'] == next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') - wheel = pathlib.Path('_state/dist') / ('uchc-' + verification['candidate_version'] + '-py3-none-any.whl') - assert verification['candidate_wheel_sha256'] == digest(wheel) + historical_wheel = pathlib.Path('_state/historical-dist') / ('uchc-' + verification['candidate_version'] + '-py3-none-any.whl') + assert verification['candidate_wheel_sha256'] == digest(historical_wheel) + wheel = pathlib.Path('_state/dist/uchc-0.1.0a3-py3-none-any.whl') + assert wheel.is_file() and digest(wheel) != digest(historical_wheel) tests = {} for name, expected in [('structural', verification['tests']['structural_included_in_english']), ('installed', verification['tests']['clean_installed_structural'])]: suites = list(ET.parse('_state/' + name + '.xml').getroot().iter('testsuite')) @@ -198,7 +208,7 @@ jobs: assert counts['tests'] == expected and not any(counts[k] for k in ['failures', 'errors', 'skipped']), counts tests[name] = counts assert verification['tests']['clean_installed_structural'] == tests['structural']['tests'] - record = {'schema': 'english.structural-hosted-replay', 'commit': os.environ['REPLAY_COMMIT'], 'run_id': os.environ['REPLAY_RUN'], 'python': platform.python_version(), 'sqlite': sqlite3.sqlite_version, 'local_evidence_python': verification['python'], 'local_evidence_sqlite': verification['sqlite'], 'verification_sha256': digest(root / 'experiments/structural-profile-v1/verification.json'), 'construct_db_sha256': digest('_state/first/construct.db'), 'logical_receipt': manifest['receipt_sha256'], 'candidate_wheel_sha256': digest(wheel), 'work_graph_sha256': graph['work_graph_sha256'], 'tests': tests, 'scope': 'hosted source and clean-wheel artifact equivalence; local domain and combined-suite totals and native-attachment observations remain separately scoped historical observations'} + record = {'schema': 'english.structural-hosted-replay', 'commit': os.environ['REPLAY_COMMIT'], 'run_id': os.environ['REPLAY_RUN'], 'python': platform.python_version(), 'sqlite': sqlite3.sqlite_version, 'local_evidence_python': verification['python'], 'local_evidence_sqlite': verification['sqlite'], 'verification_sha256': digest(root / 'experiments/structural-profile-v1/verification.json'), 'construct_db_sha256': digest('_state/first/construct.db'), 'logical_receipt': manifest['receipt_sha256'], 'candidate_wheel_sha256': digest(wheel), 'historical_a2_wheel_sha256': digest(historical_wheel), 'work_graph_sha256': graph['work_graph_sha256'], 'tests': tests, 'scope': 'hosted source and clean-wheel artifact equivalence; local domain and combined-suite totals and native-attachment observations remain separately scoped historical observations'} record['source_checkout'] = {key: subprocess.check_output(['git', 'rev-parse', revision], text=True).strip() for key, revision in [('commit', 'HEAD'), ('tree', 'HEAD^{tree}')]} record['participants'] = {checkout: subprocess.check_output(['git', '-C', checkout, 'rev-parse', 'HEAD'], text=True).strip() for checkout in ['_deps/forge', '_deps/ucns', '_deps/oewn', '_deps/metapat', '_deps/skill-lib', '_deps/uchc-baseline']} record['manifest_sha256'] = digest('_state/first/manifest.json') From 07d83b282436f47bb7fe43ccb9aaabf44fc3ac9b Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:23:48 -0700 Subject: [PATCH 10/30] ci: run immutable full-corpus replay through versioned a3 consumer wheel --- .github/workflows/english-full-corpus.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/english-full-corpus.yml b/.github/workflows/english-full-corpus.yml index 6c0477c..862292b 100644 --- a/.github/workflows/english-full-corpus.yml +++ b/.github/workflows/english-full-corpus.yml @@ -64,7 +64,7 @@ jobs: .venv/bin/python -m pip wheel --no-deps --no-build-isolation ./source -w evidence/dist python3 -m venv .clean .clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0a2-py3-none-any.whl + .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0a3-py3-none-any.whl mkdir -p isolated-tests cp source/human/english/tests/test_inference_input.py isolated-tests/test_input.py cp source/human/english/tests/test_structural_profile.py isolated-tests/test_structural_profile.py @@ -77,7 +77,7 @@ jobs: import python_gonol assert '/.clean/' in str(Path(reader.__file__).resolve()) assert '/.clean/' in str(Path(python_gonol.__file__).resolve()) - assert version('uchc') == '0.1.0a2' + assert version('uchc') == '0.1.0a3' PY - name: Build all pinned corpus rows through the installed artifact shell: bash @@ -122,7 +122,7 @@ jobs: counts = {key: sum(int(s.get(key, 0)) for s in suites) for key in ('tests', 'failures', 'errors', 'skipped')} assert counts['tests'] > 0 and not any(counts[k] for k in ('failures', 'errors', 'skipped')), counts tests[path.stem] = counts - wheel = Path('evidence/dist/uchc-0.1.0a2-py3-none-any.whl') + wheel = Path('evidence/dist/uchc-0.1.0a3-py3-none-any.whl') with wheel.open('rb') as stream: digest = hashlib.file_digest(stream, 'sha256').hexdigest() record = {'source_commit': os.environ['SOURCE_SHA'], 'wheel': wheel.name, 'wheel_sha256': digest, 'tests': tests, 'input_acceptance': json.loads(Path('evidence/input-acceptance.json').read_text())['receipt_sha256'], 'standing': 'verified release candidate; not neural inference or completed domain graduation'} From 0c5b028a440a28855cd14d8ab674c55196570181 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:28:10 -0700 Subject: [PATCH 11/30] ci: census every verified English word through pinned UCNS geometry with explicit missing-bearing evidence --- .../workflows/english-structural-profile.yml | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 5b6ffc8..855a466 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -98,6 +98,12 @@ jobs: ref: 45f50ebce04235611223fda13cf67e1a71d45dba path: _deps/uchc-a2 persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/ucns + ref: ed0b0760f05cd975a7a811f8abeb70a11d09f00b + path: _deps/ucns-ordinal + persist-credentials: false - uses: actions/setup-python@v7.0.0 with: python-version: '3.12.14' @@ -136,6 +142,62 @@ jobs: python -m english_gonol.structural_query _state/first 'Dr. creates geometry. Dr. creates 3.14...' > _state/query.json cmp _state/first/manifest.json human/english/experiments/structural-profile-v1/manifest.json cmp _state/query.json human/english/experiments/structural-profile-v1/query.json + - name: Exercise UCNS ordinal geometry across every corpus word + run: | + _state/clean/bin/python -m pip install ./_deps/ucns-ordinal + _state/clean/bin/python -I - <<'PYTHON' + from collections import Counter + import hashlib, json + from pathlib import Path + from english_gonol.ordinal_construction import ( + OrdinalGeometryError, OrdinalStructuralField, construct_glyph_gonol, + PUBLIC_GONOL_SHA256, UCNS_COMMIT, + ) + with OrdinalStructuralField('_state/first') as field: + assert field.complete_corpus + word = field.word('geometry') + assert word['geometry_state'] == 'constructed' + assert word['occurrence_count'] == 8 + assert [p['radius']['power_of_two_denominator'] for p in word['gonal_order']['placements']] == list(range(8, 0, -1)) + graph = field.construct('geometry') + geometry = field.geometry(graph, operation='ordinal-affixiation') + assert geometry['standing'] == 'constructed' + assert len(geometry['word_interiors']) == 1 + assert geometry['word_interiors'][0]['receipt'] == word['geometry_receipt'] + assert field.compose(graph, relation='ordered-text')['glyph_geometry'] == geometry['glyph_frame'] + census = hashlib.sha256() + total = constructed = unresolved = glyph_occurrences = 0 + missing = Counter() + source = 'uchc:english.structural/1:' + field.manifest['receipt_sha256'] + for wid, surface in field.db.execute('SELECT id,surface FROM words ORDER BY id'): + total += 1 + glyph_occurrences += len(surface) + try: + obj = construct_glyph_gonol(surface, source=source + ':word:' + str(wid)) + except OrdinalGeometryError as exc: + assert exc.code == 'PUBLIC_GONOL_ANGLE_UNAVAILABLE', exc.code + unresolved += 1 + missing.update(exc.glyphs) + item = {'word_id': wid, 'standing': 'hmmm', 'missing': list(exc.glyphs)} + else: + constructed += 1 + assert obj.recover() == tuple(surface) + assert obj.placement(0).exponent == len(surface) + assert obj.placement(len(surface) - 1).exponent == 1 + item = {'word_id': wid, 'standing': 'constructed', 'receipt': obj.receipt} + census.update(json.dumps(item, sort_keys=True, ensure_ascii=False, separators=(',', ':')).encode() + b'\n') + assert total > 0 and total == constructed + unresolved + record = {'schema': 'uchc.english-ordinal-corpus-census', + 'version': '1.0.0', 'corpus_receipt': field.manifest['receipt_sha256'], + 'ucns_commit': UCNS_COMMIT, 'public_gonol_sha256': PUBLIC_GONOL_SHA256, + 'word_identities': total, 'placed_words': constructed, + 'unplaced_words': unresolved, 'glyph_occurrences': glyph_occurrences, + 'missing_bearings': dict(sorted((f'U+{ord(g):04X}', n) for g, n in missing.items())), + 'ordered_census_sha256': census.hexdigest(), + 'standing': 'SURVIVED' if not unresolved else 'hmmm:expanded_public_gonol_required'} + Path('_state/ordinal-corpus-census.json').write_text(json.dumps(record, indent=2, sort_keys=True) + '\n') + print(json.dumps(record)) + PYTHON - name: Diagnose physical SQLite replay identity without relaxing the gate run: | python - <<'PYTHON' @@ -232,6 +294,7 @@ jobs: _state/first/manifest.json _state/query.json _state/hosted-replay.json + _state/ordinal-corpus-census.json _state/sqlite-diagnostic.json _state/structural.xml _state/installed.xml From 9c448323aff63bb09bac91f9dec41ed57a606933 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:29:52 -0700 Subject: [PATCH 12/30] fix(english): preserve SPACE as origin/seam, never a radial glyph placement --- .../english_gonol/ordinal_construction.py | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/human/english/english_gonol/ordinal_construction.py b/human/english/english_gonol/ordinal_construction.py index 1ff2ca2..bdc4231 100644 --- a/human/english/english_gonol/ordinal_construction.py +++ b/human/english/english_gonol/ordinal_construction.py @@ -128,6 +128,9 @@ def construct_glyph_gonol(text: str, *, source: str = "uchc:english.ordinal/1"): raise OrdinalGeometryError("UNICODE_SCALAR_REQUIRED") if not isinstance(source, str) or not source: raise OrdinalGeometryError("SOURCE_IDENTITY_REQUIRED") + # SPACE is the fixed reference and seam event, not a radial glyph instance. + if " " in text: + raise OrdinalGeometryError("SPACE_SEAM_REQUIRES_FRAME_ATTACHMENT") ordinal, public, carrier = _ucns() missing = tuple(dict.fromkeys( glyph for glyph in text if public.public_gonol_position(glyph) is None @@ -216,10 +219,6 @@ def geometry(self, record: dict, *, operation: str) -> dict: if not graph["source"]: return _refusal("NONEMPTY_GLYPH_SEQUENCE_REQUIRED") try: - glyph_frame = construct_glyph_gonol( - graph["source"], - source="uchc:english.structural-query:" + graph["receipt_sha256"], - ) interiors: dict[str, dict] = {} word_order = [] for part in graph["parts"]: @@ -236,6 +235,21 @@ def geometry(self, record: dict, *, operation: str) -> dict: "receipt": interior["geometry_receipt"], } word_order.append({"ordinal": part["ordinal"], "word_id": part["identity"]}) + if " " in graph["source"]: + return { + "standing": "partial", + "code": "SPACE_SEAM_FRAME_NOT_SELECTED", + "source_receipt": graph["receipt_sha256"], + "word_interiors": list(interiors.values()), + "ordered_word_references": word_order, + "word_sites": graph["word_sites"], + "higher_word_frame": "hmmm:WORD_CARRIER_ANGLE_NOT_SELECTED", + "edges": [], + } + glyph_frame = construct_glyph_gonol( + graph["source"], + source="uchc:english.structural-query:" + graph["receipt_sha256"], + ) except OrdinalGeometryError as exc: return _refusal(exc.code, exc.glyphs) return { @@ -256,6 +270,8 @@ def compose(self, record: dict, *, relation: str) -> dict: geometry = self.geometry(record, operation="ordinal-affixiation") if geometry["standing"] != "constructed": result["geometry_state"] = "hmmm:" + geometry["code"] + result["word_interiors"] = geometry.get("word_interiors", []) + result["word_sites"] = geometry.get("word_sites", []) result["geometry_refusal"] = geometry return result result["geometry_state"] = "constructed-glyph-frame;higher-word-frame-hmmm" From b0ba3d8f7fe6968534ddbf49c965742cea755838 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:30:10 -0700 Subject: [PATCH 13/30] test: refuse literal SPACE as a radial occurrence; preserve origin distinction --- tests/test_ordinal_construction.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_ordinal_construction.py b/tests/test_ordinal_construction.py index ef9c695..9dcc54e 100644 --- a/tests/test_ordinal_construction.py +++ b/tests/test_ordinal_construction.py @@ -20,6 +20,13 @@ # timeout: 30 # mutates: none # cleanup: none +# id: check_ordinal_space_is_reference +# proves: uchc_ordinal_no_fabricated_angles +# call: self::test_space_is_origin_not_radial_glyph +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none # id: check_ordinal_source_drift # proves: uchc_ordinal_no_fabricated_angles # call: self::test_source_drift_refuses @@ -132,6 +139,14 @@ def test_missing_public_gonol_angles_fail_closed(): assert public.public_gonol_sha256() == PUBLIC_GONOL_SHA256 +def test_space_is_origin_not_radial_glyph(): + assert public.public_gonol_position(" ") == 0 + for text in (" ", "w o", "word "): + with pytest.raises(OrdinalGeometryError) as exc: + construct_glyph_gonol(text) + assert exc.value.code == "SPACE_SEAM_REQUIRES_FRAME_ATTACHMENT" + + def test_source_drift_refuses(tmp_path, monkeypatch): fixture = tmp_path / "forged.py" fixture.write_text("def affine_radius(i): return 17\n", encoding="utf-8") From 1913b3a9dcfd909453fa00c7348d300bc4b477ce Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:30:33 -0700 Subject: [PATCH 14/30] docs: distinguish fixed SPACE origin from literal seam events --- human/english/docs/ordinal-geometry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index 864ee95..dc1f586 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -45,7 +45,7 @@ To consume a complete **verified** structural English corpus: The new OrdinalStructuralField is the geometry-enabled API. The historical StructuralField remains available for byte-identical verification of its immutable artifacts. The new consumer does not rewrite historical database rows or receipts. -The geometry API constructs a raw glyph frame for verified admitted text and separately preserves the ordered internal geometry of each closed word identity. It does **not** assign an invented angular carrier to the higher word frame; that separate geometry remains hmmm. Other operations, such as displacement, retain their explicit refusal. +The geometry API constructs a raw glyph frame when the admitted text has no literal SPACE seam and separately preserves the ordered internal geometry of each closed word identity. The Public Gonol's fixed SPACE position is an origin/seam, not a glyph inserted at nonzero radius. Text crossing a literal SPACE returns **partial** geometry with its word interiors and word-site events preserved, while the cross-word frame remains hmmm. It does **not** invent an angular carrier for the higher word frame. Other operations, such as displacement, retain their explicit refusal. ## Evidence and failure From 8cc5cad13518128bc63181f0945024dc853f2508 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:30:44 -0700 Subject: [PATCH 15/30] ci: verify SPACE-separated complete-corpus queries preserve word interiors without false parent geometry --- .github/workflows/english-structural-profile.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 855a466..06547d3 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -165,6 +165,10 @@ jobs: assert len(geometry['word_interiors']) == 1 assert geometry['word_interiors'][0]['receipt'] == word['geometry_receipt'] assert field.compose(graph, relation='ordered-text')['glyph_geometry'] == geometry['glyph_frame'] + with_space = field.geometry(field.construct('geometry geometry'), operation='ordinal-affixiation') + assert with_space['standing'] == 'partial' and with_space['code'] == 'SPACE_SEAM_FRAME_NOT_SELECTED' + assert len(with_space['word_interiors']) == 1 and len(with_space['ordered_word_references']) == 2 + assert 'glyph_frame' not in with_space census = hashlib.sha256() total = constructed = unresolved = glyph_occurrences = 0 missing = Counter() From 819b0aed18692c07a0216f76e1aac9e11e7f5703 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:36:22 -0700 Subject: [PATCH 16/30] fix(english): authenticate geometry scope against exact Public Gonol glyph carrier before receipt labeling --- .../english_gonol/ordinal_construction.py | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/human/english/english_gonol/ordinal_construction.py b/human/english/english_gonol/ordinal_construction.py index bdc4231..7f9799f 100644 --- a/human/english/english_gonol/ordinal_construction.py +++ b/human/english/english_gonol/ordinal_construction.py @@ -150,10 +150,33 @@ def construct_glyph_gonol(text: str, *, source: str = "uchc:english.ordinal/1"): def geometry_record(construction) -> dict: - """Transport the actual UCNS geometry and receipt, not derived local coordinates.""" - ordinal, _public, _carrier = _ucns() + """Carry only Public Gonol glyph constructions, not arbitrary UCNS frames.""" + ordinal, _public, carrier = _ucns() if not isinstance(construction, ordinal.Construction): raise OrdinalGeometryError("UCNS_CONSTRUCTION_REQUIRED") + if ( + construction.origin != "SPACE" + or construction.relation != "english.ordinal/1:glyph-instantiation" + or not construction.participants + or any( + participant.interior is not None + or participant.carrier != carrier + or participant.identity == " " + for participant in construction.participants + ) + or construction.identity != "".join(p.identity for p in construction.participants) + or construction.recover() != tuple(construction.identity) + ): + raise OrdinalGeometryError("UCNS_PUBLIC_GLYPH_CONSTRUCTION_REQUIRED") + # A native UCNS object can be built using an alternate relation or carrier. + # Never attach Public Gonol provenance to that different construction. + rebuilt = ordinal.affixiate( + construction.identity, construction.participants, + origin=construction.origin, relation=construction.relation, + source=construction.source, + ) + if construction.receipt != rebuilt.receipt: + raise OrdinalGeometryError("UCNS_CONSTRUCTION_RECEIPT_MISMATCH") return { "schema": SCHEMA, "version": VERSION, From 1595989d57e69421177ee9473f7f9a5415752ab7 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:36:34 -0700 Subject: [PATCH 17/30] test: falsify Pubic Gonol attribution for unrelated word carriers, origins and relations --- tests/test_ordinal_construction.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/test_ordinal_construction.py b/tests/test_ordinal_construction.py index 9dcc54e..8512770 100644 --- a/tests/test_ordinal_construction.py +++ b/tests/test_ordinal_construction.py @@ -34,6 +34,13 @@ # timeout: 30 # mutates: filesystem # cleanup: pytest_tmp_path +# id: check_ordinal_rejects_unrelated_ucns_frames +# proves: uchc_ordinal_ucns_is_the_sole_geometry_authority, uchc_ordinal_no_fabricated_angles +# call: self::test_geometry_record_never_mislabels_non_glyph_frames +# requires: python3, pytest +# timeout: 30 +# mutates: none +# cleanup: none # id: check_ordinal_partial_corpus # proves: uchc_ordinal_no_fabricated_angles, uchc_ordinal_query_consumes_verified_word_interiors # call: self::test_partial_corpus_refuses_public_binding @@ -209,6 +216,27 @@ def test_ucns_nested_construction_retains_word_interior(): assert sentence.participants[1].interior is first + +def test_geometry_record_never_mislabels_non_glyph_frames(): + public_word = construct_glyph_gonol("word") + other = ordinal.Carrier(("word", "other"), "fixture:word-carrier") + unrelated = ordinal.affixiate( + "test:word", (ordinal.Participant.closed(other, public_word),), + origin="SPACE", relation="test:word-promotion", source="fixture", + ) + for obj in (unrelated, ordinal.affixiate( + "word", public_word.participants, + origin="OTHER", relation=public_word.relation, source="fixture", + ), ordinal.affixiate( + "word", public_word.participants, + origin="SPACE", relation="unrelated-relation", source="fixture", + )): + with pytest.raises(OrdinalGeometryError) as exc: + geometry_record(obj) + assert exc.value.code == "UCNS_PUBLIC_GLYPH_CONSTRUCTION_REQUIRED" + assert geometry_record(public_word)["receipt"] == public_word.receipt + + def test_geometry_record_refuses_fake_construction(): with pytest.raises(OrdinalGeometryError) as exc: geometry_record({"receipt": "made-up"}) From c514e1a2a3f3da5ffae9ebf76d67a1d348845842 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 19 Oct 2026 10:36:42 -0700 Subject: [PATCH 18/30] ci: exercise geometry consumer whenever inherited English implementation changes --- .github/workflows/english-ordinal-geometry.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml index 207146f..d4f7852 100644 --- a/.github/workflows/english-ordinal-geometry.yml +++ b/.github/workflows/english-ordinal-geometry.yml @@ -1,10 +1,10 @@ name: English ordinal UCNS geometry on: pull_request: - paths: ['human/english/english_gonol/ordinal_construction.py', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] + paths: ['human/english/**', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] push: branches: [main] - paths: ['human/english/english_gonol/ordinal_construction.py', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] + paths: ['human/english/**', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] permissions: contents: read jobs: From 31205e004366788990037bfbc278c5e3175060c2 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 26 Oct 2026 20:13:20 -0700 Subject: [PATCH 19/30] Repair ordinal forge extraction and detached UCNS provenance Extract the exact Stack candidate and tests, preserve authority in partial word interiors, and bind evidence to source commits and the work graph. Verify full-corpus partial results from Stack and the installed wheel. --- .../workflows/english-ordinal-geometry.yml | 79 ++++++++++++--- .../workflows/english-structural-profile.yml | 73 +++++++++++++- README.md | 4 +- docs/MIGRATION.md | 20 ++++ .../english-ordinal-geometry-v1.json | 14 +-- human/english/README.md | 4 +- human/english/docs/ordinal-geometry.md | 17 +++- .../english_gonol/ordinal_construction.py | 26 +++-- .../ordinal-geometry-v1/extraction.json | 95 +++++++++++++++++++ tests/test_ordinal_construction.py | 4 + tests/test_ordinal_corpus.py | 75 +++++++++++++++ 11 files changed, 381 insertions(+), 30 deletions(-) create mode 100644 human/english/experiments/ordinal-geometry-v1/extraction.json create mode 100644 tests/test_ordinal_corpus.py diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml index d4f7852..4c17d22 100644 --- a/.github/workflows/english-ordinal-geometry.yml +++ b/.github/workflows/english-ordinal-geometry.yml @@ -1,10 +1,10 @@ name: English ordinal UCNS geometry on: pull_request: - paths: ['human/english/**', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] + paths: ['human/english/**', 'tests/test_ordinal*.py', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] push: branches: [main] - paths: ['human/english/**', 'tests/test_ordinal_construction.py', 'human/english/docs/ordinal-geometry.md', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] + paths: ['human/english/**', 'tests/test_ordinal*.py', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'pyproject.toml', '.github/workflows/english-ordinal-geometry.yml'] permissions: contents: read jobs: @@ -25,7 +25,15 @@ jobs: - uses: actions/setup-python@v7.0.0 with: python-version: '3.12.14' + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/stack + ref: c8bddd5ae02fdaa001c2ba6962da66117384437e + path: _deps/ordinal-forge + persist-credentials: false - name: Verify immutable producer and work graph + env: + PYTHONPATH: human/english shell: bash run: | set -euo pipefail @@ -33,8 +41,9 @@ jobs: test "$(git -C _deps/ucns-ordinal hash-object src/ucns/ordinal_affixiation.py)" = 9fa84ef20f19fe0c04df680f49b50ea307e6d624 test "$(git -C _deps/ucns-ordinal hash-object src/ucns/public_gonol.py)" = c1955e46e2dc918fb657cb346e42106d71937e91 python - <<'PY' - import json, hashlib + import json, hashlib, subprocess from pathlib import Path + from english_gonol.structural_construct import IMPLEMENTATION_FILES graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) assert graph['schema'] == 'the-interdependency.stack-manifest' and graph['version'] == '1.0.0' ucns = next(r for r in graph['repositories'] if r['repository'] == 'The-Interdependency/ucns') @@ -42,6 +51,23 @@ jobs: payload = {key: graph[key] for key in ('repositories', 'boundaries')} assert hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':'), ensure_ascii=True).encode()).hexdigest() == graph['work_graph_sha256'] assert graph['boundaries']['authority_transfer'] is False + source = next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') + assert subprocess.check_output(['git', '-C', '_deps/ordinal-forge', 'rev-parse', 'HEAD'], text=True).strip() == source + extraction = json.loads(Path('human/english/experiments/ordinal-geometry-v1/extraction.json').read_text()) + assert extraction['source_repository'] == 'The-Interdependency/stack' + assert extraction['source_commit'] == source and extraction['authority_transfer'] is False + assert extraction['work_graph_sha256'] == graph['work_graph_sha256'] + expected = {f'human/english/english_gonol/{p}': f'english_gonol/{p}' for p in IMPLEMENTATION_FILES} + expected['human/english/english_gonol/ordinal_construction.py'] = 'english_gonol/ordinal_construction.py' + for name in ('test_ordinal_construction.py', 'test_ordinal_corpus.py'): + expected['tests/' + name] = 'ordinal_tests/' + name + assert len(extraction['files']) == len(expected) + assert {item['target']: item['source'] for item in extraction['files']} == expected + for item in extraction['files']: + original = Path('_deps/ordinal-forge/research/english-gonol') / item['source'] + copied = Path(item['target']) + assert original.read_bytes() == copied.read_bytes(), item['target'] + assert hashlib.sha256(copied.read_bytes()).hexdigest() == item['sha256'], item['target'] PY - name: Install exact native producer and test tools run: | @@ -54,6 +80,12 @@ jobs: mkdir -p _state python -m pytest -q tests/test_ordinal_construction.py --junitxml=_state/source.xml python -m english_gonol.ordinal_construction word > _state/word-source.json + - name: Execute the exact Stack source before candidate comparison + env: + PYTHONPATH: _deps/ordinal-forge/research/english-gonol + run: | + python -m pytest -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_construction.py --junitxml=_state/forge.xml + python -m english_gonol.ordinal_construction word > _state/word-forge.json - name: Build and clean-install UCHC with UCNS run: | python -m pip wheel --no-deps --no-build-isolation . -w _state/dist @@ -66,27 +98,48 @@ jobs: _state/clean/bin/python -I -m pytest -q _state/isolated-tests --junitxml=_state/installed.xml _state/clean/bin/python -I -m english_gonol.ordinal_construction word > _state/word-installed.json - name: Verify exact end-to-end artifact, receipt and test outcomes + env: + UCHC_SOURCE_COMMIT: ${{ github.sha }} + UCHC_PR_HEAD: ${{ github.event.pull_request.head.sha || github.sha }} run: | python - <<'PY' from fractions import Fraction from pathlib import Path - import hashlib, json, xml.etree.ElementTree as ET + import hashlib, json, os, subprocess, xml.etree.ElementTree as ET left = json.loads(Path('_state/word-source.json').read_text()) right = json.loads(Path('_state/word-installed.json').read_text()) - assert left == right and right['standing'] == 'constructed' + forge = json.loads(Path('_state/word-forge.json').read_text()) + assert left == right == forge and right['standing'] == 'constructed' assert right['recovered_glyphs'] == list('word') positions = right['construction']['placements'] assert [p['radius']['power_of_two_denominator'] for p in positions] == [4,3,2,1] assert all(p['carrier_receipt'] == positions[0]['carrier_receipt'] for p in positions) assert right['geometry_authority']['commit'] == 'ed0b0760f05cd975a7a811f8abeb70a11d09f00b' - for name in ('source', 'installed'): + tests = {} + for name in ('source', 'installed', 'forge'): cases = list(ET.parse('_state/' + name + '.xml').getroot().iter('testsuite')) totals = {k: sum(int(x.get(k,0)) for x in cases) for k in ('tests','failures','errors','skipped')} - assert totals['tests'] >= 7 and totals['failures'] == totals['errors'] == totals['skipped'] == 0, totals + assert totals['tests'] >= 10 and totals['failures'] == totals['errors'] == totals['skipped'] == 0, totals + tests[name] = totals wheel = Path('_state/dist/uchc-0.1.0a3-py3-none-any.whl') - evidence = {'ucns_commit': right['geometry_authority']['commit'], - 'uchc_source': right['receipt'], - 'installed_identical': left == right, + source_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() + assert source_commit == os.environ['UCHC_SOURCE_COMMIT'] + graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) + payload = {key: graph[key] for key in ('repositories', 'boundaries')} + assert hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':')).encode()).hexdigest() == graph['work_graph_sha256'] + forge_commit = subprocess.check_output(['git', '-C', '_deps/ordinal-forge', 'rev-parse', 'HEAD'], text=True).strip() + assert forge_commit == next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') + evidence = {'schema': 'uchc.english-ordinal-acceptance', 'version': '1.0.0', + 'ucns_commit': right['geometry_authority']['commit'], + 'uchc_source_commit': source_commit, + 'uchc_pr_head_commit': os.environ['UCHC_PR_HEAD'], + 'uchc_source_tree': subprocess.check_output(['git', 'rev-parse', 'HEAD^{tree}'], text=True).strip(), + 'forge_source_commit': forge_commit, + 'work_graph_sha256': graph['work_graph_sha256'], + 'extraction_sha256': hashlib.sha256(Path('human/english/experiments/ordinal-geometry-v1/extraction.json').read_bytes()).hexdigest(), + 'construction_receipt': right['receipt'], + 'installed_identical': left == right == forge, + 'tests': tests, 'wheel_sha256': hashlib.sha256(wheel.read_bytes()).hexdigest(), 'standing': 'executed pinned UCNS ordinal geometry; no domain graduation'} Path('_state/ordinal-evidence.json').write_text(json.dumps(evidence, sort_keys=True, indent=2) + '\n') @@ -100,6 +153,10 @@ jobs: _state/ordinal-evidence.json _state/word-source.json _state/word-installed.json + _state/word-forge.json _state/source.xml _state/installed.xml - if-no-files-found: warn + _state/forge.xml + human/english/experiments/ordinal-geometry-v1/extraction.json + docs/work-graphs/english-ordinal-geometry-v1.json + if-no-files-found: error diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 06547d3..764da22 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -2,10 +2,10 @@ name: English structural profile on: pull_request: - paths: ['human/english/**', 'programming/python/**', 'pyproject.toml', 'README.md', 'LICENSE', 'NOTICE', '.github/workflows/english-structural-profile.yml'] + paths: ['human/english/**', 'tests/test_ordinal*.py', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'programming/python/**', 'pyproject.toml', 'README.md', 'LICENSE', 'NOTICE', '.github/workflows/english-structural-profile.yml'] push: branches: [main] - paths: ['human/english/**', 'programming/python/**', 'pyproject.toml', 'README.md', 'LICENSE', 'NOTICE', '.github/workflows/english-structural-profile.yml'] + paths: ['human/english/**', 'tests/test_ordinal*.py', 'docs/work-graphs/english-ordinal-geometry-v1.json', 'programming/python/**', 'pyproject.toml', 'README.md', 'LICENSE', 'NOTICE', '.github/workflows/english-structural-profile.yml'] permissions: contents: read jobs: @@ -104,6 +104,12 @@ jobs: ref: ed0b0760f05cd975a7a811f8abeb70a11d09f00b path: _deps/ucns-ordinal persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/stack + ref: c8bddd5ae02fdaa001c2ba6962da66117384437e + path: _deps/ordinal-forge + persist-credentials: false - uses: actions/setup-python@v7.0.0 with: python-version: '3.12.14' @@ -142,6 +148,61 @@ jobs: python -m english_gonol.structural_query _state/first 'Dr. creates geometry. Dr. creates 3.14...' > _state/query.json cmp _state/first/manifest.json human/english/experiments/structural-profile-v1/manifest.json cmp _state/query.json human/english/experiments/structural-profile-v1/query.json + - name: Verify detached partial geometry against Stack and installed wheel + env: + UCHC_STRUCTURAL_FIELD: ${{ github.workspace }}/_state/first + UCHC_SOURCE_COMMIT: ${{ github.sha }} + run: | + python -m pip install ./_deps/ucns-ordinal + _state/clean/bin/python -m pip install ./_deps/ucns-ordinal + mkdir -p _state/corpus-tests + cp tests/test_ordinal_corpus.py _state/corpus-tests/ + PYTHONPATH=_deps/ordinal-forge/research/english-gonol python -m pytest -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_corpus.py --junitxml=_state/ordinal-corpus-forge.xml + _state/clean/bin/python -I -m pytest -q _state/corpus-tests --junitxml=_state/ordinal-corpus-installed.xml + python - <<'PYTHON' + import hashlib, json, os, subprocess, sys, xml.etree.ElementTree as ET + from pathlib import Path + source_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() + assert source_commit == os.environ['UCHC_SOURCE_COMMIT'] + graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) + payload = {key: graph[key] for key in ('repositories', 'boundaries')} + assert hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':')).encode()).hexdigest() == graph['work_graph_sha256'] + forge_commit = subprocess.check_output(['git', '-C', '_deps/ordinal-forge', 'rev-parse', 'HEAD'], text=True).strip() + assert forge_commit == next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') + extraction_path = Path('human/english/experiments/ordinal-geometry-v1/extraction.json') + extraction = json.loads(extraction_path.read_text()) + assert extraction['source_commit'] == forge_commit + assert extraction['work_graph_sha256'] == graph['work_graph_sha256'] + for item in extraction['files']: + source = Path('_deps/ordinal-forge/research/english-gonol') / item['source'] + assert source.read_bytes() == Path(item['target']).read_bytes() + assert hashlib.sha256(source.read_bytes()).hexdigest() == item['sha256'] + tests = {} + for name in ('forge', 'installed'): + suites = list(ET.parse('_state/ordinal-corpus-' + name + '.xml').getroot().iter('testsuite')) + counts = {k: sum(int(s.get(k, 0)) for s in suites) for k in ('tests', 'failures', 'errors', 'skipped')} + assert counts == {'tests': 3, 'failures': 0, 'errors': 0, 'skipped': 0}, counts + tests[name] = counts + env = dict(os.environ, PYTHONPATH=str(Path('_deps/ordinal-forge/research/english-gonol').resolve())) + outputs = {} + for name, command in [('forge', [sys.executable]), ('installed', [str(Path('_state/clean/bin/python').absolute()), '-I'])]: + completed = subprocess.run(command + ['-m', 'english_gonol.ordinal_construction', ' word word ', '--state-dir', os.environ['UCHC_STRUCTURAL_FIELD']], env=env, capture_output=True, text=True) + assert completed.returncode == 2, (name, completed.returncode, completed.stderr) + outputs[name] = completed.stdout + Path('_state/ordinal-partial-' + name + '.json').write_text(completed.stdout) + assert outputs['forge'] == outputs['installed'] + partial = json.loads(outputs['installed']) + assert partial['standing'] == 'partial' and partial['code'] == 'SPACE_SEAM_FRAME_NOT_SELECTED' + record = {'schema': 'uchc.ordinal-corpus-acceptance', 'version': '1.0.0', + 'uchc_source_commit': source_commit, 'forge_source_commit': forge_commit, + 'work_graph_sha256': graph['work_graph_sha256'], + 'extraction_sha256': hashlib.sha256(extraction_path.read_bytes()).hexdigest(), + 'corpus_receipt': json.loads(Path('_state/first/manifest.json').read_text())['receipt_sha256'], + 'partial_output_sha256': hashlib.sha256(outputs['installed'].encode()).hexdigest(), + 'tests': tests, 'standing': 'exact candidate partial-result equivalence; no domain graduation'} + Path('_state/ordinal-corpus-acceptance.json').write_text(json.dumps(record, indent=2) + '\n') + print(json.dumps(record)) + PYTHON - name: Exercise UCNS ordinal geometry across every corpus word run: | _state/clean/bin/python -m pip install ./_deps/ucns-ordinal @@ -168,6 +229,7 @@ jobs: with_space = field.geometry(field.construct('geometry geometry'), operation='ordinal-affixiation') assert with_space['standing'] == 'partial' and with_space['code'] == 'SPACE_SEAM_FRAME_NOT_SELECTED' assert len(with_space['word_interiors']) == 1 and len(with_space['ordered_word_references']) == 2 + assert with_space['word_interiors'][0]['geometry_authority'] == word['geometry_authority'] == geometry['glyph_frame']['geometry_authority'] assert 'glyph_frame' not in with_space census = hashlib.sha256() total = constructed = unresolved = glyph_occurrences = 0 @@ -299,6 +361,13 @@ jobs: _state/query.json _state/hosted-replay.json _state/ordinal-corpus-census.json + _state/ordinal-corpus-acceptance.json + _state/ordinal-corpus-forge.xml + _state/ordinal-corpus-installed.xml + _state/ordinal-partial-forge.json + _state/ordinal-partial-installed.json + human/english/experiments/ordinal-geometry-v1/extraction.json + docs/work-graphs/english-ordinal-geometry-v1.json _state/sqlite-diagnostic.json _state/structural.xml _state/installed.xml diff --git a/README.md b/README.md index 9cec89c..ae1c875 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,14 @@ Applications consume UCHC; applications do not define UCHC. ## Executable English ordinal geometry -UCHC provides an executable, UCNS-backed English glyph construction API in [ordinal_construction.py](human/english/english_gonol/ordinal_construction.py). Run the clean-installed package with the pinned UCNS producer: +UCHC carries a verified extraction of the Stack-owned, UCNS-backed English ordinal candidate in [ordinal_construction.py](human/english/english_gonol/ordinal_construction.py). Run the clean-installed package with the pinned UCNS producer: python -m english_gonol.ordinal_construction word The result contains UCNS turns, exact per-instance radial-halving exponents, and a recoverable receipt. The new OrdinalStructuralField supplies geometry for complete verified English corpus queries; the original StructuralField remains immutable for historical replay. See the [construction law and refusals](human/english/docs/ordinal-geometry.md). +Implementation changes start in the [pinned Stack forge](https://github.com/The-Interdependency/stack/tree/c8bddd5ae02fdaa001c2ba6962da66117384437e/research/english-gonol). The [extraction receipt](human/english/experiments/ordinal-geometry-v1/extraction.json) and CI bind source/test bytes, complete-corpus behavior and the clean wheel; domain graduation remains incomplete. + **hmmm:** glyphs outside the 157-position Public Gonol and higher-scale word-carrier angular attachment require additional selected geometry; neither receives a fabricated bearing. ## Domains diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 1f27b43..e6d0fea 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -228,3 +228,23 @@ installing that candidate into the existing Stack/ZFAE consumer. Its gate 8 remains pending for `0.1.0a2`; the historical `0.1.0a1` integration receipt does not establish it. Release, released-artifact reconsumption and authority transfer remain uncompleted. + +## Ordinal candidate extraction + +The `0.1.0a3` ordinal extension is extracted from Stack +`c8bddd5ae02fdaa001c2ba6962da66117384437e`, proposed in +[Stack #93](https://github.com/The-Interdependency/stack/pull/93). That source +preserves the earlier UCHC #10 proposal identity rather than retroactively +claiming it originated in Stack. Stack owns ongoing implementation changes. + +The [ordinal graph](work-graphs/english-ordinal-geometry-v1.json) and +[extraction receipt](../human/english/experiments/ordinal-geometry-v1/extraction.json) +bind the native producer, complete structural import closure, candidate source +and both test suites. The ordinal gate compares Stack/source/clean-wheel CLI +results. The structural gate additionally compares real complete-corpus partial +results and verifies producer identity on every detached word interior. + +Use [ordinal geometry](../human/english/docs/ordinal-geometry.md) for installation +and query commands. Candidate equivalence is distinct from stable publication, +AHBG lock migration and domain graduation. Merge the Stack producer before its +dependent UCHC extraction; no authority-transition receipt is issued here. diff --git a/docs/work-graphs/english-ordinal-geometry-v1.json b/docs/work-graphs/english-ordinal-geometry-v1.json index 29402ff..a38ab5c 100644 --- a/docs/work-graphs/english-ordinal-geometry-v1.json +++ b/docs/work-graphs/english-ordinal-geometry-v1.json @@ -10,19 +10,19 @@ }, { "repository": "The-Interdependency/stack", - "commit": "faf265422011a7a705c712886d4369136fdbc7eb", - "authority": "active English construction research forge pending UCHC graduation", - "relation": "untouched compatibility and lifecycle authority; historical corpus receipts preserved" + "commit": "c8bddd5ae02fdaa001c2ba6962da66117384437e", + "authority": "active English implementation and public-contract forge pending UCHC graduation", + "relation": "exact repaired ordinal source and tests extracted into this UCHC candidate; source and behavior equivalence required" }, { "repository": "The-Interdependency/uchc", "commit": "45f50ebce04235611223fda13cf67e1a71d45dba", "authority": "verified English structural consumer and extracted candidate baseline", - "relation": "input baseline; proposed new consumer in branch feat/english-ordinal-ucns-consumer-20261019" + "relation": "pre-change extracted baseline; current tested candidate identity is recorded by CI, not inferred from this input pin" }, { "repository": "The-Interdependency/skill-lib", - "commit": "83aef7813dbd040a67ddc07bbb8845f51eb38a3e", + "commit": "e46accffcb67a10630516d486c89e67f6ad19c7a", "authority": "WDLL, gonol construction, cross-repository evidence and audit discipline", "relation": "governing skills consumed; no geometry authority" } @@ -31,7 +31,7 @@ "authority_transfer": false, "proof_status_transfer": false, "measurement_status_transfer": false, - "semantic_mapping": "UCHC admits exact glyphs; UCNS defines geometry; semantic evidence and corpus membership remain external.", + "semantic_mapping": "UCNS owns geometry; Stack owns the English candidate; UCHC carries a verified extraction without transferring authority.", "agent_scope": "uchc-english-ordinal-geometry-consumer", "hmmm": [ "Non-Public-Gonol Unicode scalars have no licensed public angular bearing in this selected 157-glyph carrier.", @@ -39,5 +39,5 @@ "The immutable historical UCHC English corpus receipts and Stack-to-UCHC graduation are unchanged." ] }, - "work_graph_sha256": "00e40c52cc7a522696665d5db40eb59706bd33e7a5a2ad689d1f3ac3329cabb4" + "work_graph_sha256": "39da6181572b57e90510bf307c05da87ef4c1ddab4dba9c89280707507e1b1f8" } diff --git a/human/english/README.md b/human/english/README.md index 27ba841..b463af9 100644 --- a/human/english/README.md +++ b/human/english/README.md @@ -1,7 +1,9 @@ -## Current UCNS-backed ordinal geometry consumer +## Extracted Stack ordinal candidate The executable [ordinal-geometry contract](docs/ordinal-geometry.md) constructs admitted glyph instances through UCNS ordinal_affixiation and the Public Gonol angular registry. For 'word', it returns radii R/16, R/8, R/4, R/2, real UCNS placements and exact source recovery. +Stack owns this implementation until graduation; the [extraction receipt](experiments/ordinal-geometry-v1/extraction.json) binds its exact source and tests. + Use OrdinalStructuralField for verified English corpus geometric queries; legacy StructuralField remains the immutable historical replay API. No replacement coordinates are fabricated. --- diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index dc1f586..4c86727 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -1,6 +1,9 @@ # English ordinal geometry — executable UCNS consumer -**Status:** New UCHC consumer of existing UCNS geometry. The sealed English corpus and Stack's forge authority do not change. +**Status:** Extracted Stack ordinal candidate consuming existing UCNS geometry. +Stack owns the candidate source and tests until domain graduation. UCHC verifies +their exact extraction before building its candidate wheel. The sealed English +corpus and UCNS geometry authority do not change. ## Construction @@ -59,7 +62,17 @@ The new consumer: The hosted workflow uses a pinned actual UCNS checkout, runs independent append-oracle and source-drift tests, and verifies the clean-installed UCHC wheel. -Machine authority graph: [english-ordinal-geometry-v1.json](../../docs/work-graphs/english-ordinal-geometry-v1.json). +Machine authority graph: [english-ordinal-geometry-v1.json](../../../docs/work-graphs/english-ordinal-geometry-v1.json). + +The [extraction receipt](../experiments/ordinal-geometry-v1/extraction.json) +pins the Stack source commit, source/test paths and SHA-256 values. Make candidate +implementation changes in Stack first, then extract and verify the exact bytes +here. This is candidate equivalence, not completed release or graduation. + +Each returned word and each detached `word_interiors` entry carries its UCNS +`geometry_authority`, including partial SPACE-seam results. The CI evidence +separately records the tested UCHC commit, PR head, work-graph digest, Stack +extraction identity, construction receipt and built wheel hash. ## DONE WHEN / PROVEN BY / FAILS IF diff --git a/human/english/english_gonol/ordinal_construction.py b/human/english/english_gonol/ordinal_construction.py index 7f9799f..2e6deb2 100644 --- a/human/english/english_gonol/ordinal_construction.py +++ b/human/english/english_gonol/ordinal_construction.py @@ -1,7 +1,10 @@ +# ratios: loc_comments=234:76 imports_exports=8:5 calls_definitions=72:13 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer # === MODULE_BUILD === # id: uchc_english_ordinal_ucns_consumer # module_name: ordinal_construction -# module_kind: consumer +# module_kind: adapter # summary: exact glyph instantiation from the UCNS Public Gonol carrier and ordinal-affixiation geometry # owner: Erin Spencer # public_surface: construct_glyph_gonol, geometry_record, OrdinalStructuralField, OrdinalGeometryError @@ -11,8 +14,8 @@ # network_boundary: none # user_data_boundary: caller source remains in local computation # admin_only: false -# tests: tests/test_ordinal_construction.py -# rollout: use the new OrdinalStructuralField for geometry; historical StructuralField receipts remain immutable +# tests: ordinal_tests/test_ordinal_construction.py in Stack; tests/test_ordinal_construction.py in UCHC; paired complete-corpus acceptance +# rollout: extract the verified Stack candidate; historical StructuralField receipts remain immutable # rollback: remove consumer module and its explicit API; do not modify UCNS or sealed corpus artifacts # requires: ucns.ordinal_affixiation, ucns.public_gonol, english_gonol.structural_query # since: 2026-10-19 @@ -39,15 +42,22 @@ # given: an admitted verified English structural query and Public Gonol glyphs # then: returned glyph geometry and each word's recoverable interior come from UCNS without inventing a parent word carrier # class: correctness +# +# id: uchc_ordinal_detached_interiors_keep_authority +# given: a word or partial SPACE-seam result is detached from its query +# then: every constructed word interior carries the exact UCNS repository, commit and source blob identities +# class: evidence # === END CONTRACTS === -"""Executable English glyph geometry, consuming UCNS instead of reimplementing it. +"""Stack-forged English ordinal candidate, consuming UCNS geometry. Usage with exact UCNS producer installed: python -m english_gonol.ordinal_construction word Use OrdinalStructuralField for a verified English corpus. The older StructuralField remains the immutable historical-replay surface. +Stack owns this candidate until domain graduation. UCHC verifies its exact +extraction; see the ordinal work graph and extraction receipt before editing. The Public Gonol fixes angular ordering; UCNS computes turns, radial halvings, closure and receipts. Hyperspace before instantiation is NOT a gonol. """ @@ -226,8 +236,10 @@ def _word_geometry(self, surface: str, word: dict): def word(self, surface: str) -> dict: result = super().word(surface) constructed = self._word_geometry(surface, result) - result["gonal_order"] = constructed.record() - result["geometry_receipt"] = constructed.receipt + geometry = geometry_record(constructed) + result["gonal_order"] = geometry["construction"] + result["geometry_receipt"] = geometry["receipt"] + result["geometry_authority"] = geometry["geometry_authority"] result["geometry_state"] = "constructed" return result @@ -256,6 +268,7 @@ def geometry(self, record: dict, *, operation: str) -> dict: "source": surface, "construction": interior["gonal_order"], "receipt": interior["geometry_receipt"], + "geometry_authority": interior["geometry_authority"], } word_order.append({"ordinal": part["ordinal"], "word_id": part["identity"]}) if " " in graph["source"]: @@ -327,3 +340,4 @@ def main() -> int: if __name__ == "__main__": raise SystemExit(main()) +# ratios: loc_comments=234:76 imports_exports=8:5 calls_definitions=72:13 diff --git a/human/english/experiments/ordinal-geometry-v1/extraction.json b/human/english/experiments/ordinal-geometry-v1/extraction.json new file mode 100644 index 0000000..13016fa --- /dev/null +++ b/human/english/experiments/ordinal-geometry-v1/extraction.json @@ -0,0 +1,95 @@ +{ + "schema": "uchc.english-ordinal-extraction", + "version": "1.0.0", + "source_repository": "The-Interdependency/stack", + "source_commit": "c8bddd5ae02fdaa001c2ba6962da66117384437e", + "source_root": "research/english-gonol", + "files": [ + { + "source": "english_gonol/full_construct_run.py", + "target": "human/english/english_gonol/full_construct_run.py", + "sha256": "fbadf9cc033a154148b62e11b52d7e38b845c0d0b669ff34dfc6186cab15c064" + }, + { + "source": "english_gonol/hyperspace_construct.py", + "target": "human/english/english_gonol/hyperspace_construct.py", + "sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71" + }, + { + "source": "english_gonol/language/__init__.py", + "target": "human/english/english_gonol/language/__init__.py", + "sha256": "0620712b60b0c51483f45212dc63fc139b1c51a561ad863512344a5477727352" + }, + { + "source": "english_gonol/language/affixes.py", + "target": "human/english/english_gonol/language/affixes.py", + "sha256": "50df16c8dd71dcc0e1d964ac36909b3d48fbedbf404e27312492024261e36392" + }, + { + "source": "english_gonol/language/manifest.py", + "target": "human/english/english_gonol/language/manifest.py", + "sha256": "ae0b1176398f48463c3082f46afc7cd82e7273a72555a3c76e47e8fe90e15155" + }, + { + "source": "english_gonol/language/model.py", + "target": "human/english/english_gonol/language/model.py", + "sha256": "35a8ce27dcc70011cba1d31c3d6f9b1c4ec24f49a63316226ff92d12ce3332b4" + }, + { + "source": "english_gonol/language/morphology.py", + "target": "human/english/english_gonol/language/morphology.py", + "sha256": "84ea74d3498442c313bc318f0d19c4951ef59ad8411f0122bdb7a116383460ce" + }, + { + "source": "english_gonol/language/relational_bridge.py", + "target": "human/english/english_gonol/language/relational_bridge.py", + "sha256": "bceb4efc4730b2c7fc5ce8cb6f4d9334deeddb27905b79d273ce9ad3204b58eb" + }, + { + "source": "english_gonol/language/rendering.py", + "target": "human/english/english_gonol/language/rendering.py", + "sha256": "83a1b8c8fb31c7bc64a857b7f57a67079e01daa19f0d7e1d74cd501b61b0ec20" + }, + { + "source": "english_gonol/language/source.py", + "target": "human/english/english_gonol/language/source.py", + "sha256": "beb4d86f9c2a2879d3f63f4b73867af19edf33a2fdd6fea32e4e6e14c6b4ae2f" + }, + { + "source": "english_gonol/ordinal_construction.py", + "target": "human/english/english_gonol/ordinal_construction.py", + "sha256": "5b43d0efe7661cda69b2fd2c50998834795adb4467febb7a9d7a3d54883a3da7" + }, + { + "source": "english_gonol/structural_construct.py", + "target": "human/english/english_gonol/structural_construct.py", + "sha256": "8920759980c590719ff19a4a23906775b4058bda7f95f915a1621b1d56af18f4" + }, + { + "source": "english_gonol/structural_query.py", + "target": "human/english/english_gonol/structural_query.py", + "sha256": "3a97e971825468347ab76a44a3203ed0ce706ca0293836ffd4cc0d223d2987be" + }, + { + "source": "english_gonol/structural_rules.py", + "target": "human/english/english_gonol/structural_rules.py", + "sha256": "4686f6a847dd0cee24e3f0a05154a71203a1d4c790922952f9876a38f017db70" + }, + { + "source": "ordinal_tests/test_ordinal_construction.py", + "target": "tests/test_ordinal_construction.py", + "sha256": "6e4efc2eef6e0c74f1f57f26fdbd083edbfdb54a494148ab6ff1a2b45f2ff651" + }, + { + "source": "ordinal_tests/test_ordinal_corpus.py", + "target": "tests/test_ordinal_corpus.py", + "sha256": "55c2c4be6681ffe2964af85193176a72fea8cb298d6b03686c92c88b2eacd142" + } + ], + "work_graph_sha256": "39da6181572b57e90510bf307c05da87ef4c1ddab4dba9c89280707507e1b1f8", + "authority_transfer": false, + "hmmm": [ + "Pinned Stack source is proposed in Stack #93; merge the producer before this dependent candidate.", + "Stable release, released-artifact reconsumption and English domain graduation remain incomplete." + ] +} diff --git a/tests/test_ordinal_construction.py b/tests/test_ordinal_construction.py index 8512770..ade9fe2 100644 --- a/tests/test_ordinal_construction.py +++ b/tests/test_ordinal_construction.py @@ -1,3 +1,6 @@ +# ratios: loc_comments=155:63 imports_exports=8:10 calls_definitions=76:10 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer # === CHECKS === # id: check_ordinal_ucns_exact_prefixes # proves: uchc_ordinal_ucns_is_the_sole_geometry_authority, uchc_ordinal_glyph_occurrences_preserve_geometry @@ -241,3 +244,4 @@ def test_geometry_record_refuses_fake_construction(): with pytest.raises(OrdinalGeometryError) as exc: geometry_record({"receipt": "made-up"}) assert exc.value.code == "UCNS_CONSTRUCTION_REQUIRED" +# ratios: loc_comments=155:63 imports_exports=8:10 calls_definitions=76:10 diff --git a/tests/test_ordinal_corpus.py b/tests/test_ordinal_corpus.py new file mode 100644 index 0000000..c5ae031 --- /dev/null +++ b/tests/test_ordinal_corpus.py @@ -0,0 +1,75 @@ +# ratios: loc_comments=45:17 imports_exports=5:2 calls_definitions=12:2 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +"""Real-corpus ordinal acceptance; no replacement corpus or geometry mocks. + +Usage: set UCHC_STRUCTURAL_FIELD to a verified complete structural field, then +run pytest on this file with pinned UCNS and the selected English package. +The structural workflow runs these checks against both Stack source and the +clean-installed UCHC wheel. Missing corpus configuration is a failure. +""" +from __future__ import annotations + +import json +import os + +import pytest + +from english_gonol.ordinal_construction import OrdinalStructuralField + +# === CHECKS === +# id: check_detached_ordinal_interiors_keep_authority +# proves: uchc_ordinal_detached_interiors_keep_authority +# call: self::test_detached_word_and_query_interiors_keep_authority +# requires: pytest, pinned_ucns, complete_structural_corpus +# mutates: none +# cleanup: context_manager_closes_read_only_field +# === END CHECKS === + +EXPECTED_AUTHORITY = { + "repository": "The-Interdependency/ucns", + "commit": "ed0b0760f05cd975a7a811f8abeb70a11d09f00b", + "ordinal_blob": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol_blob": "c1955e46e2dc918fb657cb346e42106d71937e91", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", +} + + +@pytest.fixture(scope="module") +def field(): + path = os.environ.get("UCHC_STRUCTURAL_FIELD") + if not path: + pytest.fail("UCHC_STRUCTURAL_FIELD must name a verified complete corpus") + with OrdinalStructuralField(path) as opened: + assert opened.complete_corpus + yield opened + + +@pytest.mark.parametrize("text", ["word", "word word", " word word "]) +def test_detached_word_and_query_interiors_keep_authority(field, text): + word = json.loads(json.dumps(field.word("word"))) + assert word["geometry_authority"] == EXPECTED_AUTHORITY + assert word["gonal_order"]["identity"] == "word" + assert [p["radius"]["power_of_two_denominator"] + for p in word["gonal_order"]["placements"]] == [4, 3, 2, 1] + + query = field.construct(text) + geometry = field.geometry(query, operation="ordinal-affixiation") + expected_standing = "partial" if " " in text else "constructed" + assert geometry["standing"] == expected_standing + if expected_standing == "partial": + assert geometry["code"] == "SPACE_SEAM_FRAME_NOT_SELECTED" + assert "glyph_frame" not in geometry + else: + assert geometry["glyph_frame"]["geometry_authority"] == EXPECTED_AUTHORITY + assert len(geometry["word_interiors"]) == 1 + assert len(geometry["ordered_word_references"]) == len(text.split()) + # Serialized alone, the interior must still name its verified producer. + interior = json.loads(json.dumps(geometry["word_interiors"][0])) + assert interior["geometry_authority"] == EXPECTED_AUTHORITY + assert interior["construction"] == word["gonal_order"] + assert interior["receipt"] == word["geometry_receipt"] + composed = field.compose(query, relation="ordered-text") + assert composed["word_interiors"] == geometry["word_interiors"] + assert composed["word_interiors"][0]["geometry_authority"] == EXPECTED_AUTHORITY +# ratios: loc_comments=45:17 imports_exports=5:2 calls_definitions=12:2 From 27796465cfb5f68497e63aa1a10cf5c0c6d91b19 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 26 Oct 2026 20:20:09 -0700 Subject: [PATCH 20/30] Isolate forge and installed-wheel pytest imports Disable checkout pytest configuration in acceptance runs so its pythonpath cannot shadow the exact Stack source or clean-installed package. --- .github/workflows/english-ordinal-geometry.yml | 7 ++++--- .github/workflows/english-structural-profile.yml | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml index 4c17d22..0ade89a 100644 --- a/.github/workflows/english-ordinal-geometry.yml +++ b/.github/workflows/english-ordinal-geometry.yml @@ -1,3 +1,4 @@ +# Pytest uses -c /dev/null so checkout pythonpath settings cannot shadow the selected source or installed wheel. name: English ordinal UCNS geometry on: pull_request: @@ -78,13 +79,13 @@ jobs: PYTHONPATH: human/english run: | mkdir -p _state - python -m pytest -q tests/test_ordinal_construction.py --junitxml=_state/source.xml + python -m pytest -c /dev/null -q tests/test_ordinal_construction.py --junitxml=_state/source.xml python -m english_gonol.ordinal_construction word > _state/word-source.json - name: Execute the exact Stack source before candidate comparison env: PYTHONPATH: _deps/ordinal-forge/research/english-gonol run: | - python -m pytest -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_construction.py --junitxml=_state/forge.xml + python -m pytest -c /dev/null -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_construction.py --junitxml=_state/forge.xml python -m english_gonol.ordinal_construction word > _state/word-forge.json - name: Build and clean-install UCHC with UCNS run: | @@ -95,7 +96,7 @@ jobs: _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl mkdir -p _state/isolated-tests cp tests/test_ordinal_construction.py _state/isolated-tests/test_ordinal_construction.py - _state/clean/bin/python -I -m pytest -q _state/isolated-tests --junitxml=_state/installed.xml + _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml _state/clean/bin/python -I -m english_gonol.ordinal_construction word > _state/word-installed.json - name: Verify exact end-to-end artifact, receipt and test outcomes env: diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 764da22..40a88a5 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -1,3 +1,4 @@ +# Pytest uses -c /dev/null so checkout pythonpath settings cannot shadow the selected source or installed wheel. # Usage: executable structural-profile gates; all source records, no sample substitute. name: English structural profile on: @@ -124,7 +125,7 @@ jobs: - name: Structural regressions env: PYTHONPATH: human/english - run: python -m pytest -q human/english/tests/test_structural_profile.py --junitxml=_state/structural.xml + run: python -m pytest -c /dev/null -q human/english/tests/test_structural_profile.py --junitxml=_state/structural.xml - name: Build and test the exact clean candidate wheel env: SOURCE_DATE_EPOCH: '1790308800' @@ -136,7 +137,7 @@ jobs: _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl mkdir -p _state/isolated-tests cp ./human/english/tests/test_structural_profile.py _state/isolated-tests/ - _state/clean/bin/python -I -m pytest -q _state/isolated-tests --junitxml=_state/installed.xml + _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml - name: Build every corpus construction twice and compare exact artifacts env: PYTHONPATH: human/english @@ -157,8 +158,8 @@ jobs: _state/clean/bin/python -m pip install ./_deps/ucns-ordinal mkdir -p _state/corpus-tests cp tests/test_ordinal_corpus.py _state/corpus-tests/ - PYTHONPATH=_deps/ordinal-forge/research/english-gonol python -m pytest -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_corpus.py --junitxml=_state/ordinal-corpus-forge.xml - _state/clean/bin/python -I -m pytest -q _state/corpus-tests --junitxml=_state/ordinal-corpus-installed.xml + PYTHONPATH=_deps/ordinal-forge/research/english-gonol python -m pytest -c /dev/null -q _deps/ordinal-forge/research/english-gonol/ordinal_tests/test_ordinal_corpus.py --junitxml=_state/ordinal-corpus-forge.xml + _state/clean/bin/python -I -m pytest -c /dev/null -q _state/corpus-tests --junitxml=_state/ordinal-corpus-installed.xml python - <<'PYTHON' import hashlib, json, os, subprocess, sys, xml.etree.ElementTree as ET from pathlib import Path From 2794309975d65102d7a900f08bcbaa8918fa25f3 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Tue, 27 Oct 2026 10:08:13 -0700 Subject: [PATCH 21/30] Link ratified ordinal choices and narrow remaining questions [skip ci] Distinguish settled ownership and versioning requirements from unfinished geometry and implementation. Keep historical source and receipt pins exact. --- human/english/docs/ordinal-geometry.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index 4c86727..e92b73e 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -74,6 +74,17 @@ Each returned word and each detached `word_interiors` entry carries its UCNS separately records the tested UCHC commit, PR head, work-graph digest, Stack extraction identity, construction receipt and built wheel hash. +## Ratified forward requirements + +The [2026-10-27 operator decision](https://github.com/The-Interdependency/stack/blob/2909ffa0268c9535ea2b6ad1dd892caa82f447b4/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) +selects construction-derived parent bearing through SPACE, definition ownership +by the whole closed lexical construction, and permission to rebase existing +glyph bearings in a new carrier version with new receipts. These policy choices +are settled. The linked record distinguishes them from the exact angular rule, +typed-origin implementation, carrier specification and replay still required. +The source extraction pinned above remains the tested implementation; this +decision does not change its geometry or reinterpret its receipts. + ## DONE WHEN / PROVEN BY / FAILS IF **DONE WHEN:** UCHC constructs real UCNS glyph geometry for admitted sequences and exposes it in a corpus-aware consumer. @@ -84,6 +95,7 @@ extraction identity, construction receipt and built wheel hash. ## hmmm -1. The public 157-glyph carrier does not yet give every Unicode scalar in the broader English corpus a licensed angular bearing. Unsupported glyphs refuse; an explicitly specified expanded public angular carrier is needed for complete coverage. -2. Angular attachment of closed words to a higher carrier and transport between word/definition frames are not selected. -3. This consumer does not by itself complete Stack-to-UCHC graduation, full-corpus geometric census, native Möbius lift, or semantic measurement. +1. The expanded carrier still needs an exact inventory/order and implementation. Rebasing in a new version is authorized; unsupported glyphs continue to refuse in the current pinned implementation. +2. Parent bearing must derive from the closed construction and SPACE attachment. Its exact numerical rule remains unresolved. +3. Whole-lexical definition ownership is ratified; its typed-origin implementation and complete-corpus replay remain pending. +4. Stable release, released-artifact reconsumption and Stack-to-UCHC graduation remain incomplete. Native Möbius lift, sheet-state transport and 360°/720° return tests are outside this English ordinal construction's scope. From 5424432fdca7ac020d56d8538014260942303575 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Tue, 27 Oct 2026 19:01:21 -0700 Subject: [PATCH 22/30] Distinguish compound attachment from sentence hypotheses [skip ci] Link the clarified terminal-occurrence SPACE reference, fixed radial distance and explicit angular candidate. Keep sentence alternatives open. --- human/english/docs/ordinal-geometry.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index e92b73e..0bcd5c1 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -76,7 +76,7 @@ extraction identity, construction receipt and built wheel hash. ## Ratified forward requirements -The [2026-10-27 operator decision](https://github.com/The-Interdependency/stack/blob/2909ffa0268c9535ea2b6ad1dd892caa82f447b4/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) +The [2026-10-27 operator decision](https://github.com/The-Interdependency/stack/blob/c17ed27a935a5583880f2a29d79f9152f2362ea3/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) selects construction-derived parent bearing through SPACE, definition ownership by the whole closed lexical construction, and permission to rebase existing glyph bearings in a new carrier version with new receipts. These policy choices @@ -85,6 +85,13 @@ typed-origin implementation, carrier specification and replay still required. The source extraction pinned above remains the tested implementation; this decision does not change its geometry or reinterpret its receipts. +The compound clarification fixes the terminal glyph occurrence as the next +component's SPACE reference: in `bull + shit`, use the second `l`. Established +radial distances remain unchanged; the angular change expresses the join. The +linked record includes an explicitly derived angular-reference candidate. +Sentence joining by distance, angle or both remains a comparison of alternatives; +no sentence operator has been ratified or substituted into this runtime. + ## DONE WHEN / PROVEN BY / FAILS IF **DONE WHEN:** UCHC constructs real UCNS glyph geometry for admitted sequences and exposes it in a corpus-aware consumer. @@ -96,6 +103,6 @@ decision does not change its geometry or reinterpret its receipts. ## hmmm 1. The expanded carrier still needs an exact inventory/order and implementation. Rebasing in a new version is authorized; unsupported glyphs continue to refuse in the current pinned implementation. -2. Parent bearing must derive from the closed construction and SPACE attachment. Its exact numerical rule remains unresolved. +2. Compound attachment uses the terminal occurrence as SPACE and preserves radial distance. The derived angular-reference candidate still needs native implementation and verification. Sentence distance/angle operators remain candidates. 3. Whole-lexical definition ownership is ratified; its typed-origin implementation and complete-corpus replay remain pending. 4. Stable release, released-artifact reconsumption and Stack-to-UCHC graduation remain incomplete. Native Möbius lift, sheet-state transport and 360°/720° return tests are outside this English ordinal construction's scope. From 06d5c73f438d67f2ea989b688600b95e22cf11b9 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Wed, 28 Oct 2026 02:59:38 -0700 Subject: [PATCH 23/30] Link selected SPACE retention and attachment requirements [skip ci] --- human/english/docs/ordinal-geometry.md | 48 ++++++++++++++++++-------- 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index 0bcd5c1..3794e8f 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -76,24 +76,42 @@ extraction identity, construction receipt and built wheel hash. ## Ratified forward requirements -The [2026-10-27 operator decision](https://github.com/The-Interdependency/stack/blob/c17ed27a935a5583880f2a29d79f9152f2362ea3/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) -selects construction-derived parent bearing through SPACE, definition ownership +The [operator decisions, clarified 2026-10-28](https://github.com/The-Interdependency/stack/blob/147583a6f23fdc48d5ba59e3baa1d984309c20fb/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) +select construction-derived parent bearing through SPACE, definition ownership by the whole closed lexical construction, and permission to rebase existing -glyph bearings in a new carrier version with new receipts. These policy choices -are settled. The linked record distinguishes them from the exact angular rule, -typed-origin implementation, carrier specification and replay still required. -The source extraction pinned above remains the tested implementation; this -decision does not change its geometry or reinterpret its receipts. - -The compound clarification fixes the terminal glyph occurrence as the next -component's SPACE reference: in `bull + shit`, use the second `l`. Established -radial distances remain unchanged; the angular change expresses the join. The -linked record includes an explicitly derived angular-reference candidate. -Sentence joining by distance, angle or both remains a comparison of alternatives; -no sentence operator has been ratified or substituted into this runtime. +glyph bearings in a new carrier version with new receipts. + +The clarified attachment and storage requirements are also selected: + +- Word origins sit at their declared attachments. In `bull + shit`, the second + `l` occurrence supplies the incoming SPACE attachment while the whole lexical + construction retains definition ownership. +- The preceding placed letter's direction becomes the next frame's SPACE + direction. Glyph angles remain relative to their own local SPACE; their + parent-frame headings can differ even for repeated glyphs. +- Every glyph begins as SPACE. Its original SPACE storage remains together + with its glyph, origin and angular reference; glyph assignment must not + discard or replace that support. +- Compound joining preserves component-local radii. Glyph appending remains + the distinct ordinal-halving operation. + +Retained SPACE is a geometric/storage role, not an extra literal U+0020 text +occurrence. The source extraction pinned above remains the tested +implementation. It does not yet implement retained per-glyph SPACE storage, +inherited local-frame direction or origin-at-attachment transport. A word-level +`origin='SPACE'` label does not establish those behaviors. + +The earlier shared-origin angular drawing is a projected view, not the complete +attachment construction. Common-origin and individual-origin views require a +recoverable correspondence preserving occurrences, frame relations and SPACE +supports. Sentence joining by distance, angle or both remains a comparison of +alternatives; no sentence operator has been substituted into this runtime. ## DONE WHEN / PROVEN BY / FAILS IF +These acceptance criteria describe the pinned executable extraction above; +they do not mark the newer forward attachment/storage requirements complete. + **DONE WHEN:** UCHC constructs real UCNS glyph geometry for admitted sequences and exposes it in a corpus-aware consumer. **PROVEN BY:** word = R/16, R/8, R/4, R/2; repeated glyphs have unchanged angles and different radii; complete recovery and UCNS-native objects; named refusal for missing angle, source drift and unverified corpus; a clean installed wheel passing cross-repository tests. @@ -103,6 +121,6 @@ no sentence operator has been ratified or substituted into this runtime. ## hmmm 1. The expanded carrier still needs an exact inventory/order and implementation. Rebasing in a new version is authorized; unsupported glyphs continue to refuse in the current pinned implementation. -2. Compound attachment uses the terminal occurrence as SPACE and preserves radial distance. The derived angular-reference candidate still needs native implementation and verification. Sentence distance/angle operators remain candidates. +2. Native retained-SPACE storage, inherited SPACE direction, origin-at-attachment transport and both-view recovery still need implementation and verification. The requirements are selected; sentence distance/angle operators remain candidates. 3. Whole-lexical definition ownership is ratified; its typed-origin implementation and complete-corpus replay remain pending. 4. Stable release, released-artifact reconsumption and Stack-to-UCHC graduation remain incomplete. Native Möbius lift, sheet-state transport and 360°/720° return tests are outside this English ordinal construction's scope. From f2528c7f4cc182912df11b92fa355b16231b1fb5 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Thu, 29 Oct 2026 01:29:17 -0700 Subject: [PATCH 24/30] Clarify implicit SPACE assumption and disk-stack hypothesis [skip ci] --- human/english/docs/ordinal-geometry.md | 39 ++++++++++++++------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/human/english/docs/ordinal-geometry.md b/human/english/docs/ordinal-geometry.md index 3794e8f..66be130 100644 --- a/human/english/docs/ordinal-geometry.md +++ b/human/english/docs/ordinal-geometry.md @@ -74,14 +74,14 @@ Each returned word and each detached `word_interiors` entry carries its UCNS separately records the tested UCHC commit, PR head, work-graph digest, Stack extraction identity, construction receipt and built wheel hash. -## Ratified forward requirements +## Forward decisions and construction assumptions -The [operator decisions, clarified 2026-10-28](https://github.com/The-Interdependency/stack/blob/147583a6f23fdc48d5ba59e3baa1d984309c20fb/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) +The [operator decisions, clarified through 2026-10-29](https://github.com/The-Interdependency/stack/blob/f19389bd7b15e6540f812ec47d67274e429daec5/research/english-gonol/docs/ordinal-decisions-2026-10-27.md) select construction-derived parent bearing through SPACE, definition ownership by the whole closed lexical construction, and permission to rebase existing glyph bearings in a new carrier version with new receipts. -The clarified attachment and storage requirements are also selected: +The attachment and direction requirements remain selected: - Word origins sit at their declared attachments. In `bull + shit`, the second `l` occurrence supplies the incoming SPACE attachment while the whole lexical @@ -89,28 +89,31 @@ The clarified attachment and storage requirements are also selected: - The preceding placed letter's direction becomes the next frame's SPACE direction. Glyph angles remain relative to their own local SPACE; their parent-frame headings can differ even for repeated glyphs. -- Every glyph begins as SPACE. Its original SPACE storage remains together - with its glyph, origin and angular reference; glyph assignment must not - discard or replace that support. - Compound joining preserves component-local radii. Glyph appending remains the distinct ordinal-halving operation. -Retained SPACE is a geometric/storage role, not an extra literal U+0020 text -occurrence. The source extraction pinned above remains the tested -implementation. It does not yet implement retained per-glyph SPACE storage, -inherited local-frame direction or origin-at-attachment transport. A word-level -`origin='SPACE'` label does not establish those behaviors. +Every glyph beginning as SPACE, with SPACE remaining alongside it, is a +construction assumption. Erin clarified that this does not necessarily require +storage. A separately stored SPACE object or field is not mandated; origins, +directions and attachment relations may be implicit or derived when recoverable. +The SPACE role does not insert an extra literal U+0020 text occurrence. -The earlier shared-origin angular drawing is a projected view, not the complete -attachment construction. Common-origin and individual-origin views require a -recoverable correspondence preserving occurrences, frame relations and SPACE -supports. Sentence joining by distance, angle or both remains a comparison of -alternatives; no sentence operator has been substituted into this runtime. +The source extraction pinned above remains the tested implementation. It does +not implement the selected inherited local-frame direction or origin-at- +attachment transport. A word-level `origin='SPACE'` label does not establish +those behaviors; absence of a separate SPACE record is not itself a failure. + +The earlier shared-origin angular drawing is a projected view. Common-origin +and individual-origin views require a recoverable correspondence preserving +occurrences and frame relations consistently with the SPACE assumption. The +disk-stack picture is a proposed depth interpretation; disk arrangement, +viewpoint, projection, exact halving and the changing angle remain unresolved. +Sentence distance/angle alternatives remain unselected. ## DONE WHEN / PROVEN BY / FAILS IF These acceptance criteria describe the pinned executable extraction above; -they do not mark the newer forward attachment/storage requirements complete. +they do not mark the newer forward attachment/direction requirements complete. **DONE WHEN:** UCHC constructs real UCNS glyph geometry for admitted sequences and exposes it in a corpus-aware consumer. @@ -121,6 +124,6 @@ they do not mark the newer forward attachment/storage requirements complete. ## hmmm 1. The expanded carrier still needs an exact inventory/order and implementation. Rebasing in a new version is authorized; unsupported glyphs continue to refuse in the current pinned implementation. -2. Native retained-SPACE storage, inherited SPACE direction, origin-at-attachment transport and both-view recovery still need implementation and verification. The requirements are selected; sentence distance/angle operators remain candidates. +2. Native inherited SPACE direction, origin-at-attachment transport and both-view recovery still need implementation and verification. Explicit SPACE storage is not required; its representation and the proposed disk-stack projection remain open. Sentence distance/angle operators remain candidates. 3. Whole-lexical definition ownership is ratified; its typed-origin implementation and complete-corpus replay remain pending. 4. Stable release, released-artifact reconsumption and Stack-to-UCHC graduation remain incomplete. Native Möbius lift, sheet-state transport and 360°/720° return tests are outside this English ordinal construction's scope. From 8ac9ba88a40af24d332453c93d6357ccf1fb9fa7 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Thu, 29 Oct 2026 19:00:24 -0700 Subject: [PATCH 25/30] Extract recursive attachment profile as UCHC 0.1.0a4 candidate Pin Stack 86a5fb1 and UCNS 9cc0077, verify the full source closure, preserve historical replay and add installed complete-corpus acceptance. GPT generated; context, prompt Erin Spencer. --- .github/workflows/english-full-corpus.yml | 6 +- .../workflows/english-ordinal-geometry.yml | 4 +- .../english-recursive-attachment.yml | 124 +++++++ .../workflows/english-structural-profile.yml | 4 +- README.md | 28 +- docs/MIGRATION.md | 14 + .../english-recursive-attachment-v1.json | 42 +++ human/english/README.md | 15 +- .../docs/ordinal-decisions-2026-10-27.md | 282 +++++++++++++++ human/english/docs/recursive-stack.md | 97 ++++++ human/english/docs/recursive-work-graph.json | 42 +++ .../english/english_gonol/attachment_audit.py | 106 ++++++ .../english_gonol/attachment_construction.py | 322 ++++++++++++++++++ .../recursive-attachment-v1/extraction.json | 114 +++++++ pyproject.toml | 2 +- tests/test_attachment_construction.py | 160 +++++++++ tests/test_attachment_corpus.py | 96 ++++++ tools/verify_attachment_extraction.py | 85 +++++ 18 files changed, 1520 insertions(+), 23 deletions(-) create mode 100644 .github/workflows/english-recursive-attachment.yml create mode 100644 docs/work-graphs/english-recursive-attachment-v1.json create mode 100644 human/english/docs/ordinal-decisions-2026-10-27.md create mode 100644 human/english/docs/recursive-stack.md create mode 100644 human/english/docs/recursive-work-graph.json create mode 100644 human/english/english_gonol/attachment_audit.py create mode 100644 human/english/english_gonol/attachment_construction.py create mode 100644 human/english/experiments/recursive-attachment-v1/extraction.json create mode 100644 tests/test_attachment_construction.py create mode 100644 tests/test_attachment_corpus.py create mode 100644 tools/verify_attachment_extraction.py diff --git a/.github/workflows/english-full-corpus.yml b/.github/workflows/english-full-corpus.yml index 862292b..f872af0 100644 --- a/.github/workflows/english-full-corpus.yml +++ b/.github/workflows/english-full-corpus.yml @@ -64,7 +64,7 @@ jobs: .venv/bin/python -m pip wheel --no-deps --no-build-isolation ./source -w evidence/dist python3 -m venv .clean .clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0a3-py3-none-any.whl + .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0a4-py3-none-any.whl mkdir -p isolated-tests cp source/human/english/tests/test_inference_input.py isolated-tests/test_input.py cp source/human/english/tests/test_structural_profile.py isolated-tests/test_structural_profile.py @@ -77,7 +77,7 @@ jobs: import python_gonol assert '/.clean/' in str(Path(reader.__file__).resolve()) assert '/.clean/' in str(Path(python_gonol.__file__).resolve()) - assert version('uchc') == '0.1.0a3' + assert version('uchc') == '0.1.0a4' PY - name: Build all pinned corpus rows through the installed artifact shell: bash @@ -122,7 +122,7 @@ jobs: counts = {key: sum(int(s.get(key, 0)) for s in suites) for key in ('tests', 'failures', 'errors', 'skipped')} assert counts['tests'] > 0 and not any(counts[k] for k in ('failures', 'errors', 'skipped')), counts tests[path.stem] = counts - wheel = Path('evidence/dist/uchc-0.1.0a3-py3-none-any.whl') + wheel = Path('evidence/dist/uchc-0.1.0a4-py3-none-any.whl') with wheel.open('rb') as stream: digest = hashlib.file_digest(stream, 'sha256').hexdigest() record = {'source_commit': os.environ['SOURCE_SHA'], 'wheel': wheel.name, 'wheel_sha256': digest, 'tests': tests, 'input_acceptance': json.loads(Path('evidence/input-acceptance.json').read_text())['receipt_sha256'], 'standing': 'verified release candidate; not neural inference or completed domain graduation'} diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml index 0ade89a..258a21f 100644 --- a/.github/workflows/english-ordinal-geometry.yml +++ b/.github/workflows/english-ordinal-geometry.yml @@ -93,7 +93,7 @@ jobs: python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 _state/clean/bin/python -m pip install ./_deps/ucns-ordinal - _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a4-py3-none-any.whl mkdir -p _state/isolated-tests cp tests/test_ordinal_construction.py _state/isolated-tests/test_ordinal_construction.py _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml @@ -122,7 +122,7 @@ jobs: totals = {k: sum(int(x.get(k,0)) for x in cases) for k in ('tests','failures','errors','skipped')} assert totals['tests'] >= 10 and totals['failures'] == totals['errors'] == totals['skipped'] == 0, totals tests[name] = totals - wheel = Path('_state/dist/uchc-0.1.0a3-py3-none-any.whl') + wheel = Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') source_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() assert source_commit == os.environ['UCHC_SOURCE_COMMIT'] graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) diff --git a/.github/workflows/english-recursive-attachment.yml b/.github/workflows/english-recursive-attachment.yml new file mode 100644 index 0000000..afd00b1 --- /dev/null +++ b/.github/workflows/english-recursive-attachment.yml @@ -0,0 +1,124 @@ +name: English recursive attachment +on: + pull_request: + paths: ['human/english/**', 'tests/test_attachment*.py', 'tools/verify_attachment_extraction.py', 'docs/work-graphs/english-recursive-attachment-v1.json', 'pyproject.toml', '.github/workflows/english-recursive-attachment.yml'] + push: + branches: [main] + paths: ['human/english/**', 'tests/test_attachment*.py', 'tools/verify_attachment_extraction.py', 'docs/work-graphs/english-recursive-attachment-v1.json', 'pyproject.toml', '.github/workflows/english-recursive-attachment.yml'] +permissions: + contents: read +jobs: + complete-installed-consumer: + runs-on: ubuntu-24.04 + env: + SOURCE_DATE_EPOCH: '1790308800' + UCHC_STRUCTURAL_FIELD: ${{ github.workspace }}/_state/field + steps: + - uses: actions/checkout@v7.0.1 + with: + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/ucns + ref: 9cc00771e54336d58ee377faeec87a3a33dbd4bf + path: _deps/native + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/stack + ref: 86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88 + path: _deps/forge + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: globalwordnet/english-wordnet + ref: dc343f2683279ecbb13fab4e2fd778d7b162d287 + path: _deps/oewn + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/ucns + ref: 4f863ad37096b7baab8f62820ad5cb937b62a3a7 + path: _deps/corpus-carrier + persist-credentials: false + - uses: actions/setup-python@v7.0.0 + with: + python-version: '3.12.14' + - name: Build and install exact artifacts + run: | + test "$(git -C _deps/native rev-parse HEAD)" = 9cc00771e54336d58ee377faeec87a3a33dbd4bf + test "$(git -C _deps/oewn rev-parse HEAD)" = dc343f2683279ecbb13fab4e2fd778d7b162d287 + test "$(git -C _deps/corpus-carrier rev-parse HEAD)" = 4f863ad37096b7baab8f62820ad5cb937b62a3a7 + python -m pip install pytest==8.3.5 PyYAML==6.0.2 setuptools==82.0.1 wheel==0.46.3 packaging==26.0 + python -m pip wheel --no-deps ./_deps/native -w _state/native-dist + python -m pip install --no-deps _state/native-dist/*.whl + python -m pip wheel --no-deps --no-build-isolation . -w _state/dist + python -m venv _state/clean + _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 + _state/clean/bin/python -m pip install --no-deps _state/native-dist/*.whl _state/dist/uchc-0.1.0a4-py3-none-any.whl + mkdir -p _state/isolated + cp tests/test_attachment*.py _state/isolated/ + - name: Verify source closure and isolated installed imports + env: + PYTHONPATH: human/english + run: | + python tools/verify_attachment_extraction.py _deps/forge > _state/source-extraction.json + _state/clean/bin/python -I tools/verify_attachment_extraction.py _deps/forge > _state/installed-extraction.json + cmp _state/source-extraction.json _state/installed-extraction.json + python -m pytest -c /dev/null -q tests/test_attachment_construction.py --junitxml=_state/source.xml + - name: Build complete historical corpus through installed package + run: | + _state/clean/bin/python -I -m english_gonol.structural_construct build --source-root _deps/oewn/src/yaml --ucns-source-root _deps/corpus-carrier --out-dir _state/field > _state/corpus-build.json + python - <<'PY' + import json + from pathlib import Path + manifest = json.loads(Path('_state/field/manifest.json').read_text()) + assert manifest['receipt_sha256'] == '26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a' + PY + - name: Verify complete corpus queries and all ownership overlays + env: + PYTHONPATH: _deps/forge/research/english-gonol + run: | + python -m pytest -c /dev/null -q _deps/forge/research/english-gonol/ordinal_tests/test_attachment*.py --junitxml=_state/forge.xml + _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated --junitxml=_state/installed.xml + python -m english_gonol.attachment_audit _state/field > _state/audit-forge.json + _state/clean/bin/python -I -m english_gonol.attachment_audit _state/field > _state/audit-installed.json + cmp _state/audit-forge.json _state/audit-installed.json + - name: Compare CLI operations and record exact candidate evidence + env: + UCHC_SOURCE_COMMIT: ${{ github.sha }} + run: | + python - <<'PY' + import hashlib, json, os, subprocess, sys, xml.etree.ElementTree as E + from pathlib import Path + operations = [('word','bull'), ('compound','bull','shit'), ('sequence','bull','shit','--bearing','root-endpoint-v1'), ('sequence','bull','shit','--bearing','exit-heading-v1')] + outputs = [] + for args in operations: + values = [] + for prefix, source in (([sys.executable], 'human/english'), ([sys.executable], '_deps/forge/research/english-gonol'), ([str(Path('_state/clean/bin/python').absolute()), '-I'], '')): + env = dict(os.environ, PYTHONPATH=str(Path(source).resolve())) + values.append(subprocess.check_output(prefix + ['-m','english_gonol.attachment_construction',*args], env=env)) + assert values[0] == values[1] == values[2], args + outputs.append({'operation': args, 'sha256': hashlib.sha256(values[0]).hexdigest()}) + tests = {} + for name, count in (('source',5),('forge',11),('installed',11)): + suites = list(E.parse('_state/'+name+'.xml').getroot().iter('testsuite')) + totals = {k: sum(int(s.get(k,0)) for s in suites) for k in ('tests','failures','errors','skipped')} + assert totals == {'tests':count,'failures':0,'errors':0,'skipped':0}, totals + tests[name] = totals + sha = subprocess.check_output(['git','rev-parse','HEAD'], text=True).strip() + assert sha == os.environ['UCHC_SOURCE_COMMIT'] + audit = json.loads(Path('_state/audit-installed.json').read_text()) + assert audit['counts']['words'] == 103053 + assert audit['counts']['formerly_compound_definitions'] == 57155 + wheel = Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') + evidence = {'schema':'uchc.recursive-attachment-acceptance.v1','uchc_source_commit':sha,'forge_commit':'86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88','ucns_commit':'9cc00771e54336d58ee377faeec87a3a33dbd4bf','tests':tests,'operations':outputs,'audit':audit,'wheel_sha256':hashlib.sha256(wheel.read_bytes()).hexdigest(),'authority_transfer':False,'bearing_selection':'none'} + Path('_state/recursive-evidence.json').write_text(json.dumps(evidence,indent=2,sort_keys=True)+'\n') + PY + - uses: actions/upload-artifact@v7.0.1 + if: always() + with: + name: uchc-recursive-attachment + path: | + _state/*.json + _state/*.xml diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 40a88a5..1c3c3a5 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -134,7 +134,7 @@ jobs: python -m pip wheel --no-deps --no-build-isolation . -w _state/dist python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a3-py3-none-any.whl + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a4-py3-none-any.whl mkdir -p _state/isolated-tests cp ./human/english/tests/test_structural_profile.py _state/isolated-tests/ _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml @@ -328,7 +328,7 @@ jobs: assert verification['forge_source_commit'] == next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') historical_wheel = pathlib.Path('_state/historical-dist') / ('uchc-' + verification['candidate_version'] + '-py3-none-any.whl') assert verification['candidate_wheel_sha256'] == digest(historical_wheel) - wheel = pathlib.Path('_state/dist/uchc-0.1.0a3-py3-none-any.whl') + wheel = pathlib.Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') assert wheel.is_file() and digest(wheel) != digest(historical_wheel) tests = {} for name, expected in [('structural', verification['tests']['structural_included_in_english']), ('installed', verification['tests']['clean_installed_structural'])]: diff --git a/README.md b/README.md index ae1c875..767f3a9 100644 --- a/README.md +++ b/README.md @@ -4,17 +4,29 @@ UCHC is the implementation repository for **Unit Circle Hyperspace Constructs**. Applications consume UCHC; applications do not define UCHC. -## Executable English ordinal geometry +## Recursive English attachment -UCHC carries a verified extraction of the Stack-owned, UCNS-backed English ordinal candidate in [ordinal_construction.py](human/english/english_gonol/ordinal_construction.py). Run the clean-installed package with the pinned UCNS producer: +The [recursive attachment profile](human/english/docs/recursive-stack.md) stacks +glyphs into words and closed words into sentences using one native UCNS operation. +Compound joins preserve component-local radii; both origin views replay exactly. - python -m english_gonol.ordinal_construction word - -The result contains UCNS turns, exact per-instance radial-halving exponents, and a recoverable receipt. The new OrdinalStructuralField supplies geometry for complete verified English corpus queries; the original StructuralField remains immutable for historical replay. See the [construction law and refusals](human/english/docs/ordinal-geometry.md). - -Implementation changes start in the [pinned Stack forge](https://github.com/The-Interdependency/stack/tree/c8bddd5ae02fdaa001c2ba6962da66117384437e/research/english-gonol). The [extraction receipt](human/english/experiments/ordinal-geometry-v1/extraction.json) and CI bind source/test bytes, complete-corpus behavior and the clean wheel; domain graduation remains incomplete. +```bash +python -m english_gonol.attachment_construction word bull +python -m english_gonol.attachment_construction compound bull shit +python -m english_gonol.attachment_construction sequence bull shit --bearing root-endpoint-v1 +``` -**hmmm:** glyphs outside the 157-position Public Gonol and higher-scale word-carrier angular attachment require additional selected geometry; neither receives a fabricated bearing. +Install the exact UCNS producer named by the +[work graph](docs/work-graphs/english-recursive-attachment-v1.json). +The [extraction receipt](human/english/experiments/recursive-attachment-v1/extraction.json) +binds Stack source, tests and import closure. `RecursiveStructuralField` preserves +corpus admission, sentence closure, source punctuation/SPACE and every occurrence; +it overlays a typed whole lexical definition owner. Historical ordinal and +structural APIs remain versioned replay interfaces. + +**hmmm:** the closed-word bearing functional remains unselected; both named +candidates are explicit. Numerical definition attachment, expanded glyph +inventory, punctuation geometry, native sheet lift and graduation remain open. ## Domains diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index e6d0fea..2ab3d49 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -248,3 +248,17 @@ Use [ordinal geometry](../human/english/docs/ordinal-geometry.md) for installati and query commands. Candidate equivalence is distinct from stable publication, AHBG lock migration and domain graduation. Merge the Stack producer before its dependent UCHC extraction; no authority-transition receipt is issued here. + +## Recursive attachment candidate — 0.1.0a4 + +This candidate extracts the Stack forward `english.attachment/1` profile and +consumes UCNS `9cc00771e54336d58ee377faeec87a3a33dbd4bf`. It adds native recursive +stacks, closed compound transport, both origin views, complete graph replay and +a typed whole lexical-owner overlay. The exact source/test/import-closure receipt +is `human/english/experiments/recursive-attachment-v1/extraction.json`. + +The new acceptance workflow verifies the pinned forge, native bytes, clean +installed package, complete-corpus queries and all-word/all-definition stream +digests. Existing historical corpus and ordinal receipts keep their identities. +Bearing selection, numerical definition attachment, stable release, +released-artifact reconsumption and authority transition remain hmmm. diff --git a/docs/work-graphs/english-recursive-attachment-v1.json b/docs/work-graphs/english-recursive-attachment-v1.json new file mode 100644 index 0000000..ca727d6 --- /dev/null +++ b/docs/work-graphs/english-recursive-attachment-v1.json @@ -0,0 +1,42 @@ +{ + "schema": "the-interdependency.stack-manifest", + "version": "1.0.0", + "repositories": [ + { + "repository": "The-Interdependency/ucns", + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "authority": "native recursive planar attachment and exact expression geometry", + "relation": "exact producer; historical ordinal modules unchanged" + }, + { + "repository": "The-Interdependency/stack", + "commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "authority": "English construction forge pending domain graduation", + "relation": "exact implementation, audit and tests extracted into this candidate" + }, + { + "repository": "The-Interdependency/uchc", + "commit": "f2528c7f4cc182912df11b92fa355b16231b1fb5", + "authority": "verified extraction consumer baseline", + "relation": "input baseline; candidate output identity is separate" + }, + { + "repository": "The-Interdependency/skill-lib", + "commit": "d71a3a938cb6d646ffc0b59186452117e4a37d13", + "authority": "build and verification discipline", + "relation": "resolved governing skills; no geometry authority" + } + ], + "boundaries": { + "authority_transfer": false, + "proof_status_transfer": false, + "measurement_status_transfer": false, + "semantic_mapping": "UCNS owns geometry; Stack owns English; UCHC verifies extraction.", + "agent_scope": "english-recursive-attachment", + "hmmm": [ + "Closed bearing functional remains unselected; recursive stack operation is specified.", + "Numerical definition attachment, expanded carrier, sheet lift and graduation remain open." + ] + }, + "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603" +} diff --git a/human/english/README.md b/human/english/README.md index b463af9..2e59cb8 100644 --- a/human/english/README.md +++ b/human/english/README.md @@ -1,10 +1,11 @@ -## Extracted Stack ordinal candidate - -The executable [ordinal-geometry contract](docs/ordinal-geometry.md) constructs admitted glyph instances through UCNS ordinal_affixiation and the Public Gonol angular registry. For 'word', it returns radii R/16, R/8, R/4, R/2, real UCNS placements and exact source recovery. - -Stack owns this implementation until graduation; the [extraction receipt](experiments/ordinal-geometry-v1/extraction.json) binds its exact source and tests. - -Use OrdinalStructuralField for verified English corpus geometric queries; legacy StructuralField remains the immutable historical replay API. No replacement coordinates are fabricated. +## Extracted recursive attachment profile + +Start with [recursive-stack.md](docs/recursive-stack.md) and the +[exact extraction receipt](experiments/recursive-attachment-v1/extraction.json). +Sentences stack closed words through the same native operation as glyphs within +words. Whole lexical ownership is represented by a typed source closure. +Bearing candidates remain explicit; historical ordinal/structural replay remains +available. Stack retains implementation authority pending graduation. --- # English Gonol Construction diff --git a/human/english/docs/ordinal-decisions-2026-10-27.md b/human/english/docs/ordinal-decisions-2026-10-27.md new file mode 100644 index 0000000..a6d988f --- /dev/null +++ b/human/english/docs/ordinal-decisions-2026-10-27.md @@ -0,0 +1,282 @@ +# English ordinal decisions — 2026-10-27, clarified through 2026-10-29 + +**Standing:** Erin Spencer ratified the policy, attachment and SPACE-direction +requirements below. SPACE remaining with each glyph is a construction +assumption; a separately stored SPACE object is not a selected requirement. +Each halving represents another disk; sentences recursively stack closed words +using the same operation. The native implementation is described in +[recursive-stack.md](recursive-stack.md). A physical camera model remains open. + +## Scope and authority + +These decisions apply to forward English ordinal construction and its required +UCNS carrier/attachment support. Stack owns English admission, lexical ownership +and construction research. UCNS owns the geometric constructor and exact angles. +UCHC consumes a verified extraction. No geometry, proof, measurement or release +standing transfers between those roles. + +Here, **definition origin** means the local attachment belonging to the source +lexical construction. It does not mean a grammatical head word, semantic cause, +or a new physical coordinate law. **Rebasing** means assigning bearings under a +new explicitly identified carrier version; it does not edit old receipts. + +## Ratification and selected requirements + +The preceding answer offered a probable and an alternative answer for each row. +Erin replied: “the probable answer. the probable answer. the alternative answer.” +The positional mapping is: + +| Question | Ratified requirement | Other option from that question | +|---|---|---| +| What determines a closed word's bearing in its parent frame? | Derive it from the closed construction and SPACE attachment. | A separately defined word carrier was not chosen. | +| Who owns the definition origin for a multiword lexical entry? | The whole closed lexical construction, retaining its constituent relations. | Attachment to an explicitly selected constituent was not chosen. | +| May expanding the Public Gonol change existing glyph bearings? | Permit rebasing in a new version with new construction receipts. | Preserving existing bearings during expansion is not a requirement. | + +This ratification is scoped to these requirements. It does not select an +unstated formula, glyph ordering, carrier inventory, or executable candidate. +The third choice permits changed bearings; it does not require every bearing +to change. The existing 157-position artifact and its digest retain their exact +historical identity. New constructions must identify the new carrier version. + +SPACE already supplies attachment between nested frames and multiword lexical +definition attachment. The new ownership decision applies that attachment to +the whole source lexical construction. Ordered constituents, punctuation, +multiplicity, sense/synset provenance and successive-definition relations remain +recoverable. Selecting one constituent silently would violate this decision. + +## Compound joining clarification + +Erin specified: “bull + shit the 'l' in bull becomes the space that the 's' in +shit sits on.” When asked about distance, Erin clarified: “distance is +unchanged, this preserves the compound joining. the angle changes, +demonstrating the join”. + +For this explicitly declared compound join: + +- The terminal `l` occurrence in `bull` supplies the local SPACE attachment + reference for `shit`. This means the second `l` occurrence, not every + occurrence of the shared glyph identity. +- `s` retains its established ordinal radial distance in the incoming local + frame. The join changes that frame's attachment and angular placement. +- Compound joining preserves established radial distances and the recoverable + interiors of the component constructions. It is a separate operation from + appending glyphs with successive radial halving. +- The terminal occurrence keeps its identity and participation in `bull` while + serving the SPACE role at this join. It is not deleted or relabeled globally. +- The compound relation must retain its declared component boundary and order. + This example does not authorize automatic splitting of arbitrary words or + applying the rule to every ordinary inter-word SPACE. + +The symbolic invariant is `local_radius_after_join == local_radius_before_join`. +The 2026-10-28 origin-at-attachment clarification below fixes the local-frame +reading of that invariant. Distances measured from a different parent origin +need not stay unchanged. `s` has its retained nonzero local radius; making the +terminal `l` the incoming origin does not place `s` on top of that `l`. + +### Superseded complete-join interpretation + +The earlier angular-reference formula at +`c17ed27a935a5583880f2a29d79f9152f2362ea3` kept all spatial origins together. +Its exact-turn angle shift remains useful as a projected view, but an +angle-only shared-origin drawing is not the complete origin-at-attachment +construction now requested. The earlier projections and receipts retain their +historical scope; they do not verify the forward transport or SPACE assumption. + +## SPACE direction and persistence — clarified 2026-10-29 + +### Domain-bound meanings + +These records scope the operative terms before attaching conversational +provenance. They concern forward UCNS geometry consumed by English research; +Stack records the requirements and assumptions without acquiring UCNS authority. + +| Field | Retained SPACE | Superposition | +|---|---|---| +| Surface form | SPACE, SPACE storage | super positioned with the glyph | +| Term id | `ucns.ordinal_attachment.retained_space` | `ucns.ordinal_attachment.space_glyph_superposition` | +| Claiming domain | UCNS construction/frame geometry | UCNS construction/frame geometry | +| Claimed sense | A glyph begins as SPACE; its underlying SPACE and frame reference remain assumed in the construction after placement. | SPACE and the glyph coexist in the construction's interpretation. | +| Scope | Forward glyph and word attachments in this record. | The same forward construction scope. | +| Claim type / status | Specialized / construction assumption; storage representation open. | Specialized / construction assumption; storage representation open. | +| Included uses | Preserving or deriving the occurrence's SPACE role, origin, direction and attachment relation. | Interpreting glyph placement without erasing the underlying SPACE role. | +| Excluded uses | Automatically inserting a literal U+0020; requiring an additional stored object or field merely because the assumption is present. | Destructive conceptual replacement of SPACE; an extra sequential text character; an undeclared arithmetic operation. | +| Neighbors | Public Gonol SPACE position, literal SPACE seam, local origin, local zero-angle direction, definition origin. | Retained interior, glyph identity, occurrence, rendering and storage representation. | +| Known collisions / resolution | Literal text SPACE and the geometric SPACE role remain distinct; the literal-SPACE admission rule is unchanged. | Conceptual coexistence does not itself prescribe separate allocation, serialization or object identity. | +| Effective version | 2026-10-29 clarification | 2026-10-29 clarification | +| Supersedes | The assistant's 2026-10-28 claim that every SPACE support must be stored explicitly. | The assistant's promotion of conceptual coexistence into mandatory native storage. | +| Authority source | The operator statements and accepted antecedent below. | The operator statements below. | +| Handle identity | Not applicable. | Not applicable. | +| Unresolved | Which relations are implicit, derived or stored; exact native frame transport. | Representation and verification of the assumption without prescribing redundant records. | + +### Accepted direction and corrected storage interpretation + +Erin stated: “origin at the attachment is definitely a thing for words.” + +The proposed SPACE-direction rule was: the preceding letter's placement +direction becomes the next frame's SPACE direction; the next glyph's carrier +angle is measured relative to that inherited direction. Erin then replied: + +> I agree with your space direction rule; every glyph begins as space; the storage never goes away but instead it's super positioned with the glyph + +The assistant interpreted this as requiring explicit per-occurrence SPACE +storage. Erin corrected that interpretation on 2026-10-29: + +> I'm not sure it's required to store such; but the assumption is there. + +The correction changes the representation claim, without withdrawing the +accepted word attachment or direction rule: + +1. A word's local origin is at its declared attachment. For the declared + `bull + shit` join, the second `l` occurrence supplies the incoming SPACE + attachment, while the whole closed lexical construction retains definition + ownership. +2. The preceding placed letter's direction supplies the next frame's SPACE + direction. A point alone is not the angular datum: both location and oriented + SPACE reference must be available, whether stored or derived. +3. Every glyph beginning as SPACE, with SPACE remaining alongside it, is the + working construction assumption. This does not require a separately stored + SPACE object, a particular field, or preserving a runtime object's identity. + An implicit or derived representation remains admissible if it supplies the + declared relations without guessing. +4. Preserve individual occurrences, including repeated glyphs, their order, + attachments and closed interiors. A display may emphasize the glyph while + leaving the assumed SPACE role implicit. +5. Keep glyph-building halving distinct from joining already closed components. + Appending a glyph follows the declared ordinal halving rule; the compound + join preserves the components' established local radii. + +The direction rule is selected and implemented by the native attachment profile. +Explicit SPACE storage is not an additional acceptance gate. + +### Directional consequence and view contract + +Let `theta_i` be occurrence i's exact carrier turn relative to its own SPACE, +and let `space_heading_i` express that SPACE direction in a common planar +orientation. The accepted direction rule gives, modulo one turn: + +```text +placed_heading_i = space_heading_i + theta_i +space_heading_(i+1) = placed_heading_i +``` + +The first SPACE heading comes from the word's declared attachment frame. +Repeated glyphs retain the same local carrier turn while their parent-frame +headings can differ. This does not change the historical carrier or its old +receipts. + +A planar display can express a placement as +`point_i = origin_i + local_radius_i * unit(placed_heading_i)`. +This equation neither defines a depth projection nor supplies missing native +cross-frame transport or further sheet/lift behavior. Origins, orientations and +attachment sites must be available from the construction; this does not require +storing each as a separate field. + +The common-origin concentric view and the view retaining individual origins +are proposed views of one construction. Their correspondence must recover the +ordered occurrences, local radii, local carrier turns and attachment/frame +relations consistently with the SPACE assumption. Coincident rendered points +must not merge occurrences. Exact derivation from sufficient construction data +is allowed. A flattened drawing is insufficient if it loses required relations. +Coordinate-only round trips do not establish native implementation. + +### Recursive disk-stack rule — clarified 2026-10-29 + +Erin specified: “each halving represents another disk.” The clarified sentence +rule is: “from words, sentences stack like glyphs into words.” This settles the +recursive operation. For `n` participants, zero-based occurrence `i` has disk +depth `n-i` and parent radius `R / 2**(n-i)`. Appending a participant halves the +earlier parent radii and advances their depths. A closed child's internal +geometry is retained; a word is one participant in its parent stack. + +The common-origin view shows each ordered ray from the root; the attached-origin +view places each origin at the preceding endpoint. Both retain the root SPACE +orientation. They express the same construction and need not be congruent. + +The exact functional deriving a closed word's bearing was not specified. +The implementation exposes root-to-endpoint and final accumulated heading as +explicit comparison candidates, without a default. This narrow remaining choice +does not reopen whether sentences use the recursive stack. A physical observer +projection or camera law is not required to implement the selected recurrence. + +### Representation-neutral verification + +Native validation must establish: + +- the inherited SPACE direction and exact local carrier turn at each occurrence; +- local radii under both glyph appending and closed-component joining; +- distinguishable repeated occurrences and their attachment relations; +- recovery through both proposed views for the declared representation; +- preservation of required information through nesting and serialization, + with a new versioned receipt for changed geometry. + +Fail if required relations cannot be recovered, if SPACE is silently inserted +as an extra text occurrence, if selected direction inheritance resets to global +zero, or if an old receipt is reused for a changed construction. Absence of a +separate SPACE record is not by itself a failure. Physical projection claims require their own specified camera model and checks. + +## Historical source inspection before native integration + +The inspected inputs are: + +| Repository | Exact revision | Role | +|---|---|---| +| The-Interdependency/skill-lib | `e46accffcb67a10630516d486c89e67f6ad19c7a` | Construction, scoped ratification and provenance discipline | +| The-Interdependency/ucns | `ed0b0760f05cd975a7a811f8abeb70a11d09f00b` | Native ordinal constructor and current Public Gonol | +| The-Interdependency/stack | `c8bddd5ae02fdaa001c2ba6962da66117384437e` | English candidate implementation before this decision record | +| The-Interdependency/uchc | `27796465cfb5f68497e63aa1a10cf5c0c6d91b19` | Verified extraction and isolated acceptance commands | + +At that UCNS revision, `Participant.closed(carrier, interior)` requires an +explicit carrier. `Placement.turn` obtains the angle from that carrier. Neither +derives a parent bearing from the closed interior or its SPACE attachment. +The clarified requirements select the terminal attachment and inherited SPACE +direction; SPACE persistence remains an assumption with representation open. +They do not collapse the whole word into its terminal glyph. Centroid, hash, +lexical-index and shared-zero substitutions remain unauthorized. + +The inspected ordinal implementation stores `Construction.origin` as a string +and each `Participant` as a carrier/identity with an optional closed interior. +No separate initial-SPACE object per primitive occurrence is represented. +That absence alone does not violate the clarified assumption. The inspected +source does not implement the selected inherited per-occurrence orientation +and attachment transport; a word-level `origin='SPACE'` label does not +establish those behaviors. + +The sealed historical structural profile returns +`hmmm:compound-lexical-origin` for the 57,155 affected definition records in its +sealed complete-corpus evidence. The forward recursive profile overlays a typed whole lexical owner and audits +every definition. It does not retrospectively change those rows or receipts. + +## Implementation and failure conditions + +1. Implement the selected attachment and inherited SPACE direction in UCNS, + consistently with the SPACE assumption. Choose stored or derived relations + only as needed by the representation. English supplies declared relations + and consumes that geometry. Verify the terminal occurrence, unchanged + compound local radii, correct directional composition and both component + interiors. Fail on radial recontraction, a wrong repeated occurrence, + unrecoverable relations/boundaries, or reuse of an old receipt for changed + placements. Do not substitute an unrelated word carrier. +2. Represent the whole closed lexical owner in the forward English profile. + Preserve each constituent and each original definition relation; never pass + a lexical-entry identifier off as a word identifier. Verify all affected + definitions against the complete source and replay the resulting receipts. +3. Declare the expanded carrier's admitted inventory, ordering and SPACE datum. + Give it a distinct version and receipt. Reconstruct consumers against that + version; reject receipt/version substitution and silent reinterpretation of + constructions made with the old carrier. + +Completion requires executable source and exact replay for the declared scope. +It fails if a chosen policy is reported as implemented, an unresolved numerical +rule is invented, constituent information disappears, or old receipts are +silently relabeled. Rollback selects an explicitly identified prior profile; +it does not reverse this ratification or erase historical evidence. + +## hmmm + +- Select the precise construction-derived closed-word bearing functional. +- Numerical definition attachment, beyond the implemented typed lexical owner. +- Native sheet/lift behavior and any physical observer projection. +- Exact expanded carrier inventory/order and versioned reconstruction. +- Hosted verification, stable publication and domain graduation. + +GPT generated; context, prompt Erin Spencer. diff --git a/human/english/docs/recursive-stack.md b/human/english/docs/recursive-stack.md new file mode 100644 index 0000000..77e0518 --- /dev/null +++ b/human/english/docs/recursive-stack.md @@ -0,0 +1,97 @@ +# Recursive attachment profile + +GPT generated; context, prompt Erin Spencer. + +`english.attachment/1` applies the same native UCNS stack to glyphs within words +and closed words within sentences. Compound joining is a separate native rigid +attachment: it preserves the components' local radii and retains their boundary. +The declared `bull + shit` join attaches at the second `l`; the resulting closed +compound can itself participate in a parent stack. + +Stack owns English admission and source relations. UCNS owns all geometry. +UCHC must extract this source and tests at an exact Stack commit. The +[input work graph](recursive-work-graph.json) records the starting baselines; +its Stack baseline is not the eventual extraction commit. Graduation is unchanged. + +## Exact construction and views + +With `n` participants, occurrence `i` has depth `n-i`, radius `R/2**(n-i)` and +the previous placed heading as its SPACE direction. Its origin is the preceding +endpoint. Appending halves the earlier parent geometry and advances disk depths. +Closed interiors keep their own local geometry, order, repeated occurrences and +source identities. No separate stored SPACE object is required. + +The common-origin view retains ordered rays from the root; the attached-origin +view uses their prefix sums. Exact differences recover the original rays. +Both serialize the root location and SPACE orientation. These views need not be +congruent. Graph replay retains carriers, shared child references and every +occurrence; it rejects receipt, root, carrier and relationship mutations. + +Native coordinates are exact constructive expressions. Expression identity is +not a complete geometric-equivalence test. Floating display is explicitly lossy +and refuses detected underflow/collapse; it does not supply construction receipts. +No physical camera or sheet-lift law is asserted. + +## Explicit bearing candidates + +The recursive operation is specified. The exact functional deriving a closed +word's bearing remains unselected; neither candidate has a default: + +| Candidate | Bearing supplied to the parent | Boundary | +| --- | --- | --- | +| `root-endpoint-v1` | Direction from the child's root to its endpoint | Requires a proved nonzero endpoint; unsupported nonzero proofs refuse | +| `exit-heading-v1` | Final accumulated heading within the child | Distinct interiors can share this bearing; interiors remain retained | + +Comparing these candidates does not introduce an alternative sentence-distance +rule. Native stacks have a nonzero endpoint by strict last-ray dominance. A +compound join need not; native exact zero/unknown checks prevent undefined +endpoint normalization. A bearing is an orientation, not a unique word identity. + +## Usage + +Install UCNS at `9cc00771e54336d58ee377faeec87a3a33dbd4bf`; the consumer verifies +the exact four source blobs before construction. From the English forge: + +```bash +python -m english_gonol.attachment_construction word bull +python -m english_gonol.attachment_construction compound bull shit +python -m english_gonol.attachment_construction sequence bull shit --bearing root-endpoint-v1 +python -m pytest -c /dev/null ordinal_tests/test_attachment_construction.py +UCHC_STRUCTURAL_FIELD=/path/to/complete/field python -m pytest -c /dev/null ordinal_tests/test_attachment_corpus.py +python -m english_gonol.attachment_audit /path/to/complete/field +``` + +CLI sequence arguments declare word boundaries; they do not infer sentence +closure. `RecursiveStructuralField.compose(..., relation='sentence')` preserves +the existing structural closure gate. Source queries retain all punctuation, +SPACE events, offsets and word occurrences. The parent geometry's scope is +ordered closed-word placement; it does not invent punctuation function geometry. +Without a bearing, it returns retained word interiors and the narrow partial +`CLOSED_WORD_BEARING_POLICY_REQUIRED`. + +`definition()` overlays a typed whole lexical owner, including all components +and provenance, and retains the historical origin separately. A lexical record +ID is never passed as a word ID. This fixes logical ownership; numerical +definition attachment is still open. Historical database bytes and receipts +are not rewritten. Historical word geometry is explicitly qualified under +`historical_structural_geometry` when the new profile returns a word. + +## Evidence and remaining scope + +The native full outcome gate passes 303 tests, including 24,336 non-SPACE glyph +pairs against an independent cyclotomic oracle, recursive candidate bindings, +graph/view mutation controls and 1,100-level nesting. An independent review +checked attachment closure and the PID-namespace supervisor repair required by +the gate. Consumer checks cover actual native imports, drift/refusal boundaries, +compound replay, shared interiors, and complete-corpus sentence closure. + +The complete corpus audit visits every word and definition, checking retained +parts, source succession and typed lexical ownership. Its deterministic stream +digests can be compared across forge and installed consumer. Read the adjacent +experiment evidence for executed counts and exact producer identities. + +**hmmm:** select the closed-word bearing functional; numerical definition +attachment; expanded carrier inventory/order; punctuation geometry and sheet +lift; hosted CI, stable publication, released-artifact reconsumption and domain +graduation. Historical ordinal and structural profiles remain explicit replay +interfaces. Rollback selects those versioned profiles without changing receipts. diff --git a/human/english/docs/recursive-work-graph.json b/human/english/docs/recursive-work-graph.json new file mode 100644 index 0000000..9b7e27e --- /dev/null +++ b/human/english/docs/recursive-work-graph.json @@ -0,0 +1,42 @@ +{ + "schema": "the-interdependency.stack-manifest", + "version": "1.0.0", + "repositories": [ + { + "repository": "The-Interdependency/ucns", + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "authority": "native recursive planar attachment and exact expression geometry", + "relation": "exact producer; historical ordinal modules unchanged" + }, + { + "repository": "The-Interdependency/stack", + "commit": "f19389bd7b15e6540f812ec47d67274e429daec5", + "authority": "English construction forge pending domain graduation", + "relation": "input baseline; output extraction must pin the resulting forge commit" + }, + { + "repository": "The-Interdependency/uchc", + "commit": "f2528c7f4cc182912df11b92fa355b16231b1fb5", + "authority": "verified extraction consumer baseline", + "relation": "input baseline; candidate output identity is separate" + }, + { + "repository": "The-Interdependency/skill-lib", + "commit": "d71a3a938cb6d646ffc0b59186452117e4a37d13", + "authority": "build and verification discipline", + "relation": "resolved governing skills; no geometry authority" + } + ], + "boundaries": { + "authority_transfer": false, + "proof_status_transfer": false, + "measurement_status_transfer": false, + "semantic_mapping": "UCNS owns geometry; Stack owns English; UCHC verifies extraction.", + "agent_scope": "english-recursive-attachment", + "hmmm": [ + "Closed bearing functional remains unselected; recursive stack operation is specified.", + "Numerical definition attachment, expanded carrier, sheet lift and graduation remain open." + ] + }, + "work_graph_sha256": "ba6ce1f1d3586d06c6eb8027958db8f43097a629e47c7cb79148bf6b4e048fbf" +} diff --git a/human/english/english_gonol/attachment_audit.py b/human/english/english_gonol/attachment_audit.py new file mode 100644 index 0000000..5484c54 --- /dev/null +++ b/human/english/english_gonol/attachment_audit.py @@ -0,0 +1,106 @@ +# ratios: loc_comments=65:31 imports_exports=7:2 calls_definitions=31:2 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +# === MODULE_BUILD === +# id: english_attachment_complete_audit +# module_name: attachment_audit +# module_kind: verification-tool +# summary: complete forward word and typed lexical ownership census over a verified corpus +# owner: Erin Spencer +# public_surface: audit, main +# internal_surface: ordered stream digests +# auth_boundary: verified structural field and pinned native modules +# storage_boundary: corpus read-only; JSON report to stdout +# network_boundary: none +# user_data_boundary: public corpus only +# admin_only: false +# tests: complete-corpus execution and source/installed report equality +# rollout: additive attachment profile evidence +# rollback: preserve historical structural profile +# requires: english_recursive_attachment_consumer +# unresolved: candidate bearing selection and numerical definition attachment +# === END MODULE_BUILD === +# === CONTRACTS === +# id: english_attachment_complete_census +# given: a verified complete structural corpus +# then: every word is reconstructed or explicitly refused and every definition retains its whole lexical owner, constituents and source succession +# === END CONTRACTS === +"""GPT generated; context, prompt Erin Spencer. + +Usage: python -m english_gonol.attachment_audit /path/to/structural-field +This finite complete audit has no sampling or scientific runtime cutoff. +Stream hashes bind ordered results without retaining a second corpus in memory. +""" +import argparse +from collections import Counter +import hashlib +import json + +from english_gonol.attachment_construction import RecursiveStructuralField, authority +from english_gonol.ordinal_construction import OrdinalGeometryError +from english_gonol.structural_rules import digest + + +def audit(path): + counts, refusals = Counter(), Counter() + words_hash, definitions_hash = hashlib.sha256(), hashlib.sha256() + with RecursiveStructuralField(path) as field: + if not field.complete_corpus: + raise ValueError('COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL') + for wid, surface in field.db.execute('SELECT id,surface FROM words ORDER BY id'): + counts['words'] += 1 + try: + obj = field._closed_word(surface, wid) + except OrdinalGeometryError as exc: + if exc.code != 'PUBLIC_GONOL_ANGLE_UNAVAILABLE': + raise + counts['refused_words'] += 1 + refusals.update(exc.glyphs) + record = {'word_id': wid, 'surface': surface, 'code': exc.code, 'glyphs': list(exc.glyphs)} + else: + assert obj.recover() == tuple(surface) + assert [obj.depth(i) for i in range(len(surface))] == list(range(len(surface), 0, -1)) + counts['constructed_words'] += 1 + record = {'word_id': wid, 'construction': obj.record()} + words_hash.update((digest(record) + '\n').encode()) + for rid, text, owner, ordinal, previous, provenance, old_state in field.db.execute( + "SELECT id,text,owner_record_id,ordinal,previous_definition_id,provenance,origin_state FROM records WHERE kind='definition' ORDER BY id"): + result = field.definition(rid) + lexical = result['lexical_owner'] + assert lexical['record_id'] == owner and lexical['kind'] == 'lexical-construction' + assert result['text'] == text and result['provenance'] == json.loads(provenance) + assert result['definition_succession'] == {'ordinal': ordinal, 'previous': previous} + for source_id, source_text, parts in ((rid, text, result['parts']), (owner, lexical['text'], lexical['parts'])): + source_parts = list(field.db.execute( + 'SELECT ordinal,kind,word_id,character_id,start_offset,end_offset,function FROM components WHERE record_id=? ORDER BY ordinal', (source_id,))) + assert len(source_parts) == len(parts) + for part, row in zip(parts, source_parts): + n, kind, wid, cid, start, end, function = row + assert part == {'ordinal': n, 'kind': kind, 'identity': wid if kind == 'word' else cid, + 'start': start, 'end': end, 'function': json.loads(function)} + assert ''.join(source_text[p['start']:p['end']] for p in parts) == source_text + assert len(result['constituent_direct']) == len(result['parts']) + assert all(p['owner'] == result['origin'] for p in result['constituent_direct']) + counts['definitions'] += 1 + counts['formerly_compound_definitions'] += int(old_state == 'hmmm:compound-lexical-origin') + definitions_hash.update((result['attachment_receipt'] + '\n').encode()) + assert counts['words'] == field.db.execute('SELECT count(*) FROM words').fetchone()[0] + result = {'schema': 'english.attachment-corpus-audit.v1', 'geometry_authority': authority(), + 'field_receipt': field._field_receipt, 'counts': dict(counts), + 'unplaced_glyph_word_counts': dict(sorted(refusals.items())), + 'word_stream_sha256': words_hash.hexdigest(), 'definition_stream_sha256': definitions_hash.hexdigest(), + 'scope': 'all corpus words and all definition ownership overlays; no bearing candidate selected', + 'hmmm': ['Numerical definition attachment and bearing selection remain open.']} + return {**result, 'receipt': digest(result)} + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('field') + args = parser.parse_args() + print(json.dumps(audit(args.field), sort_keys=True, ensure_ascii=False, indent=2)) + + +if __name__ == '__main__': + main() +# ratios: loc_comments=65:31 imports_exports=7:2 calls_definitions=31:2 diff --git a/human/english/english_gonol/attachment_construction.py b/human/english/english_gonol/attachment_construction.py new file mode 100644 index 0000000..4b10066 --- /dev/null +++ b/human/english/english_gonol/attachment_construction.py @@ -0,0 +1,322 @@ +# ratios: loc_comments=230:54 imports_exports=9:9 calls_definitions=103:17 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +# === MODULE_BUILD === +# id: english_recursive_attachment_consumer +# module_name: attachment_construction +# module_kind: adapter +# summary: English admission and lexical ownership consuming native recursive UCNS stacks +# owner: Erin Spencer +# public_surface: construct_word, construct_sequence, construct_compound, replay_compound, word_record, RecursiveStructuralField, main +# internal_surface: exact producer integrity and language-only relation records +# auth_boundary: exact UCNS modules and verified corpus; integrity is not authentication +# storage_boundary: read-only structural field; caller owns returned records +# network_boundary: none +# user_data_boundary: query text remains local +# admin_only: false +# tests: ordinal_tests/test_attachment_construction.py, ordinal_tests/test_attachment_corpus.py +# rollout: explicit recursive-stack profile; historical structural and ordinal replay remain versioned +# rollback: select historical profile explicitly; never reinterpret an existing receipt +# requires: ucns_attachment_stack, ucns_attachment_codec, english_structural_profile +# unresolved: exact closed-word bearing selection, non-Public-Gonol admission and punctuation geometric operations +# === END MODULE_BUILD === +# === CONTRACTS === +# id: english_attachment_native_authority +# given: an admitted word or explicitly bound sequence +# then: all coordinates, headings, halvings, closure and graph replay are produced by exact pinned UCNS modules +# id: english_attachment_source_structure +# given: a verified query containing repeated words, punctuation and whitespace +# then: preserve every source part and occurrence and apply the existing admission and sentence-closure gates without splitting or normalizing text +# id: english_attachment_bearing_boundary +# given: closed words to place at the parent scale +# then: require an explicit named candidate bearing without reopening the specified recursive stacking operation +# id: english_attachment_lexical_owner +# given: a definition with a source lexical owner +# then: the entire closed lexical construction owns the typed definition origin while original parts, succession and provenance remain recoverable +# === END CONTRACTS === +"""Forward English attachment profile, forged in Stack and extracted into UCHC. + +GPT generated; context, prompt Erin Spencer. + +Usage:: + + python -m english_gonol.attachment_construction word bull + python -m english_gonol.attachment_construction sequence bull shit --bearing exit-heading-v1 + python -m english_gonol.attachment_construction compound bull shit + +The sequence command declares word boundaries explicitly; it does not infer a +sentence. Corpus queries use RecursiveStructuralField and the structural +sentence-closure gate. Both bearing choices are unselected candidates. Every +result retains exact UCNS expressions; display is optional and lossy. Historical +StructuralField and OrdinalStructuralField remain explicit replay interfaces. +""" +from __future__ import annotations + +import argparse +from functools import lru_cache +import importlib +import json +from pathlib import Path + +from english_gonol.ordinal_construction import ( + OrdinalGeometryError, _git_blob_sha1, _ucns, + construct_glyph_gonol, PUBLIC_GONOL_SHA256, +) +from english_gonol.structural_query import StructuralField +from english_gonol.structural_rules import digest + +UCNS_COMMIT = '9cc00771e54336d58ee377faeec87a3a33dbd4bf' +UCNS_BLOBS = {'attachment_stack': '0ce3879257b40d264749c1b65fff23abf186fded', 'attachment_codec': '5e761f8e2169ddb24aa6744a8a577ee4aa4989bd', 'ordinal_affixiation': '9fa84ef20f19fe0c04df680f49b50ea307e6d624', 'public_gonol': 'c1955e46e2dc918fb657cb346e42106d71937e91'} + + +@lru_cache(maxsize=1) +def _native(): + _ucns() + modules = {} + for name, expected in UCNS_BLOBS.items(): + try: + module = importlib.import_module('ucns.' + name) + except ImportError as exc: + raise OrdinalGeometryError('UCNS_ATTACHMENT_PRODUCER_REQUIRED') from exc + path = getattr(module, '__file__', None) + try: + content = Path(path).read_bytes() if path else None + except OSError as exc: + raise OrdinalGeometryError('UCNS_ATTACHMENT_PRODUCER_REQUIRED') from exc + if content is None or _git_blob_sha1(content) != expected: + raise OrdinalGeometryError('UCNS_ATTACHMENT_PRODUCER_DRIFT') + modules[name] = module + if set(modules) != {'attachment_stack', 'attachment_codec', 'ordinal_affixiation', 'public_gonol'}: + raise OrdinalGeometryError('UCNS_ATTACHMENT_PRODUCER_REQUIRED') + return modules['attachment_stack'], modules['attachment_codec'] + + +def authority(): + _native() + return {'repository': 'The-Interdependency/ucns', 'commit': UCNS_COMMIT, + 'source_blobs': dict(UCNS_BLOBS), 'public_gonol_sha256': PUBLIC_GONOL_SHA256} + + +def construct_word(text, *, source='english.attachment/1:declared-word'): + """Construct one declared word; no corpus admission is implied by this API.""" + native, _codec = _native() + admitted = construct_glyph_gonol(text, source=source) + return native.stack(text, admitted.participants, relation='english.attachment/1:glyph-stack', source=source) + + +def word_record(word): + native, codec = _native() + if not isinstance(word, native.DiskStack): + raise OrdinalGeometryError('NATIVE_WORD_STACK_REQUIRED') + expected = construct_word(word.identity, source=word.source) + if expected.receipt != word.receipt: + raise OrdinalGeometryError('PUBLIC_GONOL_WORD_STACK_REQUIRED') + return {'schema': 'english.attachment-word.v1', 'geometry_authority': authority(), + 'graph': codec.export_graph(word), 'recovered_glyphs': list(word.recover()), + 'disk_depths': [word.depth(i) for i in range(len(word.rays))]} + + +def construct_sequence(words, *, bearing=None, source='english.attachment/1:declared-sequence'): + """Same native stack, now consuming already closed words; never text.split().""" + native, _codec = _native() + if bearing not in native.POLICIES: + raise OrdinalGeometryError('CLOSED_WORD_BEARING_POLICY_REQUIRED') + if not isinstance(words, tuple) or not words: + raise OrdinalGeometryError('CLOSED_WORD_PARTICIPANTS_REQUIRED') + for word in words: + closed_record(word) + return native.stack('declared-word-sequence', tuple(native.Closed(w, bearing) for w in words), + relation='english.attachment/1:word-stack', source=source) + + +def construct_compound(left, right, *, source='english.attachment/1:declared-compound'): + """Explicit component boundary; the terminal occurrence supplies attachment.""" + if not isinstance(source, str) or not source: + raise OrdinalGeometryError('SOURCE_IDENTITY_REQUIRED') + native, codec = _native() + left_record, right_record = closed_record(left), closed_record(right) + site = len(left.rays) - 1 + rows = native.attach(left, site, right) + obj = native.join(left.identity + right.identity, left, right, + relation='english.attachment/1:declared-compound', source=source) + result = {'schema': 'english.attachment-compound.v1', 'source': source, + 'relation': 'declared-compound', 'geometry_authority': authority(), + 'components': [left_record, right_record], 'attachment_ordinal': site, + 'graph': codec.export_graph(obj), + 'incoming_rows': [{'origin': o.record(), 'point': p.record()} for o, p in rows], + 'local_radii_preserved': True, 'definition_owner': 'whole-closed-lexical-construction'} + return {**result, 'receipt': digest(result)} + + +def closed_record(obj): + """Validate either a glyph-built word or a retained explicit compound.""" + native, codec = _native() + if not isinstance(obj, native.AttachmentJoin): + return word_record(obj) + pending, seen = [obj], set() + while pending: + current = pending.pop() + if current.receipt in seen: + continue + seen.add(current.receipt) + if isinstance(current, native.AttachmentJoin): + expected = native.join(current.left.identity + current.right.identity, + current.left, current.right, + relation='english.attachment/1:declared-compound', source=current.source) + if current.receipt != expected.receipt: + raise OrdinalGeometryError('DECLARED_COMPOUND_REQUIRED') + pending.extend((current.right, current.left)) + else: + word_record(current) + return {'schema': 'english.closed-compound.v1', 'geometry_authority': authority(), + 'graph': codec.export_graph(obj)} + + +def replay_compound(record): + """Reconstruct both components and the actual attachment, not just a hash.""" + _native_module, codec = _native() + try: + if not isinstance(record, dict) or len(record['components']) != 2: + raise ValueError('two components required') + left, right = (codec.replay_graph(p['graph']) for p in record['components']) + expected = construct_compound(left, right, source=record['source']) + if digest(expected) != digest(record): + raise ValueError('compound replay mismatch') + return expected + except (KeyError, TypeError, ValueError) as exc: + raise OrdinalGeometryError('COMPOUND_REPLAY_MISMATCH') from exc + + +class RecursiveStructuralField(StructuralField): + """Verified corpus adapter. Candidate bearings are explicit per field instance.""" + + def __init__(self, out_dir, *, bearing=None): + native, _codec = _native() + if bearing is not None and bearing not in native.POLICIES: + raise OrdinalGeometryError('CLOSED_WORD_BEARING_POLICY_REQUIRED') + self.bearing = bearing + super().__init__(out_dir) + + def _closed_word(self, surface, word_id): + if not self.complete_corpus: + raise OrdinalGeometryError('COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL') + return construct_word(surface, source='english.structural/1:' + self._field_receipt + ':word:' + str(word_id)) + + def word(self, surface): + result = super().word(surface) + result['attachment_geometry'] = word_record(self._closed_word(surface, result['word_id'])) + result['historical_structural_geometry'] = {key: result.pop(key) for key in + ('gonal_order', 'attachment', 'definition_attachment')} + result['gonal_order'] = result['attachment_geometry']['graph'] + result['geometry_state'] = 'constructed-native-attachment' + return result + + def geometry(self, record, *, operation): + if operation != 'recursive-stack': + return super().geometry(record, operation=operation) + graph = self.replay(record) + if not self.complete_corpus: + return {'standing': 'refused', 'code': 'COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL'} + if graph['refusals']: + return {'standing': 'refused', 'code': 'PARTICIPANT_ADMISSION_REQUIRED'} + native, codec = _native() + words, occurrences, interiors = [], [], {} + try: + for part in graph['parts']: + if part['kind'] != 'word': + continue + surface = graph['source'][part['start']:part['end']] + word = self._closed_word(surface, part['identity']) + words.append(word) + interiors[word.receipt] = word_record(word) + occurrences.append({'part_ordinal': part['ordinal'], 'start': part['start'], + 'end': part['end'], 'word_id': part['identity'], 'interior': word.receipt}) + except OrdinalGeometryError as exc: + return {'standing': 'refused', 'code': exc.code, 'unplaced_glyphs': list(exc.glyphs)} + result = {'schema': 'english.recursive-word-placement.v1', 'source_structure': graph, + 'geometry_authority': authority(), 'word_interiors': list(interiors.values()), + 'word_occurrences': occurrences, 'scope': 'ordered closed-word placement', + 'hmmm': ['Punctuation function geometry is not supplied by the word stack.', + 'Closed-word bearing candidates remain unselected.']} + if not words: + return {**result, 'standing': 'refused', 'code': 'CLOSED_WORD_PARTICIPANTS_REQUIRED'} + if self.bearing is None: + return {**result, 'standing': 'partial', 'code': 'CLOSED_WORD_BEARING_POLICY_REQUIRED'} + parent = construct_sequence(tuple(words), bearing=self.bearing, + source='english.query:' + graph['receipt_sha256']) + result.update(standing='constructed', bearing_policy=self.bearing, + bearing_standing='unselected-candidate', word_stack=codec.export_graph(parent)) + result['receipt'] = digest(result) + return result + + def compose(self, record, *, relation): + result = super().compose(record, relation=relation) + if result['standing'] != 'logically-closed': + return result + geometry = self.geometry(record, operation='recursive-stack') + result['attachment_geometry'] = geometry + result['geometry_state'] = ('constructed-word-stack;candidate-bearing' if geometry['standing'] == 'constructed' + else 'hmmm:' + geometry['code']) + return result + + def lexical_owner(self, record_id): + """Whole source lexical closure; this is a typed owner, never a word ID.""" + row = self.db.execute("SELECT text,provenance FROM records WHERE id=? AND kind='lexical'", (record_id,)).fetchone() + if row is None: + raise OrdinalGeometryError('LEXICAL_OWNER_REQUIRED') + parts = [] + for ordinal, kind, wid, cid, start, end, function in self.db.execute( + 'SELECT ordinal,kind,word_id,character_id,start_offset,end_offset,function FROM components WHERE record_id=? ORDER BY ordinal', (record_id,)): + parts.append({'ordinal': ordinal, 'kind': kind, 'identity': wid if kind == 'word' else cid, + 'start': start, 'end': end, 'function': json.loads(function)}) + owner = {'schema': 'english.closed-lexical-owner.v1', 'kind': 'lexical-construction', + 'record_id': record_id, 'field_receipt': self._field_receipt, 'text': row[0], + 'parts': parts, 'closed': True, 'provenance': json.loads(row[1])} + return {**owner, 'receipt': digest(owner)} + + def definition(self, record_id): + result = super().definition(record_id) + owner = self.lexical_owner(result['owner_record_id']) + result['historical_origin'] = {'origin': result['origin'], 'state': result['origin_state']} + result['lexical_owner'] = owner + result['origin'] = {'space': 'O_D', 'owner_kind': owner['kind'], 'owner_record_id': owner['record_id'], + 'owner_receipt': owner['receipt']} + result['origin_state'] = 'whole-closed-lexical-owner' + result['constituent_direct'] = [{'owner': result['origin'], 'part': i, 'standing': result['origin_state']} + for i in range(len(result['parts']))] + result['origin_geometry'] = 'hmmm: typed lexical ownership is not a numerical definition attachment' + result['attachment_profile'] = 'english.attachment/1' + result['attachment_receipt'] = digest(result) + return result + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + sub = parser.add_subparsers(dest='command', required=True) + word = sub.add_parser('word'); word.add_argument('text') + sequence = sub.add_parser('sequence'); sequence.add_argument('words', nargs='+') + sequence.add_argument('--bearing', required=True, choices=('root-endpoint-v1', 'exit-heading-v1')) + compound = sub.add_parser('compound'); compound.add_argument('left'); compound.add_argument('right') + args = parser.parse_args() + try: + _native_module, codec = _native() + if args.command == 'word': + obj = construct_word(args.text) + result = {**word_record(obj), 'common_view': codec.export_view(obj, kind='common'), + 'attached_view': codec.export_view(obj)} + elif args.command == 'sequence': + obj = construct_sequence(tuple(construct_word(w) for w in args.words), bearing=args.bearing) + result = {'geometry_authority': authority(), 'bearing_standing': 'unselected-candidate', + 'bearing_policy': args.bearing, 'graph': codec.export_graph(obj)} + else: + result = construct_compound(construct_word(args.left), construct_word(args.right)) + except OrdinalGeometryError as exc: + print(json.dumps({'standing': 'refused', 'code': exc.code, 'glyphs': exc.glyphs})) + return 2 + print(json.dumps(result, ensure_ascii=False, sort_keys=True, indent=2)) + return 0 + + +if __name__ == '__main__': + raise SystemExit(main()) +# ratios: loc_comments=230:54 imports_exports=9:9 calls_definitions=103:17 diff --git a/human/english/experiments/recursive-attachment-v1/extraction.json b/human/english/experiments/recursive-attachment-v1/extraction.json new file mode 100644 index 0000000..b99acd5 --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/extraction.json @@ -0,0 +1,114 @@ +{ + "schema": "uchc.recursive-attachment-extraction.v1", + "source_repository": "The-Interdependency/stack", + "source_commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "source_root": "research/english-gonol", + "authority_transfer": false, + "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603", + "geometry_authority": { + "repository": "The-Interdependency/ucns", + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "source_blobs": { + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + }, + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5" + }, + "files": [ + { + "source": "english_gonol/structural_rules.py", + "target": "human/english/english_gonol/structural_rules.py", + "sha256": "4686f6a847dd0cee24e3f0a05154a71203a1d4c790922952f9876a38f017db70" + }, + { + "source": "english_gonol/structural_construct.py", + "target": "human/english/english_gonol/structural_construct.py", + "sha256": "8920759980c590719ff19a4a23906775b4058bda7f95f915a1621b1d56af18f4" + }, + { + "source": "english_gonol/structural_query.py", + "target": "human/english/english_gonol/structural_query.py", + "sha256": "3a97e971825468347ab76a44a3203ed0ce706ca0293836ffd4cc0d223d2987be" + }, + { + "source": "english_gonol/hyperspace_construct.py", + "target": "human/english/english_gonol/hyperspace_construct.py", + "sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71" + }, + { + "source": "english_gonol/full_construct_run.py", + "target": "human/english/english_gonol/full_construct_run.py", + "sha256": "fbadf9cc033a154148b62e11b52d7e38b845c0d0b669ff34dfc6186cab15c064" + }, + { + "source": "english_gonol/language/source.py", + "target": "human/english/english_gonol/language/source.py", + "sha256": "beb4d86f9c2a2879d3f63f4b73867af19edf33a2fdd6fea32e4e6e14c6b4ae2f" + }, + { + "source": "english_gonol/language/__init__.py", + "target": "human/english/english_gonol/language/__init__.py", + "sha256": "0620712b60b0c51483f45212dc63fc139b1c51a561ad863512344a5477727352" + }, + { + "source": "english_gonol/language/affixes.py", + "target": "human/english/english_gonol/language/affixes.py", + "sha256": "50df16c8dd71dcc0e1d964ac36909b3d48fbedbf404e27312492024261e36392" + }, + { + "source": "english_gonol/language/manifest.py", + "target": "human/english/english_gonol/language/manifest.py", + "sha256": "ae0b1176398f48463c3082f46afc7cd82e7273a72555a3c76e47e8fe90e15155" + }, + { + "source": "english_gonol/language/model.py", + "target": "human/english/english_gonol/language/model.py", + "sha256": "35a8ce27dcc70011cba1d31c3d6f9b1c4ec24f49a63316226ff92d12ce3332b4" + }, + { + "source": "english_gonol/language/morphology.py", + "target": "human/english/english_gonol/language/morphology.py", + "sha256": "84ea74d3498442c313bc318f0d19c4951ef59ad8411f0122bdb7a116383460ce" + }, + { + "source": "english_gonol/language/relational_bridge.py", + "target": "human/english/english_gonol/language/relational_bridge.py", + "sha256": "bceb4efc4730b2c7fc5ce8cb6f4d9334deeddb27905b79d273ce9ad3204b58eb" + }, + { + "source": "english_gonol/language/rendering.py", + "target": "human/english/english_gonol/language/rendering.py", + "sha256": "83a1b8c8fb31c7bc64a857b7f57a67079e01daa19f0d7e1d74cd501b61b0ec20" + }, + { + "source": "english_gonol/ordinal_construction.py", + "target": "human/english/english_gonol/ordinal_construction.py", + "sha256": "5b43d0efe7661cda69b2fd2c50998834795adb4467febb7a9d7a3d54883a3da7" + }, + { + "source": "english_gonol/attachment_construction.py", + "target": "human/english/english_gonol/attachment_construction.py", + "sha256": "7c754e6a8e0f860e1f645af88c4d48a8894a6dcfcde55ca5ae6af96b9378e7d1" + }, + { + "source": "english_gonol/attachment_audit.py", + "target": "human/english/english_gonol/attachment_audit.py", + "sha256": "28563495fab1ea7bd497a2e7689632fa80a46162242ae3e04b39c42a891402f0" + }, + { + "source": "ordinal_tests/test_attachment_construction.py", + "target": "tests/test_attachment_construction.py", + "sha256": "b86dabc4303dd9b63c82fe7d76188311b5c91637d918ea23738d0a45477991fc" + }, + { + "source": "ordinal_tests/test_attachment_corpus.py", + "target": "tests/test_attachment_corpus.py", + "sha256": "58bc964fbbfeb6f592551fea31f90ccaebdf1cf27312a6ce97d7e2cdc291ae3d" + } + ], + "hmmm": [ + "Bearing candidates remain unselected; extraction does not complete graduation." + ] +} diff --git a/pyproject.toml b/pyproject.toml index 51217b3..43e3418 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "uchc" -version = "0.1.0a3" +version = "0.1.0a4" description = "Unit Circle Hyperspace Constructs: exact language construction and receipt-bound inference inputs" readme = "README.md" requires-python = ">=3.12" diff --git a/tests/test_attachment_construction.py b/tests/test_attachment_construction.py new file mode 100644 index 0000000..1791b28 --- /dev/null +++ b/tests/test_attachment_construction.py @@ -0,0 +1,160 @@ +# ratios: loc_comments=106:39 imports_exports=10:5 calls_definitions=70:5 +# === CHECKS === +# id: check_english_word_uses_native_attachment_and_exact_views +# proves: english_attachment_native_authority +# call: self::test_word_uses_native_attachment_and_exact_views +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# id: check_english_recursive_word_stack_requires_explicit_candidate +# proves: english_attachment_bearing_boundary +# call: self::test_recursive_word_stack_requires_explicit_candidate +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# id: check_english_compound_keeps_boundary_and_replays +# proves: english_attachment_native_authority +# call: self::test_compound_keeps_boundary_and_replays +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# id: check_english_no_false_native_or_carrier_provenance +# proves: english_attachment_native_authority +# call: self::test_no_false_native_or_carrier_provenance +# requires: pytest, pinned_ucns +# mutates: filesystem +# cleanup: pytest_fixture_teardown +# id: check_english_partial_corpus_and_whole_lexical_owner +# proves: english_attachment_source_structure, english_attachment_lexical_owner +# call: self::test_partial_corpus_and_whole_lexical_owner +# requires: pytest, pinned_ucns +# mutates: filesystem +# cleanup: pytest_fixture_teardown +# === END CHECKS === +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +"""Native consumer tests: pytest -c /dev/null ordinal_tests/test_attachment_construction.py. + +GPT generated; context, prompt Erin Spencer. +Corpus fixtures test admission refusals and typed ownership only; no partial +fixture is represented as verified Public Gonol corpus geometry. +""" +from copy import deepcopy +from fractions import Fraction +import json + +import pytest + +from english_gonol import attachment_construction as api +from english_gonol.ordinal_construction import OrdinalGeometryError +from english_gonol.language.source import LexemeRecord, SenseRecord, SynsetRecord, WordnetSnapshot +from english_gonol.structural_construct import build +from ucns.attachment_stack import DiskStack, Closed, stack, display +from ucns.attachment_codec import export_graph, replay_graph + + +def test_word_uses_native_attachment_and_exact_views(): + word = api.construct_word('bull') + assert isinstance(word, DiskStack) + assert [r.radius for r in word.rays] == [Fraction(1, 16), Fraction(1, 8), Fraction(1, 4), Fraction(1, 2)] + assert [r.heading.turn for r in word.rays] == [Fraction(i, 157) for i in (83, 66, 22, 135)] + packet = json.loads(json.dumps(api.word_record(word))) + assert packet['geometry_authority'] == api.authority() + assert replay_graph(packet['graph']).recover() == tuple('bull') + assert packet['disk_depths'] == [4, 3, 2, 1] + + +def test_recursive_word_stack_requires_explicit_candidate(): + words = tuple(api.construct_word(w) for w in ('on', 'the', 'on')) + with pytest.raises(OrdinalGeometryError, match='CLOSED_WORD_BEARING_POLICY_REQUIRED'): + api.construct_sequence(words) + for policy in ('root-endpoint-v1', 'exit-heading-v1'): + obj = api.construct_sequence(words, bearing=policy) + assert [obj.depth(i) for i in range(3)] == [3, 2, 1] + assert obj.recover() == tuple('ontheon') + assert obj.participants[0].interior is words[0] + assert replay_graph(export_graph(obj)).recover() == obj.recover() + assert abs(display(obj.endpoint)) > 0 + with pytest.raises(OrdinalGeometryError, match='CLOSED_WORD_PARTICIPANTS_REQUIRED'): + api.construct_sequence((), bearing='exit-heading-v1') + + +def test_compound_keeps_boundary_and_replays(): + left, right = api.construct_word('bull'), api.construct_word('shit') + record = api.construct_compound(left, right) + assert record['attachment_ordinal'] == 3 + assert api.replay_compound(json.loads(json.dumps(record))) == record + assert record['components'][0]['graph']['root'] == left.receipt + assert record['components'][1]['graph']['root'] == right.receipt + compound = replay_graph(record['graph']) + for policy in ('root-endpoint-v1', 'exit-heading-v1'): + parent = api.construct_sequence((compound, left), bearing=policy) + assert parent.recover() == tuple('bullshitbull') + for mutate in ( + lambda r: r.update(attachment_ordinal=2), + lambda r: r['components'].reverse(), + lambda r: r['incoming_rows'][0].update(origin=[]), + lambda r: r['geometry_authority'].update(commit='0' * 40), + ): + bad = deepcopy(record); mutate(bad) + with pytest.raises(OrdinalGeometryError, match='COMPOUND_REPLAY_MISMATCH'): + api.replay_compound(bad) + + +def test_no_false_native_or_carrier_provenance(tmp_path, monkeypatch): + native, _codec = api._native() + forged = tmp_path / 'producer.py'; forged.write_text('changed producer\n') + with monkeypatch.context() as patch: + patch.setattr(native, '__file__', str(forged)) + api._native.cache_clear() + with pytest.raises(OrdinalGeometryError, match='UCNS_ATTACHMENT_PRODUCER_DRIFT'): + api.construct_word('word') + api._native.cache_clear() + with monkeypatch.context() as patch: + patch.setattr(native, '__file__', str(tmp_path / 'missing.py')) + api._native.cache_clear() + with pytest.raises(OrdinalGeometryError, match='UCNS_ATTACHMENT_PRODUCER_REQUIRED'): + api.construct_word('word') + api._native.cache_clear() + importer = api.importlib.import_module + with monkeypatch.context() as patch: + def missing(name): + if name == 'ucns.attachment_stack': + raise ModuleNotFoundError(name) + return importer(name) + patch.setattr(api.importlib, 'import_module', missing) + api._native.cache_clear() + with pytest.raises(OrdinalGeometryError, match='UCNS_ATTACHMENT_PRODUCER_REQUIRED'): + api.construct_word('word') + api._native.cache_clear() + for text in ('word word', 'é', '🦄', ''): + with pytest.raises(OrdinalGeometryError): + api.construct_word(text) + word = api.construct_word('word') + other = stack(word.identity, word.participants, relation='unrelated', source=word.source) + with pytest.raises(OrdinalGeometryError, match='PUBLIC_GONOL_WORD_STACK_REQUIRED'): + api.word_record(other) + + +def test_partial_corpus_and_whole_lexical_owner(tmp_path): + source = WordnetSnapshot( + lexemes=(LexemeRecord('bull shit', 'n', (), (SenseRecord('s1', 'n1', ()),)),), + synsets=(SynsetRecord('n1', 'n', ('bull shit',), ('bull shit.',), ()),), + source_tree_sha256='0' * 64, source_file_count=1) + output = tmp_path / 'fixture' + build(source, out_dir=output, public_position=lambda _c: None, producer={'standing': 'fixture-only'}) + with api.RecursiveStructuralField(output, bearing='exit-heading-v1') as field: + query = field.construct(' bull shit. ') + assert field.geometry(query, operation='recursive-stack')['code'] == 'COMPLETE_CORPUS_REQUIRED_FOR_PUBLIC_GONOL' + assert field.compose(field.construct('bull shit'), relation='sentence')['code'] == 'SENTENCE_CLOSURE_UNRESOLVED' + rid = field.db.execute("SELECT id FROM records WHERE kind='definition'").fetchone()[0] + definition = field.definition(rid) + owner = definition['lexical_owner'] + assert owner['kind'] == 'lexical-construction' and owner['text'] == 'bull shit' + assert [p['kind'] for p in owner['parts']] == ['word', 'character', 'word'] + assert definition['origin']['owner_record_id'] == owner['record_id'] + assert 'word_id' not in definition['origin'] + assert definition['definition_succession']['ordinal'] == 0 + assert definition['historical_origin']['state'] == 'hmmm:compound-lexical-origin' + assert all(p['owner'] == definition['origin'] for p in definition['constituent_direct']) +# ratios: loc_comments=106:39 imports_exports=10:5 calls_definitions=70:5 diff --git a/tests/test_attachment_corpus.py b/tests/test_attachment_corpus.py new file mode 100644 index 0000000..3bb851a --- /dev/null +++ b/tests/test_attachment_corpus.py @@ -0,0 +1,96 @@ +# ratios: loc_comments=56:27 imports_exports=5:4 calls_definitions=22:4 +# === CHECKS === +# id: check_english_complete_query_retains_source_and_occurrences +# proves: english_attachment_source_structure +# call: self::test_complete_query_retains_source_and_occurrences +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# id: check_english_no_policy_is_a_narrow_bearing_boundary +# proves: english_attachment_bearing_boundary +# call: self::test_no_policy_is_a_narrow_bearing_boundary +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# id: check_english_endpoint_candidate_preserves_corpus_closure +# proves: english_attachment_source_structure +# call: self::test_endpoint_candidate_preserves_corpus_closure +# requires: pytest, pinned_ucns +# mutates: none +# cleanup: context_manager +# === END CHECKS === +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +"""Complete-corpus consumer acceptance, with no admission or geometry mocks. + +GPT generated; context, prompt Erin Spencer. +Usage: UCHC_STRUCTURAL_FIELD=/path/to/verified/field pytest -c /dev/null +ordinal_tests/test_attachment_corpus.py. Missing corpus is a failure. +""" +import json +import os + +import pytest + +from english_gonol.attachment_construction import RecursiveStructuralField, authority +from ucns.attachment_codec import replay_graph + + +@pytest.fixture(scope='module') +def field(): + path = os.environ.get('UCHC_STRUCTURAL_FIELD') + if not path: + pytest.fail('UCHC_STRUCTURAL_FIELD must name the complete verified corpus') + with RecursiveStructuralField(path, bearing='exit-heading-v1') as opened: + assert opened.complete_corpus + yield opened + + +@pytest.mark.parametrize('text', ('word', 'word word', ' word word ', 'word word.')) +def test_complete_query_retains_source_and_occurrences(field, text): + word = field.word('word') + assert word['gonal_order'] == word['attachment_geometry']['graph'] + assert 'attachment' not in word and 'definition_attachment' not in word + assert word['historical_structural_geometry']['gonal_order'] == 'hmmm:UCNS_OPERATION_REQUIRED' + query = field.construct(text) + result = field.geometry(query, operation='recursive-stack') + assert result['standing'] == 'constructed' + assert result['source_structure'] == query + assert result['geometry_authority'] == authority() + assert result['bearing_standing'] == 'unselected-candidate' + words = [p for p in query['parts'] if p['kind'] == 'word'] + assert len(result['word_occurrences']) == len(words) + assert len(result['word_interiors']) == 1 + obj = replay_graph(json.loads(json.dumps(result['word_stack']))) + assert len(obj.participants) == len(words) + assert obj.recover() == tuple('word' * len(words)) + assert result['source_structure']['word_sites'] == query['word_sites'] + assert [p['part_ordinal'] for p in result['word_occurrences']] == [p['ordinal'] for p in words] + sentence = field.compose(query, relation='sentence') + assert sentence['standing'] == ('logically-closed' if text.endswith('.') else 'refused') + + +def test_no_policy_is_a_narrow_bearing_boundary(field): + old = field.bearing + try: + field.bearing = None + result = field.geometry(field.construct('word word'), operation='recursive-stack') + assert result['standing'] == 'partial' + assert result['code'] == 'CLOSED_WORD_BEARING_POLICY_REQUIRED' + assert len(result['word_occurrences']) == 2 and len(result['word_interiors']) == 1 + finally: + field.bearing = old + + +def test_endpoint_candidate_preserves_corpus_closure(field): + old = field.bearing + try: + field.bearing = 'root-endpoint-v1' + query = field.construct('word word.') + result = field.compose(query, relation='sentence') + assert result['standing'] == 'logically-closed' + obj = replay_graph(result['attachment_geometry']['word_stack']) + assert obj.recover() == tuple('wordword') + finally: + field.bearing = old +# ratios: loc_comments=56:27 imports_exports=5:4 calls_definitions=22:4 diff --git a/tools/verify_attachment_extraction.py b/tools/verify_attachment_extraction.py new file mode 100644 index 0000000..b3f4434 --- /dev/null +++ b/tools/verify_attachment_extraction.py @@ -0,0 +1,85 @@ +# ratios: loc_comments=47:30 imports_exports=8:1 calls_definitions=23:1 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +# === MODULE_BUILD === +# id: uchc_attachment_extraction_verifier +# module_name: verify_attachment_extraction +# module_kind: verification-tool +# summary: verify exact Stack extraction, graph and imported producer identities +# owner: Erin Spencer +# public_surface: command line +# internal_surface: digest and file comparisons +# auth_boundary: content integrity; no authentication claim +# storage_boundary: read-only checkouts +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: source and clean-installed recursive attachment workflow +# rollout: additive candidate gate +# rollback: retain historical extraction gates +# requires: pinned Stack checkout, pinned UCNS installation +# unresolved: stable publication and graduation +# === END MODULE_BUILD === +# === CONTRACTS === +# id: uchc_attachment_exact_extraction +# given: pinned Stack checkout and candidate files +# then: require complete declared source closure, matching source bytes, graph identity and native producer identity +# === END CONTRACTS === +"""GPT generated; context, prompt Erin Spencer. + +Usage: PYTHONPATH=human/english python tools/verify_attachment_extraction.py /path/to/stack +Run the same command with isolated installed Python to verify packaged modules. +""" +import argparse +import hashlib +import importlib +import json +from pathlib import Path +import subprocess + +from english_gonol.attachment_construction import authority +from english_gonol.structural_construct import IMPLEMENTATION_FILES + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('forge', type=Path) + args = parser.parse_args() + root = Path(__file__).resolve().parents[1] + graph = json.loads((root / 'docs/work-graphs/english-recursive-attachment-v1.json').read_text()) + extraction = json.loads((root / 'human/english/experiments/recursive-attachment-v1/extraction.json').read_text()) + payload = {k: graph[k] for k in ('repositories', 'boundaries')} + assert graph['work_graph_sha256'] == hashlib.sha256(json.dumps(payload, sort_keys=True, separators=(',', ':')).encode()).hexdigest() + assert all(graph['boundaries'][k] is False for k in ('authority_transfer', 'proof_status_transfer', 'measurement_status_transfer')) + source = next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') + assert subprocess.check_output(['git', '-C', str(args.forge), 'rev-parse', 'HEAD'], text=True).strip() == source + assert extraction['source_commit'] == source and extraction['authority_transfer'] is False + assert extraction['work_graph_sha256'] == graph['work_graph_sha256'] + expected = {'human/english/english_gonol/' + p: 'english_gonol/' + p for p in IMPLEMENTATION_FILES} + for name in ('ordinal_construction.py', 'attachment_construction.py', 'attachment_audit.py'): + expected['human/english/english_gonol/' + name] = 'english_gonol/' + name + for name in ('test_attachment_construction.py', 'test_attachment_corpus.py'): + expected['tests/' + name] = 'ordinal_tests/' + name + assert len(extraction['files']) == len(expected) + assert {item['target']: item['source'] for item in extraction['files']} == expected + for item in extraction['files']: + original = args.forge / 'research/english-gonol' / item['source'] + copied = root / item['target'] + assert original.read_bytes() == copied.read_bytes(), item['target'] + assert hashlib.sha256(copied.read_bytes()).hexdigest() == item['sha256'] + if item['source'].startswith('english_gonol/'): + module = item['source'][:-3].replace('/', '.') + if module.endswith('.__init__'): + module = module[:-9] + installed = Path(importlib.import_module(module).__file__) + assert installed.read_bytes() == original.read_bytes(), module + native = next(r for r in graph['repositories'] if r['repository'] == 'The-Interdependency/ucns') + assert authority()['commit'] == native['commit'] + assert authority() == extraction['geometry_authority'] + print(json.dumps({'standing': 'exact', 'source_commit': source, 'files': len(expected), + 'work_graph_sha256': graph['work_graph_sha256'], 'geometry_authority': authority()}, sort_keys=True)) + + +if __name__ == '__main__': + main() +# ratios: loc_comments=47:30 imports_exports=8:1 calls_definitions=23:1 From 18a464d9442e56b9d76ca2411fa5ac6d4e12cc05 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Thu, 29 Oct 2026 19:11:24 -0700 Subject: [PATCH 26/30] Record recursive attachment acceptance and verify committed forge blobs GPT generated; context, prompt Erin Spencer. --- .../recursive-attachment-v1/README.md | 26 ++ .../recursive-attachment-v1/corpus-audit.json | 47 ++++ .../local-verification.json | 246 ++++++++++++++++++ tools/verify_attachment_extraction.py | 7 +- 4 files changed, 324 insertions(+), 2 deletions(-) create mode 100644 human/english/experiments/recursive-attachment-v1/README.md create mode 100644 human/english/experiments/recursive-attachment-v1/corpus-audit.json create mode 100644 human/english/experiments/recursive-attachment-v1/local-verification.json diff --git a/human/english/experiments/recursive-attachment-v1/README.md b/human/english/experiments/recursive-attachment-v1/README.md new file mode 100644 index 0000000..52a001e --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/README.md @@ -0,0 +1,26 @@ +# Recursive attachment evidence — 30 October 2026 + +GPT generated; context, prompt Erin Spencer. + +`local-verification.json` binds the executed source and artifact identities. +`corpus-audit.json` is the complete clean-installed forward census. Counts and +stream digests cover every corpus word and definition; neither bearing candidate +is selected. Typed whole lexical ownership does not claim numerical attachment. + +Native source, wheel and sdist each passed 303 tests. The first wheel run had +two wall-clock timing failures; both isolated controls and the complete retry +passed without changing code or thresholds. That attempt remains disclosed. +Hosted jobs failed before any steps; their cause is not established here. + +The source census began before the final native commit metadata was filled. +Its word/definition streams, counts and native source blobs match the final +installed census. The whole reports differ only in commit metadata and their +own receipt; no identical whole-report claim is made. + +Historical corpus bytes/receipts were not reinterpreted. The corpus was rebuilt +under Python 3.12.14 and PyYAML 6.0.3, then verified by the installed consumer with +PyYAML 6.0.2. Its logical receipt reproduces the sealed profile; this is not a claim +that its physical SQLite bytes match a historical build on another runtime. + +hmmm: bearing functional, numerical definition attachment, expanded carrier, +native sheet lift, hosted CI, stable publication and domain graduation. diff --git a/human/english/experiments/recursive-attachment-v1/corpus-audit.json b/human/english/experiments/recursive-attachment-v1/corpus-audit.json new file mode 100644 index 0000000..e7e37aa --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/corpus-audit.json @@ -0,0 +1,47 @@ +{ + "counts": { + "constructed_words": 103027, + "definitions": 185155, + "formerly_compound_definitions": 57155, + "refused_words": 26, + "words": 103053 + }, + "definition_stream_sha256": "9d28ce7be9d073498b20ebd1064a71911d05822d363ffa4e3a2f4a455d69d59f", + "field_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a", + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "hmmm": [ + "Numerical definition attachment and bearing selection remain open." + ], + "receipt": "10b484f2e025f39160a6af7f67d3da5b3f88732d42288361347a2345f7216dd7", + "schema": "english.attachment-corpus-audit.v1", + "scope": "all corpus words and all definition ownership overlays; no bearing candidate selected", + "unplaced_glyph_word_counts": { + "á": 1, + "ä": 1, + "ç": 3, + "é": 8, + "ê": 1, + "ë": 1, + "ð": 1, + "ñ": 3, + "ò": 2, + "š": 1, + "ʰ": 1, + "θ": 1, + "Ъ": 1, + "Ь": 1, + "ъ": 1, + "ь": 1 + }, + "word_stream_sha256": "a8a1c8248ad97711055dacb698f863a3fe8d36eb29013391900d7506da37edc1" +} diff --git a/human/english/experiments/recursive-attachment-v1/local-verification.json b/human/english/experiments/recursive-attachment-v1/local-verification.json new file mode 100644 index 0000000..b77b1a1 --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/local-verification.json @@ -0,0 +1,246 @@ +{ + "archive_permission_normalization": [ + "LICENSE: 0664 to 0644", + "NOTICE: 0664 to 0644" + ], + "artifacts_sha256": { + "authority/consumer-committed-dist/uchc-0.1.0a4-py3-none-any.whl": "a5ad321549152411ff736124a09d50ea665603d5d8be791ecd2e2e85039b45cd", + "ucns/dist/ucns-0.0.0.dev0-py3-none-any.whl": "ccdbb2de6228e153e9e9065ff7aa9c099f87371fa1c55206b001535d9c51464d", + "ucns/dist/ucns-0.0.0.dev0.tar.gz": "5c5de04e6431fc79ad5f5c7a090d47c8f220209ef877f555502f998d2e3638b3" + }, + "attribution": "GPT generated; context, prompt Erin Spencer.", + "authority_transfer": false, + "bearing_selection": "none", + "cli_operations": [ + { + "operation": [ + "word", + "bull" + ], + "sha256": "b9add37dbdd3e65832054adcdd190151241667bc3973f7f792df404dd04dcbfb" + }, + { + "operation": [ + "compound", + "bull", + "shit" + ], + "sha256": "c15836e0ef0d4778523be891760bf32ed22176983deb0a6ab72ccc447259e695" + }, + { + "operation": [ + "sequence", + "bull", + "shit", + "--bearing", + "root-endpoint-v1" + ], + "sha256": "f11e62b7feaa3ea559dd3423592613bb358af3844f4ef4bf5bfb9b234df8be79" + }, + { + "operation": [ + "sequence", + "bull", + "shit", + "--bearing", + "exit-heading-v1" + ], + "sha256": "49ab6d6833a94fac1b7ebf7b450dcead118ea46fec8871b3d4ea6de03997556f" + } + ], + "corpus_build_pyyaml": "6.0.3", + "extraction": { + "files": 18, + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "source_commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "standing": "exact", + "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603" + }, + "extraction_verifier": "checks both pinned committed Git blobs and working tree bytes", + "hmmm": [ + "Closed-word bearing functional unselected", + "Numerical definition attachment, punctuation geometry, expanded carrier and native sheet lift remain open", + "Hosted CI and stable release/graduation remain incomplete" + ], + "hosted_ci": "failed before any job steps; cause not established", + "hosted_ci_evidence": { + "stack": { + "jobs": [ + { + "conclusion": "failure", + "name": "native-consumer", + "steps": [] + } + ], + "run": 40988619431 + }, + "uchc": { + "jobs": [ + { + "conclusion": "failure", + "name": "complete-installed-consumer", + "steps": [] + } + ], + "run": 40989143484 + }, + "ucns": { + "jobs": [ + { + "conclusion": "failure", + "name": "verify (3.10)", + "steps": [] + }, + { + "conclusion": "failure", + "name": "verify (3.11)", + "steps": [] + }, + { + "conclusion": "failure", + "name": "verify (3.12)", + "steps": [] + } + ], + "run": 40988417301 + } + }, + "independent_handoff_review": "all 18 files matched immutable Stack Git blobs; no substantive findings", + "installed_corpus_audit": { + "counts": { + "constructed_words": 103027, + "definitions": 185155, + "formerly_compound_definitions": 57155, + "refused_words": 26, + "words": 103053 + }, + "definition_stream_sha256": "9d28ce7be9d073498b20ebd1064a71911d05822d363ffa4e3a2f4a455d69d59f", + "field_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a", + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "hmmm": [ + "Numerical definition attachment and bearing selection remain open." + ], + "receipt": "10b484f2e025f39160a6af7f67d3da5b3f88732d42288361347a2345f7216dd7", + "schema": "english.attachment-corpus-audit.v1", + "scope": "all corpus words and all definition ownership overlays; no bearing candidate selected", + "unplaced_glyph_word_counts": { + "\u00e1": 1, + "\u00e4": 1, + "\u00e7": 3, + "\u00e9": 8, + "\u00ea": 1, + "\u00eb": 1, + "\u00f0": 1, + "\u00f1": 3, + "\u00f2": 2, + "\u0161": 1, + "\u02b0": 1, + "\u03b8": 1, + "\u042a": 1, + "\u042c": 1, + "\u044a": 1, + "\u044c": 1 + }, + "word_stream_sha256": "a8a1c8248ad97711055dacb698f863a3fe8d36eb29013391900d7506da37edc1" + }, + "installed_verification_pyyaml": "6.0.2", + "native_confirmation_sdist": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 303 + }, + "native_confirmation_wheel": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 303 + }, + "native_distribution_replay": { + "artifacts_sha256": { + "ucns-0.0.0.dev0-py3-none-any.whl": "ccdbb2de6228e153e9e9065ff7aa9c099f87371fa1c55206b001535d9c51464d", + "ucns-0.0.0.dev0.tar.gz": "5c5de04e6431fc79ad5f5c7a090d47c8f220209ef877f555502f998d2e3638b3" + }, + "exact_input_receipt_identity": "5d9593d7c7c8dd2d240682bf53f968032194a63c6acd749ce233d2166f53e07c", + "receipt_sha256": "b590b990cd31823212f0cad1f541b37b04cfafe5cdeff2c211b405bc816f0b7c", + "status": "passed" + }, + "native_first_wheel": { + "failed_tests": [ + "test_geometry_suite_rejects_nonpasses", + "test_missing_capability_and_timeout_are_enforced" + ], + "isolated_unchanged_retry": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 2 + }, + "results": { + "errors": 0, + "failures": 2, + "skipped": 0, + "tests": 303 + }, + "thresholds_changed": false + }, + "python": "3.12.14", + "schema": "english.recursive-integration-local-evidence.v1", + "source_census_comparison": { + "prepin_source_audit_sha256": "c1df7ff97adf1d1b9bf49b10aa912369c1fddb087021cab2f763c5c03df3428b", + "reason": "Source report had PENDING_NATIVE_COMMIT; installed report binds the final immutable producer.", + "standing": "exact word and definition streams, counts and source blobs; source process began before commit metadata was filled", + "whole_report_equality": false + }, + "sqlite_build_version": "3.53.1", + "stack_source_commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "test_results": { + "consumer_complete_source": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 6 + }, + "consumer_installed": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 11 + }, + "consumer_source": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 5 + }, + "ucns_source": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 303 + } + }, + "uchc_clean_archive_wheel_equals_tested": true, + "uchc_source_commit": "8ac9ba88a40af24d332453c93d6357ccf1fb9fa7", + "ucns_commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf" +} diff --git a/tools/verify_attachment_extraction.py b/tools/verify_attachment_extraction.py index b3f4434..d856e39 100644 --- a/tools/verify_attachment_extraction.py +++ b/tools/verify_attachment_extraction.py @@ -1,4 +1,4 @@ -# ratios: loc_comments=47:30 imports_exports=8:1 calls_definitions=23:1 +# ratios: loc_comments=50:30 imports_exports=8:1 calls_definitions=25:1 # SPDX-License-Identifier: FSL-1.1-ALv2 # Copyright 2026 Erin Spencer # === MODULE_BUILD === @@ -65,6 +65,9 @@ def main(): for item in extraction['files']: original = args.forge / 'research/english-gonol' / item['source'] copied = root / item['target'] + committed = subprocess.check_output(['git', '-C', str(args.forge), 'show', + source + ':research/english-gonol/' + item['source']]) + assert original.read_bytes() == committed, item['source'] assert original.read_bytes() == copied.read_bytes(), item['target'] assert hashlib.sha256(copied.read_bytes()).hexdigest() == item['sha256'] if item['source'].startswith('english_gonol/'): @@ -82,4 +85,4 @@ def main(): if __name__ == '__main__': main() -# ratios: loc_comments=47:30 imports_exports=8:1 calls_definitions=23:1 +# ratios: loc_comments=50:30 imports_exports=8:1 calls_definitions=25:1 From fabe52e0e180ec508d81dc5e695a867d37a2bc51 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Sat, 31 Oct 2026 00:01:32 -0700 Subject: [PATCH 27/30] Verify recursive candidate against preserved census and reject optimized extraction Extract Stack 251ba2290675a21154582f0b3fb0d7a9d509ed50, preserve prior evidence, enforce complete baseline agreement, and document installed candidate use with explicit bearing choices. Signed-off-by: Codex --- .../english-recursive-attachment.yml | 13 +- README.md | 2 + docs/RECURSIVE_INTEGRATION.md | 99 +++++++++++++++ .../english-recursive-attachment-v1.json | 4 +- human/english/docs/recursive-stack.md | 5 +- .../english/english_gonol/attachment_audit.py | 27 ++++- .../extraction-86a5fb1.json | 114 ++++++++++++++++++ .../recursive-attachment-v1/extraction.json | 8 +- tests/test_attachment_construction.py | 55 ++++++++- tests/test_attachment_verification.py | 31 +++++ tools/verify_attachment_extraction.py | 10 +- 11 files changed, 347 insertions(+), 21 deletions(-) create mode 100644 docs/RECURSIVE_INTEGRATION.md create mode 100644 human/english/experiments/recursive-attachment-v1/extraction-86a5fb1.json create mode 100644 tests/test_attachment_verification.py diff --git a/.github/workflows/english-recursive-attachment.yml b/.github/workflows/english-recursive-attachment.yml index afd00b1..b326495 100644 --- a/.github/workflows/english-recursive-attachment.yml +++ b/.github/workflows/english-recursive-attachment.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v7.0.1 with: repository: The-Interdependency/stack - ref: 86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88 + ref: 251ba2290675a21154582f0b3fb0d7a9d509ed50 path: _deps/forge persist-credentials: false - uses: actions/checkout@v7.0.1 @@ -57,7 +57,7 @@ jobs: _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 _state/clean/bin/python -m pip install --no-deps _state/native-dist/*.whl _state/dist/uchc-0.1.0a4-py3-none-any.whl mkdir -p _state/isolated - cp tests/test_attachment*.py _state/isolated/ + cp tests/test_attachment_construction.py tests/test_attachment_corpus.py _state/isolated/ - name: Verify source closure and isolated installed imports env: PYTHONPATH: human/english @@ -66,6 +66,7 @@ jobs: _state/clean/bin/python -I tools/verify_attachment_extraction.py _deps/forge > _state/installed-extraction.json cmp _state/source-extraction.json _state/installed-extraction.json python -m pytest -c /dev/null -q tests/test_attachment_construction.py --junitxml=_state/source.xml + python -m pytest -c /dev/null -q tests/test_attachment_verification.py --junitxml=_state/verifier.xml - name: Build complete historical corpus through installed package run: | _state/clean/bin/python -I -m english_gonol.structural_construct build --source-root _deps/oewn/src/yaml --ucns-source-root _deps/corpus-carrier --out-dir _state/field > _state/corpus-build.json @@ -81,8 +82,8 @@ jobs: run: | python -m pytest -c /dev/null -q _deps/forge/research/english-gonol/ordinal_tests/test_attachment*.py --junitxml=_state/forge.xml _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated --junitxml=_state/installed.xml - python -m english_gonol.attachment_audit _state/field > _state/audit-forge.json - _state/clean/bin/python -I -m english_gonol.attachment_audit _state/field > _state/audit-installed.json + python -m english_gonol.attachment_audit _state/field --expect human/english/experiments/recursive-attachment-v1/corpus-audit.json > _state/audit-forge.json + _state/clean/bin/python -I -m english_gonol.attachment_audit _state/field --expect human/english/experiments/recursive-attachment-v1/corpus-audit.json > _state/audit-installed.json cmp _state/audit-forge.json _state/audit-installed.json - name: Compare CLI operations and record exact candidate evidence env: @@ -101,7 +102,7 @@ jobs: assert values[0] == values[1] == values[2], args outputs.append({'operation': args, 'sha256': hashlib.sha256(values[0]).hexdigest()}) tests = {} - for name, count in (('source',5),('forge',11),('installed',11)): + for name, count in (('source',7),('forge',13),('installed',13),('verifier',1)): suites = list(E.parse('_state/'+name+'.xml').getroot().iter('testsuite')) totals = {k: sum(int(s.get(k,0)) for s in suites) for k in ('tests','failures','errors','skipped')} assert totals == {'tests':count,'failures':0,'errors':0,'skipped':0}, totals @@ -112,7 +113,7 @@ jobs: assert audit['counts']['words'] == 103053 assert audit['counts']['formerly_compound_definitions'] == 57155 wheel = Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') - evidence = {'schema':'uchc.recursive-attachment-acceptance.v1','uchc_source_commit':sha,'forge_commit':'86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88','ucns_commit':'9cc00771e54336d58ee377faeec87a3a33dbd4bf','tests':tests,'operations':outputs,'audit':audit,'wheel_sha256':hashlib.sha256(wheel.read_bytes()).hexdigest(),'authority_transfer':False,'bearing_selection':'none'} + evidence = {'schema':'uchc.recursive-attachment-acceptance.v1','uchc_source_commit':sha,'forge_commit':'251ba2290675a21154582f0b3fb0d7a9d509ed50','ucns_commit':'9cc00771e54336d58ee377faeec87a3a33dbd4bf','tests':tests,'operations':outputs,'audit':audit,'wheel_sha256':hashlib.sha256(wheel.read_bytes()).hexdigest(),'authority_transfer':False,'bearing_selection':'none','work_graph_sha256':json.loads(Path('docs/work-graphs/english-recursive-attachment-v1.json').read_text())['work_graph_sha256'],'baseline_audit_sha256':hashlib.sha256(Path('human/english/experiments/recursive-attachment-v1/corpus-audit.json').read_bytes()).hexdigest()} Path('_state/recursive-evidence.json').write_text(json.dumps(evidence,indent=2,sort_keys=True)+'\n') PY - uses: actions/upload-artifact@v7.0.1 diff --git a/README.md b/README.md index 767f3a9..0dd3b81 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Applications consume UCHC; applications do not define UCHC. ## Recursive English attachment +Start with [candidate installation, use and acceptance](docs/RECURSIVE_INTEGRATION.md). + The [recursive attachment profile](human/english/docs/recursive-stack.md) stacks glyphs into words and closed words into sentences using one native UCNS operation. Compound joins preserve component-local radii; both origin views replay exactly. diff --git a/docs/RECURSIVE_INTEGRATION.md b/docs/RECURSIVE_INTEGRATION.md new file mode 100644 index 0000000..28ecb96 --- /dev/null +++ b/docs/RECURSIVE_INTEGRATION.md @@ -0,0 +1,99 @@ +# Using the recursive attachment candidate + +GPT generated; context, prompt Erin Spencer. + +This is the extracted `english.attachment/1` candidate, not a stable release or +an authority graduation. UCNS constructs the geometry; Stack remains the +English forge. The [current extraction](../human/english/experiments/recursive-attachment-v1/extraction.json) +binds its source and tests. The [earlier extraction](../human/english/experiments/recursive-attachment-v1/extraction-86a5fb1.json) +and [October 30 verification](../human/english/experiments/recursive-attachment-v1/local-verification.json) +remain historical evidence. + +## Install and use + +From the UCHC candidate checkout, with Python 3.12 and Git available: + +```bash +python3.12 -m venv .venv +.venv/bin/python -m pip install 'ucns @ git+https://github.com/The-Interdependency/ucns.git@9cc00771e54336d58ee377faeec87a3a33dbd4bf' +SOURCE_DATE_EPOCH=1790308800 .venv/bin/python -m pip wheel --no-deps . -w dist +.venv/bin/python -m pip install --no-deps dist/uchc-0.1.0a4-py3-none-any.whl +sha256sum dist/uchc-0.1.0a4-py3-none-any.whl +.venv/bin/python -I -m english_gonol.attachment_construction word bull +.venv/bin/python -I -m english_gonol.attachment_construction compound bull shit +.venv/bin/python -I -m english_gonol.attachment_construction sequence bull shit --bearing root-endpoint-v1 +.venv/bin/python -I -m english_gonol.attachment_construction sequence bull shit --bearing exit-heading-v1 +``` + +Keep the source commit (`git rev-parse HEAD`) and wheel hash with your outputs. +The module verifies the four pinned UCNS source blobs before constructing. +`-I` prevents a checkout or ambient `PYTHONPATH` from replacing the installed +package. Do not use optimized Python for verification. + +`word` accepts an explicitly declared glyph sequence; it does not establish +dictionary admission. `sequence` accepts explicitly separated words; it does +not infer a sentence. Compound joins retain the components' local radii. +Neither bearing candidate is selected as the default. + +For corpus admission and sentence closure, use the complete verified structural +field, built with the pinned sources in the +[acceptance workflow](../.github/workflows/english-recursive-attachment.yml): + +```python +from english_gonol.attachment_construction import RecursiveStructuralField + +with RecursiveStructuralField('/path/to/complete/field', + bearing='exit-heading-v1') as field: + query = field.construct('word word.') + sentence = field.compose(query, relation='sentence') + assert sentence['standing'] == 'logically-closed' + assert sentence['attachment_geometry']['bearing_standing'] == 'unselected-candidate' +``` + +Omitting `bearing` preserves the word interiors and returns the explicit partial +`CLOSED_WORD_BEARING_POLICY_REQUIRED`. Missing carrier bearings refuse rather +than allocating new angles. `field.definition(record_id)` retains a typed whole +lexical owner, original provenance, parts and succession; it does not claim a +numerical definition attachment. + +## Reproduce acceptance + +Use the exact Stack commit in the current extraction receipt, not its moving +branch head. From this repository, with that checkout at `/path/to/forge`: + +```bash +.venv/bin/python -I tools/verify_attachment_extraction.py /path/to/forge +.venv/bin/python -I -m english_gonol.attachment_audit /path/to/complete/field \ + --expect human/english/experiments/recursive-attachment-v1/corpus-audit.json +``` + +The complete audit must reproduce 103,027 constructed words, 26 explicit +refusals, and 185,155 definition ownership records, including both ordered stream +digests, exclusions and producer provenance. Equality between two consumers +alone is insufficient: both could share a regression. `--expect` compares the +entire result with the preserved census. Omitting it records a new observation +without claiming baseline acceptance. + +The hosted workflow also executes the copied source and installed tests, +compares four CLI operations, and records source, graph, baseline and wheel +identities. Its success must be observed after the jobs actually execute. + +## Remaining boundaries + +| Requirement | Effect on use | +| --- | --- | +| Closed-word bearing selection | Blocks claiming one canonical bearing. Both named candidates are usable explicitly. | +| Expanded carrier coverage | Blocks constructing the 26 refused corpus words. Does not block the admitted subset. | +| Numerical definition attachment | Blocks definitions-as-geometry. Typed whole-word ownership and provenance remain usable. | +| Punctuation function geometry | Source punctuation and sentence-closure evidence are retained; no punctuation geometry is claimed. | +| Native Möbius/sheet lift | Outside this planar profile; it is not a prerequisite for its bounded use. | +| Hosted verification | Current jobs never start: GitHub reports an account lock due to a billing issue. Local results do not constitute hosted success. | +| Merge and stable publication | UCNS → Stack → UCHC review/merge, exact-candidate forge verification, authorized publication, released-artifact reconsumption and the scoped authority receipt remain separate gates. | + +Rollback uses the prior exact candidate wheel or an explicitly versioned +historical profile. It must not reinterpret existing receipts. No consumer +should treat an unmerged branch or a local wheel as a stable released authority. + +**hmmm:** billing recovery and executed hosted checks; terminal review and +producer-order merge; stable publication/reconsumption/graduation; the +mathematical boundaries above remain explicit. diff --git a/docs/work-graphs/english-recursive-attachment-v1.json b/docs/work-graphs/english-recursive-attachment-v1.json index ca727d6..00165d1 100644 --- a/docs/work-graphs/english-recursive-attachment-v1.json +++ b/docs/work-graphs/english-recursive-attachment-v1.json @@ -10,7 +10,7 @@ }, { "repository": "The-Interdependency/stack", - "commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "commit": "251ba2290675a21154582f0b3fb0d7a9d509ed50", "authority": "English construction forge pending domain graduation", "relation": "exact implementation, audit and tests extracted into this candidate" }, @@ -38,5 +38,5 @@ "Numerical definition attachment, expanded carrier, sheet lift and graduation remain open." ] }, - "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603" + "work_graph_sha256": "a17bdf8c1fda5fec60f7d1b819b48fa493b873c8e3f8997d83144b038fb14dd5" } diff --git a/human/english/docs/recursive-stack.md b/human/english/docs/recursive-stack.md index 77e0518..0877c02 100644 --- a/human/english/docs/recursive-stack.md +++ b/human/english/docs/recursive-stack.md @@ -58,7 +58,7 @@ python -m english_gonol.attachment_construction compound bull shit python -m english_gonol.attachment_construction sequence bull shit --bearing root-endpoint-v1 python -m pytest -c /dev/null ordinal_tests/test_attachment_construction.py UCHC_STRUCTURAL_FIELD=/path/to/complete/field python -m pytest -c /dev/null ordinal_tests/test_attachment_corpus.py -python -m english_gonol.attachment_audit /path/to/complete/field +python -m english_gonol.attachment_audit /path/to/complete/field --expect experiments/recursive-attachment-v1/corpus-audit.json ``` CLI sequence arguments declare word boundaries; they do not infer sentence @@ -89,6 +89,9 @@ The complete corpus audit visits every word and definition, checking retained parts, source succession and typed lexical ownership. Its deterministic stream digests can be compared across forge and installed consumer. Read the adjacent experiment evidence for executed counts and exact producer identities. +Acceptance also requires the complete report to match the preserved census via +`--expect`; two equally regressed consumers do not pass. Optimized Python (`-O` +or `PYTHONOPTIMIZE`) is refused because it disables verification assertions. **hmmm:** select the closed-word bearing functional; numerical definition attachment; expanded carrier inventory/order; punctuation geometry and sheet diff --git a/human/english/english_gonol/attachment_audit.py b/human/english/english_gonol/attachment_audit.py index 5484c54..9262618 100644 --- a/human/english/english_gonol/attachment_audit.py +++ b/human/english/english_gonol/attachment_audit.py @@ -1,4 +1,4 @@ -# ratios: loc_comments=65:31 imports_exports=7:2 calls_definitions=31:2 +# ratios: loc_comments=76:37 imports_exports=8:3 calls_definitions=38:3 # SPDX-License-Identifier: FSL-1.1-ALv2 # Copyright 2026 Erin Spencer # === MODULE_BUILD === @@ -7,7 +7,7 @@ # module_kind: verification-tool # summary: complete forward word and typed lexical ownership census over a verified corpus # owner: Erin Spencer -# public_surface: audit, main +# public_surface: audit, verify_report, main # internal_surface: ordered stream digests # auth_boundary: verified structural field and pinned native modules # storage_boundary: corpus read-only; JSON report to stdout @@ -24,17 +24,23 @@ # id: english_attachment_complete_census # given: a verified complete structural corpus # then: every word is reconstructed or explicitly refused and every definition retains its whole lexical owner, constituents and source succession +# id: english_attachment_census_baseline +# given: an observed census and an explicitly supplied preserved baseline +# then: refuse any changed result even when forge and installed outputs agree; refuse optimized execution that disables the audit assertions # === END CONTRACTS === """GPT generated; context, prompt Erin Spencer. Usage: python -m english_gonol.attachment_audit /path/to/structural-field + --expect experiments/recursive-attachment-v1/corpus-audit.json This finite complete audit has no sampling or scientific runtime cutoff. Stream hashes bind ordered results without retaining a second corpus in memory. +Omit --expect only for a new observation, never for baseline acceptance. """ import argparse from collections import Counter import hashlib import json +from pathlib import Path from english_gonol.attachment_construction import RecursiveStructuralField, authority from english_gonol.ordinal_construction import OrdinalGeometryError @@ -42,6 +48,8 @@ def audit(path): + if not __debug__: + raise RuntimeError('OPTIMIZED_AUDIT_FORBIDDEN: verification requires assertions') counts, refusals = Counter(), Counter() words_hash, definitions_hash = hashlib.sha256(), hashlib.sha256() with RecursiveStructuralField(path) as field: @@ -94,13 +102,24 @@ def audit(path): return {**result, 'receipt': digest(result)} +def verify_report(observed, expected): + """Bind the whole census, including exclusions, provenance and stream identities.""" + if digest(observed) != digest(expected): + raise ValueError('CENSUS_BASELINE_MISMATCH') + + def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('field') + parser.add_argument('--expect', type=Path, help='require the complete preserved census JSON') args = parser.parse_args() - print(json.dumps(audit(args.field), sort_keys=True, ensure_ascii=False, indent=2)) + expected = json.loads(args.expect.read_text()) if args.expect else None + result = audit(args.field) + if args.expect is not None: + verify_report(result, expected) + print(json.dumps(result, sort_keys=True, ensure_ascii=False, indent=2)) if __name__ == '__main__': main() -# ratios: loc_comments=65:31 imports_exports=7:2 calls_definitions=31:2 +# ratios: loc_comments=76:37 imports_exports=8:3 calls_definitions=38:3 diff --git a/human/english/experiments/recursive-attachment-v1/extraction-86a5fb1.json b/human/english/experiments/recursive-attachment-v1/extraction-86a5fb1.json new file mode 100644 index 0000000..b99acd5 --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/extraction-86a5fb1.json @@ -0,0 +1,114 @@ +{ + "schema": "uchc.recursive-attachment-extraction.v1", + "source_repository": "The-Interdependency/stack", + "source_commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "source_root": "research/english-gonol", + "authority_transfer": false, + "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603", + "geometry_authority": { + "repository": "The-Interdependency/ucns", + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "source_blobs": { + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + }, + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5" + }, + "files": [ + { + "source": "english_gonol/structural_rules.py", + "target": "human/english/english_gonol/structural_rules.py", + "sha256": "4686f6a847dd0cee24e3f0a05154a71203a1d4c790922952f9876a38f017db70" + }, + { + "source": "english_gonol/structural_construct.py", + "target": "human/english/english_gonol/structural_construct.py", + "sha256": "8920759980c590719ff19a4a23906775b4058bda7f95f915a1621b1d56af18f4" + }, + { + "source": "english_gonol/structural_query.py", + "target": "human/english/english_gonol/structural_query.py", + "sha256": "3a97e971825468347ab76a44a3203ed0ce706ca0293836ffd4cc0d223d2987be" + }, + { + "source": "english_gonol/hyperspace_construct.py", + "target": "human/english/english_gonol/hyperspace_construct.py", + "sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71" + }, + { + "source": "english_gonol/full_construct_run.py", + "target": "human/english/english_gonol/full_construct_run.py", + "sha256": "fbadf9cc033a154148b62e11b52d7e38b845c0d0b669ff34dfc6186cab15c064" + }, + { + "source": "english_gonol/language/source.py", + "target": "human/english/english_gonol/language/source.py", + "sha256": "beb4d86f9c2a2879d3f63f4b73867af19edf33a2fdd6fea32e4e6e14c6b4ae2f" + }, + { + "source": "english_gonol/language/__init__.py", + "target": "human/english/english_gonol/language/__init__.py", + "sha256": "0620712b60b0c51483f45212dc63fc139b1c51a561ad863512344a5477727352" + }, + { + "source": "english_gonol/language/affixes.py", + "target": "human/english/english_gonol/language/affixes.py", + "sha256": "50df16c8dd71dcc0e1d964ac36909b3d48fbedbf404e27312492024261e36392" + }, + { + "source": "english_gonol/language/manifest.py", + "target": "human/english/english_gonol/language/manifest.py", + "sha256": "ae0b1176398f48463c3082f46afc7cd82e7273a72555a3c76e47e8fe90e15155" + }, + { + "source": "english_gonol/language/model.py", + "target": "human/english/english_gonol/language/model.py", + "sha256": "35a8ce27dcc70011cba1d31c3d6f9b1c4ec24f49a63316226ff92d12ce3332b4" + }, + { + "source": "english_gonol/language/morphology.py", + "target": "human/english/english_gonol/language/morphology.py", + "sha256": "84ea74d3498442c313bc318f0d19c4951ef59ad8411f0122bdb7a116383460ce" + }, + { + "source": "english_gonol/language/relational_bridge.py", + "target": "human/english/english_gonol/language/relational_bridge.py", + "sha256": "bceb4efc4730b2c7fc5ce8cb6f4d9334deeddb27905b79d273ce9ad3204b58eb" + }, + { + "source": "english_gonol/language/rendering.py", + "target": "human/english/english_gonol/language/rendering.py", + "sha256": "83a1b8c8fb31c7bc64a857b7f57a67079e01daa19f0d7e1d74cd501b61b0ec20" + }, + { + "source": "english_gonol/ordinal_construction.py", + "target": "human/english/english_gonol/ordinal_construction.py", + "sha256": "5b43d0efe7661cda69b2fd2c50998834795adb4467febb7a9d7a3d54883a3da7" + }, + { + "source": "english_gonol/attachment_construction.py", + "target": "human/english/english_gonol/attachment_construction.py", + "sha256": "7c754e6a8e0f860e1f645af88c4d48a8894a6dcfcde55ca5ae6af96b9378e7d1" + }, + { + "source": "english_gonol/attachment_audit.py", + "target": "human/english/english_gonol/attachment_audit.py", + "sha256": "28563495fab1ea7bd497a2e7689632fa80a46162242ae3e04b39c42a891402f0" + }, + { + "source": "ordinal_tests/test_attachment_construction.py", + "target": "tests/test_attachment_construction.py", + "sha256": "b86dabc4303dd9b63c82fe7d76188311b5c91637d918ea23738d0a45477991fc" + }, + { + "source": "ordinal_tests/test_attachment_corpus.py", + "target": "tests/test_attachment_corpus.py", + "sha256": "58bc964fbbfeb6f592551fea31f90ccaebdf1cf27312a6ce97d7e2cdc291ae3d" + } + ], + "hmmm": [ + "Bearing candidates remain unselected; extraction does not complete graduation." + ] +} diff --git a/human/english/experiments/recursive-attachment-v1/extraction.json b/human/english/experiments/recursive-attachment-v1/extraction.json index b99acd5..55413be 100644 --- a/human/english/experiments/recursive-attachment-v1/extraction.json +++ b/human/english/experiments/recursive-attachment-v1/extraction.json @@ -1,10 +1,10 @@ { "schema": "uchc.recursive-attachment-extraction.v1", "source_repository": "The-Interdependency/stack", - "source_commit": "86a5fb1936dc6ca04ad6fb9bb161ea3fd7f4da88", + "source_commit": "251ba2290675a21154582f0b3fb0d7a9d509ed50", "source_root": "research/english-gonol", "authority_transfer": false, - "work_graph_sha256": "a8e9be098fc1fb21bbf8af555ee0271377f9114263dad2bf259ce27847155603", + "work_graph_sha256": "a17bdf8c1fda5fec60f7d1b819b48fa493b873c8e3f8997d83144b038fb14dd5", "geometry_authority": { "repository": "The-Interdependency/ucns", "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", @@ -95,12 +95,12 @@ { "source": "english_gonol/attachment_audit.py", "target": "human/english/english_gonol/attachment_audit.py", - "sha256": "28563495fab1ea7bd497a2e7689632fa80a46162242ae3e04b39c42a891402f0" + "sha256": "57f057cea6defd01001edf9a6443d1b51d4f3ebe4d1f56d480ac2b3398199d07" }, { "source": "ordinal_tests/test_attachment_construction.py", "target": "tests/test_attachment_construction.py", - "sha256": "b86dabc4303dd9b63c82fe7d76188311b5c91637d918ea23738d0a45477991fc" + "sha256": "d58b367607a83336ea100afd2723de0359f6d38db58214e773fa89b303b0915c" }, { "source": "ordinal_tests/test_attachment_corpus.py", diff --git a/tests/test_attachment_construction.py b/tests/test_attachment_construction.py index 1791b28..219ee8b 100644 --- a/tests/test_attachment_construction.py +++ b/tests/test_attachment_construction.py @@ -1,4 +1,4 @@ -# ratios: loc_comments=106:39 imports_exports=10:5 calls_definitions=70:5 +# ratios: loc_comments=141:53 imports_exports=14:7 calls_definitions=86:7 # === CHECKS === # id: check_english_word_uses_native_attachment_and_exact_views # proves: english_attachment_native_authority @@ -31,6 +31,18 @@ # mutates: filesystem # cleanup: pytest_fixture_teardown # === END CHECKS === +# === CHECKS === +# id: check_attachment_census_rejects_shared_regressions +# proves: english_attachment_census_baseline +# call: self::test_census_rejects_shared_regressions +# mutates: none +# cleanup: none +# id: check_attachment_audit_refuses_disabled_assertions +# proves: english_attachment_census_baseline +# call: self::test_audit_refuses_disabled_assertions +# mutates: none +# cleanup: subprocess_exit +# === END CHECKS === # SPDX-License-Identifier: FSL-1.1-ALv2 # Copyright 2026 Erin Spencer """Native consumer tests: pytest -c /dev/null ordinal_tests/test_attachment_construction.py. @@ -42,10 +54,14 @@ from copy import deepcopy from fractions import Fraction import json +from pathlib import Path +import subprocess +import sys import pytest from english_gonol import attachment_construction as api +from english_gonol.attachment_audit import verify_report from english_gonol.ordinal_construction import OrdinalGeometryError from english_gonol.language.source import LexemeRecord, SenseRecord, SynsetRecord, WordnetSnapshot from english_gonol.structural_construct import build @@ -157,4 +173,39 @@ def test_partial_corpus_and_whole_lexical_owner(tmp_path): assert definition['definition_succession']['ordinal'] == 0 assert definition['historical_origin']['state'] == 'hmmm:compound-lexical-origin' assert all(p['owner'] == definition['origin'] for p in definition['constituent_direct']) -# ratios: loc_comments=106:39 imports_exports=10:5 calls_definitions=70:5 +def test_census_rejects_shared_regressions(): + """Equal consumer outputs must still fail when both regress from the baseline.""" + baseline = {'counts': {'words': 103053, 'constructed_words': 103027, + 'refused_words': 26, 'definitions': 185155, + 'formerly_compound_definitions': 57155}, + 'word_stream_sha256': 'a' * 64, 'definition_stream_sha256': 'b' * 64, + 'unplaced_glyph_word_counts': {'é': 8}, 'field_receipt': 'c' * 64, + 'geometry_authority': {'commit': api.UCNS_COMMIT}} + verify_report(json.loads(json.dumps(baseline)), baseline) + for mutate in ( + lambda r: r['counts'].update(constructed_words=103026, refused_words=27), + lambda r: r['counts'].update(definitions=185154), + lambda r: r.update(word_stream_sha256='0' * 64), + lambda r: r.update(definition_stream_sha256='0' * 64), + lambda r: r['unplaced_glyph_word_counts'].update(é=7), + lambda r: r.update(field_receipt='0' * 64), + lambda r: r['geometry_authority'].update(commit='0' * 40), + ): + forge = deepcopy(baseline) + mutate(forge) + installed = deepcopy(forge) + assert installed == forge + for observed in (forge, installed): + with pytest.raises(ValueError, match='CENSUS_BASELINE_MISMATCH'): + verify_report(observed, baseline) + + +def test_audit_refuses_disabled_assertions(): + """Reject -O before opening a corpus or reporting verification success.""" + package_root = str(Path(api.__file__).resolve().parents[1]) + code = (f'import sys; sys.path.insert(0, {package_root!r}); ' + 'from english_gonol.attachment_audit import audit; audit("unused")') + result = subprocess.run([sys.executable, '-I', '-O', '-c', code], capture_output=True, text=True) + assert result.returncode != 0 and not result.stdout + assert 'OPTIMIZED_AUDIT_FORBIDDEN' in result.stderr +# ratios: loc_comments=141:53 imports_exports=14:7 calls_definitions=86:7 diff --git a/tests/test_attachment_verification.py b/tests/test_attachment_verification.py new file mode 100644 index 0000000..2f325fd --- /dev/null +++ b/tests/test_attachment_verification.py @@ -0,0 +1,31 @@ +# ratios: loc_comments=13:13 imports_exports=4:1 calls_definitions=3:1 +# SPDX-License-Identifier: FSL-1.1-ALv2 +# Copyright 2026 Erin Spencer +# === CHECKS === +# id: check_attachment_extraction_refuses_optimized_python +# proves: uchc_attachment_verification_not_optimized +# call: self::test_extraction_refuses_optimized_python +# mutates: none +# cleanup: subprocess_exit +# === END CHECKS === +"""Usage: PYTHONPATH=human/english pytest -c /dev/null tests/test_attachment_verification.py. + +GPT generated; context, prompt Erin Spencer. +This tests the verifier refusal, not corpus construction or authority graduation. +""" +from pathlib import Path +import os +import subprocess +import sys + + +def test_extraction_refuses_optimized_python(): + root = Path(__file__).resolve().parents[1] + script = root / 'tools/verify_attachment_extraction.py' + for flags, optimization in ((['-O'], ''), ([], '1')): + env = dict(os.environ, PYTHONPATH=str(root / 'human/english'), PYTHONOPTIMIZE=optimization) + result = subprocess.run([sys.executable, *flags, str(script), 'not-a-forge'], + env=env, capture_output=True, text=True) + assert result.returncode != 0 and not result.stdout + assert 'OPTIMIZED_VERIFICATION_FORBIDDEN' in result.stderr +# ratios: loc_comments=13:13 imports_exports=4:1 calls_definitions=3:1 diff --git a/tools/verify_attachment_extraction.py b/tools/verify_attachment_extraction.py index d856e39..d95f7ff 100644 --- a/tools/verify_attachment_extraction.py +++ b/tools/verify_attachment_extraction.py @@ -1,4 +1,4 @@ -# ratios: loc_comments=50:30 imports_exports=8:1 calls_definitions=25:1 +# ratios: loc_comments=52:34 imports_exports=8:1 calls_definitions=26:1 # SPDX-License-Identifier: FSL-1.1-ALv2 # Copyright 2026 Erin Spencer # === MODULE_BUILD === @@ -24,11 +24,15 @@ # id: uchc_attachment_exact_extraction # given: pinned Stack checkout and candidate files # then: require complete declared source closure, matching source bytes, graph identity and native producer identity +# id: uchc_attachment_verification_not_optimized +# given: optimized Python disables verification assertions +# then: refuse before emitting an exact-extraction claim # === END CONTRACTS === """GPT generated; context, prompt Erin Spencer. Usage: PYTHONPATH=human/english python tools/verify_attachment_extraction.py /path/to/stack Run the same command with isolated installed Python to verify packaged modules. +Optimized Python (-O or PYTHONOPTIMIZE) is not an evidence-producing mode. """ import argparse import hashlib @@ -42,6 +46,8 @@ def main(): + if not __debug__: + raise SystemExit('OPTIMIZED_VERIFICATION_FORBIDDEN: extraction requires assertions') parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('forge', type=Path) args = parser.parse_args() @@ -85,4 +91,4 @@ def main(): if __name__ == '__main__': main() -# ratios: loc_comments=50:30 imports_exports=8:1 calls_definitions=25:1 +# ratios: loc_comments=52:34 imports_exports=8:1 calls_definitions=26:1 From a4a3826c9585c612e83e079eeed5715a579e8cec Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Sat, 31 Oct 2026 00:10:55 -0700 Subject: [PATCH 28/30] Record installed recursive consumer acceptance and explicit remaining gates --- .../integration-verification.json | 699 ++++++++++++++++++ 1 file changed, 699 insertions(+) create mode 100644 human/english/experiments/recursive-attachment-v1/integration-verification.json diff --git a/human/english/experiments/recursive-attachment-v1/integration-verification.json b/human/english/experiments/recursive-attachment-v1/integration-verification.json new file mode 100644 index 0000000..0deb97f --- /dev/null +++ b/human/english/experiments/recursive-attachment-v1/integration-verification.json @@ -0,0 +1,699 @@ +{ + "attribution": "GPT generated; context, prompt Erin Spencer.", + "authority_transfer": false, + "bearing_selection": "none", + "build_environment": { + "SOURCE_DATE_EPOCH": "1790308800", + "packaging": "26.0", + "pytest": "8.3.5", + "python": "3.12.14", + "setuptools": "82.0.1", + "sqlite": "3.53.1", + "uchc_archive_permissions": [ + "LICENSE: 0664 to 0644", + "NOTICE: 0664 to 0644" + ], + "wheel": "0.46.3" + }, + "cli_operations": [ + { + "operation": [ + "word", + "bull" + ], + "sha256": "b9add37dbdd3e65832054adcdd190151241667bc3973f7f792df404dd04dcbfb", + "source_forge_installed_and_historical_match": true + }, + { + "operation": [ + "compound", + "bull", + "shit" + ], + "sha256": "c15836e0ef0d4778523be891760bf32ed22176983deb0a6ab72ccc447259e695", + "source_forge_installed_and_historical_match": true + }, + { + "operation": [ + "sequence", + "bull", + "shit", + "--bearing", + "root-endpoint-v1" + ], + "sha256": "f11e62b7feaa3ea559dd3423592613bb358af3844f4ef4bf5bfb9b234df8be79", + "source_forge_installed_and_historical_match": true + }, + { + "operation": [ + "sequence", + "bull", + "shit", + "--bearing", + "exit-heading-v1" + ], + "sha256": "49ab6d6833a94fac1b7ebf7b450dcead118ea46fec8871b3d4ea6de03997556f", + "source_forge_installed_and_historical_match": true + }, + { + "exit_code": 2, + "operation": [ + "sequence", + "bull", + "shit" + ], + "refusal": "argparse: explicit --bearing required" + }, + { + "exit_code": 2, + "operation": [ + "word", + "\u00e9" + ], + "refusal": "{\"standing\": \"refused\", \"code\": \"PUBLIC_GONOL_ANGLE_UNAVAILABLE\", \"glyphs\": [\"\\u00e9\"]}" + } + ], + "complete_corpus": { + "audit": { + "counts": { + "constructed_words": 103027, + "definitions": 185155, + "formerly_compound_definitions": 57155, + "refused_words": 26, + "words": 103053 + }, + "definition_stream_sha256": "9d28ce7be9d073498b20ebd1064a71911d05822d363ffa4e3a2f4a455d69d59f", + "field_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a", + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "hmmm": [ + "Numerical definition attachment and bearing selection remain open." + ], + "receipt": "10b484f2e025f39160a6af7f67d3da5b3f88732d42288361347a2345f7216dd7", + "schema": "english.attachment-corpus-audit.v1", + "scope": "all corpus words and all definition ownership overlays; no bearing candidate selected", + "unplaced_glyph_word_counts": { + "\u00e1": 1, + "\u00e4": 1, + "\u00e7": 3, + "\u00e9": 8, + "\u00ea": 1, + "\u00eb": 1, + "\u00f0": 1, + "\u00f1": 3, + "\u00f2": 2, + "\u0161": 1, + "\u02b0": 1, + "\u03b8": 1, + "\u042a": 1, + "\u042c": 1, + "\u044a": 1, + "\u044c": 1 + }, + "word_stream_sha256": "a8a1c8248ad97711055dacb698f863a3fe8d36eb29013391900d7506da37edc1" + }, + "baseline_sha256": "99d26c9aa091e85a741ecbed77cf556807b362857ea756eb37517bd23762b92e", + "forge_equals_installed_equals_baseline": true, + "installed_build_logical_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a" + }, + "corrections": [ + "Forge and installed census are each compared in full with the preserved baseline; shared regressions no longer pass by equality alone.", + "Extraction verifier and census audit refuse optimized Python before assertions can be disabled; pre-fix -O incorrectly reported exact for a changed checkout.", + "Workflow verifies exact test counts and records graph and baseline identities; install/use guide separates candidate usability from stable authority." + ], + "dependency_pins": { + "historical_corpus_carrier": "4f863ad37096b7baab8f62820ad5cb937b62a3a7", + "historical_lexical_test_ucns": "d7c6f51304ed6c32d48badf63132bea6de8af497", + "native_ucns": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "oewn": "dc343f2683279ecbb13fab4e2fd778d7b162d287", + "stack_extraction": "251ba2290675a21154582f0b3fb0d7a9d509ed50" + }, + "earlier_environment_attempts": [ + { + "reason": "Missing historical checkout roots and wrong working directory; not the configured acceptance gate.", + "results": { + "errors": 0, + "failures": 26, + "skipped": 9, + "tests": 301 + } + }, + { + "reason": "One historical UCNS checkout was insufficient for independent lexical/inference pins.", + "results": { + "errors": 0, + "failures": 18, + "skipped": 8, + "tests": 301 + } + } + ], + "evidence_commit_scope": "This record is added after the tested implementation commits; no package or verification code changes.", + "extraction": { + "files": 18, + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "source_commit": "251ba2290675a21154582f0b3fb0d7a9d509ed50", + "standing": "exact", + "work_graph_sha256": "a17bdf8c1fda5fec60f7d1b819b48fa493b873c8e3f8997d83144b038fb14dd5" + }, + "graph_sha256": "a17bdf8c1fda5fec60f7d1b819b48fa493b873c8e3f8997d83144b038fb14dd5", + "historical_evidence_unchanged_sha256": { + "stack/corpus-audit.json": "99d26c9aa091e85a741ecbed77cf556807b362857ea756eb37517bd23762b92e", + "stack/local-verification.json": "f62e8f21adfcbb6683f67b0555b38f95a342a3e081c2db7f51e35ebb47359bbb", + "uchc/corpus-audit.json": "99d26c9aa091e85a741ecbed77cf556807b362857ea756eb37517bd23762b92e", + "uchc/local-verification.json": "f62e8f21adfcbb6683f67b0555b38f95a342a3e081c2db7f51e35ebb47359bbb" + }, + "historical_suite_resolution": { + "ENGLISH_GONOL_UCNS_ROOT": "ucns at historical_lexical_test_ucns pin", + "PYTHONPATH": "absolute human/english, programming/python, shared/polyglot", + "UCNS_SOURCE_ROOT": "ucns at native_ucns pin", + "command": "python -m pytest -c /dev/null -q tests ../../programming/python/tests ../../shared/polyglot/tests", + "cwd": "uchc/human/english", + "product_changes": false + }, + "hmmm": [ + "root-endpoint-v1 and exit-heading-v1 remain explicit unselected candidates", + "26 corpus words remain refused; expanded carrier requires supported bearings", + "Numerical definition attachment and punctuation geometry remain unresolved", + "Native sheet lift remains outside this planar profile", + "Hosted verification, terminal review, producer-order merge and authorized publication/reconsumption/graduation remain incomplete" + ], + "hosted_ci": { + "stack": { + "annotation": "The job was not started because your account is locked due to a billing issue.", + "annotation_url": "https://api.github.com/repos/The-Interdependency/stack/check-runs/124472084029/annotations", + "annotations_sha256": "e4ba63d453d99ba274ea6f07623573768e2acb4ef418f43e0a587e5d8754b954", + "check_run_id": 124472084029, + "checks": [ + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910401/job/124472084399", + "id": 124472084399, + "name": "english-gonol-tests", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910418/job/124472084051", + "id": 124472084051, + "name": "input-distinction", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910449/job/124472084035", + "id": 124472084035, + "name": "consistency", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910433/job/124472084029", + "id": 124472084029, + "name": "native-consumer", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910417/job/124472083971", + "id": 124472083971, + "name": "ordinal-source", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910367/job/124472083948", + "id": 124472083948, + "name": "sealed-evidence", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910430/job/124472083936", + "id": 124472083936, + "name": "released-artifact", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910384/job/124472083864", + "id": 124472083864, + "name": "installed-candidate", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910364/job/124472083850", + "id": 124472083850, + "name": "contracts", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910346/job/124472083776", + "id": 124472083776, + "name": "test", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910340/job/124472083759", + "id": 124472083759, + "name": "structural-complete-corpus", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178910363/job/124472083754", + "id": 124472083754, + "name": "contracts", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178907554/job/124472078650", + "id": 124472078650, + "name": "Analyze (python)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178907554/job/124472078610", + "id": 124472078610, + "name": "Analyze (actions)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178907554/job/124472078489", + "id": 124472078489, + "name": "Analyze (javascript-typescript)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/stack/actions/runs/41178905997/job/124472072158", + "id": 124472072158, + "name": "english-gonol-tests", + "status": "completed" + } + ], + "classification": "external account billing lock before test steps", + "conclusion": "failure", + "head": "251ba2290675a21154582f0b3fb0d7a9d509ed50" + }, + "uchc": { + "annotation": "The job was not started because your account is locked due to a billing issue.", + "annotation_url": "https://api.github.com/repos/The-Interdependency/uchc/check-runs/124472228538/annotations", + "annotations_sha256": "75e310cbc62c5abe0e25858879198f7ac404a6a1bc9ab6da4e7dc8e81ea81108", + "check_run_id": 124472228538, + "checks": [ + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959617/job/124472228538", + "id": 124472228538, + "name": "complete-installed-consumer", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959600/job/124472228518", + "id": 124472228518, + "name": "work-graph-integrity", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959632/job/124472228512", + "id": 124472228512, + "name": "polyglot-identity", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959582/job/124472228504", + "id": 124472228504, + "name": "structural-complete-corpus", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959574/job/124472228315", + "id": 124472228315, + "name": "installed-geometry", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178959569/job/124472228264", + "id": 124472228264, + "name": "complete-corpus", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178956835/job/124472222700", + "id": 124472222700, + "name": "Analyze (python)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/uchc/actions/runs/41178956835/job/124472222458", + "id": 124472222458, + "name": "Analyze (actions)", + "status": "completed" + } + ], + "classification": "external account billing lock before test steps", + "conclusion": "failure", + "head": "fabe52e0e180ec508d81dc5e695a867d37a2bc51" + }, + "ucns": { + "annotation": "The job was not started because your account is locked due to a billing issue.", + "annotation_url": "https://api.github.com/repos/The-Interdependency/ucns/check-runs/123844738271/annotations", + "annotations_sha256": "d4abed9511e5ae5cc86897c1730d6150f68502b4bf05c72c304a69da2af86670", + "check_run_id": 123844738271, + "checks": [ + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988417301/job/123844738271", + "id": 123844738271, + "name": "verify (3.12)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988417301/job/123844738267", + "id": 123844738267, + "name": "verify (3.11)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988417301/job/123844738012", + "id": 123844738012, + "name": "verify (3.10)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988415129/job/123844735062", + "id": 123844735062, + "name": "Analyze (actions)", + "status": "completed" + }, + { + "conclusion": "failure", + "details_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988415129/job/123844734862", + "id": 123844734862, + "name": "Analyze (python)", + "status": "completed" + } + ], + "classification": "external account billing lock before test steps", + "conclusion": "failure", + "head": "9cc00771e54336d58ee377faeec87a3a33dbd4bf" + } + }, + "implementation_commits": { + "stack": "251ba2290675a21154582f0b3fb0d7a9d509ed50", + "uchc": "fabe52e0e180ec508d81dc5e695a867d37a2bc51", + "ucns": "9cc00771e54336d58ee377faeec87a3a33dbd4bf" + }, + "implementation_trees": { + "stack": "e4daaf4e55ac98b9f6e210f4ce56f9cc75577789", + "uchc": "676c36089355e5b78982f060c20e77a06efdd76d", + "ucns": "d871b3d8d94abc106e83e9b88c4a403019b83f21" + }, + "initial_heads": { + "stack": "dd0af5fd985a620608b188bb10403775837334c4", + "uchc": "18a464d9442e56b9d76ca2411fa5ac6d4e12cc05", + "ucns": "9cc00771e54336d58ee377faeec87a3a33dbd4bf" + }, + "installed_import_proof": "Noneditable clean wheel and sdist environments; isolated -I imports; native blob identities checked; extraction closure identical in source, wheel and sdist.", + "merge_admission": { + "blocking_gates": [ + "Hosted checks have not executed successfully", + "Complete effective UCNS branch protection policy unreadable", + "Terminal review at current head/base remains unestablished" + ], + "current_head_approval": "none observed", + "merge_order": [ + "ucns", + "stack", + "uchc" + ], + "rulesets": { + "stack": [], + "uchc": [], + "ucns": [] + }, + "stack_main_protected": false, + "standing": "not admitted", + "uchc_main_protected": false, + "ucns_full_protection": "hmmm: HTTP 403; integration lacks administration read access", + "ucns_main_protected": true + }, + "merged": false, + "native_distribution_replay": { + "artifacts_sha256": { + "ucns-0.0.0.dev0-py3-none-any.whl": "e62016ba688e9ef20b4a8adc3a794af8fddf3e971fb772581ffcca6ed9331a97", + "ucns-0.0.0.dev0.tar.gz": "5d9fe7db99f0f0954bf34c434b6f52afd3e03bbe26752f8a578b1fb09e991d59" + }, + "candidate_ratification": "none", + "exact_input_receipt_identity": "91e93c882f8db3391214804fa3a3bdc8c094593158d618653f5a7b9ce2aa8028", + "receipt_sha256": "73c061f783a540f76539ff2ea3de2197bef396ce75f45e2ec863543519801b91", + "status": "passed" + }, + "native_geometry_witnesses": [ + "UCNS DiskStack type, exact glyph headings and dyadic radii", + "closed word recursion and compound participants under both explicit candidates", + "complete corpus source structure, multiplicity, closure and replay", + "producer/carrier drift and missing bearings refuse" + ], + "negative_controls": { + "audit_optimization_mode": "-O", + "extraction_optimization_modes": [ + "-O", + "PYTHONOPTIMIZE=1" + ], + "pre_fix_false_exact_report_sha256": "bfc6225f2ed717a94b9c1ce2dabf9f4d3ab569f5827797c908566c09eb6cb4f8", + "shared_census_mutations": 7 + }, + "observed_at": "2026-10-31T07:09:23.585570+00:00", + "other_gates": { + "build_and_twine": "passed for both packages", + "changed_python_ratios": "passed", + "exact_native_distribution_bytes": "passed", + "git_diff_check": "passed", + "stack_consistency": "passed: 7 repositories, 48 research identities", + "ucns_contracts": "closed", + "workflow_yaml_bash_python_syntax": "passed" + }, + "released": false, + "review_snapshot": { + "stack": { + "base": "9de81c67b271df09c1d9ba5422660c96fe8af7ac", + "draft": false, + "head": "251ba2290675a21154582f0b3fb0d7a9d509ed50", + "mergeable": true, + "merged": false, + "resolved_threads": 0, + "reviews": { + "reviews": [] + }, + "state": "open", + "unresolved_threads": [] + }, + "uchc": { + "base": "45f50ebce04235611223fda13cf67e1a71d45dba", + "draft": false, + "head": "fabe52e0e180ec508d81dc5e695a867d37a2bc51", + "mergeable": true, + "merged": false, + "resolved_threads": 6, + "reviews": { + "reviews": [ + { + "author": { + "avatar_url": "https://avatars.githubusercontent.com/in/1144995?v=4", + "email": null, + "id": null, + "login": "chatgpt-codex-connector", + "name": "chatgpt-codex-connector" + }, + "body": "\n\n\n### \ud83d\udca1 Codex Review\n\nHere are some automated review suggestions for this pull request.\n\n**Reviewed commit:** `07d83b2824`\n \n\n
\u2139\ufe0f About Codex in GitHub\n
\n\n[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you\n- Open a pull request for review\n- Mark a draft as ready\n- Comment \"@codex review\".\n\nIf Codex has suggestions, it will comment; otherwise it will react with \ud83d\udc4d.\n\n\n\n\nCodex can also answer questions or update the PR. Try commenting \"@codex address that feedback\".\n \n
", + "id": "PRR_kwDOUi3exM8AAAABTE_tIg", + "state": "COMMENTED", + "submitted_at": "2026-10-19T17:29:12Z" + }, + { + "author": { + "avatar_url": "https://avatars.githubusercontent.com/u/250928284?u=0560d31094b3002a9f20474298720fcba2e06acd&v=4", + "email": null, + "id": null, + "login": "erinepshovel-code", + "name": "erinepshovel-code" + }, + "body": "", + "id": "PRR_kwDOUi3exM8AAAABTFE6KQ", + "state": "COMMENTED", + "submitted_at": "2026-10-19T17:37:00Z" + }, + { + "author": { + "avatar_url": "https://avatars.githubusercontent.com/u/250928284?u=0560d31094b3002a9f20474298720fcba2e06acd&v=4", + "email": null, + "id": null, + "login": "erinepshovel-code", + "name": "erinepshovel-code" + }, + "body": "", + "id": "PRR_kwDOUi3exM8AAAABTFE8Jg", + "state": "COMMENTED", + "submitted_at": "2026-10-19T17:37:03Z" + }, + { + "author": { + "avatar_url": "https://avatars.githubusercontent.com/u/250928284?u=0560d31094b3002a9f20474298720fcba2e06acd&v=4", + "email": null, + "id": null, + "login": "erinepshovel-code", + "name": "erinepshovel-code" + }, + "body": "", + "id": "PRR_kwDOUi3exM8AAAABTFE-Ww", + "state": "COMMENTED", + "submitted_at": "2026-10-19T17:37:06Z" + }, + { + "author": { + "avatar_url": "https://avatars.githubusercontent.com/in/1144995?v=4", + "email": null, + "id": null, + "login": "chatgpt-codex-connector", + "name": "chatgpt-codex-connector" + }, + "body": "\n\n\n### \ud83d\udca1 Codex Review\n\nHere are some automated review suggestions for this pull request.\n\n**Reviewed commit:** `c514e1a2a3`\n \n\n
\u2139\ufe0f About Codex in GitHub\n
\n\n[Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you\n- Open a pull request for review\n- Mark a draft as ready\n- Comment \"@codex review\".\n\nIf Codex has suggestions, it will comment; otherwise it will react with \ud83d\udc4d.\n\n\n\n\nCodex can also answer questions or update the PR. Try commenting \"@codex address that feedback\".\n \n
", + "id": "PRR_kwDOUi3exM8AAAABTFKNew", + "state": "COMMENTED", + "submitted_at": "2026-10-19T17:43:56Z" + } + ] + }, + "state": "open", + "unresolved_threads": [] + }, + "ucns": { + "base": "ed0b0760f05cd975a7a811f8abeb70a11d09f00b", + "draft": false, + "head": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "mergeable": true, + "merged": false, + "resolved_threads": 0, + "reviews": { + "reviews": [] + }, + "state": "open", + "unresolved_threads": [] + } + }, + "schema": "english.recursive-integration-local-evidence.v2", + "skill_lib_commit": "d71a3a938cb6d646ffc0b59186452117e4a37d13", + "standing": "locally verified candidate; hosted verification and merge admission incomplete", + "test_results": { + "stack_complete": { + "errors": 0, + "failures": 0, + "junit_sha256": "3fd262f68a3b6fd666580e212e79ee5fb28331321d47a60d891608b504a4d41f", + "skipped": 0, + "tests": 13 + }, + "stack_focused": { + "errors": 0, + "failures": 0, + "junit_sha256": "0c4a0dae05b8498372b0dc495b8c1234f8e6e06f401f15652f5d47280f4e7a3c", + "skipped": 0, + "tests": 7 + }, + "uchc_historical": { + "errors": 0, + "failures": 0, + "junit_sha256": "d6679b203e7cdf74d0298a0afc2acf492ffa755e18bb0285d744a6b839e68243", + "skipped": 0, + "tests": 301 + }, + "uchc_installed_complete": { + "errors": 0, + "failures": 0, + "junit_sha256": "d5e56e8dc2e6c7c6649a447e9a28882fe02d49db86fccc124737f441f0b5ed5f", + "skipped": 0, + "tests": 13 + }, + "uchc_sdist_focused": { + "errors": 0, + "failures": 0, + "junit_sha256": "4cad16ebf1402ff016d868fd82ffabeac2971dd3bffdd11b7d5dd6a1d19ac089", + "skipped": 0, + "tests": 7 + }, + "uchc_verifier": { + "errors": 0, + "failures": 0, + "junit_sha256": "36183aa58f5f477f22ad39ec50dea5985b739d0e0777f191e00ad5b30d3234ec", + "skipped": 0, + "tests": 1 + }, + "uchc_wheel_focused": { + "errors": 0, + "failures": 0, + "junit_sha256": "7b6e21fa07a0a29db33296caf21dcef7f4b0d4b27b1d3e848e44802f24b01cee", + "skipped": 0, + "tests": 7 + }, + "ucns_sdist": { + "errors": 0, + "failures": 0, + "junit_sha256": "2c033807865f92b1f344180dccf950046a93d32a6ffd68185880eaafac18e610", + "skipped": 0, + "tests": 303 + }, + "ucns_source": { + "errors": 0, + "failures": 0, + "skipped": 0, + "tests": 303 + }, + "ucns_wheel": { + "errors": 0, + "failures": 0, + "junit_sha256": "586eae390dc1b9c1e64e564da6c0820395417b34eca71239183449202fb24064", + "skipped": 0, + "tests": 303 + } + }, + "uchc_artifacts_sha256": { + "uchc-0.1.0a4-py3-none-any.whl": "e6a5fe38334bda30fc1158652e9badee91f20d35bcb00a1544d75d1285399cb2", + "uchc-0.1.0a4.tar.gz": "071463636bbe916211c035a1df08c47e6d7ba27506d5ee41907fd60e59c374f1" + } +} From b1d2c62fd55d2898bb37cba9ebec862c9a8d5980 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Sun, 1 Nov 2026 20:57:22 -0800 Subject: [PATCH 29/30] Complete UCHC runtime extraction and distributable package Include polyglot, exact Stack Hilbert/trajectory/view/displacement runtime, packaged metric-origin provenance, and required language JSON resources. Preserve candidate mathematics and historical receipts. Add full inventory and clean wheel/sdist verification; prepare 0.1.0 for publication without claiming graduation. Local validation: 344 English tests; 10 Python/polyglot tests; 43 tests per wheel and sdist; 49 installed runtime/data files verified; 49 extraction entries matched exact Stack source; full English corpus receipt reproduced. Final corpus/consumer gates remain in progress. --- .github/workflows/english-full-corpus.yml | 18 +- .../workflows/english-ordinal-geometry.yml | 4 +- .../english-recursive-attachment.yml | 4 +- .../workflows/english-structural-profile.yml | 4 +- .github/workflows/package-completeness.yml | 66 ++ MANIFEST.in | 10 + README.md | 10 +- docs/ARCHITECTURE.md | 20 +- docs/HILBERT_INFERENCE.md | 12 +- docs/MIGRATION.md | 38 +- docs/package-extraction.json | 405 ++++++++++ docs/work-graphs/package-extraction-v1.json | 56 ++ .../data/EDCM_METRIC_ORIGINS_SOURCE.json | 206 +++++ .../data/METRIC_ORIGIN_PROVENANCE.json | 8 + .../english/english_gonol/describing_graph.py | 231 ++++++ .../english_gonol/displacement_operator.py | 375 ++++++++++ .../displacement_operator_options.py | 242 ++++++ .../english_gonol/edcm_metric_origins.py | 280 +++++++ .../english_gonol/hilbert_inference.py | 707 ++++++++++++++++++ .../english_gonol/hyperspace_geometry.py | 248 ++++++ .../english/english_gonol/hyperspace_views.py | 431 +++++++++++ .../english_gonol/system_set_trajectory.py | 160 ++++ human/english/tests/test_describing_graph.py | 119 +++ .../tests/test_displacement_operator.py | 137 ++++ .../test_displacement_operator_options.py | 136 ++++ .../english/tests/test_edcm_metric_origins.py | 312 ++++++++ human/english/tests/test_hilbert_inference.py | 376 ++++++++++ .../english/tests/test_hyperspace_geometry.py | 133 ++++ human/english/tests/test_hyperspace_views.py | 182 +++++ .../tests/test_system_set_trajectory.py | 134 ++++ pyproject.toml | 9 +- tools/verify_installed_package.py | 104 +++ tools/verify_package_extraction.py | 73 ++ 33 files changed, 5209 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/package-completeness.yml create mode 100644 MANIFEST.in create mode 100644 docs/package-extraction.json create mode 100644 docs/work-graphs/package-extraction-v1.json create mode 100644 human/english/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json create mode 100644 human/english/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json create mode 100644 human/english/english_gonol/describing_graph.py create mode 100644 human/english/english_gonol/displacement_operator.py create mode 100644 human/english/english_gonol/displacement_operator_options.py create mode 100644 human/english/english_gonol/edcm_metric_origins.py create mode 100644 human/english/english_gonol/hilbert_inference.py create mode 100644 human/english/english_gonol/hyperspace_geometry.py create mode 100644 human/english/english_gonol/hyperspace_views.py create mode 100644 human/english/english_gonol/system_set_trajectory.py create mode 100644 human/english/tests/test_describing_graph.py create mode 100644 human/english/tests/test_displacement_operator.py create mode 100644 human/english/tests/test_displacement_operator_options.py create mode 100644 human/english/tests/test_edcm_metric_origins.py create mode 100644 human/english/tests/test_hilbert_inference.py create mode 100644 human/english/tests/test_hyperspace_geometry.py create mode 100644 human/english/tests/test_hyperspace_views.py create mode 100644 human/english/tests/test_system_set_trajectory.py create mode 100644 tools/verify_installed_package.py create mode 100644 tools/verify_package_extraction.py diff --git a/.github/workflows/english-full-corpus.yml b/.github/workflows/english-full-corpus.yml index f872af0..b88f57c 100644 --- a/.github/workflows/english-full-corpus.yml +++ b/.github/workflows/english-full-corpus.yml @@ -34,6 +34,7 @@ jobs: } fetch_source The-Interdependency/uchc source "$SOURCE_SHA" fetch_source globalwordnet/english-wordnet oewn dc343f2683279ecbb13fab4e2fd778d7b162d287 + fetch_source The-Interdependency/edcm edcm-metric 0873c105799681ea1f7ccb3e619d1f7aebbd85e0 fetch_source The-Interdependency/ucns ucns 380ce7b7ec6b8b45ffa53ea4210070f0b3129747 git -C ucns fetch --quiet origin fc01e1f0323da45362704f92adbf6d3b8a008307 git -C ucns fetch --quiet origin 4f863ad37096b7baab8f62820ad5cb937b62a3a7 @@ -50,7 +51,10 @@ jobs: set -euo pipefail export UCNS_SOURCE_ROOT="$PWD/ucns" export ENGLISH_GONOL_UCNS_ROOT="$PWD/ucns-relational" - .venv/bin/python -m pytest -q source/human/english/tests --ignore=source/human/english/tests/test_language_relational_bridge.py --junitxml=evidence/english.xml + export OEWN_SOURCE_ROOT="$PWD/oewn/src/yaml" + export EDCM_METRIC_ORIGIN_ROOT="$PWD/edcm-metric" + export REQUIRE_METRIC_ORIGIN_SOURCES=1 + .venv/bin/python -m pytest -q source/human/english/tests --ignore=source/human/english/tests/test_language_relational_bridge.py -k 'not full_construct_origins' --junitxml=evidence/english.xml (cd source/human/english && ../../../.venv/bin/python -m pytest -q tests/test_language_relational_bridge.py --junitxml=../../../evidence/relational.xml) PYTHONPATH="$PWD/source/programming/python" .venv/bin/python -m pytest -q source/programming/python/tests --junitxml=evidence/python.xml PYTHONPATH="$PWD/source/shared/polyglot" .venv/bin/python -m pytest -q source/shared/polyglot/tests --junitxml=evidence/polyglot.xml @@ -64,11 +68,12 @@ jobs: .venv/bin/python -m pip wheel --no-deps --no-build-isolation ./source -w evidence/dist python3 -m venv .clean .clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0a4-py3-none-any.whl + .clean/bin/python -m pip install --no-index --no-deps evidence/dist/uchc-0.1.0-py3-none-any.whl mkdir -p isolated-tests cp source/human/english/tests/test_inference_input.py isolated-tests/test_input.py cp source/human/english/tests/test_structural_profile.py isolated-tests/test_structural_profile.py cp source/programming/python/tests/test_construct.py isolated-tests/test_python.py + cp source/shared/polyglot/tests/test_polyglot.py isolated-tests/test_polyglot.py UCNS_SOURCE_ROOT="$PWD/ucns" .clean/bin/python -I -m pytest -q isolated-tests --junitxml=evidence/installed.xml .clean/bin/python -I - <<'PY' from pathlib import Path @@ -77,7 +82,7 @@ jobs: import python_gonol assert '/.clean/' in str(Path(reader.__file__).resolve()) assert '/.clean/' in str(Path(python_gonol.__file__).resolve()) - assert version('uchc') == '0.1.0a4' + assert version('uchc') == '0.1.0' PY - name: Build all pinned corpus rows through the installed artifact shell: bash @@ -86,6 +91,11 @@ jobs: .clean/bin/python -I -m english_gonol.full_construct_run \ --source-root "$PWD/oewn/src/yaml" --ucns-source-root "$PWD/ucns-build" \ --out-dir "$PWD/evidence/full-construct" + cp source/human/english/tests/test_edcm_metric_origins.py isolated-tests/test_edcm_metric_origins.py + OEWN_SOURCE_ROOT="$PWD/oewn/src/yaml" EDCM_METRIC_ORIGIN_ROOT="$PWD/edcm-metric" \ + REQUIRE_METRIC_ORIGIN_SOURCES=1 ENGLISH_GONOL_FULL_CONSTRUCT_ROOT="$PWD/evidence/full-construct" \ + .clean/bin/python -I -m pytest -q -c /dev/null --noconftest isolated-tests/test_edcm_metric_origins.py \ + --junitxml=evidence/metric-origins.xml .clean/bin/python -I - <<'PY' from pathlib import Path import hashlib, json @@ -122,7 +132,7 @@ jobs: counts = {key: sum(int(s.get(key, 0)) for s in suites) for key in ('tests', 'failures', 'errors', 'skipped')} assert counts['tests'] > 0 and not any(counts[k] for k in ('failures', 'errors', 'skipped')), counts tests[path.stem] = counts - wheel = Path('evidence/dist/uchc-0.1.0a4-py3-none-any.whl') + wheel = Path('evidence/dist/uchc-0.1.0-py3-none-any.whl') with wheel.open('rb') as stream: digest = hashlib.file_digest(stream, 'sha256').hexdigest() record = {'source_commit': os.environ['SOURCE_SHA'], 'wheel': wheel.name, 'wheel_sha256': digest, 'tests': tests, 'input_acceptance': json.loads(Path('evidence/input-acceptance.json').read_text())['receipt_sha256'], 'standing': 'verified release candidate; not neural inference or completed domain graduation'} diff --git a/.github/workflows/english-ordinal-geometry.yml b/.github/workflows/english-ordinal-geometry.yml index 258a21f..57a3e1b 100644 --- a/.github/workflows/english-ordinal-geometry.yml +++ b/.github/workflows/english-ordinal-geometry.yml @@ -93,7 +93,7 @@ jobs: python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 _state/clean/bin/python -m pip install ./_deps/ucns-ordinal - _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a4-py3-none-any.whl + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0-py3-none-any.whl mkdir -p _state/isolated-tests cp tests/test_ordinal_construction.py _state/isolated-tests/test_ordinal_construction.py _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml @@ -122,7 +122,7 @@ jobs: totals = {k: sum(int(x.get(k,0)) for x in cases) for k in ('tests','failures','errors','skipped')} assert totals['tests'] >= 10 and totals['failures'] == totals['errors'] == totals['skipped'] == 0, totals tests[name] = totals - wheel = Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') + wheel = Path('_state/dist/uchc-0.1.0-py3-none-any.whl') source_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD'], text=True).strip() assert source_commit == os.environ['UCHC_SOURCE_COMMIT'] graph = json.loads(Path('docs/work-graphs/english-ordinal-geometry-v1.json').read_text()) diff --git a/.github/workflows/english-recursive-attachment.yml b/.github/workflows/english-recursive-attachment.yml index b326495..f899edb 100644 --- a/.github/workflows/english-recursive-attachment.yml +++ b/.github/workflows/english-recursive-attachment.yml @@ -55,7 +55,7 @@ jobs: python -m pip wheel --no-deps --no-build-isolation . -w _state/dist python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - _state/clean/bin/python -m pip install --no-deps _state/native-dist/*.whl _state/dist/uchc-0.1.0a4-py3-none-any.whl + _state/clean/bin/python -m pip install --no-deps _state/native-dist/*.whl _state/dist/uchc-0.1.0-py3-none-any.whl mkdir -p _state/isolated cp tests/test_attachment_construction.py tests/test_attachment_corpus.py _state/isolated/ - name: Verify source closure and isolated installed imports @@ -112,7 +112,7 @@ jobs: audit = json.loads(Path('_state/audit-installed.json').read_text()) assert audit['counts']['words'] == 103053 assert audit['counts']['formerly_compound_definitions'] == 57155 - wheel = Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') + wheel = Path('_state/dist/uchc-0.1.0-py3-none-any.whl') evidence = {'schema':'uchc.recursive-attachment-acceptance.v1','uchc_source_commit':sha,'forge_commit':'251ba2290675a21154582f0b3fb0d7a9d509ed50','ucns_commit':'9cc00771e54336d58ee377faeec87a3a33dbd4bf','tests':tests,'operations':outputs,'audit':audit,'wheel_sha256':hashlib.sha256(wheel.read_bytes()).hexdigest(),'authority_transfer':False,'bearing_selection':'none','work_graph_sha256':json.loads(Path('docs/work-graphs/english-recursive-attachment-v1.json').read_text())['work_graph_sha256'],'baseline_audit_sha256':hashlib.sha256(Path('human/english/experiments/recursive-attachment-v1/corpus-audit.json').read_bytes()).hexdigest()} Path('_state/recursive-evidence.json').write_text(json.dumps(evidence,indent=2,sort_keys=True)+'\n') PY diff --git a/.github/workflows/english-structural-profile.yml b/.github/workflows/english-structural-profile.yml index 1c3c3a5..0765a84 100644 --- a/.github/workflows/english-structural-profile.yml +++ b/.github/workflows/english-structural-profile.yml @@ -134,7 +134,7 @@ jobs: python -m pip wheel --no-deps --no-build-isolation . -w _state/dist python -m venv _state/clean _state/clean/bin/python -m pip install pytest==8.3.5 PyYAML==6.0.2 - _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0a4-py3-none-any.whl + _state/clean/bin/python -m pip install --no-index --no-deps _state/dist/uchc-0.1.0-py3-none-any.whl mkdir -p _state/isolated-tests cp ./human/english/tests/test_structural_profile.py _state/isolated-tests/ _state/clean/bin/python -I -m pytest -c /dev/null -q _state/isolated-tests --junitxml=_state/installed.xml @@ -328,7 +328,7 @@ jobs: assert verification['forge_source_commit'] == next(r['commit'] for r in graph['repositories'] if r['repository'] == 'The-Interdependency/stack') historical_wheel = pathlib.Path('_state/historical-dist') / ('uchc-' + verification['candidate_version'] + '-py3-none-any.whl') assert verification['candidate_wheel_sha256'] == digest(historical_wheel) - wheel = pathlib.Path('_state/dist/uchc-0.1.0a4-py3-none-any.whl') + wheel = pathlib.Path('_state/dist/uchc-0.1.0-py3-none-any.whl') assert wheel.is_file() and digest(wheel) != digest(historical_wheel) tests = {} for name, expected in [('structural', verification['tests']['structural_included_in_english']), ('installed', verification['tests']['clean_installed_structural'])]: diff --git a/.github/workflows/package-completeness.yml b/.github/workflows/package-completeness.yml new file mode 100644 index 0000000..d354ae5 --- /dev/null +++ b/.github/workflows/package-completeness.yml @@ -0,0 +1,66 @@ +name: Package completeness +on: + pull_request: + push: + branches: [main] +permissions: + contents: read +jobs: + package: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v7.0.1 + with: + path: source + persist-credentials: false + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/stack + ref: ca69c60032a079585ccb89d5cc7aba67f637df55 + path: forge + persist-credentials: false + - uses: actions/setup-python@v7.0.0 + with: + python-version: '3.12' + - uses: actions/checkout@v7.0.1 + with: + repository: The-Interdependency/ucns + ref: 9cc00771e54336d58ee377faeec87a3a33dbd4bf + path: ucns + fetch-depth: 0 + persist-credentials: false + - name: Verify complete extraction and build both distributions + run: | + set -euo pipefail + python -m pip install build==1.6.1 twine==6.2.0 setuptools==82.0.1 wheel==0.46.3 packaging==26.0 + python source/tools/verify_package_extraction.py forge + mkdir evidence + python source/tools/verify_installed_package.py evidence/source-manifest.json --source source + SOURCE_DATE_EPOCH="$(git -C source log -1 --format=%ct)" python -m build --no-isolation --outdir evidence/dist source + python -m twine check evidence/dist/* + sha256sum evidence/dist/* > evidence/artifacts.sha256 + - name: Exercise exact wheel and source archive in separate clean environments + run: | + set -euo pipefail + export UCNS_SOURCE_ROOT="$PWD/ucns" + mkdir isolated-tests + cp source/shared/polyglot/tests/test_polyglot.py isolated-tests/ + cp source/human/english/tests/test_hilbert_inference.py isolated-tests/ + cp source/human/english/tests/test_system_set_trajectory.py isolated-tests/ + cp source/human/english/tests/test_suffixiation.py isolated-tests/ + cp source/human/english/tests/test_character_definitions.py isolated-tests/ + cp source/programming/python/tests/test_construct.py isolated-tests/ + for kind in wheel sdist; do + python -m venv "$kind" + "$kind/bin/python" -m pip install pytest==8.3.5 PyYAML==6.0.2 setuptools==82.0.1 wheel==0.46.3 packaging==26.0 + if [ "$kind" = wheel ]; then artifact=(evidence/dist/*.whl); else artifact=(evidence/dist/*.tar.gz); fi + "$kind/bin/python" -m pip install --no-deps --no-build-isolation "${artifact[0]}" + "$kind/bin/python" -I source/tools/verify_installed_package.py evidence/source-manifest.json > "evidence/$kind-package.json" + "$kind/bin/python" -I -m pytest -q -c /dev/null --noconftest isolated-tests --junitxml="evidence/$kind.xml" + done + sha256sum -c evidence/artifacts.sha256 + - uses: actions/upload-artifact@v7.0.1 + with: + name: uchc-package-completeness + path: evidence/ + if-no-files-found: error diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..043b73d --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,10 @@ +include NOTICE LICENSE +recursive-include docs *.md *.json +recursive-include human/english/tests *.py +recursive-include human/english/tools *.py +recursive-include human/english/docs *.md *.json +include human/english/README.md +recursive-include human/english/experiments *.json +recursive-include programming/python/tests *.py +recursive-include shared/polyglot/tests *.py +recursive-include tools *.py diff --git a/README.md b/README.md index 0dd3b81..04ce493 100644 --- a/README.md +++ b/README.md @@ -91,8 +91,9 @@ Carrier position and axis participation are distinct roles of a glyph gonol. ## Hilbert inference target The axis-native Hilbert correction is currently forged in Stack, which remains -the implementation owner until UCHC graduation completes. UCHC records the -migration target without duplicating a second writable implementation. +the implementation owner until UCHC graduation completes. Candidate `0.1.0` +packages its exact runtime and tests; the [extraction inventory](docs/package-extraction.json) +binds them to Stack `ca69c60032a079585ccb89d5cc7aba67f637df55`. ```text glyph axes @@ -113,7 +114,8 @@ orthonormal inner products, and fails closed on cross-origin/cross-construct products. The exact merged producer is `The-Interdependency/stack@6504ed963d93836f66fc88e354fe52809a1a3b7a`. See [the provisional migration contract](docs/HILBERT_INFERENCE.md); these -Hilbert helpers and the future frame bridge are not available in this UCHC package. +Hilbert helpers are available as an extracted candidate in this package. The +future frame bridge remains unimplemented. The current UCHC O/S/C inference and epicyclic graph paths remain downstream candidate operators/readouts. Their executable channel tuples do not define @@ -207,7 +209,7 @@ the Open English WordNet input. This section is a licensing map, not legal advic - cross-origin inner products, angles, and attachment geometry beyond the implemented construction-derived attachment relation; - amplitude/phase, sense-selection, and learned inference operators; - sentence-axis promotion relation; -- migration of the Stack-forged Hilbert candidate into UCHC; +- stable release and released-artifact verification of the extracted Hilbert candidate; - continuum lift-selection law; - stable release, published-artifact reconsumption, and domain graduation; - Spanish, TypeScript, and Rust admission/construction profiles. diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 929de61..a9a91ba 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -47,8 +47,9 @@ glyph identity without becoming interchangeable. ## Hilbert-state migration target The English Hilbert correction is a Stack-forged candidate until UCHC -graduation completes. This repository records the intended independent contract -without creating a second writable implementation. +graduation completes. Candidate `0.1.0` contains an exact extraction of the +runtime and tests. Until the release transition, fixes originate in Stack and +the extraction inventory verifies the UCHC copy. ```text O_G: admitted glyph axes @@ -85,12 +86,13 @@ that UCHC does not contain. ## Usage guidance Treat [`HILBERT_INFERENCE.md`](HILBERT_INFERENCE.md) as the UCHC migration -target and provenance boundary, not as an implemented public API. The executable -candidate remains in Stack's `research/english-gonol/` forge at -`6504ed963d93836f66fc88e354fe52809a1a3b7a`, pinned in the -[shared work graph](work-graphs/hilbert-inference.json). Continue using -the existing receipt-bound UCHC input API only for the contracts it currently -implements. +contract and provenance boundary. The executable candidate is packaged as +`english_gonol.hilbert_inference`; its complete extraction source is Stack +`ca69c60032a079585ccb89d5cc7aba67f637df55`, recorded in the +[package inventory](package-extraction.json). The +[historical work graph](work-graphs/hilbert-inference.json) retains the original +merged producer. The receipt-bound input API and future input-frame bridge +remain distinct from these origin-local Hilbert helpers. Do not use a renderer, O/S/C candidate map, or external embedding dimension to manufacture the basis. @@ -102,5 +104,5 @@ manufacture the basis. - amplitude and phase assignment; - learned inference operators and sense selection; - sentence-axis promotion; -- migration of the Stack-forged Hilbert implementation into UCHC; +- stable release and published-artifact reconsumption of the extracted Hilbert candidate; - geometric consequences of declared local definition-axis orthogonality. diff --git a/docs/HILBERT_INFERENCE.md b/docs/HILBERT_INFERENCE.md index fffb7f7..b8e1e8f 100644 --- a/docs/HILBERT_INFERENCE.md +++ b/docs/HILBERT_INFERENCE.md @@ -1,8 +1,12 @@ # Hilbert inference migration contract -Status: **provisional, unimplemented UCHC migration target**. English remains -`extracted`; Stack owns this executable candidate and its public contract. -This document introduces no UCHC Hilbert API and claims no completed graduation. +Status: **provisional, extracted UCHC candidate**. English remains `extracted`; +Stack owns the implementation and public contract until graduation completes. +Candidate `0.1.0` packages `english_gonol.hilbert_inference` and its behavioral +tests byte-for-byte from Stack `ca69c60032a079585ccb89d5cc7aba67f637df55`. +See [the complete extraction inventory](package-extraction.json). +The input-frame bridge remains unimplemented. Extraction does not ratify the +mathematics or establish completed graduation. ## Exact producer and authority @@ -32,7 +36,7 @@ Each row is a separate domain claim. The following fields apply to **every row** - authority source: the linked Stack candidate contract and implementation; - effective version: Stack `6504ed963d93836f66fc88e354fe52809a1a3b7a`; - supersedes: the unscoped UCHC wording in `7ab46c5df37fce9612eed9948fb4500f191f6746:docs/HILBERT_INFERENCE.md`, not upstream canon; -- downstream authorization: describe and compare the candidate; UCHC encoding remains pending migration and equivalence evidence. +- downstream authorization: describe, compare and verify the extracted candidate; release, published-artifact reconsumption and scoped authority transfer remain pending. The `term_id` values retain the producer's qualified identities. UCHC does not create competing definitions by copying the terms. diff --git a/docs/MIGRATION.md b/docs/MIGRATION.md index 2ab3d49..a70d6aa 100644 --- a/docs/MIGRATION.md +++ b/docs/MIGRATION.md @@ -4,12 +4,29 @@ - name: UCHC - forge: `The-Interdependency/stack` -- current state: `extracted`; new input-contract release candidate under verification +- current state: `extracted`; package-complete `0.1.0` candidate under verification - intended independent authority: `The-Interdependency/uchc` - mode: execution -Repository population is authorized by the operator. Implementation/public-contract -authority transfer is **not yet complete**. +The operator's 2026-11-01 instruction, "graduate uchc", authorizes execution, +publication, consumer migration and the scoped implementation/public-contract +transition. Implementation/public-contract authority transfer is **not yet complete**. + +The current [package extraction inventory](package-extraction.json) binds 41 +runtime/data files and eight migrated test files to Stack +`ca69c60032a079585ccb89d5cc7aba67f637df55`. Two test adaptations remove +Stack-workspace assumptions while retaining behavior checks. The verifier reads +exact Git objects and checks the complete runtime inventory, including the two +explicit exclusions: Stack's frozen full-view audit runner and its independent +reconstruction helper. The [package extraction work graph](work-graphs/package-extraction-v1.json) +records the authorities for this increment; prior graphs and receipts remain +historical evidence. + +This candidate includes `uchc_polyglot`, the Hilbert and semantic-trajectory +modules, and packaged EDCM fixture/provenance bytes. EDCM remains the semantic +source and measurement authority. Stable publication, exact published-artifact +reconsumption, retirement of the forge runtime, and the transition receipt remain +unfulfilled gates. ## Source baseline @@ -80,11 +97,10 @@ verification separately from outstanding stable release, released-artifact reconsumption, forge-path severance, and scoped authority-transition evidence. Those input-candidate gates do not establish Hilbert migration or graduation. -UCHC carries only the [provisional migration contract](HILBERT_INFERENCE.md), -including domain-qualified mathematical terms and remaining falsifiers. No -Hilbert implementation or frame bridge is introduced here. To replay or prepare -migration, resolve the exact Stack commit through that graph and run its linked -candidate checks before attempting the lifecycle gates below. +UCHC carries the [provisional contract](HILBERT_INFERENCE.md) and now packages +the exact Hilbert implementation and tests in candidate `0.1.0`. The frame +bridge remains unimplemented. The package extraction verifier establishes source +identity; clean installation and behavioral replay are separate gates. ## Recurrence work graph and usage @@ -97,9 +113,9 @@ into any resulting handoff. These are pinned coordination baselines, not claims that the commits are the latest heads or that downstream validation has passed. Stack remains the current English semantic-trajectory implementation authority. -UCHC is a migration target only; this record introduces no recurrence code or -public trajectory API. A future migration must first copy source and tests with -provenance, then satisfy the remaining lifecycle gates below. Neither this +UCHC `0.1.0` packages the exact `system_set_trajectory` candidate with its +behavioral tests and recorded provenance. It must still satisfy the remaining +lifecycle gates below. Neither this graph nor its digest transfers authority, proof, certification, measurement or empirical standing. All unresolved boundaries remain `hmmm`. diff --git a/docs/package-extraction.json b/docs/package-extraction.json new file mode 100644 index 0000000..2f5d7ab --- /dev/null +++ b/docs/package-extraction.json @@ -0,0 +1,405 @@ +{ + "schema": "uchc.package-extraction", + "version": "1.0.0", + "source_repository": "The-Interdependency/stack", + "source_commit": "ca69c60032a079585ccb89d5cc7aba67f637df55", + "authority_transfer": false, + "files": [ + { + "source": "research/english-gonol/english_gonol/attachment_audit.py", + "target": "human/english/english_gonol/attachment_audit.py", + "kind": "runtime", + "source_sha256": "57f057cea6defd01001edf9a6443d1b51d4f3ebe4d1f56d480ac2b3398199d07", + "target_sha256": "57f057cea6defd01001edf9a6443d1b51d4f3ebe4d1f56d480ac2b3398199d07", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/attachment_construction.py", + "target": "human/english/english_gonol/attachment_construction.py", + "kind": "runtime", + "source_sha256": "7c754e6a8e0f860e1f645af88c4d48a8894a6dcfcde55ca5ae6af96b9378e7d1", + "target_sha256": "7c754e6a8e0f860e1f645af88c4d48a8894a6dcfcde55ca5ae6af96b9378e7d1", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json", + "target": "human/english/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json", + "kind": "runtime", + "source_sha256": "4a769f493af21eb54c0f7d95307237a172e3fd17aaf43e62d6602cd80e0dba5c", + "target_sha256": "4a769f493af21eb54c0f7d95307237a172e3fd17aaf43e62d6602cd80e0dba5c", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json", + "target": "human/english/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json", + "kind": "runtime", + "source_sha256": "869eeca3796c10358cba8c893bb0dccb07685bf012ce5204541dab17aaf99dc6", + "target_sha256": "869eeca3796c10358cba8c893bb0dccb07685bf012ce5204541dab17aaf99dc6", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/definition_affixiation_run.py", + "target": "human/english/english_gonol/definition_affixiation_run.py", + "kind": "runtime", + "source_sha256": "edabab5f3db85bd0ca52749fe4f47038755e06c1c2e8e1fa53d2b2bcffd126a3", + "target_sha256": "edabab5f3db85bd0ca52749fe4f47038755e06c1c2e8e1fa53d2b2bcffd126a3", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/density_run.py", + "target": "human/english/english_gonol/density_run.py", + "kind": "runtime", + "source_sha256": "8c98160c4b32ccd8554f17a112f0be1922e02383e48768ec634d5093efe839b8", + "target_sha256": "8c98160c4b32ccd8554f17a112f0be1922e02383e48768ec634d5093efe839b8", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/describing_graph.py", + "target": "human/english/english_gonol/describing_graph.py", + "kind": "runtime", + "source_sha256": "99771bcd05670f2fbf0f688986943148233eebdfc6f7df05ee47e709489f9beb", + "target_sha256": "99771bcd05670f2fbf0f688986943148233eebdfc6f7df05ee47e709489f9beb", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/displacement_operator.py", + "target": "human/english/english_gonol/displacement_operator.py", + "kind": "runtime", + "source_sha256": "42a6f4b1d8e236e755eef9b6388011ac663d2596036cef270157d60847a003ca", + "target_sha256": "42a6f4b1d8e236e755eef9b6388011ac663d2596036cef270157d60847a003ca", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/displacement_operator_options.py", + "target": "human/english/english_gonol/displacement_operator_options.py", + "kind": "runtime", + "source_sha256": "319a08177c7d857bb50da34083782e49079cd6f5cc50bbc3b0455bbb14799785", + "target_sha256": "319a08177c7d857bb50da34083782e49079cd6f5cc50bbc3b0455bbb14799785", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/edcm_metric_origins.py", + "target": "human/english/english_gonol/edcm_metric_origins.py", + "kind": "runtime", + "source_sha256": "23c2db2de698717539644fdb13f3b0b0ebb7e045ef75587e26251760be4c6e78", + "target_sha256": "23c2db2de698717539644fdb13f3b0b0ebb7e045ef75587e26251760be4c6e78", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/full_construct_run.py", + "target": "human/english/english_gonol/full_construct_run.py", + "kind": "runtime", + "source_sha256": "fbadf9cc033a154148b62e11b52d7e38b845c0d0b669ff34dfc6186cab15c064", + "target_sha256": "fbadf9cc033a154148b62e11b52d7e38b845c0d0b669ff34dfc6186cab15c064", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/gonol.py", + "target": "human/english/english_gonol/gonol.py", + "kind": "runtime", + "source_sha256": "8ac63d14154293a1212a363f6bb60ec8d408b12413332deec684496eed3ee1d2", + "target_sha256": "8ac63d14154293a1212a363f6bb60ec8d408b12413332deec684496eed3ee1d2", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/gonol_relationship_run.py", + "target": "human/english/english_gonol/gonol_relationship_run.py", + "kind": "runtime", + "source_sha256": "18a7942958d515df4e1886d354b2754dc19fa3ff43dc8634eb78b222b73e5cbb", + "target_sha256": "18a7942958d515df4e1886d354b2754dc19fa3ff43dc8634eb78b222b73e5cbb", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/hilbert_inference.py", + "target": "human/english/english_gonol/hilbert_inference.py", + "kind": "runtime", + "source_sha256": "81f8dc2424c7513b598fd625101fda5371bace5969462ae3a785a160a7bc2ec4", + "target_sha256": "81f8dc2424c7513b598fd625101fda5371bace5969462ae3a785a160a7bc2ec4", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/hyperspace_construct.py", + "target": "human/english/english_gonol/hyperspace_construct.py", + "kind": "runtime", + "source_sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71", + "target_sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/hyperspace_geometry.py", + "target": "human/english/english_gonol/hyperspace_geometry.py", + "kind": "runtime", + "source_sha256": "0b9eb4a871a47175448c12807262c7747f99275fa0d937eb68697e4cedcd63f6", + "target_sha256": "0b9eb4a871a47175448c12807262c7747f99275fa0d937eb68697e4cedcd63f6", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/hyperspace_views.py", + "target": "human/english/english_gonol/hyperspace_views.py", + "kind": "runtime", + "source_sha256": "529b536cb03a28d8e05c802b50997fb71f30d921c908a5e33fc07552e4f500fe", + "target_sha256": "529b536cb03a28d8e05c802b50997fb71f30d921c908a5e33fc07552e4f500fe", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/__init__.py", + "target": "human/english/english_gonol/language/__init__.py", + "kind": "runtime", + "source_sha256": "0620712b60b0c51483f45212dc63fc139b1c51a561ad863512344a5477727352", + "target_sha256": "0620712b60b0c51483f45212dc63fc139b1c51a561ad863512344a5477727352", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/affixes.py", + "target": "human/english/english_gonol/language/affixes.py", + "kind": "runtime", + "source_sha256": "50df16c8dd71dcc0e1d964ac36909b3d48fbedbf404e27312492024261e36392", + "target_sha256": "50df16c8dd71dcc0e1d964ac36909b3d48fbedbf404e27312492024261e36392", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/character_definitions.py", + "target": "human/english/english_gonol/language/character_definitions.py", + "kind": "runtime", + "source_sha256": "0fe9c8a0ee263c008e530e3df2b521ad4ccb08c50c59939872d7b6fcb9f8e67c", + "target_sha256": "0fe9c8a0ee263c008e530e3df2b521ad4ccb08c50c59939872d7b6fcb9f8e67c", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/data/bones_affixes_v1.json", + "target": "human/english/english_gonol/language/data/bones_affixes_v1.json", + "kind": "runtime", + "source_sha256": "430a6b4b1fe1c74de1020e66f7105b1e81d3776569fdea7a14a6b95afa23e06d", + "target_sha256": "430a6b4b1fe1c74de1020e66f7105b1e81d3776569fdea7a14a6b95afa23e06d", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/data/character_definitions_v1.json", + "target": "human/english/english_gonol/language/data/character_definitions_v1.json", + "kind": "runtime", + "source_sha256": "ba431162c065a033d60f66bfb84d62d93f55ca6ca954ec59756c4bacc854827d", + "target_sha256": "ba431162c065a033d60f66bfb84d62d93f55ca6ca954ec59756c4bacc854827d", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/glyph_floor.py", + "target": "human/english/english_gonol/language/glyph_floor.py", + "kind": "runtime", + "source_sha256": "ff224bbed8b362d423958a231391ae26bbddbf85461e630a9d14ba68b9e93c9d", + "target_sha256": "ff224bbed8b362d423958a231391ae26bbddbf85461e630a9d14ba68b9e93c9d", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/manifest.py", + "target": "human/english/english_gonol/language/manifest.py", + "kind": "runtime", + "source_sha256": "ae0b1176398f48463c3082f46afc7cd82e7273a72555a3c76e47e8fe90e15155", + "target_sha256": "ae0b1176398f48463c3082f46afc7cd82e7273a72555a3c76e47e8fe90e15155", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/model.py", + "target": "human/english/english_gonol/language/model.py", + "kind": "runtime", + "source_sha256": "35a8ce27dcc70011cba1d31c3d6f9b1c4ec24f49a63316226ff92d12ce3332b4", + "target_sha256": "35a8ce27dcc70011cba1d31c3d6f9b1c4ec24f49a63316226ff92d12ce3332b4", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/morphology.py", + "target": "human/english/english_gonol/language/morphology.py", + "kind": "runtime", + "source_sha256": "84ea74d3498442c313bc318f0d19c4951ef59ad8411f0122bdb7a116383460ce", + "target_sha256": "84ea74d3498442c313bc318f0d19c4951ef59ad8411f0122bdb7a116383460ce", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/relational_bridge.py", + "target": "human/english/english_gonol/language/relational_bridge.py", + "kind": "runtime", + "source_sha256": "bceb4efc4730b2c7fc5ce8cb6f4d9334deeddb27905b79d273ce9ad3204b58eb", + "target_sha256": "bceb4efc4730b2c7fc5ce8cb6f4d9334deeddb27905b79d273ce9ad3204b58eb", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/rendering.py", + "target": "human/english/english_gonol/language/rendering.py", + "kind": "runtime", + "source_sha256": "83a1b8c8fb31c7bc64a857b7f57a67079e01daa19f0d7e1d74cd501b61b0ec20", + "target_sha256": "83a1b8c8fb31c7bc64a857b7f57a67079e01daa19f0d7e1d74cd501b61b0ec20", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/source.py", + "target": "human/english/english_gonol/language/source.py", + "kind": "runtime", + "source_sha256": "beb4d86f9c2a2879d3f63f4b73867af19edf33a2fdd6fea32e4e6e14c6b4ae2f", + "target_sha256": "beb4d86f9c2a2879d3f63f4b73867af19edf33a2fdd6fea32e4e6e14c6b4ae2f", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/language/suffixiation.py", + "target": "human/english/english_gonol/language/suffixiation.py", + "kind": "runtime", + "source_sha256": "c5909df6fa8b78c5cc2dfb28dd17e53c245c07eaad9714e045cd5167db386e84", + "target_sha256": "c5909df6fa8b78c5cc2dfb28dd17e53c245c07eaad9714e045cd5167db386e84", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/motion_run.py", + "target": "human/english/english_gonol/motion_run.py", + "kind": "runtime", + "source_sha256": "cda7e65e0923782e3d78e88650522bc56dc95be8b2c9335ee705fa5080a050b3", + "target_sha256": "cda7e65e0923782e3d78e88650522bc56dc95be8b2c9335ee705fa5080a050b3", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/ordinal_construction.py", + "target": "human/english/english_gonol/ordinal_construction.py", + "kind": "runtime", + "source_sha256": "5b43d0efe7661cda69b2fd2c50998834795adb4467febb7a9d7a3d54883a3da7", + "target_sha256": "5b43d0efe7661cda69b2fd2c50998834795adb4467febb7a9d7a3d54883a3da7", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/orthogonal_carrier_sweep.py", + "target": "human/english/english_gonol/orthogonal_carrier_sweep.py", + "kind": "runtime", + "source_sha256": "48c1526d6a77caa6a8d838b9ee036d79243add70468527c7d400e55fb7daf773", + "target_sha256": "48c1526d6a77caa6a8d838b9ee036d79243add70468527c7d400e55fb7daf773", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/primitive_layer_run.py", + "target": "human/english/english_gonol/primitive_layer_run.py", + "kind": "runtime", + "source_sha256": "82a9c18dc08c62e6230a05d449cbbd353631b3f9cd76912cb0c188f46b5d0c30", + "target_sha256": "82a9c18dc08c62e6230a05d449cbbd353631b3f9cd76912cb0c188f46b5d0c30", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/structural_construct.py", + "target": "human/english/english_gonol/structural_construct.py", + "kind": "runtime", + "source_sha256": "8920759980c590719ff19a4a23906775b4058bda7f95f915a1621b1d56af18f4", + "target_sha256": "8920759980c590719ff19a4a23906775b4058bda7f95f915a1621b1d56af18f4", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/structural_query.py", + "target": "human/english/english_gonol/structural_query.py", + "kind": "runtime", + "source_sha256": "3a97e971825468347ab76a44a3203ed0ce706ca0293836ffd4cc0d223d2987be", + "target_sha256": "3a97e971825468347ab76a44a3203ed0ce706ca0293836ffd4cc0d223d2987be", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/structural_rules.py", + "target": "human/english/english_gonol/structural_rules.py", + "kind": "runtime", + "source_sha256": "4686f6a847dd0cee24e3f0a05154a71203a1d4c790922952f9876a38f017db70", + "target_sha256": "4686f6a847dd0cee24e3f0a05154a71203a1d4c790922952f9876a38f017db70", + "adaptation": null + }, + { + "source": "research/english-gonol/english_gonol/system_set_trajectory.py", + "target": "human/english/english_gonol/system_set_trajectory.py", + "kind": "runtime", + "source_sha256": "62ba0b8ac30b5ec13781344ea2996622ece8af8c226a59eb4f676aaa4c50c388", + "target_sha256": "62ba0b8ac30b5ec13781344ea2996622ece8af8c226a59eb4f676aaa4c50c388", + "adaptation": null + }, + { + "source": "research/python-gonol/python_gonol/__init__.py", + "target": "programming/python/python_gonol/__init__.py", + "kind": "runtime", + "source_sha256": "93ce032c0d9438c424d76f2c8e2dabaa0bb7eb5e4dda5f4942e6bb0792885f06", + "target_sha256": "93ce032c0d9438c424d76f2c8e2dabaa0bb7eb5e4dda5f4942e6bb0792885f06", + "adaptation": null + }, + { + "source": "research/python-gonol/python_gonol/__main__.py", + "target": "programming/python/python_gonol/__main__.py", + "kind": "runtime", + "source_sha256": "80279c9acef41aa8bab806219b4d219b83d52c94e4bd98b225d580e0b49347cf", + "target_sha256": "80279c9acef41aa8bab806219b4d219b83d52c94e4bd98b225d580e0b49347cf", + "adaptation": null + }, + { + "source": "research/python-gonol/python_gonol/construct.py", + "target": "programming/python/python_gonol/construct.py", + "kind": "runtime", + "source_sha256": "e13b6d4b7d0af580225ee95e8ab7ee0ac41791e5f45eb171f11d048f687e8265", + "target_sha256": "e13b6d4b7d0af580225ee95e8ab7ee0ac41791e5f45eb171f11d048f687e8265", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_describing_graph.py", + "target": "human/english/tests/test_describing_graph.py", + "kind": "test", + "source_sha256": "2b697538afb7e40cef548e5c3d3ea3933f235f91c708f55541bff0c9a332c96b", + "target_sha256": "2b697538afb7e40cef548e5c3d3ea3933f235f91c708f55541bff0c9a332c96b", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_displacement_operator.py", + "target": "human/english/tests/test_displacement_operator.py", + "kind": "test", + "source_sha256": "90492723ad52787b7b457ba658abd3ec1e6293d1013a78f28b3f3bba67e0732d", + "target_sha256": "90492723ad52787b7b457ba658abd3ec1e6293d1013a78f28b3f3bba67e0732d", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_displacement_operator_options.py", + "target": "human/english/tests/test_displacement_operator_options.py", + "kind": "test", + "source_sha256": "4c098a649a22ad82182ba17735a94d87b5e37446561270fae0fc5b7fb111e6e8", + "target_sha256": "4c098a649a22ad82182ba17735a94d87b5e37446561270fae0fc5b7fb111e6e8", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_edcm_metric_origins.py", + "target": "human/english/tests/test_edcm_metric_origins.py", + "kind": "test", + "source_sha256": "d663d1f3b20e6930010f7223f0661a94d9fce2a22af38f7cc16d4c29c10fccca", + "target_sha256": "69065bc1fc9f8cc8c57b70454b351676a30438dccd01268a39585014244ec397", + "adaptation": "Replace Stack manifest-projection assertion with packaged producer-registration assertion; original forge assertion remains in Stack." + }, + { + "source": "research/english-gonol/tests/test_hilbert_inference.py", + "target": "human/english/tests/test_hilbert_inference.py", + "kind": "test", + "source_sha256": "0fcc03bb99c566ac8e961d60bb10d05b53f59e5f433f9e2a93f95994a47df64e", + "target_sha256": "0fcc03bb99c566ac8e961d60bb10d05b53f59e5f433f9e2a93f95994a47df64e", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_hyperspace_geometry.py", + "target": "human/english/tests/test_hyperspace_geometry.py", + "kind": "test", + "source_sha256": "7a315eba74b1d2e705abb9ed8de8e7574edd1ec4eb81b8cd853138e2acbfb8ef", + "target_sha256": "7a315eba74b1d2e705abb9ed8de8e7574edd1ec4eb81b8cd853138e2acbfb8ef", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_hyperspace_views.py", + "target": "human/english/tests/test_hyperspace_views.py", + "kind": "test", + "source_sha256": "6ba59517422f5ac46e0213f65b6ba1b3bd902c83e41a7b388855b4e941f7c4b7", + "target_sha256": "6ba59517422f5ac46e0213f65b6ba1b3bd902c83e41a7b388855b4e941f7c4b7", + "adaptation": null + }, + { + "source": "research/english-gonol/tests/test_system_set_trajectory.py", + "target": "human/english/tests/test_system_set_trajectory.py", + "kind": "test", + "source_sha256": "c5576e389191b43b073f61723104fa751c0522d63391bcc87dc1370c86234d83", + "target_sha256": "ed668b374c718fa6fc41872ebebe78dba591492f2a9552f1508606803bf60b32", + "adaptation": "Move exact Git source provenance assertion to the complete package extraction verifier; preserve all trajectory behavior assertions." + } + ], + "forge_only": { + "research/english-gonol/english_gonol/full_view_audit.py": "Frozen Stack audit runner; reads Stack protocol, graph and source inventory.", + "research/english-gonol/english_gonol/view_replay.py": "Independent view reconstruction helper owned by the Stack audit." + } +} diff --git a/docs/work-graphs/package-extraction-v1.json b/docs/work-graphs/package-extraction-v1.json new file mode 100644 index 0000000..2fba21c --- /dev/null +++ b/docs/work-graphs/package-extraction-v1.json @@ -0,0 +1,56 @@ +{ + "schema": "the-interdependency.stack-manifest", + "version": "1.0.0", + "work_graph_sha256": "8eaf4849f262e49f956aa9e43e3c4330669b368154e0f48ffa6dbc4d9c26252e", + "repositories": [ + { + "repository": "The-Interdependency/uchc", + "commit": "a4a3826c9585c612e83e079eeed5715a579e8cec", + "authority": "extracted candidate; implementation transfer incomplete", + "relation": "pre-extraction baseline for package-completeness repair" + }, + { + "repository": "The-Interdependency/stack", + "commit": "ca69c60032a079585ccb89d5cc7aba67f637df55", + "authority": "current English/Python implementation and public-contract forge", + "relation": "exact source for the complete runtime extraction and eight migrated test files" + }, + { + "repository": "The-Interdependency/ucns", + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "authority": "geometry and mathematical representation", + "relation": "recursive geometry producer; older geometry profiles retain their own exact pins" + }, + { + "repository": "The-Interdependency/edcm", + "commit": "0873c105799681ea1f7ccb3e619d1f7aebbd85e0", + "authority": "EDCM metric semantics and measurement", + "relation": "exact semantic metric-origin fixture; packaging does not change or validate its measurement claims" + }, + { + "repository": "The-Interdependency/metapat", + "commit": "1cdfb09dd00a451cee30eec2e78624df8c682662", + "authority": "semantic distinctions for state, vector and transformation", + "relation": "constrains placement of vector/state language without supplying Hilbert mathematics" + }, + { + "repository": "The-Interdependency/skill-lib", + "commit": "38c64332b840b2bbe1c07e53aeee8996644548e9", + "authority": "reusable build and evidence discipline", + "relation": "governs this graph's schema, digest and authority boundaries through the propagated interdependent-work-graph contract" + } + ], + "boundaries": { + "authority_transfer": false, + "proof_status_transfer": false, + "measurement_status_transfer": false, + "semantic_mapping": "declared mapping", + "agent_scope": "cross-repository-work-graph", + "hmmm": [ + "Stable publication, published-artifact reconsumption and scoped authority transition remain incomplete.", + "Canonical Hilbert scalar field and cross-origin geometry remain unresolved; callers must choose the existing explicit field.", + "The input-frame bridge remains unimplemented.", + "GitHub hosted verification is blocked by account billing; local evidence is recorded separately." + ] + } +} diff --git a/human/english/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json b/human/english/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json new file mode 100644 index 0000000..244f58c --- /dev/null +++ b/human/english/english_gonol/data/EDCM_METRIC_ORIGINS_SOURCE.json @@ -0,0 +1,206 @@ +{ + "schema": "edcm.metric-origin-spec-fixture", + "version": "0.4.0", + "producer_repository": "The-Interdependency/edcm", + "producer_commit": "0873c105799681ea1f7ccb3e619d1f7aebbd85e0", + "specs": { + "C": { + "surface_terms": [ + "Constraint Strain" + ], + "semantic_definition": "constraint strain is pressure produced by contradiction within the measured window", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "implicit contradiction semantics are not measured by the maintained proxy" + ], + "construction_terms": [ + "constraint", + "strain", + "contradiction", + "pressure" + ], + "canonical_metric_id": "edcm.behavioral.C.constraint_strain" + }, + "R": { + "surface_terms": [ + "Refusal Density" + ], + "semantic_definition": "refusal density is the concentration of refusal relative to active constraint statements", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "implemented denominator is token-count scale, not counted constraint statements" + ], + "construction_terms": [ + "refusal", + "density", + "refusal", + "constraint" + ], + "canonical_metric_id": "edcm.behavioral.R.refusal_density" + }, + "F": { + "surface_terms": [ + "Fixation" + ], + "semantic_definition": "fixation is persistence of substantially the same constraint-bearing pattern across successive states", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "maintained implementation is a lexical structural proxy, not embedding similarity" + ], + "construction_terms": [ + "fixation", + "persistence", + "repetition" + ], + "canonical_metric_id": "edcm.behavioral.F.fixation" + }, + "E": { + "surface_terms": [ + "Escalation" + ], + "semantic_definition": "escalation is positive change in commitment or constraint intensity across sequence", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "maintained implementation does not directly compute commitment-intensity derivative" + ], + "construction_terms": [ + "escalation", + "increase", + "commitment", + "intensity" + ], + "canonical_metric_id": "edcm.behavioral.E.escalation" + }, + "D": { + "surface_terms": [ + "Deflection" + ], + "semantic_definition": "deflection is movement away from the active constraint-bearing subject or relation", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "prior-round lexical overlap substitutes for active-constraint topic tracking" + ], + "construction_terms": [ + "deflection", + "movement", + "away", + "constraint" + ], + "canonical_metric_id": "edcm.behavioral.D.deflection" + }, + "N": { + "surface_terms": [ + "Noise" + ], + "semantic_definition": "noise is activity that consumes representational space without proportionate constraint resolution", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "maintained implementation measures repetition and entropy rather than resolution ratio" + ], + "construction_terms": [ + "noise", + "repetition", + "without", + "resolution" + ], + "canonical_metric_id": "edcm.behavioral.N.noise" + }, + "I": { + "surface_terms": [ + "Integration Failure" + ], + "semantic_definition": "integration failure is failure of a correction or newly supplied constraint to alter subsequent behavior accordingly", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "maintained implementation does not observe subsequent integration behavior" + ], + "construction_terms": [ + "integration", + "failure", + "correction", + "change" + ], + "canonical_metric_id": "edcm.behavioral.I.integration" + }, + "O": { + "canonical_metric_id": "edcm.behavioral.O_scope", + "surface_terms": [ + "Scope Motion", + "Overextension" + ], + "semantic_definition": "scope motion is signed boundary change from contraction through stability to expansion or overextension", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "legacy scalar carrier O explicitly targets edcm.behavioral.O_scope; O_confidence is a distinct canonical axis and is not produced by RoundMetrics" + ], + "construction_terms": [ + "scope", + "motion", + "expansion", + "contraction" + ] + }, + "L": { + "canonical_metric_id": "edcm.behavioral.L_loss", + "surface_terms": [ + "Coherence Loss" + ], + "semantic_definition": "coherence loss is signed continuity motion from recovery through stability to degradation", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "legacy scalar carrier L explicitly targets edcm.behavioral.L_loss; L_load and L_resistance are distinct canonical axes" + ], + "construction_terms": [ + "coherence", + "loss", + "continuity", + "degradation" + ] + }, + "P": { + "surface_terms": [ + "Progress" + ], + "semantic_definition": "progress is newly integrated information or state change that advances resolution relative to the prior state", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "progress is explicitly implemented as a proxy" + ], + "construction_terms": [ + "progress", + "novelty", + "change", + "resolution" + ], + "canonical_metric_id": "edcm.round.P_progress" + }, + "kappa": { + "surface_terms": [ + "Stored Tension" + ], + "semantic_definition": "stored tension is unresolved dissonance carried forward as circuit state", + "standing": "resolved", + "measurement_alignment": "proxy", + "unresolved": [ + "resolution function is currently approximated from dissonance" + ], + "construction_terms": [ + "stored", + "tension", + "unresolved", + "conflict" + ], + "canonical_metric_id": "edcm.state.kappa" + } + } +} diff --git a/human/english/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json b/human/english/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json new file mode 100644 index 0000000..f117731 --- /dev/null +++ b/human/english/english_gonol/data/METRIC_ORIGIN_PROVENANCE.json @@ -0,0 +1,8 @@ +{ + "metric_origin_source": { + "repository": "The-Interdependency/edcm", + "commit": "0873c105799681ea1f7ccb3e619d1f7aebbd85e0", + "relation": "exact EDCM semantic metric-origin producer with canonical O/L split; does not refresh the historical extraction source or libs/edcm pin", + "authority_transfer": false + } +} diff --git a/human/english/english_gonol/describing_graph.py b/human/english/english_gonol/describing_graph.py new file mode 100644 index 0000000..4f7b885 --- /dev/null +++ b/human/english/english_gonol/describing_graph.py @@ -0,0 +1,231 @@ +# === MODULE_BUILD === +# id: english_gonol_describing_graph +# module_name: describing_graph +# module_kind: instrument +# summary: the external 3-axis describing graph with evidence channels x, y, z; describes the construct from outside, shares no origin +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, DescribingGraphError, describe_word, describing_graph_receipt, verify_describing_graph_replay +# internal_surface: residue channel extraction, external projection, streaming aggregate receipt +# auth_boundary: none +# storage_boundary: aggregate receipts only; projections recomputed on demand +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_describing_graph +# rollout: external description instrument; never merged with any construct origin +# rollback: remove this module, facade exports, tests, and candidate documentation +# requires: english_gonol_full_construct (v2 compact construct) +# since: 2026-09-23 +# unresolved: projection semantics are measurement only; the describing graph defines no construct geometry +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: describing_graph_is_external +# given: a word gonol +# then: the describing graph returns x, y, z residue projections and never claims membership in O_G, O_W, or O_D +# class: doctrine +# since: 2026-09-23 +# +# id: describing_graph_channels_are_construction_derived +# given: a word gonol +# then: x is the word occurrence ordinal, y is the first semantic evidence target, and z is the definition count +# class: correctness +# since: 2026-09-23 +# +# id: describing_graph_fails_closed +# given: malformed input or a malformed receipt +# then: the instrument raises DescribingGraphError rather than inventing coordinates +# class: safety +# since: 2026-09-23 +# === END CONTRACTS === + +"""The external 3-axis describing graph. + +Axes x, y, z are the three evidence residue channels. The graph describes +the construct from outside; it shares no origin with the glyph, word, or +definition origins. +""" + +from __future__ import annotations + +import hashlib +import json +import sqlite3 +from pathlib import Path +from typing import Any + +SCHEMA = "english-gonol.describing-graph" +VERSION = "0.1.0" +_MODULUS = 157 + + +class DescribingGraphError(ValueError): + """Raised when the describing graph fails closed.""" + + +def _open_db(state_dir: Path) -> sqlite3.Connection: + db_path = Path(state_dir) / "construct.db" + if not db_path.exists(): + raise DescribingGraphError(f"construct.db not found under {state_dir}") + return sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + + +def _receipt(payload: dict[str, Any]) -> str: + return hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + + +def _semantic_map(db: sqlite3.Connection) -> dict[int, int]: + """First semantic evidence target per definition, one linear scan.""" + + targets: dict[int, int] = {} + for definition_id, target_word_id in db.execute( + "SELECT definition_id, target_word_id FROM semantic_evidence ORDER BY definition_id, id" + ).fetchall(): + targets.setdefault(definition_id, target_word_id) + return targets + + +def _first_definition_ids(db: sqlite3.Connection) -> dict[int, int]: + """First definition id per origin word, one linear scan.""" + + first: dict[int, int] = {} + for definition_id, origin_word_id in db.execute( + "SELECT id, origin_word_id FROM definitions ORDER BY origin_word_id, ordinal" + ).fetchall(): + first.setdefault(origin_word_id, definition_id) + return first + + +def describe_word(db: sqlite3.Connection, word_id: int) -> dict[str, Any]: + """Project one word onto the external x, y, z residue channels.""" + + row = db.execute("SELECT surface FROM words WHERE id = ?", (word_id,)).fetchone() + if row is None: + raise DescribingGraphError(f"word {word_id} is not constructed") + definition_count = db.execute( + "SELECT COUNT(*) FROM definitions WHERE origin_word_id = ?", (word_id,) + ).fetchone()[0] + first_definition_id = db.execute( + "SELECT id FROM definitions WHERE origin_word_id = ? ORDER BY ordinal LIMIT 1", + (word_id,), + ).fetchone() + semantic = 0 + if first_definition_id is not None: + target = db.execute( + "SELECT target_word_id FROM semantic_evidence WHERE definition_id = ? ORDER BY id LIMIT 1", + (first_definition_id[0],), + ).fetchone() + semantic = target[0] if target else 0 + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "surface": row[0], + "x": word_id % _MODULUS, + "y": semantic % _MODULUS, + "z": definition_count % _MODULUS, + "origin": "external describing graph; shares no origin with O_G, O_W, or O_D", + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +def describing_graph_receipt( + state_dir: Path, *, limit: int | None = None +) -> dict[str, Any]: + """Stream the full describing graph and return the aggregate receipt.""" + + db = _open_db(state_dir) + try: + rows = db.execute("SELECT id FROM words ORDER BY id").fetchall() + words = [row[0] for row in rows[:limit]] if limit is not None else [row[0] for row in rows] + semantic_map = _semantic_map(db) + first_defs = _first_definition_ids(db) + definition_counts = dict( + db.execute( + "SELECT origin_word_id, COUNT(*) FROM definitions GROUP BY origin_word_id" + ).fetchall() + ) + surfaces = dict(db.execute("SELECT id, surface FROM words").fetchall()) + digest = hashlib.sha256() + x_sum = 0 + y_sum = 0 + z_sum = 0 + for word_id in words: + definition_count = definition_counts.get(word_id, 0) + semantic = semantic_map.get(first_defs.get(word_id, -1), 0) + record = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "surface": surfaces.get(word_id), + "x": word_id % _MODULUS, + "y": semantic % _MODULUS, + "z": definition_count % _MODULUS, + "origin": "external describing graph; shares no origin with O_G, O_W, or O_D", + } + record["receipt_sha256"] = _receipt(record) + x_sum += record["x"] + y_sum += record["y"] + z_sum += record["z"] + digest.update( + json.dumps(record, sort_keys=True, separators=(",", ":")).encode("utf-8") + ) + finally: + db.close() + + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_count": len(words), + "limit": limit, + "x_channel_sum": x_sum, + "y_channel_sum": y_sum, + "z_channel_sum": z_sum, + "external": True, + "hmmm": ( + "the describing graph projects the residue channels from outside; " + "it defines no construct geometry and shares no origin" + ), + } + payload["receipt_sha256"] = hashlib.sha256( + digest.digest() + + json.dumps( + {key: value for key, value in payload.items() if key != "receipt_sha256"}, + sort_keys=True, + separators=(",", ":"), + ).encode("utf-8") + ).hexdigest() + return payload + + +def verify_describing_graph_replay(data: bytes, state_dir: Path) -> dict[str, Any]: + """Recompute the describing graph receipt and verify byte-identically.""" + + if not isinstance(data, bytes): + raise DescribingGraphError("receipt must be bytes") + try: + obj = json.loads(data.decode("utf-8")) + except (UnicodeDecodeError, json.JSONDecodeError) as exc: + raise DescribingGraphError("receipt is not valid canonical JSON") from exc + if obj.get("schema") != SCHEMA or obj.get("version") != VERSION: + raise DescribingGraphError("receipt schema or version mismatch") + rebuilt = describing_graph_receipt(state_dir, limit=obj.get("limit")) + if rebuilt["receipt_sha256"] != obj.get("receipt_sha256"): + raise DescribingGraphError("receipt digest does not match recomputation") + rebuilt_bytes = json.dumps(rebuilt, sort_keys=True, separators=(",", ":")).encode("utf-8") + if rebuilt_bytes != data: + raise DescribingGraphError("receipt does not replay byte-identically") + return rebuilt + + +__all__ = [ + "SCHEMA", + "VERSION", + "DescribingGraphError", + "describe_word", + "describing_graph_receipt", + "verify_describing_graph_replay", +] diff --git a/human/english/english_gonol/displacement_operator.py b/human/english/english_gonol/displacement_operator.py new file mode 100644 index 0000000..131bd67 --- /dev/null +++ b/human/english/english_gonol/displacement_operator.py @@ -0,0 +1,375 @@ +# === MODULE_BUILD === +# id: english_gonol_displacement_operator +# module_name: displacement_operator +# module_kind: candidate +# summary: word-level displacement operator D_O_W over the word origin - each word displaces by its own construction-derived channels under the selected lifted displacement and provenance-interval lift +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, UCNS_OPERATOR_COMMIT, UCNS_LIFT_SELECTION_MODULE_SHA256, UCNS_MOTION_MODULE_SHA256, UCNS_LIFTED_DISPLACEMENT_MODULE_SHA256, DisplacementOperatorError, apply_word_displacement, iterate_word_displacement, run_displacement_operator_controls, displacement_operator_receipt +# internal_surface: verified UCNS consumption, channel extraction, provenance lift, deterministic receipts +# auth_boundary: none +# storage_boundary: aggregate receipts only; per-word displacements recomputed on demand +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_displacement_operator +# rollout: candidate displacement operator inside the construct; the describing graph measures and never moves +# rollback: remove this module, facade exports, tests, and candidate documentation +# requires: english_gonol_full_construct (v2), ucns_lift_selection (pinned), ucns_motion (pinned) +# since: 2026-09-27 +# unresolved: operator candidate standing; selection follows preregistered controls +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: displacement_operator_uses_selected_laws +# given: one word gonol +# then: the operator advances by the selected lifted displacement and selects the lift by the provenance-interval law +# class: correctness +# since: 2026-09-27 +# +# id: displacement_operator_closes_inside_word_origin +# given: one word gonol +# then: the displaced position remains a word-origin position; no cross-origin coordinate is produced +# class: doctrine +# since: 2026-09-27 +# +# id: displacement_operator_iteration_is_deck_translation +# given: n-fold application of the operator +# then: the lift advances by n decks exactly +# class: correctness +# since: 2026-09-27 +# +# id: displacement_operator_fails_closed +# given: malformed input, source drift, or a malformed receipt +# then: the operator raises DisplacementOperatorError rather than inventing motion +# class: safety +# since: 2026-09-27 +# === END CONTRACTS === + +"""Word-level displacement operator over the word origin. + +D_O_W(w) displaces word w by its own construction-derived channels: + +* ordinal = word id, +* semantic = first semantic-evidence target word id, +* context = definition count. + +The operator advances the word's NativeMobiusState by the selected lifted +displacement and selects the lift by the provenance-interval law. It acts +inside the construct; the external describing graph measures the channels +and never moves. +""" + +from __future__ import annotations + +import hashlib +import json +import sqlite3 +import subprocess +import sys +from pathlib import Path +from typing import Any + +SCHEMA = "english-gonol.displacement-operator" +VERSION = "0.1.0" +_MODULUS = 157 + +UCNS_OPERATOR_COMMIT = "5a042416ef62abd9b674523284c2a31193918d66" +UCNS_MOTION_MODULE_SHA256 = "5fc2b40967ab9da9cc805935d169d04a4b09594267c16df9959e9a566aa6b541" +UCNS_LIFTED_DISPLACEMENT_MODULE_SHA256 = "670c4e41f130b2d6b2439ee17c65bc699985d18e36d4958edbdb06e445c2c037" +UCNS_LIFT_SELECTION_MODULE_SHA256 = "e9be3f8668bd98170cf5820e1b0c679d1a98bf9c8984a6eab987a1209dda3fc1" + + +class DisplacementOperatorError(ValueError): + """Raised when the displacement operator fails closed.""" + + +def _open_db(state_dir: Path) -> sqlite3.Connection: + db_path = Path(state_dir) / "construct.db" + if not db_path.exists(): + raise DisplacementOperatorError(f"construct.db not found under {state_dir}") + return sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + + +def _sha256(path: Path) -> str: + return hashlib.sha256(path.read_bytes()).hexdigest() + + +_ucns_cache: dict[Path, tuple[Any, Any, Any]] = {} + + +def _load_verified_ucns(ucns_source_root: Path) -> tuple[Any, Any, Any]: + root = Path(ucns_source_root) + if root in _ucns_cache: + return _ucns_cache[root] + motion = root / "src" / "ucns" / "motion.py" + lifted = root / "src" / "ucns" / "lifted_displacement.py" + lift_sel = root / "src" / "ucns" / "lift_selection.py" + for path, digest, name in ( + (motion, UCNS_MOTION_MODULE_SHA256, "motion.py"), + (lifted, UCNS_LIFTED_DISPLACEMENT_MODULE_SHA256, "lifted_displacement.py"), + (lift_sel, UCNS_LIFT_SELECTION_MODULE_SHA256, "lift_selection.py"), + ): + if not path.exists(): + raise DisplacementOperatorError(f"ucns {name} missing under {root}") + if _sha256(path) != digest: + raise DisplacementOperatorError(f"ucns {name} bytes do not match the pinned commit") + try: + subprocess.run( + ["git", "-C", str(root), "merge-base", "--is-ancestor", UCNS_OPERATOR_COMMIT, "HEAD"], + check=True, + capture_output=True, + ) + except subprocess.CalledProcessError as exc: + raise DisplacementOperatorError("ucns checkout does not contain the pinned operator commit") from exc + package = root / "src" + sys.path.insert(0, str(package)) + try: + from ucns.motion import build_motion # type: ignore + from ucns.lift_selection import build_provenance_interval_lift # type: ignore + finally: + sys.path.pop(0) + loaded = (build_motion, build_provenance_interval_lift) + _ucns_cache[root] = loaded + return loaded + + +def _channels(db: sqlite3.Connection, word_id: int) -> tuple[int, int, int]: + row = db.execute("SELECT surface FROM words WHERE id = ?", (word_id,)).fetchone() + if row is None: + raise DisplacementOperatorError(f"word {word_id} is not constructed") + definition_count = db.execute( + "SELECT COUNT(*) FROM definitions WHERE origin_word_id = ?", (word_id,) + ).fetchone()[0] + first_def = db.execute( + "SELECT id FROM definitions WHERE origin_word_id = ? ORDER BY ordinal LIMIT 1", + (word_id,), + ).fetchone() + semantic = 0 + if first_def is not None: + target = db.execute( + "SELECT target_word_id FROM semantic_evidence WHERE definition_id = ? ORDER BY id LIMIT 1", + (first_def[0],), + ).fetchone() + semantic = target[0] if target else 0 + return word_id, semantic, definition_count + + +def apply_word_displacement( + db: sqlite3.Connection, + word_id: int, + ucns_source_root: Path, + *, + iterations: int = 1, +) -> dict[str, Any]: + """Apply D_O_W to one word; iterations advance decks exactly.""" + + if isinstance(iterations, bool) or not isinstance(iterations, int) or iterations < 0: + raise DisplacementOperatorError("iterations must be a nonnegative integer") + build_motion, build_lift = _load_verified_ucns(Path(ucns_source_root)) + ordinal, semantic, context = _channels(db, word_id) + motion = build_motion(((ordinal, semantic, context),)) + phase_num = int(motion.end_phase.numerator) + residue = phase_num % _MODULUS + source_ordinal = word_id + iterations * _MODULUS + if residue == 0: + lift_value = None + lift_deck = None + lift_note = "a ≡ 0 (mod 157) has no bijective lift; lift unresolved" + else: + lift = build_lift(source_ordinal, residue) + lift_value = lift["lift"] + lift_deck = source_ordinal // _MODULUS + lift_note = None + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "surface": db.execute("SELECT surface FROM words WHERE id = ?", (word_id,)).fetchone()[0], + "channels": {"ordinal": ordinal, "semantic": semantic, "context": context}, + "iterations": iterations, + "end_phase": f"{motion.end_phase.numerator}/{motion.end_phase.denominator}", + "end_frame": motion.end_frame, + "lift": lift_value, + "lift_deck": lift_deck, + "lift_note": lift_note, + "closure": "word origin O_W; no cross-origin coordinate", + } + payload["receipt_sha256"] = hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + return payload + + +def iterate_word_displacement( + db: sqlite3.Connection, word_id: int, ucns_source_root: Path, iterations: int +) -> dict[str, Any]: + """N-fold operator application.""" + + return apply_word_displacement(db, word_id, ucns_source_root, iterations=iterations) + + +def run_displacement_operator_controls( + state_dir: Path, ucns_source_root: Path +) -> dict[str, Any]: + """Run the preregistered operator controls on the fixture corpus.""" + + db = _open_db(state_dir) + try: + results: dict[str, dict[str, Any]] = {} + # identity: zero channels displace to zero turn and the identity lift + identity = db.execute("SELECT id FROM words ORDER BY id LIMIT 1").fetchone() + if identity is None: + raise DisplacementOperatorError("fixture has no words") + # determinism + first = apply_word_displacement(db, identity[0], ucns_source_root) + second = apply_word_displacement(db, identity[0], ucns_source_root) + results["determinism"] = { + "ok": first["receipt_sha256"] == second["receipt_sha256"], + "detail": "same word, same receipt", + } + # iteration is deck translation + once = apply_word_displacement(db, identity[0], ucns_source_root, iterations=1) + twice = apply_word_displacement(db, identity[0], ucns_source_root, iterations=2) + results["iteration-deck-translation"] = { + "ok": twice["lift"] == once["lift"] + _MODULUS, + "detail": "two iterations advance the lift by one deck", + } + # closure: no cross-origin coordinate + results["closure"] = { + "ok": "O_W" in first["closure"], + "detail": first["closure"], + } + # external invariance: channels do not change under iteration + results["external-channel-invariance"] = { + "ok": once["channels"] == twice["channels"], + "detail": "the describing graph channels are unchanged by displacement", + } + finally: + db.close() + + ok = all(case["ok"] for case in results.values()) + payload = { + "schema": SCHEMA, + "version": VERSION, + "results": results, + "ok": ok, + "hmmm": ( + "the operator candidate acts inside the construct; the describing " + "graph measures and never moves; selection follows preregistered " + "controls, not this report" + ), + } + payload["receipt_sha256"] = hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + return payload + + +def _channel_maps(db: sqlite3.Connection) -> tuple[dict[int, str], dict[int, int], dict[int, int]]: + surfaces = dict(db.execute("SELECT id, surface FROM words").fetchall()) + definition_counts = dict( + db.execute( + "SELECT origin_word_id, COUNT(*) FROM definitions GROUP BY origin_word_id" + ).fetchall() + ) + first_defs: dict[int, int] = {} + for definition_id, origin_word_id in db.execute( + "SELECT id, origin_word_id FROM definitions ORDER BY origin_word_id, ordinal" + ).fetchall(): + first_defs.setdefault(origin_word_id, definition_id) + semantic_targets: dict[int, int] = {} + for definition_id, target_word_id in db.execute( + "SELECT definition_id, target_word_id FROM semantic_evidence ORDER BY definition_id, id" + ).fetchall(): + semantic_targets.setdefault(definition_id, target_word_id) + return surfaces, definition_counts, { + word_id: semantic_targets.get(first_defs.get(word_id, -1), 0) + for word_id in surfaces + } + + +def displacement_operator_receipt( + state_dir: Path, + ucns_source_root: Path, + *, + limit: int | None = None, +) -> dict[str, Any]: + """Stream the operator over the corpus and return an aggregate receipt.""" + + db = _open_db(state_dir) + try: + build_motion, build_lift = _load_verified_ucns(Path(ucns_source_root)) + rows = db.execute("SELECT id FROM words ORDER BY id").fetchall() + words = [row[0] for row in rows[:limit]] if limit is not None else [row[0] for row in rows] + surfaces, definition_counts, semantic_by_word = _channel_maps(db) + digest = hashlib.sha256() + for word_id in words: + ordinal = word_id + semantic = semantic_by_word.get(word_id, 0) + context = definition_counts.get(word_id, 0) + motion = build_motion(((ordinal, semantic, context),)) + phase_num = int(motion.end_phase.numerator) + residue = phase_num % _MODULUS + if residue == 0: + lift_value = None + lift_deck = None + lift_note = "a ≡ 0 (mod 157) has no bijective lift; lift unresolved" + else: + lift = build_lift(word_id, residue) + lift_value = lift["lift"] + lift_deck = word_id // _MODULUS + lift_note = None + record = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "surface": surfaces.get(word_id), + "channels": {"ordinal": ordinal, "semantic": semantic, "context": context}, + "iterations": 1, + "end_phase": f"{motion.end_phase.numerator}/{motion.end_phase.denominator}", + "end_frame": motion.end_frame, + "lift": lift_value, + "lift_deck": lift_deck, + "lift_note": lift_note, + "closure": "word origin O_W; no cross-origin coordinate", + } + record["receipt_sha256"] = hashlib.sha256( + json.dumps(record, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + digest.update( + json.dumps(record, sort_keys=True, separators=(",", ":")).encode("utf-8") + ) + finally: + db.close() + + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_count": len(words), + "limit": limit, + "hmmm": "candidate standing; selection follows preregistered controls", + } + payload["receipt_sha256"] = hashlib.sha256( + digest.digest() + + json.dumps( + {key: value for key, value in payload.items() if key != "receipt_sha256"}, + sort_keys=True, + separators=(",", ":"), + ).encode("utf-8") + ).hexdigest() + return payload + + +__all__ = [ + "SCHEMA", + "VERSION", + "UCNS_OPERATOR_COMMIT", + "UCNS_MOTION_MODULE_SHA256", + "UCNS_LIFTED_DISPLACEMENT_MODULE_SHA256", + "UCNS_LIFT_SELECTION_MODULE_SHA256", + "DisplacementOperatorError", + "apply_word_displacement", + "iterate_word_displacement", + "run_displacement_operator_controls", + "displacement_operator_receipt", +] diff --git a/human/english/english_gonol/displacement_operator_options.py b/human/english/english_gonol/displacement_operator_options.py new file mode 100644 index 0000000..55b4506 --- /dev/null +++ b/human/english/english_gonol/displacement_operator_options.py @@ -0,0 +1,242 @@ +# === MODULE_BUILD === +# id: english_gonol_displacement_operator_options +# module_name: displacement_operator_options +# module_kind: adjudication +# summary: three channel-mapping options for D_O_W, adjudicated by identity preservation and displacement distinctness +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, DisplacementOperatorOptionsError, channel_option_a, channel_option_b, channel_option_c, apply_option_displacement, run_channel_option_adjudication +# internal_surface: option builders, identity-preservation check, distinctness/collision counts, selection receipt +# auth_boundary: none +# storage_boundary: aggregate receipts only; per-word options recomputed on demand +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_displacement_operator_options +# rollout: where options exist, build them; select what works by preserving the identity +# rollback: remove this module, facade exports, tests, and candidate documentation +# requires: english_gonol_displacement_operator, english_gonol_hyperspace_views +# since: 2026-09-27 +# unresolved: selection is by the stated criterion (identity preservation, then distinctness), not by geometry preference +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: channel_options_are_built +# given: one word gonol +# then: exactly three channel-mapping options are available and each is construction-derived +# class: correctness +# since: 2026-09-27 +# +# id: channel_option_selection_preserves_identity +# given: a corpus sweep +# then: an option is selected only if its channel tuple is injective over the swept words (zero channel collisions) +# class: doctrine +# since: 2026-09-27 +# +# id: channel_option_selection_prefers_distinctness +# given: two identity-preserving options +# then: the option with more distinct displacement receipts is selected +# class: doctrine +# since: 2026-09-27 +# === END CONTRACTS === + +"""Three channel-mapping options for the word displacement operator. + +* option a: ordinal = word id, semantic = first semantic target, context = + definition count (the current default); +* option b: ordinal = word id, semantic = glyph-walk terminal phase + numerator, context = definition-walk terminal phase numerator; +* option c: ordinal = word id, semantic = definition inner-product + shared_sum, context = definition count. + +Selection preserves the identity: a channel tuple must be injective over +the corpus before distinctness is allowed to decide. +""" + +from __future__ import annotations + +import hashlib +import json +import sqlite3 +from pathlib import Path +from typing import Any + +from .displacement_operator import ( + _channel_maps, + _load_verified_ucns, + _open_db, +) +from .hyperspace_views import _definition_density, word_views + +SCHEMA = "english-gonol.displacement-operator-options" +VERSION = "0.1.0" +_MODULUS = 157 + + +class DisplacementOperatorOptionsError(ValueError): + """Raised when the option adjudication fails closed.""" + + +def _receipt(payload: dict[str, Any]) -> str: + return hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + + +_channel_maps_cache: dict[int, tuple[dict[int, str], dict[int, int], dict[int, int]]] = {} + + +def _cached_channel_maps(db: sqlite3.Connection) -> tuple[dict[int, str], dict[int, int], dict[int, int]]: + key = id(db) + if key not in _channel_maps_cache: + _channel_maps_cache[key] = _channel_maps(db) + return _channel_maps_cache[key] + + +def channel_option_a(db: sqlite3.Connection, word_id: int) -> tuple[int, int, int]: + """Option a: ordinal, first semantic target, definition count.""" + + _surfaces, counts, semantic_by_word = _cached_channel_maps(db) + return word_id, semantic_by_word.get(word_id, 0), counts.get(word_id, 0) + + +def channel_option_b(db: sqlite3.Connection, word_id: int, ucns_source_root: Path) -> tuple[int, int, int]: + """Option b: word id, glyph-walk phase numerator, definition-walk phase numerator.""" + + views = word_views(db, word_id, ucns_source_root) + view2 = views["views"]["view2_word_axis_angle"] + glyph_num = int(view2["glyph_walk"]["phase"].split("/")[0]) + def_walk = view2["definition_walk"] + def_num = int(def_walk["end_phase"].split("/")[0]) if def_walk else 0 + return word_id, glyph_num, def_num + + +def channel_option_c(db: sqlite3.Connection, word_id: int) -> tuple[int, int, int]: + """Option c: word id, definition inner-product shared sum, definition count.""" + + density = _definition_density(db, word_id) + shared = density["shared_sum"] if density else 0 + count = density["definition_count"] if density else 0 + return word_id, shared, count + + +def apply_option_displacement( + db: sqlite3.Connection, + word_id: int, + ucns_source_root: Path, + option: str, +) -> dict[str, Any]: + """Apply D_O_W with one named channel-mapping option.""" + + if option == "a": + channels = channel_option_a(db, word_id) + elif option == "b": + channels = channel_option_b(db, word_id, ucns_source_root) + elif option == "c": + channels = channel_option_c(db, word_id) + else: + raise DisplacementOperatorOptionsError(f"unknown option {option!r}") + build_motion, build_lift = _load_verified_ucns(Path(ucns_source_root)) + motion = build_motion((channels,)) + phase_num = int(motion.end_phase.numerator) + residue = phase_num % _MODULUS + if residue == 0: + lift_value = None + lift_deck = None + else: + lift = build_lift(word_id, residue) + lift_value = lift["lift"] + lift_deck = word_id // _MODULUS + payload = { + "schema": SCHEMA, + "version": VERSION, + "option": option, + "word_id": word_id, + "channels": list(channels), + "end_phase": f"{motion.end_phase.numerator}/{motion.end_phase.denominator}", + "end_frame": motion.end_frame, + "lift": lift_value, + "lift_deck": lift_deck, + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +def run_channel_option_adjudication( + state_dir: Path, + ucns_source_root: Path, + *, + limit: int | None = None, +) -> dict[str, Any]: + """Build all options, then select by identity preservation and distinctness.""" + + db = _open_db(state_dir) + try: + rows = db.execute("SELECT id FROM words ORDER BY id").fetchall() + words = [row[0] for row in rows[:limit]] if limit is not None else [row[0] for row in rows] + options: dict[str, dict[str, Any]] = {} + for option in ("a", "b", "c"): + channel_values: set[tuple[int, int, int]] = set() + channel_collisions = 0 + receipts: set[str] = set() + receipt_collisions = 0 + for word_id in words: + record = apply_option_displacement(db, word_id, ucns_source_root, option) + channels = tuple(record["channels"]) + if channels in channel_values: + channel_collisions += 1 + channel_values.add(channels) + receipt = record["receipt_sha256"] + if receipt in receipts: + receipt_collisions += 1 + receipts.add(receipt) + options[option] = { + "channel_collisions": channel_collisions, + "distinct_channels": len(channel_values), + "receipt_collisions": receipt_collisions, + "distinct_receipts": len(receipts), + "identity_preserved": channel_collisions == 0, + } + finally: + db.close() + + identity_preserving = [ + name for name, stats in options.items() if stats["identity_preserved"] + ] + if identity_preserving: + selected = max( + identity_preserving, + key=lambda name: ( + options[name]["distinct_receipts"], + -options[name]["receipt_collisions"], + ), + ) + else: + selected = None + + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_count": len(words), + "options": options, + "identity_preserving": identity_preserving, + "selected": selected, + "criterion": "identity preservation first, then distinctness", + "hmmm": ( + "where options exist, build them; select what works by " + "preserving the identity" + ), + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +__all__ = [ + "SCHEMA", + "VERSION", + "DisplacementOperatorOptionsError", + "channel_option_a", + "channel_option_b", + "channel_option_c", + "apply_option_displacement", + "run_channel_option_adjudication", +] diff --git a/human/english/english_gonol/edcm_metric_origins.py b/human/english/english_gonol/edcm_metric_origins.py new file mode 100644 index 0000000..3852d06 --- /dev/null +++ b/human/english/english_gonol/edcm_metric_origins.py @@ -0,0 +1,280 @@ +"""Construct EDCM metric descriptions as English hyperspace origin sets. + +Only EDCM-owned construction terms enter the semantic origin. Measurement rules +and observed evidence stay outside it. Resolved origins require the exact pinned +English v2 construct receipt; any genuinely unresolved EDCM semantic origin remains unclosed hmmm. + +Usage guidance: see ``docs/metric-origin-space.md`` for source checkout, +complete-corpus construction, export, and EDCM adapter commands. +""" + +# === MODULE_BUILD === +# id: english_edcm_metric_origin_sets_v0 +# module_name: english_gonol.edcm_metric_origins +# module_kind: constructor +# summary: constructs ordered English hyperspace origin sets from EDCM-owned exact construction terms +# owner: Stack English Gonol Construction +# public_surface: MetricOriginSet, OriginComponent, load_metric_origin_specs, build_metric_origin_set +# internal_surface: verified construct identity, exact-run admission, deterministic receipt +# auth_boundary: none +# storage_boundary: read +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: research/english-gonol/tests/test_edcm_metric_origins.py +# rollout: stack-local research candidate +# rollback: remove module fixture and tests; EDCM source specs remain unchanged +# requires: english_gonol_language_hyperspace, english_gonol_full_construct, edcm metric-origin spec fixture +# since: 2026-10-03 +# unresolved: lawful observed-state projection to canonical metric origins remains hmmm +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: metric_origin_words_define_instrument_not_evidence +# given: an EDCM metric origin set is constructed +# then: it contains only source-owned semantic construction and no observation or metric value +# class: boundary_contract +# +# id: metric_origin_preserves_order_identity_provenance +# given: a resolved metric description is admitted by the verified English construct +# then: exact ordered word and whitespace-glyph axes plus producer and verified construct identities survive in the receipt +# class: correctness +# +# id: metric_origin_unresolved_fails_open_as_hmmm_not_closed +# given: the EDCM source spec is hmmm +# then: no semantic components are constructed and closed is false +# class: safety +# +# id: metric_origin_receipt_binds_schema +# given: any metric-origin record is emitted +# then: receipt identity covers schema version and every serialized field except the receipt itself +# class: identity_contract +# +# id: metric_origin_terms_admitted_by_pinned_corpus +# given: resolved EDCM construction terms are compared with the exact pinned OEWN 2025 source +# then: every term is an exact admitted word surface before an origin is licensed +# class: provenance_contract +# +# id: metric_origin_source_fixture_matches_pinned_edcm +# given: the Stack source fixture and exact pinned EDCM producer are inspected +# then: every semantic construction field is identical before Stack constructs an origin +# class: provenance_contract +# === END CONTRACTS === + +from __future__ import annotations +from dataclasses import asdict, dataclass +from hashlib import sha256 +import json +from pathlib import Path +import sqlite3 + +from .full_construct_run import _assert_schema_boundary, _definition_runs, _logical_receipt +from .hyperspace_construct import ( + V2_MANIFEST_RECEIPT, + glyph_inventory, + promote_glyph, + promote_word, +) + +SCHEMA = "english-gonol.edcm-metric-origin-set" +VERSION = "0.2.0" +DATA = Path(__file__).resolve().parent / "data" +# The exact semantic fixture and its registration travel with the package. +# Stack's BASE/manifest projections are checked by the forge tests, not read +# from a caller's workspace at runtime. +FIXTURE = DATA / "EDCM_METRIC_ORIGINS_SOURCE.json" +BASE = DATA / "METRIC_ORIGIN_PROVENANCE.json" +# Bind the complete source projection, not only a caller-supplied commit label. +FIXTURE_SHA256 = "4a769f493af21eb54c0f7d95307237a172e3fd17aaf43e62d6602cd80e0dba5c" + + +def _canonical(value: object) -> bytes: + return json.dumps( + value, sort_keys=True, ensure_ascii=False, + separators=(",", ":"), allow_nan=False, + ).encode("utf-8") + + +@dataclass(frozen=True, slots=True) +class OriginComponent: + ordinal: int + kind: str + surface: str + axis_origin: str + axis_index: int | None + identity: str + + +@dataclass(frozen=True, slots=True) +class MetricOriginSet: + carrier_id: str + metric_id: str + origin_id: str + producer_repository: str + producer_commit: str + construct_receipt: str + source_text: str + components: tuple[OriginComponent, ...] + closed: bool + unresolved: tuple[str, ...] + receipt_sha256: str + + def _payload(self) -> dict[str, object]: + return { + "schema": SCHEMA, + "version": VERSION, + "carrier_id": self.carrier_id, + "metric_id": self.metric_id, + "origin_id": self.origin_id, + "producer_repository": self.producer_repository, + "producer_commit": self.producer_commit, + "construct_receipt": self.construct_receipt, + "source_text": self.source_text, + "components": [asdict(x) for x in self.components], + "closed": self.closed, + "unresolved": list(self.unresolved), + } + + def to_dict(self) -> dict[str, object]: + return {**self._payload(), "receipt_sha256": self.receipt_sha256} + + +def load_metric_origin_specs(path: Path = FIXTURE) -> dict[str, object]: + content = Path(path).read_bytes() + if sha256(content).hexdigest() != FIXTURE_SHA256: + raise ValueError("EDCM metric-origin fixture digest mismatch") + data = json.loads(content) + if ( + data.get("schema") != "edcm.metric-origin-spec-fixture" + or data.get("version") != "0.4.0" + ): + raise ValueError("unsupported EDCM metric-origin fixture") + registered = json.loads(BASE.read_text(encoding="utf-8"))["metric_origin_source"] + if (data.get("producer_repository") != registered["repository"] + or data.get("producer_commit") != registered["commit"]): + raise ValueError("unregistered EDCM metric-origin producer") + return data + + +def _emit( + common: dict[str, object], + *, + components: tuple[OriginComponent, ...], + closed: bool, + unresolved: tuple[str, ...], +) -> MetricOriginSet: + payload = { + "schema": SCHEMA, + "version": VERSION, + **common, + "components": [asdict(x) for x in components], + "closed": closed, + "unresolved": list(unresolved), + } + receipt = sha256(_canonical(payload)).hexdigest() + return MetricOriginSet( + **common, + components=components, + closed=closed, + unresolved=unresolved, + receipt_sha256=receipt, + ) + + +def build_metric_origin_set( + state_dir: Path, + metric_id: str, + *, + fixture_path: Path = FIXTURE, +) -> MetricOriginSet: + source = load_metric_origin_specs(fixture_path) + specs = source["specs"] + if metric_id not in specs: + raise KeyError(f"unknown metric origin {metric_id!r}") + spec = specs[metric_id] + canonical_metric_id = spec.get("canonical_metric_id") + if not isinstance(canonical_metric_id, str) or not canonical_metric_id.strip(): + raise ValueError(f"metric {metric_id}: canonical_metric_id required") + unresolved = tuple(spec.get("unresolved", ())) + terms = tuple(spec.get("construction_terms", ())) + source_text = " ".join(terms) + + if spec["standing"] != "resolved": + common = { + "carrier_id": metric_id, + "metric_id": canonical_metric_id, + "origin_id": f"O_M({canonical_metric_id})", + "producer_repository": source["producer_repository"], + "producer_commit": source["producer_commit"], + "construct_receipt": "hmmm", + "source_text": source_text, + } + return _emit(common, components=(), closed=False, unresolved=unresolved) + + if not terms or any(not isinstance(term, str) or not term for term in terms): + raise ValueError(f"metric {metric_id}: resolved origin requires exact construction terms") + + db_path = Path(state_dir) / "construct.db" + if not db_path.exists(): + raise ValueError(f"construct.db not found under {state_dir}") + db = sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + try: + _assert_schema_boundary(db) + observed_receipt = _logical_receipt(db) + if observed_receipt != V2_MANIFEST_RECEIPT: + raise ValueError( + f"metric {metric_id}: construct receipt mismatch; " + f"expected {V2_MANIFEST_RECEIPT}, got {observed_receipt}" + ) + inventory = glyph_inventory(db) + components: list[OriginComponent] = [] + for ordinal, (kind, surface, _start, _end) in enumerate(_definition_runs(source_text)): + if kind == "word": + row = db.execute( + "SELECT id FROM words WHERE surface = ?", (surface,) + ).fetchone() + if row is None: + raise ValueError( + f"metric {metric_id}: unadmitted exact word surface {surface!r}" + ) + word, axis = promote_word(db, row[0]) + components.append( + OriginComponent( + ordinal, "word", surface, "O_W", axis, f"word:{word.word_id}" + ) + ) + else: + glyph, axis = promote_glyph(db, inventory, surface) + components.append( + OriginComponent( + ordinal, "glyph", surface, "O_G", axis, f"glyph:{glyph.identity}" + ) + ) + finally: + db.close() + + common = { + "carrier_id": metric_id, + "metric_id": canonical_metric_id, + "origin_id": f"O_M({canonical_metric_id})", + "producer_repository": source["producer_repository"], + "producer_commit": source["producer_commit"], + "construct_receipt": observed_receipt, + "source_text": source_text, + } + return _emit( + common, + components=tuple(components), + closed=True, + unresolved=unresolved, + ) + + +__all__ = [ + "SCHEMA", + "VERSION", + "OriginComponent", + "MetricOriginSet", + "load_metric_origin_specs", + "build_metric_origin_set", +] diff --git a/human/english/english_gonol/hilbert_inference.py b/human/english/english_gonol/hilbert_inference.py new file mode 100644 index 0000000..2833f47 --- /dev/null +++ b/human/english/english_gonol/hilbert_inference.py @@ -0,0 +1,707 @@ +# === MODULE_BUILD === +# id: english_gonol_hilbert_inference_candidate +# module_name: hilbert_inference +# module_kind: constructor +# summary: stack-forged candidate for axis-native Hilbert inference state; existing glyph axes are basis directions, ordered glyph-axis tensors close into existing word axes, and higher-scale constructions consume those closed axes without Cartesian substitution +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, HilbertInferenceError, ConstructRef, VerifiedConstruct, AxisRef, HilbertStateVector, OrderedTensor, AxisPromotion, FiniteHilbertSpace, glyph_axis, word_axis, definition_axis, basis_vector, glyph_space, word_space, definition_space, word_promotion, definition_promotion +# internal_surface: origin-local sparse coordinates, construct-qualified axis identity, ordered tensor basis states, direct SQL dimension reads +# auth_boundary: stack-local English Gonol construction candidate; no UCHC authority transfer +# storage_boundary: read-only SQLite construct consumption; no persistent state +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_hilbert_inference +# rollout: remain in Stack forge until the UCHC release/reconsumption/authority-transition gates complete +# rollback: remove this candidate module, its tests and candidate docs; existing hyperspace receipts remain unchanged +# requires: english_gonol_language_hyperspace +# since: 2026-10-01 +# unresolved: canonical scalar field (R or C), cross-origin inner products and angles, amplitudes/phases, learned inference operators, sense selection, sentence-axis promotion, and independent UCHC graduation remain hmmm +# === END MODULE_BUILD === +# +# === CONTRACTS === +# id: hilbert_axes_are_uchc_axes_not_cartesian +# given: an admitted glyph, word, or definition axis and an exact construct identity +# then: its Hilbert basis identity is that construct-qualified axis; no x/y/z basis is inserted +# class: doctrine +# +# id: hilbert_axis_identity_is_construct_bound +# given: otherwise equal axis records from distinct construct artifacts +# then: the axes compare unequal and no vector/tensor operation silently crosses artifacts +# class: correctness +# +# id: hilbert_origin_local_inner_product +# given: two state vectors over the same construct, origin space, and explicit scalar field +# then: equal basis axes have inner product 1 and distinct basis axes have inner product 0 +# class: correctness +# +# id: hilbert_word_promotion_preserves_order_and_multiplicity +# given: an admitted word gonol +# then: its source state is the ordered tensor of its glyph-axis factors and its target is the already-declared word axis +# class: correctness +# +# id: hilbert_dimension_queries_do_not_reconstruct_members +# given: a request for word or definition Hilbert-space dimension +# then: dimension is read directly from the verified construct tables without reconstructing every member +# class: performance +# +# id: hilbert_finite_origin_spaces_are_complete +# given: one bounded admitted origin basis over explicitly selected R or C +# then: the emitted finite-dimensional inner-product space is complete +# class: correctness +# === END CONTRACTS === + +"""Axis-native Hilbert-state candidate for English Gonol inference. + +This module is forged in Stack while English Gonol implementation authority +remains stack-local. It does not transfer implementation/public-contract +authority to UCHC. + +The basis is not Cartesian. Existing UCHC/English-Gonol axes are the basis: + + admitted glyph axis + -> ordered glyph-axis tensor + -> closed word + -> existing word axis + -> ordered higher-scale tensor + +The lower-scale construction remains recoverable after promotion. A word is +therefore not flattened into a sum of glyph coordinates. + +Mathematical vector/Hilbert terminology is domain-qualified by +docs/hilbert-inference.md and does not redefine METAPAT's state-altering +Vector term or UCNS displacement vectors. + +The canonical scalar field is unresolved. Callers must explicitly choose +R or C for every emitted space/vector/tensor. Cross-origin and +cross-construct vector inner products fail closed. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from hashlib import sha256 +from math import isfinite, sqrt +from pathlib import Path +import sqlite3 +import tempfile +from types import MappingProxyType +from typing import Mapping + +from .full_construct_run import ( + SCHEMA as CONSTRUCT_SCHEMA, + VERSION as CONSTRUCT_VERSION, + _assert_schema_boundary, + _logical_receipt, +) + +from .hyperspace_construct import ( + DefinitionGonol, + GlyphGonol, + WordGonol, + glyph_inventory, + promote_definition, + promote_word, +) + +SCHEMA = "english-gonol.hilbert-inference-candidate" +VERSION = "0.1.0" + + +class HilbertInferenceError(ValueError): + """Raised when an operation would invent, mix, or lose Hilbert structure.""" + + +def _sha256(value: str, label: str) -> str: + if type(value) is not str: + raise HilbertInferenceError(f"{label} must be a lowercase SHA-256 string") + if len(value) != 64 or any(ch not in "0123456789abcdef" for ch in value): + raise HilbertInferenceError(f"{label} must be a lowercase SHA-256 string") + return value + + +def _field(scalar_field: str) -> str: + if scalar_field not in {"R", "C"}: + raise HilbertInferenceError("scalar_field must be 'R' or 'C'") + return scalar_field + + +def _scalar(value: object, scalar_field: str) -> complex: + _field(scalar_field) + if isinstance(value, bool) or not isinstance(value, (int, float, complex)): + raise HilbertInferenceError("coefficients must be numeric scalars") + number = complex(value) + if not isfinite(number.real) or not isfinite(number.imag): + raise HilbertInferenceError("coefficients must be finite") + if scalar_field == "R" and number.imag != 0: + raise HilbertInferenceError("real Hilbert space rejects imaginary coefficients") + return number + + +@dataclass(frozen=True, order=True) +class ConstructRef: + """Exact logical + physical identity of the consumed construct artifact.""" + + logical_receipt: str + artifact_sha256: str + + def __post_init__(self) -> None: + _sha256(self.logical_receipt, "logical_receipt") + _sha256(self.artifact_sha256, "artifact_sha256") + + def as_dict(self) -> dict[str, str]: + return { + "logical_receipt": self.logical_receipt, + "artifact_sha256": self.artifact_sha256, + } + + +class VerifiedConstruct: + """Read-only private snapshot, verified once before any axis is emitted. + + Usage: ``with VerifiedConstruct(path, expected_ref) as db:`` then pass + ``db`` and ``expected_ref`` to helpers. Expected hashes must come from trusted + evidence. Copying and hashing the same bytes prevents pathname replacement + from changing the consumed artifact. Source WAL/uncommitted changes are not + part of the standalone artifact; publish/checkpoint it before opening. + """ + + def __init__(self, path: str | Path, construct: ConstructRef): + self._db: sqlite3.Connection | None = None + self._temporary = tempfile.TemporaryDirectory(prefix="hilbert-construct-") + try: + target = Path(self._temporary.name) / "construct.db" + digest = sha256() + with Path(path).open("rb") as source, target.open("xb") as snapshot: + while chunk := source.read(1024 * 1024): + digest.update(chunk) + snapshot.write(chunk) + if digest.hexdigest() != construct.artifact_sha256: + raise HilbertInferenceError("construct artifact SHA-256 mismatch") + db = sqlite3.connect(f"{target.as_uri()}?mode=ro&immutable=1", uri=True) + self._db = db + db.execute("PRAGMA trusted_schema=OFF") + db.execute("PRAGMA query_only=ON") + _assert_schema_boundary(db) + if db.execute("PRAGMA integrity_check").fetchall() != [("ok",)]: + raise HilbertInferenceError("construct integrity check failed") + if db.execute("PRAGMA foreign_key_check").fetchall(): + raise HilbertInferenceError("construct has dangling references") + metadata = dict(db.execute("SELECT key, value FROM meta")) + if (metadata.get("schema"), metadata.get("version")) != ( + CONSTRUCT_SCHEMA, CONSTRUCT_VERSION + ): + raise HilbertInferenceError("unsupported construct schema/version") + if _logical_receipt(db) != construct.logical_receipt: + raise HilbertInferenceError("construct logical receipt mismatch") + self._construct = construct + self._inventory = MappingProxyType(glyph_inventory(db)) + except Exception as exc: + self.close() + if isinstance(exc, HilbertInferenceError): + raise + raise HilbertInferenceError(f"cannot verify construct: {exc}") from exc + + @property + def construct(self) -> ConstructRef: + return self._construct + + @property + def inventory(self) -> Mapping[str, GlyphGonol]: + return self._inventory + + def __enter__(self) -> "VerifiedConstruct": + _verified_db(self, self.construct) + return self + + def __exit__(self, *_args: object) -> None: + self.close() + + def close(self) -> None: + if self._db is not None: + self._db.close() + self._db = None + self._temporary.cleanup() + + +def _verified_db(db: VerifiedConstruct, construct: ConstructRef) -> sqlite3.Connection: + if not isinstance(db, VerifiedConstruct): + raise HilbertInferenceError("a VerifiedConstruct is required") + if db._db is None: + raise HilbertInferenceError("verified construct is closed") + if db.construct != construct: + raise HilbertInferenceError("reference does not match verified construct") + return db._db + + +def _verified_inventory(db: VerifiedConstruct, inventory: Mapping[str, GlyphGonol]) -> None: + if inventory != db.inventory: + raise HilbertInferenceError("glyph inventory does not match verified construct") + + +@dataclass(frozen=True, order=True) +class AxisRef: + """One construct-qualified basis axis at one declared origin.""" + + construct: ConstructRef + space_id: str + identity_kind: str + identity: str + axis_index: int + + def __post_init__(self) -> None: + if not self.space_id: + raise HilbertInferenceError("space_id must be nonempty") + if not self.identity_kind: + raise HilbertInferenceError("identity_kind must be nonempty") + if not self.identity: + raise HilbertInferenceError("identity must be nonempty") + if type(self.axis_index) is not int or self.axis_index < 0: + raise HilbertInferenceError("axis_index must be a nonnegative integer") + + def as_dict(self) -> dict[str, object]: + return { + "construct": self.construct.as_dict(), + "space_id": self.space_id, + "identity_kind": self.identity_kind, + "identity": self.identity, + "axis_index": self.axis_index, + } + + +@dataclass(frozen=True) +class HilbertStateVector: + """Finite sparse mathematical vector over one origin-local axis basis.""" + + construct: ConstructRef + space_id: str + scalar_field: str + coordinates: tuple[tuple[AxisRef, complex], ...] + + def __post_init__(self) -> None: + _field(self.scalar_field) + if not self.space_id: + raise HilbertInferenceError("space_id must be nonempty") + seen: set[AxisRef] = set() + canonical = [] + for axis, coefficient in self.coordinates: + if axis.construct != self.construct: + raise HilbertInferenceError( + "vector coordinate belongs to a different construct artifact" + ) + if axis.space_id != self.space_id: + raise HilbertInferenceError( + "vector coordinates must belong to exactly one origin space" + ) + if axis in seen: + raise HilbertInferenceError("duplicate axis coordinate") + seen.add(axis) + value = _scalar(coefficient, self.scalar_field) + if value != 0: + canonical.append((axis, value)) + object.__setattr__(self, "coordinates", tuple(sorted(canonical))) + + @classmethod + def basis( + cls, axis: AxisRef, *, scalar_field: str + ) -> "HilbertStateVector": + _field(scalar_field) + return cls( + construct=axis.construct, + space_id=axis.space_id, + scalar_field=scalar_field, + coordinates=((axis, 1 + 0j),), + ) + + def _map(self) -> dict[AxisRef, complex]: + return { + axis: _scalar(value, self.scalar_field) + for axis, value in self.coordinates + if value != 0 + } + + def _compatible(self, other: "HilbertStateVector") -> None: + if not isinstance(other, HilbertStateVector): + raise TypeError("other must be HilbertStateVector") + if self.construct != other.construct: + raise HilbertInferenceError( + "cross-construct inner product is undefined and fails closed" + ) + if self.space_id != other.space_id: + raise HilbertInferenceError( + "cross-origin inner product is hmmm and fails closed" + ) + if self.scalar_field != other.scalar_field: + raise HilbertInferenceError( + "cannot mix Hilbert scalar fields implicitly" + ) + + def inner_product(self, other: "HilbertStateVector") -> complex: + """Return the origin-local orthonormal-basis inner product.""" + + self._compatible(other) + left = self._map() + right = other._map() + return _scalar(sum( + value.conjugate() * right.get(axis, 0j) + for axis, value in left.items() + ), self.scalar_field) + + def norm_squared(self) -> float: + value = self.inner_product(self) + if value.imag != 0 or value.real < 0: + raise HilbertInferenceError("inner product produced an invalid norm") + return float(value.real) + + def norm(self) -> float: + return sqrt(self.norm_squared()) + + def add(self, other: "HilbertStateVector") -> "HilbertStateVector": + self._compatible(other) + merged = self._map() + for axis, value in other._map().items(): + merged[axis] = merged.get(axis, 0j) + value + return HilbertStateVector( + self.construct, + self.space_id, + self.scalar_field, + tuple( + (axis, value) + for axis, value in sorted(merged.items()) + if value != 0 + ), + ) + + def scale(self, scalar: complex) -> "HilbertStateVector": + coefficient = _scalar(scalar, self.scalar_field) + return HilbertStateVector( + self.construct, + self.space_id, + self.scalar_field, + tuple( + (axis, coefficient * value) + for axis, value in self.coordinates + ), + ) + + +@dataclass(frozen=True) +class OrderedTensor: + """One ordered tensor-product basis ket over one exact construct.""" + + construct: ConstructRef + scalar_field: str + factors: tuple[AxisRef, ...] + + def __post_init__(self) -> None: + _field(self.scalar_field) + if not self.factors: + raise HilbertInferenceError("tensor must contain at least one axis factor") + if any(axis.construct != self.construct for axis in self.factors): + raise HilbertInferenceError( + "tensor factors must belong to exactly one construct artifact" + ) + + @property + def space_signature(self) -> tuple[str, ...]: + return tuple(axis.space_id for axis in self.factors) + + def inner_product(self, other: "OrderedTensor") -> complex: + if not isinstance(other, OrderedTensor): + raise TypeError("other must be OrderedTensor") + if self.construct != other.construct: + raise HilbertInferenceError( + "cross-construct tensor inner product is undefined" + ) + if self.scalar_field != other.scalar_field: + raise HilbertInferenceError( + "cannot mix tensor-product scalar fields implicitly" + ) + if self.space_signature != other.space_signature: + raise HilbertInferenceError( + "tensor factors inhabit different ordered Hilbert spaces" + ) + return 1 + 0j if self.factors == other.factors else 0j + + def norm(self) -> float: + return 1.0 + + def as_dict(self) -> dict[str, object]: + return { + "schema": SCHEMA, + "version": VERSION, + "construct": self.construct.as_dict(), + "scalar_field": self.scalar_field, + "space_signature": list(self.space_signature), + "factors": [axis.as_dict() for axis in self.factors], + } + + +@dataclass(frozen=True) +class AxisPromotion: + """A closed lower-scale tensor promoted into an existing higher-scale axis.""" + + relation: str + source: OrderedTensor + target: AxisRef + + def __post_init__(self) -> None: + if not self.relation: + raise HilbertInferenceError("promotion relation must be nonempty") + if self.source.construct != self.target.construct: + raise HilbertInferenceError( + "promotion source and target must share construct identity" + ) + + def as_dict(self) -> dict[str, object]: + return { + "relation": self.relation, + "source": self.source.as_dict(), + "target": self.target.as_dict(), + } + + +@dataclass(frozen=True) +class FiniteHilbertSpace: + """Bounded origin-local Hilbert-space descriptor.""" + + construct: ConstructRef + space_id: str + dimension: int + basis_kind: str + scalar_field: str + complete: bool = True + + def __post_init__(self) -> None: + _field(self.scalar_field) + if not self.space_id or not self.basis_kind: + raise HilbertInferenceError("space_id and basis_kind must be nonempty") + if type(self.dimension) is not int or self.dimension < 0: + raise HilbertInferenceError("dimension must be a nonnegative integer") + + def as_dict(self) -> dict[str, object]: + return { + "construct": self.construct.as_dict(), + "space_id": self.space_id, + "dimension": self.dimension, + "basis_kind": self.basis_kind, + "scalar_field": self.scalar_field, + "complete": self.complete, + } + + +def glyph_axis(gonol: GlyphGonol, construct: ConstructRef, *, db: VerifiedConstruct) -> AxisRef: + _verified_db(db, construct) + if db.inventory.get(gonol.identity) != gonol: + raise HilbertInferenceError("glyph does not match verified construct") + return AxisRef( + construct, + "O_G", + "glyph", + gonol.identity, + gonol.axis_index, + ) + + +def word_axis(gonol: WordGonol, construct: ConstructRef, *, db: VerifiedConstruct) -> AxisRef: + connection = _verified_db(db, construct) + if promote_word(connection, gonol.word_id)[0] != gonol: + raise HilbertInferenceError("word does not match verified construct") + return AxisRef( + construct, + "O_W", + "word", + str(gonol.word_id), + gonol.axis_index, + ) + + +def definition_axis( + gonol: DefinitionGonol, construct: ConstructRef, *, db: VerifiedConstruct +) -> AxisRef: + connection = _verified_db(db, construct) + if promote_definition(connection, gonol.definition_id)[0] != gonol: + raise HilbertInferenceError("definition does not match verified construct") + return AxisRef( + construct, + f"O_D:{gonol.origin_word_id}", + "definition", + str(gonol.definition_id), + gonol.axis_index, + ) + + +def basis_vector( + axis: AxisRef, *, scalar_field: str +) -> HilbertStateVector: + return HilbertStateVector.basis(axis, scalar_field=scalar_field) + + +def glyph_space( + inventory: Mapping[str, GlyphGonol], + construct: ConstructRef, + *, + scalar_field: str, + db: VerifiedConstruct, +) -> FiniteHilbertSpace: + _verified_db(db, construct) + _verified_inventory(db, inventory) + return FiniteHilbertSpace( + construct, + "O_G", + len(inventory), + "glyph-axis", + scalar_field, + ) + + +def word_space( + db: VerifiedConstruct, + construct: ConstructRef, + *, + scalar_field: str, +) -> FiniteHilbertSpace: + row = _verified_db(db, construct).execute("SELECT COUNT(*) FROM words").fetchone() + if row is None: + raise HilbertInferenceError("word count query returned no row") + return FiniteHilbertSpace( + construct, + "O_W", + int(row[0]), + "word-axis", + scalar_field, + ) + + +def definition_space( + db: VerifiedConstruct, + construct: ConstructRef, + origin_word_id: int, + *, + scalar_field: str, +) -> FiniteHilbertSpace: + row = _verified_db(db, construct).execute( + "SELECT COUNT(*) FROM definitions WHERE origin_word_id = ?", + (origin_word_id,), + ).fetchone() + if row is None: + raise HilbertInferenceError("definition count query returned no row") + return FiniteHilbertSpace( + construct, + f"O_D:{origin_word_id}", + int(row[0]), + "definition-axis", + scalar_field, + ) + + +def _glyph_factor( + inventory: Mapping[str, GlyphGonol], + scalar: str, + construct: ConstructRef, + db: VerifiedConstruct, +) -> AxisRef: + try: + gonol = inventory[scalar] + except KeyError as exc: + raise HilbertInferenceError(f"glyph {scalar!r} is not admitted") from exc + return glyph_axis(gonol, construct, db=db) + + +def word_promotion( + db: VerifiedConstruct, + inventory: Mapping[str, GlyphGonol], + word_id: int, + construct: ConstructRef, + *, + scalar_field: str, +) -> AxisPromotion: + """Promote an exact ordered glyph-axis construction to its word axis.""" + + connection = _verified_db(db, construct) + _verified_inventory(db, inventory) + word, _axis_index = promote_word(connection, word_id) + scalars = tuple(_character_scalar(connection, identity) for identity in word.glyph_ids) + if "".join(scalars) != word.surface: + raise HilbertInferenceError("word surface disagrees with declared glyph references") + factors = tuple( + _glyph_factor(inventory, scalar, construct, db) + for scalar in scalars + ) + return AxisPromotion( + "ordered glyph axes -> closed word axis", + OrderedTensor(construct, scalar_field, factors), + word_axis(word, construct, db=db), + ) + + +def _character_scalar(db: sqlite3.Connection, character_id: int) -> str: + row = db.execute( + "SELECT scalar FROM characters WHERE id = ?", + (character_id,), + ).fetchone() + if row is None: + raise HilbertInferenceError( + f"character {character_id} is not constructed" + ) + return str(row[0]) + + +def definition_promotion( + db: VerifiedConstruct, + inventory: Mapping[str, GlyphGonol], + definition_id: int, + construct: ConstructRef, + *, + scalar_field: str, +) -> AxisPromotion: + """Promote exact ordered closed components to the local definition axis.""" + + connection = _verified_db(db, construct) + _verified_inventory(db, inventory) + definition, _axis_index = promote_definition(connection, definition_id) + factors: list[AxisRef] = [] + for kind, identity_id in definition.constituent_ids: + if kind == "word": + factors.append(word_promotion( + db, inventory, identity_id, construct, scalar_field=scalar_field + ).target) + elif kind == "character": + scalar = _character_scalar(connection, identity_id) + factors.append(_glyph_factor(inventory, scalar, construct, db)) + else: + raise HilbertInferenceError( + f"unsupported definition component kind {kind!r}" + ) + if not factors: + raise HilbertInferenceError( + "definition has no admitted component axes" + ) + return AxisPromotion( + "ordered closed component axes -> definition axis", + OrderedTensor(construct, scalar_field, tuple(factors)), + definition_axis(definition, construct, db=db), + ) + + +__all__ = [ + "SCHEMA", + "VERSION", + "HilbertInferenceError", + "ConstructRef", + "VerifiedConstruct", + "AxisRef", + "HilbertStateVector", + "OrderedTensor", + "AxisPromotion", + "FiniteHilbertSpace", + "glyph_axis", + "word_axis", + "definition_axis", + "basis_vector", + "glyph_space", + "word_space", + "definition_space", + "word_promotion", + "definition_promotion", +] diff --git a/human/english/english_gonol/hyperspace_geometry.py b/human/english/english_gonol/hyperspace_geometry.py new file mode 100644 index 0000000..a4288bf --- /dev/null +++ b/human/english/english_gonol/hyperspace_geometry.py @@ -0,0 +1,248 @@ +# === MODULE_BUILD === +# id: english_gonol_hyperspace_geometry_candidates +# module_name: hyperspace_geometry +# module_kind: candidate +# summary: preregistered candidates resolving two English hmmms - the constructed definition inner product (orthogonality from shared constituents) and the word-axis angle (terminal phase of the ordered glyph walk) +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, HyperspaceGeometryError, definition_inner_product, word_axis_angle, run_hyperspace_geometry_controls +# internal_surface: shared-constituent intersection, glyph-walk motion over the selected lifted displacement, deterministic receipts +# auth_boundary: none +# storage_boundary: aggregate receipts only; per-word geometry recomputed on demand +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_hyperspace_geometry +# rollout: candidate answers to English hmmm; survival is not selection +# rollback: remove this module, facade exports, tests, and candidate documentation +# requires: english_gonol_hyperspace_construct, english_gonol_motion_run (pinned ucns motion) +# since: 2026-09-21 +# unresolved: candidates remain hmmm until preregistered controls pass and scoped selection receipts exist +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: definition_inner_product_is_constructed_not_statistical +# given: two definitions of one word +# then: the inner product equals the count of shared distinct constituent word axes, with disjoint definitions orthogonal by construction +# class: correctness +# since: 2026-09-21 +# +# id: word_axis_angle_is_glyph_walk_terminal_phase +# given: a word gonol with its ordered glyph construction +# then: the word-axis angle candidate is the terminal NativeMobiusState of the glyph walk under the selected lifted displacement +# class: correctness +# since: 2026-09-21 +# +# id: hyperspace_geometry_candidates_are_replayable +# given: a candidate record +# then: the canonical receipt replays deterministically and tampering fails closed +# class: safety +# since: 2026-09-21 +# === END CONTRACTS === + +"""Candidate geometry for two English hmmms. + +* H1-c4: the definition inner product counts shared distinct constituent + word axes between two definitions of the same word; disjoint definitions + are orthogonal by construction, and overlap is measured, not fitted. +* H2-c2: the word-axis angle is the terminal NativeMobiusState of the + word's ordered glyph walk under the selected lifted ordered-concatenation + displacement. + +Candidates only; survival in the controls is not selection. +""" + +from __future__ import annotations + +import hashlib +import json +import sqlite3 +from pathlib import Path +from typing import Any + +from .hyperspace_construct import HyperspaceError, promote_definition +from .motion_run import _load_verified_motion + +SCHEMA = "english-gonol.hyperspace-geometry-candidates" +VERSION = "0.1.0" + + +class HyperspaceGeometryError(ValueError): + """Raised when a hyperspace geometry candidate fails closed.""" + + +def _open_db(state_dir: Path) -> sqlite3.Connection: + db_path = Path(state_dir) / "construct.db" + if not db_path.exists(): + raise HyperspaceGeometryError(f"construct.db not found under {state_dir}") + return sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + + +def _definition_word_axes(db: sqlite3.Connection, definition_id: int) -> set[int]: + return { + ref + for kind, ref in db.execute( + "SELECT kind, word_id FROM definition_components " + "WHERE definition_id = ? AND kind = 'word'", + (definition_id,), + ).fetchall() + if kind == "word" and ref is not None + } + + +def _receipt(payload: dict[str, Any]) -> str: + return hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + + +def definition_inner_product( + db: sqlite3.Connection, word_id: int, first: int, second: int +) -> dict[str, Any]: + """The constructed inner product between two definitions of one word.""" + + first_gonol = promote_definition(db, first)[0] + second_gonol = promote_definition(db, second)[0] + if first_gonol.origin_word_id != word_id or second_gonol.origin_word_id != word_id: + raise HyperspaceGeometryError("both definitions must be rooted at the given word") + first_axes = _definition_word_axes(db, first) + second_axes = _definition_word_axes(db, second) + shared = first_axes & second_axes + payload = { + "schema": SCHEMA, + "version": VERSION, + "candidate": "definition-inner-product", + "word_id": word_id, + "definition_ids": [first, second], + "first_constituent_axes": sorted(first_axes), + "second_constituent_axes": sorted(second_axes), + "shared_constituent_axes": sorted(shared), + "inner_product": len(shared), + "norm_first": len(first_axes), + "norm_second": len(second_axes), + "orthogonal": len(shared) == 0, + "derivation": "count of shared distinct constituent word axes", + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +def word_axis_angle( + db: sqlite3.Connection, word_id: int, ucns_source_root: Path +) -> dict[str, Any]: + """The word-axis angle candidate: terminal phase of the glyph walk.""" + + row = db.execute("SELECT surface FROM words WHERE id = ?", (word_id,)).fetchone() + if row is None: + raise HyperspaceGeometryError(f"word {word_id} is not constructed") + glyph_rows = db.execute( + "SELECT ordinal, character_id FROM word_characters WHERE word_id = ? ORDER BY ordinal", + (word_id,), + ).fetchall() + if not glyph_rows: + raise HyperspaceGeometryError(f"word {word_id} has no glyph construction") + build_motion = _load_verified_motion(Path(ucns_source_root)) + walk = tuple((ordinal, character_id, 0) for ordinal, character_id in glyph_rows) + motion = build_motion(walk) + payload = { + "schema": SCHEMA, + "version": VERSION, + "candidate": "word-axis-angle", + "word_id": word_id, + "surface": row[0], + "glyph_walk": [[o, g, 0] for o, g in glyph_rows], + "end_phase": f"{motion.end_phase.numerator}/{motion.end_phase.denominator}", + "end_frame": motion.end_frame, + "derivation": "terminal NativeMobiusState of the ordered glyph walk", + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +def run_hyperspace_geometry_controls( + state_dir: Path, ucns_source_root: Path +) -> dict[str, Any]: + """Run the preregistered controls for both candidates.""" + + db = _open_db(state_dir) + try: + results: dict[str, dict[str, Any]] = {} + + # inner-product controls + inner_cases: dict[str, dict[str, Any]] = {} + # self: norm equals distinct constituent count + self_product = definition_inner_product(db, 1, 1, 1) + inner_cases["self-norm"] = { + "ok": self_product["inner_product"] == self_product["norm_first"], + "detail": "inner product with itself equals its norm", + } + # disjoint: zero shared + disjoint = definition_inner_product(db, 1, 1, 2) + inner_cases["disjoint-orthogonal"] = { + "ok": disjoint["orthogonal"] and disjoint["inner_product"] == 0, + "detail": "disjoint definitions are orthogonal by construction", + } + # symmetry + forward = definition_inner_product(db, 1, 1, 2) + reverse = definition_inner_product(db, 1, 2, 1) + inner_cases["symmetry"] = { + "ok": forward["inner_product"] == reverse["inner_product"], + "detail": "inner product is symmetric", + } + # shared: overlap measured, not fitted + shared = definition_inner_product(db, 1, 1, 3) + inner_cases["shared-overlap"] = { + "ok": not shared["orthogonal"] and shared["inner_product"] > 0, + "detail": f"shared overlap = {shared['inner_product']}", + } + inner_ok = all(case["ok"] for case in inner_cases.values()) + results["definition-inner-product"] = { + "ok": inner_ok, + "cases": inner_cases, + "detail": "all preregistered inner-product controls pass" if inner_ok else "a control failed", + } + + # word-axis-angle controls + angle_cases: dict[str, dict[str, Any]] = {} + first = word_axis_angle(db, 1, ucns_source_root) + second = word_axis_angle(db, 1, ucns_source_root) + angle_cases["determinism"] = { + "ok": first["receipt_sha256"] == second["receipt_sha256"], + "detail": "word-axis angle is deterministic", + } + other = word_axis_angle(db, 2, ucns_source_root) + angle_cases["distinct-words-distinct-walks"] = { + "ok": first["receipt_sha256"] != other["receipt_sha256"], + "detail": "different glyph walks produce different records", + } + angle_ok = all(case["ok"] for case in angle_cases.values()) + results["word-axis-angle"] = { + "ok": angle_ok, + "cases": angle_cases, + "detail": "all preregistered angle controls pass" if angle_ok else "a control failed", + } + finally: + db.close() + + payload = { + "schema": SCHEMA, + "version": VERSION, + "results": results, + "survivors": [name for name, result in results.items() if result["ok"]], + "selected": [], + "hmmm": ( + "surviving controls do not select these candidates; scoped " + "selection would require additional preregistered evidence" + ), + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +__all__ = [ + "SCHEMA", + "VERSION", + "HyperspaceGeometryError", + "definition_inner_product", + "word_axis_angle", + "run_hyperspace_geometry_controls", +] diff --git a/human/english/english_gonol/hyperspace_views.py b/human/english/english_gonol/hyperspace_views.py new file mode 100644 index 0000000..2a28a2d --- /dev/null +++ b/human/english/english_gonol/hyperspace_views.py @@ -0,0 +1,431 @@ +# === MODULE_BUILD === +# id: english_gonol_hyperspace_views +# module_name: hyperspace_views +# module_kind: audit +# summary: four candidate views over the hyperspace plus one differential synthesis; the pinned corpus adjudicates which views merit retainment +# owner: Erin Spencer +# public_surface: SCHEMA, VERSION, ViewError, word_views, run_view_adjudication +# internal_surface: definition inner-product density, word-axis angle, provenance lift, canonical-witness lift, synthesis tuple, distinctness/collision counts +# auth_boundary: none +# storage_boundary: aggregate receipts only; per-word views recomputed on demand +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: tests.test_hyperspace_views +# rollout: four views plus synthesis; reality adjudicates retainment, not declaration +# rollback: remove this module, facade exports, tests, and candidate documentation +# requires: english_gonol_hyperspace_construct, english_gonol_hyperspace_geometry, ucns_lift_selection_candidates (via ucns source) +# since: 2026-09-21 +# unresolved: view four reduces to derivation; views one, two, and three together are the thing +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: views_are_four_plus_synthesis +# given: one word gonol +# then: exactly four candidate views are produced together with one synthesis tuple, each construction-derived +# class: correctness +# since: 2026-09-21 +# +# id: views_adjudication_counts_are_exact +# given: a corpus sweep +# then: per-view distinct-value and collision counts are exact integer counts over the swept words +# class: correctness +# since: 2026-09-21 +# +# id: views_do_not_select +# given: an adjudication report +# then: the report ranks views by measured distinctness and never declares retainment +# class: doctrine +# since: 2026-09-21 +# === END CONTRACTS === + +"""Four candidate views plus differential synthesis. + +View 1: definition inner-product density (shared constituent axes). +View 2: word-axis angle (terminal glyph-walk NativeMobiusState). +View 3: provenance-interval lift (deck of the word id). +View 4: canonical-witness lift (constant per residue). + +The synthesis is the canonical tuple of all four. The corpus adjudicates +which views merit retainment; this module never selects. +""" + +from __future__ import annotations + +import hashlib +import json +import sqlite3 +from fractions import Fraction +from pathlib import Path +from typing import Any + +from .hyperspace_construct import HyperspaceError +from .hyperspace_geometry import ( + definition_inner_product, + word_axis_angle, +) +from .motion_run import _load_verified_motion + +SCHEMA = "english-gonol.hyperspace-views" +VERSION = "0.1.0" +_MODULUS = 157 + + +class ViewError(ValueError): + """Raised when a view computation fails closed.""" + + +def _open_db(state_dir: Path) -> sqlite3.Connection: + db_path = Path(state_dir) / "construct.db" + if not db_path.exists(): + raise ViewError(f"construct.db not found under {state_dir}") + return sqlite3.connect(f"file:{db_path}?mode=ro", uri=True) + + +def _receipt(payload: dict[str, Any]) -> str: + return hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + + +def _definition_density( + db: sqlite3.Connection, word_id: int +) -> dict[str, Any] | None: + definition_ids = [ + row[0] + for row in db.execute( + "SELECT id FROM definitions WHERE origin_word_id = ? ORDER BY ordinal", + (word_id,), + ).fetchall() + ] + if len(definition_ids) < 2: + return None + overlaps = [] + orthogonal_pairs = 0 + total_pairs = 0 + for i, first in enumerate(definition_ids): + for second in definition_ids[i + 1 :]: + product = definition_inner_product(db, word_id, first, second) + overlaps.append(product["inner_product"]) + total_pairs += 1 + if product["orthogonal"]: + orthogonal_pairs += 1 + return { + "definition_count": len(definition_ids), + "pair_count": total_pairs, + "orthogonal_pair_count": orthogonal_pairs, + "shared_sum": sum(overlaps), + "density": Fraction(sum(overlaps), total_pairs) if total_pairs else Fraction(0), + } + + +def _definition_walk_state( + db: sqlite3.Connection, word_id: int, build_motion: Any +) -> dict[str, Any] | None: + rows = db.execute( + "SELECT id, ordinal, definition_index FROM definitions " + "WHERE origin_word_id = ? ORDER BY ordinal", + (word_id,), + ).fetchall() + if not rows: + return None + walk = [] + for definition_id, ordinal, definition_index in rows: + target = db.execute( + "SELECT target_word_id FROM semantic_evidence " + "WHERE definition_id = ? ORDER BY id LIMIT 1", + (definition_id,), + ).fetchone() + semantic = target[0] if target else 0 + walk.append((ordinal, semantic, definition_index)) + motion = build_motion(tuple(walk)) + return { + "definition_count": len(rows), + "end_phase": f"{motion.end_phase.numerator}/{motion.end_phase.denominator}", + "end_frame": motion.end_frame, + "derivation": "terminal NativeMobiusState of the ordered definition walk", + } + + +def word_views( + db: sqlite3.Connection, word_id: int, ucns_source_root: Path +) -> dict[str, Any]: + """Compute the four views and the synthesis tuple for one word.""" + + angle = word_axis_angle(db, word_id, ucns_source_root) + build_motion = _load_verified_motion(Path(ucns_source_root)) + definition_walk = _definition_walk_state(db, word_id, build_motion) + phase_num = int(angle["end_phase"].split("/")[0]) + residue = phase_num % _MODULUS + deck = word_id // _MODULUS + + density = _definition_density(db, word_id) + view1 = ( + { + "definition_count": density["definition_count"], + "pair_count": density["pair_count"], + "orthogonal_pair_count": density["orthogonal_pair_count"], + "shared_sum": density["shared_sum"], + } + if density is not None + else None + ) + view2 = { + "glyph_walk": {"phase": angle["end_phase"], "frame": angle["end_frame"]}, + "definition_walk": definition_walk, + } + view3 = {"deck": deck, "residue": residue, "lift": deck * _MODULUS + residue} + view4 = { + "residue": residue, + "lift": _MODULUS + residue, + "derived": True, + "derivation": ( + "157 + residue, where residue is the phase numerator mod 157 " + "already carried by view2 and view3; view four reduces to derivation" + ), + } + + synthesis = (view1, view2, view3["lift"]) + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "views": { + "view1_definition_inner_product_density": view1, + "view2_word_axis_angle": view2, + "view3_provenance_interval_lift": view3, + "view4_canonical_witness_lift": view4, + }, + "synthesis": [ + view1, + view2, + view3["lift"], + ], + "synthesis_composition": "views one, two, and three together", + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +def run_view_adjudication( + state_dir: Path, + ucns_source_root: Path, + *, + limit: int | None = None, +) -> dict[str, Any]: + """Sweep the corpus and count each view's distinguishing power.""" + + db = _open_db(state_dir) + try: + rows = db.execute("SELECT id FROM words ORDER BY id").fetchall() + words = [row[0] for row in rows[:limit]] if limit is not None else [row[0] for row in rows] + seen: dict[str, set[Any]] = { + "view1_definition_inner_product_density": set(), + "view2_word_axis_angle": set(), + "view3_provenance_interval_lift": set(), + "synthesis": set(), + } + collisions: dict[str, int] = {name: 0 for name in seen} + view_names = [name for name in seen if name != "synthesis"] + view4_values: set[str] = set() + for word_id in words: + record = word_views(db, word_id, ucns_source_root) + for name in view_names: + value = record["views"][name] + key = json.dumps(value, sort_keys=True, separators=(",", ":")) + if key in seen[name]: + collisions[name] += 1 + seen[name].add(key) + view4_values.add( + json.dumps( + record["views"]["view4_canonical_witness_lift"], + sort_keys=True, + separators=(",", ":"), + ) + ) + synthesis_key = json.dumps( + record["synthesis"], sort_keys=True, separators=(",", ":") + ) + if synthesis_key in seen["synthesis"]: + collisions["synthesis"] += 1 + seen["synthesis"].add(synthesis_key) + finally: + db.close() + + ranking = sorted( + ( + (name, len(values), collisions[name]) + for name, values in seen.items() + ), + key=lambda entry: (entry[1], -entry[2]), + reverse=True, + ) + + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_count": len(words), + "distinct_values": {name: len(values) for name, values in seen.items()}, + "collisions": collisions, + "view4_canonical_witness_lift": { + "derived": True, + "distinct": len(view4_values), + "note": "view four reduces to derivation; excluded from the synthesis", + }, + "synthesis_composition": "views one, two, and three together", + "ranking_by_distinctness": [ + {"view": name, "distinct": distinct, "collisions": collision} + for name, distinct, collision in ranking + ], + "hmmm": ( + "view four reduces to derivation; views one, two, and three " + "together are the thing. This report ranks, it does not select" + ), + } + payload["receipt_sha256"] = _receipt(payload) + return payload + + +class SynthesisRecord: + """First-class synthesis of views one, two, and three for one word.""" + + def __init__( + self, + word_id: int, + surface: str, + view1: dict[str, Any] | None, + view2: dict[str, Any], + view3: dict[str, Any], + receipt_sha256: str, + ) -> None: + self.word_id = word_id + self.surface = surface + self.view1 = view1 + self.view2 = view2 + self.view3 = view3 + self.receipt_sha256 = receipt_sha256 + + def as_dict(self) -> dict[str, Any]: + return { + "schema": SCHEMA, + "version": VERSION, + "word_id": self.word_id, + "surface": self.surface, + "view1": self.view1, + "view2": self.view2, + "view3": self.view3, + "receipt_sha256": self.receipt_sha256, + } + + def canonical_bytes(self) -> bytes: + payload = self.as_dict() + payload.pop("receipt_sha256", None) + return json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + + def receipt_bytes(self) -> bytes: + return json.dumps(self.as_dict(), sort_keys=True, separators=(",", ":")).encode("utf-8") + + +def build_synthesis_record( + db: sqlite3.Connection, word_id: int, ucns_source_root: Path +) -> SynthesisRecord: + """Build the first-class synthesis record for one word.""" + + views = word_views(db, word_id, ucns_source_root) + surface = db.execute( + "SELECT surface FROM words WHERE id = ?", (word_id,) + ).fetchone()[0] + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_id": word_id, + "surface": surface, + "view1": views["views"]["view1_definition_inner_product_density"], + "view2": views["views"]["view2_word_axis_angle"], + "view3": views["views"]["view3_provenance_interval_lift"], + } + receipt = hashlib.sha256( + json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") + ).hexdigest() + return SynthesisRecord( + word_id=word_id, + surface=surface, + view1=payload["view1"], + view2=payload["view2"], + view3=payload["view3"], + receipt_sha256=receipt, + ) + + +def synthesis_corpus_receipt( + state_dir: Path, + ucns_source_root: Path, + *, + limit: int | None = None, +) -> dict[str, Any]: + """Stream the full synthesis surface and return an aggregate receipt.""" + + db = _open_db(state_dir) + try: + rows = db.execute("SELECT id FROM words ORDER BY id").fetchall() + words = [row[0] for row in rows[:limit]] if limit is not None else [row[0] for row in rows] + digest = hashlib.sha256() + for word_id in words: + record = build_synthesis_record(db, word_id, ucns_source_root) + digest.update(record.receipt_bytes()) + finally: + db.close() + + payload = { + "schema": SCHEMA, + "version": VERSION, + "word_count": len(words), + "limit": limit, + "synthesis_composition": "views one, two, and three together", + "hmmm": ( + "view four reduces to derivation; views one, two, and three " + "together are the thing" + ), + } + payload["receipt_sha256"] = hashlib.sha256( + digest.digest() + + json.dumps( + {key: value for key, value in payload.items() if key != "receipt_sha256"}, + sort_keys=True, + separators=(",", ":"), + ).encode("utf-8") + ).hexdigest() + return payload + + +def verify_synthesis_replay(data: bytes, state_dir: Path, ucns_source_root: Path) -> dict[str, Any]: + """Recompute the synthesis corpus receipt and verify byte-identically.""" + + if not isinstance(data, bytes): + raise ViewError("receipt must be bytes") + try: + obj = json.loads(data.decode("utf-8")) + except (UnicodeDecodeError, json.JSONDecodeError) as exc: + raise ViewError("receipt is not valid canonical JSON") from exc + if obj.get("schema") != SCHEMA or obj.get("version") != VERSION: + raise ViewError("receipt schema or version mismatch") + rebuilt = synthesis_corpus_receipt(state_dir, ucns_source_root, limit=obj.get("limit")) + if rebuilt["receipt_sha256"] != obj.get("receipt_sha256"): + raise ViewError("receipt digest does not match recomputation") + rebuilt_bytes = json.dumps(rebuilt, sort_keys=True, separators=(",", ":")).encode("utf-8") + if rebuilt_bytes != data: + raise ViewError("receipt does not replay byte-identically") + return rebuilt + + +__all__ = [ + "SCHEMA", + "VERSION", + "ViewError", + "word_views", + "run_view_adjudication", + "SynthesisRecord", + "build_synthesis_record", + "synthesis_corpus_receipt", + "verify_synthesis_replay", +] diff --git a/human/english/english_gonol/system_set_trajectory.py b/human/english/english_gonol/system_set_trajectory.py new file mode 100644 index 0000000..d46a337 --- /dev/null +++ b/human/english/english_gonol/system_set_trajectory.py @@ -0,0 +1,160 @@ +"""Stack-forged English semantic trajectory for structural recurrence research. + +English Gonol Construction owns this provisional language trajectory while UCHC +graduation remains incomplete. UCNS owns structural comparison evidence. +METAPAT owns recurrence adjudication. EDCM owns measurement/evaluation. + +Usage: construct SystemSetTrajectory with SemanticStep records and at least one +source provenance ID; call to_ucns_comparison_input() for the versioned handoff. +Recompute structure_id as SHA-256 of canonical JSON of all other handoff fields. +""" + +# === MODULE_BUILD === +# id: english_system_set_trajectory_v0 +# module_name: english_gonol.system_set_trajectory +# module_kind: schema +# summary: preserves ordered English semantic trajectories for downstream structural comparison +# owner: Stack English Gonol Construction +# public_surface: SemanticStep, SystemSetTrajectory +# internal_surface: canonical receipt construction +# auth_boundary: none +# storage_boundary: serialization-only +# network_boundary: none +# user_data_boundary: none +# admin_only: false +# tests: research/english-gonol/tests/test_system_set_trajectory.py +# rollout: stack-local research candidate +# rollback: remove module and tests +# requires: system-set provisional domain claim +# since: 2026-10-03 +# unresolved: automatic extraction from complete sense-selected inference frames +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: system_set_trajectory_preserves_order +# given: an ordered semantic trajectory is recorded +# then: exact axis relation target order and multiplicity survive serialization and receipt identity +# class: correctness +# +# id: system_set_trajectory_preserves_comparison_evidence +# given: a trajectory is emitted for UCNS comparison +# then: construct origin path complete ordered steps provenance and unresolved constraints remain inspectable +# class: provenance_contract +# +# id: system_set_trajectory_no_downstream_judgment +# given: trajectories expose matching or differing relation signatures +# then: source relation labels remain unevaluated evidence in the English schema and assert no equivalence analogy recurrence proof or measurement outcome +# class: boundary_contract +# +# id: system_set_trajectory_immutable_inputs +# given: ordered sequence containers are passed by a caller +# then: the record freezes them into tuples before identity is computed and rejects scalar or unordered containers +# class: correctness +# === END CONTRACTS === + +from __future__ import annotations + +from collections.abc import Sequence +from dataclasses import asdict, dataclass +from hashlib import sha256 +import json + +SCHEMA = "english-gonol.system-set-trajectory" +VERSION = "0.1.0" + + +def _canonical(value: object) -> bytes: + return json.dumps( + value, sort_keys=True, ensure_ascii=False, + separators=(",", ":"), allow_nan=False, + ).encode("utf-8") + + +def _text(value: str, label: str) -> str: + if not isinstance(value, str) or not value.strip(): + raise ValueError(f"{label} must be a non-empty string") + return value + + +@dataclass(frozen=True, slots=True) +class SemanticStep: + """A declared English relation, not a downstream adjudication. + + relation_id is an opaque source reference within this English schema. + Even the label 'equivalence' records source evidence only; it does not + evaluate the relation or assert UCNS structural equivalence. + """ + + axis_id: str + relation_id: str + target_axis_id: str + + def __post_init__(self) -> None: + _text(self.axis_id, "axis_id") + _text(self.relation_id, "relation_id") + _text(self.target_axis_id, "target_axis_id") + + +@dataclass(frozen=True, slots=True) +class SystemSetTrajectory: + construct_id: str + origin_id: str + path_id: str + steps: tuple[SemanticStep, ...] + provenance_ids: tuple[str, ...] + unresolved: tuple[str, ...] = () + + def __post_init__(self) -> None: + _text(self.construct_id, "construct_id") + _text(self.origin_id, "origin_id") + _text(self.path_id, "path_id") + for label in ("steps", "provenance_ids", "unresolved"): + values = getattr(self, label) + if isinstance(values, (str, bytes, bytearray)) or not isinstance(values, Sequence): + raise ValueError(f"{label} must be an ordered sequence, not scalar text or an unordered collection") + object.__setattr__(self, label, tuple(values)) + if not self.steps: + raise ValueError("trajectory requires at least one semantic step") + if any(not isinstance(step, SemanticStep) for step in self.steps): + raise ValueError("steps must contain SemanticStep records") + if not self.provenance_ids: + raise ValueError("trajectory requires at least one provenance identifier") + for label, values in ( + ("provenance_ids", self.provenance_ids), + ("unresolved", self.unresolved), + ): + if any(not isinstance(value, str) or not value.strip() for value in values): + raise ValueError(f"{label} must contain non-empty strings") + + @property + def relation_signature(self) -> tuple[str, ...]: + return tuple(step.relation_id for step in self.steps) + + @property + def receipt_sha256(self) -> str: + return sha256(_canonical(self.to_dict(include_receipt=False))).hexdigest() + + def to_dict(self, *, include_receipt: bool = True) -> dict[str, object]: + value: dict[str, object] = { + "schema": SCHEMA, + "version": VERSION, + "construct_id": self.construct_id, + "origin_id": self.origin_id, + "path_id": self.path_id, + "steps": [asdict(step) for step in self.steps], + "provenance_ids": list(self.provenance_ids), + "unresolved": list(self.unresolved), + } + if include_receipt: + value["receipt_sha256"] = self.receipt_sha256 + return value + + def to_ucns_comparison_input(self) -> dict[str, object]: + """Return identity-bearing evidence only; UCNS/METAPAT judge downstream.""" + + value = self.to_dict(include_receipt=False) + value["structure_id"] = self.receipt_sha256 + return value + + +__all__ = ["SCHEMA", "VERSION", "SemanticStep", "SystemSetTrajectory"] diff --git a/human/english/tests/test_describing_graph.py b/human/english/tests/test_describing_graph.py new file mode 100644 index 0000000..3f3d500 --- /dev/null +++ b/human/english/tests/test_describing_graph.py @@ -0,0 +1,119 @@ +# === CHECKS === +# id: check_describing_graph_is_external +# proves: describing_graph_is_external +# call: self::test_describing_graph_is_external +# requires: python3 +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_describing_graph_channels_are_construction_derived +# proves: describing_graph_channels_are_construction_derived +# call: self::test_channels_are_construction_derived +# requires: python3 +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_describing_graph_fails_closed +# proves: describing_graph_fails_closed +# call: self::test_fails_closed +# requires: python3 +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +from __future__ import annotations + +import json +import sqlite3 +from pathlib import Path + +import pytest + +from english_gonol.describing_graph import ( + DescribingGraphError, + describe_word, + describing_graph_receipt, + verify_describing_graph_replay, +) + + +def _fixture_state(tmp_path: Path) -> Path: + state_dir = tmp_path / "state" + state_dir.mkdir() + db = sqlite3.connect(state_dir / "construct.db") + db.executescript( + """ + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT NOT NULL UNIQUE); + CREATE TABLE definitions ( + id INTEGER PRIMARY KEY, + origin_word_id INTEGER NOT NULL REFERENCES words(id), + part_of_speech TEXT NOT NULL, + ordinal INTEGER NOT NULL, + sense_id TEXT NOT NULL, + synset_id TEXT NOT NULL, + definition_index INTEGER NOT NULL, + text TEXT NOT NULL, + previous_definition_id INTEGER REFERENCES definitions(id), + UNIQUE (origin_word_id, ordinal) + ); + CREATE TABLE semantic_evidence ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + source_ordinal INTEGER NOT NULL, + channel TEXT NOT NULL, + relation TEXT NOT NULL, + target_word_id INTEGER NOT NULL REFERENCES words(id), + target_ref TEXT NOT NULL + ); + """ + ) + db.executemany("INSERT INTO words VALUES (?, ?)", [(1, "a"), (2, "b")]) + db.executemany( + "INSERT INTO definitions VALUES (?, 1, 'noun', ?, 's', 'syn', 1, 'x', NULL)", + [(1, 1), (2, 2)], + ) + db.execute( + "INSERT INTO semantic_evidence (definition_id, source_ordinal, channel, relation, target_word_id, target_ref) VALUES (1, 0, 'semantic', 'hypernym', 2, 'ref')" + ) + db.commit() + db.close() + return state_dir + + +def test_describing_graph_is_external(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = describe_word(db, 1) + db.close() + assert set(record) >= {"x", "y", "z"} + assert "shares no origin" in record["origin"] + + +def test_channels_are_construction_derived(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = describe_word(db, 1) + db.close() + assert record["x"] == 1 % 157 + assert record["y"] == 2 % 157 + assert record["z"] == 2 % 157 + + +def test_fails_closed(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = describing_graph_receipt(state_dir) + assert report["external"] is True + data = json.dumps(report, sort_keys=True, separators=(",", ":")).encode("utf-8") + replayed = verify_describing_graph_replay(data, state_dir) + assert replayed["receipt_sha256"] == report["receipt_sha256"] + + tampered = bytearray(data) + tampered[30] ^= 0x01 + with pytest.raises(DescribingGraphError): + verify_describing_graph_replay(bytes(tampered), state_dir) + + with pytest.raises(DescribingGraphError): + describing_graph_receipt(tmp_path / "missing") diff --git a/human/english/tests/test_displacement_operator.py b/human/english/tests/test_displacement_operator.py new file mode 100644 index 0000000..0713a32 --- /dev/null +++ b/human/english/tests/test_displacement_operator.py @@ -0,0 +1,137 @@ +# === CHECKS === +# id: check_displacement_operator_uses_selected_laws +# proves: displacement_operator_uses_selected_laws +# call: self::test_uses_selected_laws +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_displacement_operator_closes_inside_word_origin +# proves: displacement_operator_closes_inside_word_origin +# call: self::test_closes_inside_word_origin +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_displacement_operator_iteration_is_deck_translation +# proves: displacement_operator_iteration_is_deck_translation +# call: self::test_iteration_is_deck_translation +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_displacement_operator_fails_closed +# proves: displacement_operator_fails_closed +# call: self::test_fails_closed +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +from __future__ import annotations + +import os +import sqlite3 +from pathlib import Path + +import pytest + +from english_gonol.displacement_operator import ( + DisplacementOperatorError, + apply_word_displacement, + displacement_operator_receipt, + run_displacement_operator_controls, +) + +UCNS_SOURCE_ROOT = Path(os.environ.get("UCNS_SOURCE_ROOT", "/tmp/ucns-lift")) + + +def _fixture_state(tmp_path: Path) -> Path: + state_dir = tmp_path / "state" + state_dir.mkdir() + db = sqlite3.connect(state_dir / "construct.db") + db.executescript( + """ + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT NOT NULL UNIQUE); + CREATE TABLE definitions ( + id INTEGER PRIMARY KEY, + origin_word_id INTEGER NOT NULL REFERENCES words(id), + part_of_speech TEXT NOT NULL, + ordinal INTEGER NOT NULL, + sense_id TEXT NOT NULL, + synset_id TEXT NOT NULL, + definition_index INTEGER NOT NULL, + text TEXT NOT NULL, + previous_definition_id INTEGER REFERENCES definitions(id), + UNIQUE (origin_word_id, ordinal) + ); + CREATE TABLE semantic_evidence ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + source_ordinal INTEGER NOT NULL, + channel TEXT NOT NULL, + relation TEXT NOT NULL, + target_word_id INTEGER NOT NULL REFERENCES words(id), + target_ref TEXT NOT NULL + ); + """ + ) + db.executemany("INSERT INTO words VALUES (?, ?)", [(1, "a"), (2, "b")]) + db.executemany( + "INSERT INTO definitions VALUES (?, 1, 'noun', ?, 's', 'syn', 1, 'x', NULL)", + [(1, 1), (2, 2)], + ) + db.execute( + "INSERT INTO semantic_evidence (definition_id, source_ordinal, channel, relation, target_word_id, target_ref) VALUES (1, 0, 'semantic', 'hypernym', 2, 'ref')" + ) + db.commit() + db.close() + return state_dir + + +def test_uses_selected_laws(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = apply_word_displacement(db, 1, UCNS_SOURCE_ROOT) + db.close() + assert record["channels"]["ordinal"] == 1 + assert record["channels"]["semantic"] == 2 + assert record["channels"]["context"] == 2 + assert record["lift"] % 157 == int(record["end_phase"].split("/")[0]) % 157 + + +def test_closes_inside_word_origin(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = apply_word_displacement(db, 1, UCNS_SOURCE_ROOT) + db.close() + assert "O_W" in record["closure"] + + +def test_iteration_is_deck_translation(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + once = apply_word_displacement(db, 1, UCNS_SOURCE_ROOT, iterations=1) + twice = apply_word_displacement(db, 1, UCNS_SOURCE_ROOT, iterations=2) + db.close() + assert twice["lift"] == once["lift"] + 157 + + +def test_fails_closed(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + with pytest.raises(DisplacementOperatorError): + apply_word_displacement(db, 1, UCNS_SOURCE_ROOT, iterations=-1) + db.close() + + report = run_displacement_operator_controls(state_dir, UCNS_SOURCE_ROOT) + assert report["ok"] is True + receipt = displacement_operator_receipt(state_dir, UCNS_SOURCE_ROOT) + assert receipt["word_count"] == 2 + + with pytest.raises(DisplacementOperatorError): + displacement_operator_receipt(tmp_path / "missing", UCNS_SOURCE_ROOT) diff --git a/human/english/tests/test_displacement_operator_options.py b/human/english/tests/test_displacement_operator_options.py new file mode 100644 index 0000000..431e5d4 --- /dev/null +++ b/human/english/tests/test_displacement_operator_options.py @@ -0,0 +1,136 @@ +# === CHECKS === +# id: check_channel_options_are_built +# proves: channel_options_are_built +# call: self::test_channel_options_are_built +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_channel_option_selection_preserves_identity +# proves: channel_option_selection_preserves_identity +# call: self::test_selection_preserves_identity +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_channel_option_selection_prefers_distinctness +# proves: channel_option_selection_prefers_distinctness +# call: self::test_selection_prefers_distinctness +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +from __future__ import annotations + +import os +import sqlite3 +from pathlib import Path + +from english_gonol.displacement_operator_options import ( + channel_option_a, + channel_option_b, + channel_option_c, + run_channel_option_adjudication, +) + +UCNS_SOURCE_ROOT = Path(os.environ.get("UCNS_SOURCE_ROOT", "/tmp/ucns-lift")) + + +def _fixture_state(tmp_path: Path) -> Path: + state_dir = tmp_path / "state" + state_dir.mkdir() + db = sqlite3.connect(state_dir / "construct.db") + db.executescript( + """ + CREATE TABLE characters (id INTEGER PRIMARY KEY, scalar TEXT NOT NULL UNIQUE, public_position INTEGER); + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT NOT NULL UNIQUE); + CREATE TABLE word_characters ( + word_id INTEGER NOT NULL REFERENCES words(id), + ordinal INTEGER NOT NULL, + character_id INTEGER NOT NULL REFERENCES characters(id), + PRIMARY KEY (word_id, ordinal) + ) WITHOUT ROWID; + CREATE TABLE definitions ( + id INTEGER PRIMARY KEY, + origin_word_id INTEGER NOT NULL REFERENCES words(id), + part_of_speech TEXT NOT NULL, + ordinal INTEGER NOT NULL, + sense_id TEXT NOT NULL, + synset_id TEXT NOT NULL, + definition_index INTEGER NOT NULL, + text TEXT NOT NULL, + previous_definition_id INTEGER REFERENCES definitions(id), + UNIQUE (origin_word_id, ordinal) + ); + CREATE TABLE definition_components ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + ordinal INTEGER NOT NULL, + kind TEXT NOT NULL, + word_id INTEGER REFERENCES words(id), + character_id INTEGER REFERENCES characters(id), + start_offset INTEGER NOT NULL, + end_offset INTEGER NOT NULL + ); + CREATE TABLE semantic_evidence ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + source_ordinal INTEGER NOT NULL, + channel TEXT NOT NULL, + relation TEXT NOT NULL, + target_word_id INTEGER NOT NULL REFERENCES words(id), + target_ref TEXT NOT NULL + ); + """ + ) + db.execute("INSERT INTO characters VALUES (1, 'a', 0)") + db.execute("INSERT INTO characters VALUES (2, 'b', 1)") + db.executemany("INSERT INTO words VALUES (?, ?)", [(1, "ab"), (2, "a"), (3, "b")]) + db.executemany( + "INSERT INTO word_characters VALUES (?, ?, ?)", + [(1, 0, 1), (1, 1, 2), (2, 0, 1), (3, 0, 2)], + ) + db.executemany( + "INSERT INTO definitions VALUES (?, 1, 'noun', ?, 's', 'syn', ?, 'x', NULL)", + [(1, 1, 1), (2, 2, 2)], + ) + db.executemany( + "INSERT INTO definition_components (id, definition_id, ordinal, kind, word_id, character_id, start_offset, end_offset) VALUES (?, ?, ?, 'word', ?, NULL, 0, 1)", + [(1, 1, 0, 2), (2, 2, 0, 3)], + ) + db.commit() + db.close() + return state_dir + + +def test_channel_options_are_built(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + assert channel_option_a(db, 1)[0] == 1 + assert channel_option_b(db, 1, UCNS_SOURCE_ROOT)[0] == 1 + assert channel_option_c(db, 1)[0] == 1 + db.close() + + +def test_selection_preserves_identity(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = run_channel_option_adjudication(state_dir, UCNS_SOURCE_ROOT) + assert report["word_count"] == 3 + for option in ("a", "b", "c"): + assert report["options"][option]["identity_preserved"] is True + assert report["selected"] in ("a", "b", "c") + + +def test_selection_prefers_distinctness(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = run_channel_option_adjudication(state_dir, UCNS_SOURCE_ROOT) + selected = report["selected"] + assert selected is not None + assert report["options"][selected]["distinct_receipts"] == max( + stats["distinct_receipts"] for stats in report["options"].values() + ) + assert "preserving the identity" in report["hmmm"] diff --git a/human/english/tests/test_edcm_metric_origins.py b/human/english/tests/test_edcm_metric_origins.py new file mode 100644 index 0000000..89d8a5a --- /dev/null +++ b/human/english/tests/test_edcm_metric_origins.py @@ -0,0 +1,312 @@ +# === CHECKS === +# id: check_metric_origin_instrument_boundary +# proves: metric_origin_words_define_instrument_not_evidence +# call: self::test_origin_record_contains_no_measurement_value +# requires: python3 +# timeout: 10 +# mutates: none +# cleanup: none +# +# id: check_metric_origin_order_provenance +# proves: metric_origin_preserves_order_identity_provenance +# call: self::test_resolved_origin_uses_word_and_glyph_axes_in_order +# requires: python3 +# timeout: 10 +# mutates: temporary sqlite fixture +# cleanup: pytest tmp_path +# +# id: check_metric_origin_construct_identity +# proves: metric_origin_preserves_order_identity_provenance +# call: self::test_wrong_construct_receipt_fails_closed +# requires: python3 +# timeout: 10 +# mutates: temporary sqlite fixture +# cleanup: pytest tmp_path +# +# id: check_metric_origin_hmmm +# proves: metric_origin_unresolved_fails_open_as_hmmm_not_closed +# call: self::test_unresolved_origin_does_not_construct_components +# requires: python3 +# timeout: 10 +# mutates: none +# cleanup: none +# +# id: check_metric_origin_receipt_schema +# proves: metric_origin_receipt_binds_schema +# call: self::test_receipt_hashes_complete_payload_except_receipt +# requires: python3 +# timeout: 10 +# mutates: temporary sqlite fixture +# cleanup: pytest tmp_path +# id: check_metric_origin_pinned_corpus_admission +# proves: metric_origin_terms_admitted_by_pinned_corpus +# call: self::test_all_resolved_terms_are_admitted_by_pinned_oewn +# requires: python3, PyYAML, exact OEWN 2025 source +# timeout: 60 +# mutates: none +# cleanup: none +# id: check_metric_origin_source_fixture +# proves: metric_origin_source_fixture_matches_pinned_edcm +# call: self::test_stack_fixture_matches_exact_edcm_producer +# requires: python3, exact EDCM metric-origin producer +# mutates: none +# cleanup: none +# === END CHECKS === + +from hashlib import sha256 +import importlib.util +import json +import os +import sqlite3 +import subprocess +import sys +from pathlib import Path + +import pytest + +import english_gonol.edcm_metric_origins as origins +from english_gonol.hyperspace_construct import V2_MANIFEST_RECEIPT +from english_gonol.full_construct_run import _collect_surfaces, verify_replay +from english_gonol.language.source import load_oewn_2025, OEWN_COMMIT + + +def _fixture(tmp_path: Path): + path = tmp_path / "source.json" + path.write_bytes(origins.FIXTURE.read_bytes()) + return path + + +def _source_root(variable): + root = os.environ.get(variable) + if not root: + if os.environ.get("REQUIRE_METRIC_ORIGIN_SOURCES") == "1": + pytest.fail(f"required provenance source missing: {variable}") + pytest.skip(f"{variable} not supplied for optional local replay") + return Path(root) + + +def _verify_checkout(root, commit, paths): + assert subprocess.check_output(["git", "-C", str(root), "rev-parse", "HEAD"], text=True).strip() == commit + subprocess.run(["git", "-C", str(root), "diff", "--exit-code", "HEAD", "--", *paths], check=True) + + +def _db(tmp_path: Path): + db=sqlite3.connect(tmp_path/"construct.db") + db.executescript(""" + CREATE TABLE characters (id INTEGER PRIMARY KEY, scalar TEXT, public_position INTEGER); + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT); + CREATE TABLE word_characters (word_id INTEGER, ordinal INTEGER, character_id INTEGER); + """) + chars={} + next_id=1 + words=["fixation","persistence","repetition"] + for surface in words: + for ch in surface+" ": + if ch not in chars: + chars[ch]=next_id + db.execute("INSERT INTO characters VALUES (?,?,NULL)",(next_id,ch)) + next_id+=1 + for wid,surface in enumerate(words,1): + db.execute("INSERT INTO words VALUES (?,?)",(wid,surface)) + for ordinal,ch in enumerate(surface): + db.execute("INSERT INTO word_characters VALUES (?,?,?)",(wid,ordinal,chars[ch])) + db.commit(); db.close() + + +def _verified(monkeypatch): + monkeypatch.setattr(origins, "_assert_schema_boundary", lambda _db: None) + monkeypatch.setattr(origins, "_logical_receipt", lambda _db: V2_MANIFEST_RECEIPT) + + +def test_resolved_origin_uses_word_and_glyph_axes_in_order(tmp_path, monkeypatch): + _db(tmp_path); _verified(monkeypatch) + record=origins.build_metric_origin_set(tmp_path,"F",fixture_path=_fixture(tmp_path)) + assert record.closed + assert record.construct_receipt==V2_MANIFEST_RECEIPT + assert record.source_text=="fixation persistence repetition" + assert record.components[0].axis_origin=="O_W" + assert any(x.axis_origin=="O_G" and x.surface==" " for x in record.components) + assert record.producer_repository=="The-Interdependency/edcm" + assert "maintained implementation is a lexical structural proxy, not embedding similarity" in record.unresolved + assert record.carrier_id == "F" + assert record.metric_id == "edcm.behavioral.F.fixation" + assert record.origin_id == "O_M(edcm.behavioral.F.fixation)" + + +def test_origin_record_contains_no_measurement_value(tmp_path, monkeypatch): + _db(tmp_path); _verified(monkeypatch) + record=origins.build_metric_origin_set(tmp_path,"F",fixture_path=_fixture(tmp_path)) + keys=record.to_dict() + assert "value" not in keys + assert "measurement" not in keys + assert "score" not in keys + assert record.source_text=="fixation persistence repetition" + + +def test_wrong_construct_receipt_fails_closed(tmp_path, monkeypatch): + _db(tmp_path) + monkeypatch.setattr(origins, "_assert_schema_boundary", lambda _db: None) + monkeypatch.setattr(origins, "_logical_receipt", lambda _db: "0"*64) + with pytest.raises(ValueError,match="construct receipt mismatch"): + origins.build_metric_origin_set(tmp_path,"F",fixture_path=_fixture(tmp_path)) + + +def test_o_l_source_split_is_resolved_without_aliasing(): + fixture=origins.load_metric_origin_specs() + o=fixture["specs"]["O"] + l=fixture["specs"]["L"] + assert o["standing"]=="resolved" + assert l["standing"]=="resolved" + assert o["canonical_metric_id"]=="edcm.behavioral.O_scope" + assert l["canonical_metric_id"]=="edcm.behavioral.L_loss" + assert "O_confidence" in o["unresolved"][0] + assert "L_load" in l["unresolved"][0] + assert "L_resistance" in l["unresolved"][0] + + +def test_unresolved_origin_does_not_construct_components(tmp_path, monkeypatch): + path=_fixture(tmp_path) + source=json.loads(path.read_text()) + source["specs"]["O"]["standing"]="hmmm" + source["specs"]["O"]["construction_terms"]=[] + source["specs"]["O"]["unresolved"]=["synthetic unresolved boundary"] + path.write_text(json.dumps(source, indent=2) + "\n") + monkeypatch.setattr(origins, "FIXTURE_SHA256", sha256(path.read_bytes()).hexdigest()) + record=origins.build_metric_origin_set(tmp_path,"O",fixture_path=path) + assert record.carrier_id=="O" + assert record.metric_id=="edcm.behavioral.O_scope" + assert record.closed is False + assert record.components==() + assert record.construct_receipt=="hmmm" + assert record.unresolved==("synthetic unresolved boundary",) + assert record.origin_id=="O_M(edcm.behavioral.O_scope)" + + +def test_receipt_hashes_complete_payload_except_receipt(tmp_path, monkeypatch): + _db(tmp_path); _verified(monkeypatch) + record=origins.build_metric_origin_set(tmp_path,"F",fixture_path=_fixture(tmp_path)) + payload=record.to_dict() + receipt=payload.pop("receipt_sha256") + expected=sha256(json.dumps( + payload,sort_keys=True,ensure_ascii=False,separators=(",",":"),allow_nan=False + ).encode("utf-8")).hexdigest() + assert receipt==expected + assert payload["schema"]==origins.SCHEMA + assert payload["version"]==origins.VERSION + + +def test_all_resolved_terms_are_admitted_by_pinned_oewn(): + root = _source_root("OEWN_SOURCE_ROOT") + _verify_checkout(root, OEWN_COMMIT, ["."]) + snapshot=load_oewn_2025(root) + words,_characters=_collect_surfaces(snapshot) + admitted=set(words) + fixture=origins.load_metric_origin_specs() + missing={} + for metric,spec in fixture["specs"].items(): + if spec["standing"]!="resolved": + continue + absent=[term for term in spec["construction_terms"] if term not in admitted] + if absent: + missing[metric]=absent + assert missing=={} + + +def test_stack_fixture_matches_exact_edcm_producer(): + root = _source_root("EDCM_METRIC_ORIGIN_ROOT") + fixture=origins.load_metric_origin_specs() + _verify_checkout(root, fixture["producer_commit"], ["edcm"] ) + module_path=Path(root)/"edcm"/"metric_origin_spec.py" + spec=importlib.util.spec_from_file_location("_pinned_edcm_metric_origin_spec",module_path) + assert spec is not None and spec.loader is not None + module=importlib.util.module_from_spec(spec) + sys.modules[spec.name]=module + spec.loader.exec_module(module) + fixture=origins.load_metric_origin_specs() + assert fixture["producer_commit"]=="0873c105799681ea1f7ccb3e619d1f7aebbd85e0" + assert tuple(fixture["specs"])==tuple(module.METRIC_ORIGIN_SPECS) + for metric,source_spec in module.METRIC_ORIGIN_SPECS.items(): + record=fixture["specs"][metric] + assert record["canonical_metric_id"]==source_spec.canonical_metric_id + assert record["surface_terms"]==list(source_spec.surface_terms) + assert record["construction_terms"]==list(source_spec.construction_terms) + assert record["semantic_definition"]==source_spec.semantic_definition + assert record["standing"]==source_spec.standing + assert record["measurement_alignment"]==source_spec.measurement_alignment + assert record["unresolved"]==list(source_spec.unresolved) + + +@pytest.mark.parametrize("mutation", ["repository", "commit", "terms", "standing"]) +def test_unregistered_or_modified_fixture_fails_closed(tmp_path, mutation): + path = _fixture(tmp_path) + source = json.loads(path.read_text()) + if mutation == "repository": + source["producer_repository"] = "someone/else" + elif mutation == "commit": + source["producer_commit"] = "a" * 40 + elif mutation == "terms": + source["specs"]["F"]["construction_terms"] = ["invented"] + else: + source["specs"]["O"]["standing"] = "resolved" + path.write_text(json.dumps(source)) + with pytest.raises(ValueError, match="fixture digest mismatch"): + origins.build_metric_origin_set(tmp_path, "F", fixture_path=path) + + +def test_packaged_producer_registration_agrees(): + fixture = origins.load_metric_origin_specs() + registered = json.loads(origins.BASE.read_text())["metric_origin_source"] + assert registered["repository"] == fixture["producer_repository"] + assert registered["commit"] == fixture["producer_commit"] + assert registered["authority_transfer"] is False + + +def test_required_provenance_source_cannot_skip(monkeypatch): + monkeypatch.setenv("REQUIRE_METRIC_ORIGIN_SOURCES", "1") + monkeypatch.delenv("OEWN_SOURCE_ROOT", raising=False) + with pytest.raises(pytest.fail.Exception, match="required provenance source missing"): + _source_root("OEWN_SOURCE_ROOT") + + +def test_full_construct_origins_bind_to_pinned_edcm(): + state_dir = _source_root("ENGLISH_GONOL_FULL_CONSTRUCT_ROOT") + edcm_root = _source_root("EDCM_METRIC_ORIGIN_ROOT") + fixture = origins.load_metric_origin_specs() + _verify_checkout(edcm_root, fixture["producer_commit"], ["edcm"]) + manifest = verify_replay(state_dir) + assert manifest["receipt_sha256"] == V2_MANIFEST_RECEIPT + records = {metric: origins.build_metric_origin_set(state_dir, metric).to_dict() + for metric in fixture["specs"]} + for metric, record in records.items(): + payload = {k: v for k, v in record.items() if k != "receipt_sha256"} + assert sha256(origins._canonical(payload)).hexdigest() == record["receipt_sha256"] + canonical = fixture["specs"][metric]["canonical_metric_id"] + assert record["carrier_id"] == metric + assert record["metric_id"] == canonical + assert record["origin_id"] == f"O_M({canonical})" + assert record["closed"] is True + # A subprocess prevents an already-imported editable EDCM from shadowing + # the exact producer checkout under test. + result = subprocess.run( + [sys.executable, "-c", """ +import json, sys +from dataclasses import asdict +from edcm.measurement import compute_transcript, parse_transcript +from edcm.semantic_metric_space import build_semantic_metric_space, bind_round_metrics +origins = json.load(sys.stdin) +space = build_semantic_metric_space(origins) +assert space.unresolved_metrics == () +assert space.complete +metrics = compute_transcript(parse_transcript('A: State the constraint.\\nB: Recorded.'))[0] +rows = bind_round_metrics(metrics, space, evidence_receipt='synthetic-transcript:full-replay-test') +assert [row.value for row in rows] == metrics.vector() +assert all(row.semantic_projection == 'hmmm' for row in rows) +print(json.dumps([asdict(row) for row in rows], allow_nan=False)) +"""], cwd=edcm_root, input=json.dumps(records), text=True, capture_output=True, + env={**os.environ, "PYTHONPATH": str(edcm_root)}, check=True, + ) + evidence = {"producer_commit": fixture["producer_commit"], + "construct_receipt": manifest["receipt_sha256"], + "origin_records": records, "readouts": json.loads(result.stdout), + "unresolved_metrics": [], "semantic_projection": "hmmm"} + (state_dir / "metric-origin-replay.json").write_text(json.dumps(evidence, indent=2) + "\n") diff --git a/human/english/tests/test_hilbert_inference.py b/human/english/tests/test_hilbert_inference.py new file mode 100644 index 0000000..1794078 --- /dev/null +++ b/human/english/tests/test_hilbert_inference.py @@ -0,0 +1,376 @@ +# === CHECKS === +# id: check_hilbert_axes_are_uchc_axes_not_cartesian +# proves: hilbert_axes_are_uchc_axes_not_cartesian +# call: self::test_origin_local_basis_uses_declared_axes +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# +# id: check_hilbert_axis_identity_is_construct_bound +# proves: hilbert_axis_identity_is_construct_bound +# call: self::test_axis_identity_is_construct_bound +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# +# id: check_hilbert_origin_local_inner_product +# proves: hilbert_origin_local_inner_product +# call: self::test_origin_local_inner_product_and_fail_closed_boundaries +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# +# id: check_hilbert_word_promotion_preserves_order_and_multiplicity +# proves: hilbert_word_promotion_preserves_order_and_multiplicity +# call: self::test_word_promotion_preserves_order_and_multiplicity +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# +# id: check_hilbert_dimension_queries_do_not_reconstruct_members +# proves: hilbert_dimension_queries_do_not_reconstruct_members +# call: self::test_dimension_queries_are_direct_counts +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# +# id: check_hilbert_finite_origin_spaces_are_complete +# proves: hilbert_finite_origin_spaces_are_complete +# call: self::test_finite_spaces_require_explicit_field_and_are_complete +# requires: python3 +# timeout: 30 +# mutates: tmp sqlite only +# cleanup: pytest tmp_path +# === END CHECKS === + +from __future__ import annotations + +import sqlite3 +from hashlib import sha256 +from dataclasses import replace +from pathlib import Path + +import pytest + +from english_gonol.hilbert_inference import ( + ConstructRef, + VerifiedConstruct, + HilbertStateVector, + definition_axis, + HilbertInferenceError, + basis_vector, + definition_promotion, + definition_space, + glyph_axis, + glyph_space, + word_axis, + word_promotion, + word_space, +) +from english_gonol.full_construct_run import _SCHEMA_SQL, _logical_receipt, SCHEMA, VERSION +from english_gonol.hyperspace_construct import ( + glyph_inventory, + promote_word, +) + + +def _fixture_db(tmp_path: Path, mutation: str | None = None) -> VerifiedConstruct: + path = tmp_path / "construct.db" + db = sqlite3.connect(path) + db.executescript(_SCHEMA_SQL) + db.executemany("INSERT INTO meta VALUES (?, ?)", [("schema", SCHEMA), ("version", VERSION)]) + db.executemany( + "INSERT INTO characters VALUES (?, ?, ?)", + [(1, "a", 0), (2, "b", 1), (3, " ", 2)], + ) + db.executemany( + "INSERT INTO words VALUES (?, ?)", + [(1, "ab"), (2, "a"), (3, "aa")], + ) + db.executemany( + "INSERT INTO word_characters VALUES (?, ?, ?)", + [ + (1, 0, 1), + (1, 1, 2), + (2, 0, 1), + (3, 0, 1), + (3, 1, 1), + ], + ) + db.execute( + "INSERT INTO definitions VALUES " + "(1, 1, 'noun', 1, 'sense', 'synset', 1, 'a a', NULL)" + ) + db.executemany( + "INSERT INTO definition_components " + "(definition_id, ordinal, kind, word_id, character_id, start_offset, end_offset) " + "VALUES (1, ?, ?, ?, ?, ?, ?)", + [ + (0, "word", 2, None, 0, 1), + (1, "character", None, 3, 1, 2), + (2, "word", 2, None, 2, 3), + ], + ) + if mutation: + db.execute(mutation) + db.commit() + logical = _logical_receipt(db) + db.close() + ref = ConstructRef(logical, sha256(path.read_bytes()).hexdigest()) + return VerifiedConstruct(path, ref) + + +def test_origin_local_basis_uses_declared_axes(tmp_path: Path) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + + a_axis = glyph_axis(inventory["a"], db.construct, db=db) + b_axis = glyph_axis(inventory["b"], db.construct, db=db) + + assert a_axis.identity == "a" + assert a_axis.axis_index == inventory["a"].axis_index + assert a_axis.space_id == "O_G" + + a = basis_vector(a_axis, scalar_field="R") + b = basis_vector(b_axis, scalar_field="R") + assert a.inner_product(a) == 1 + assert a.inner_product(b) == 0 + assert a.scale(2).add(b.scale(3)).norm_squared() == 13 + db.close() + + +def test_axis_identity_is_construct_bound(tmp_path: Path) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + + same_glyph_a = glyph_axis(inventory["a"], db.construct, db=db) + other_path = tmp_path / "other" + other_path.mkdir() + other = _fixture_db(other_path, "UPDATE words SET surface='ba' WHERE id=1") + same_glyph_b = glyph_axis(other.inventory["a"], other.construct, db=other) + assert same_glyph_a != same_glyph_b + + vector_a = basis_vector(same_glyph_a, scalar_field="R") + vector_b = basis_vector(same_glyph_b, scalar_field="R") + with pytest.raises(HilbertInferenceError, match="cross-construct"): + vector_a.inner_product(vector_b) + other.close() + db.close() + + +def test_origin_local_inner_product_and_fail_closed_boundaries( + tmp_path: Path, +) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + glyph = basis_vector( + glyph_axis(inventory["a"], db.construct, db=db), + scalar_field="C", + ) + word, _axis_index = promote_word(db._db, 2) + word_vector = basis_vector( + word_axis(word, db.construct, db=db), + scalar_field="C", + ) + + assert glyph.scale(1j).norm_squared() == 1 + with pytest.raises(HilbertInferenceError, match="cross-origin"): + glyph.inner_product(word_vector) + with pytest.raises(HilbertInferenceError, match="scalar fields"): + glyph.inner_product( + basis_vector(glyph_axis(inventory["a"], db.construct, db=db), scalar_field="R") + ) + db.close() + + +def test_word_promotion_preserves_order_and_multiplicity(tmp_path: Path) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + + ab = word_promotion( + db, + inventory, + 1, + db.construct, + scalar_field="R", + ) + assert [factor.identity for factor in ab.source.factors] == ["a", "b"] + assert ab.target.identity_kind == "word" + assert ab.target.identity == "1" + + aa = word_promotion( + db, + inventory, + 3, + db.construct, + scalar_field="R", + ) + assert [factor.identity for factor in aa.source.factors] == ["a", "a"] + assert len(aa.source.factors) == 2 + assert aa.target.identity == "3" + + definition = definition_promotion( + db, + inventory, + 1, + db.construct, + scalar_field="R", + ) + assert [ + (factor.identity_kind, factor.identity) + for factor in definition.source.factors + ] == [ + ("word", "2"), + ("glyph", " "), + ("word", "2"), + ] + assert definition.target.space_id == "O_D:1" + db.close() + + +def test_dimension_queries_are_direct_counts(tmp_path: Path) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + queries: list[str] = [] + db._db.set_trace_callback(queries.append) + + words = word_space(db, db.construct, scalar_field="R") + definitions = definition_space(db, db.construct, 1, scalar_field="R") + glyphs = glyph_space(inventory, db.construct, db=db, scalar_field="R") + + db._db.set_trace_callback(None) + normalized = [" ".join(query.upper().split()) for query in queries] + assert words.dimension == 3 + assert definitions.dimension == 1 + assert glyphs.dimension == 3 + assert normalized.count("SELECT COUNT(*) FROM WORDS") == 1 + assert normalized.count( + "SELECT COUNT(*) FROM DEFINITIONS WHERE ORIGIN_WORD_ID = 1" + ) == 1 + assert not any("WORD_CHARACTERS" in query for query in normalized) + db.close() + + +def test_finite_spaces_require_explicit_field_and_are_complete( + tmp_path: Path, +) -> None: + db = _fixture_db(tmp_path) + inventory = db.inventory + + real_space = glyph_space(inventory, db.construct, db=db, scalar_field="R") + complex_space = word_space(db, db.construct, scalar_field="C") + assert real_space.complete is True + assert complex_space.complete is True + assert real_space.scalar_field == "R" + assert complex_space.scalar_field == "C" + + with pytest.raises(HilbertInferenceError, match="scalar_field"): + glyph_space(inventory, db.construct, db=db, scalar_field="Q") + with pytest.raises(HilbertInferenceError, match="imaginary"): + basis_vector( + glyph_axis(inventory["a"], db.construct, db=db), + scalar_field="R", + ).scale(1j) + db.close() + + +@pytest.mark.parametrize("field", ["artifact_sha256", "logical_receipt"]) +def test_rejects_well_formed_false_artifact_identity(tmp_path: Path, field: str) -> None: + with _fixture_db(tmp_path) as db: + wrong = replace(db.construct, **{field: "0" * 64}) + with pytest.raises(HilbertInferenceError, match="mismatch"): + VerifiedConstruct(tmp_path / "construct.db", wrong) + + +def test_every_database_helper_rejects_stale_reference(tmp_path: Path) -> None: + with _fixture_db(tmp_path) as db: + wrong = replace(db.construct, logical_receipt="0" * 64) + word = promote_word(db._db, 1)[0] + from english_gonol.hyperspace_construct import promote_definition + definition = promote_definition(db._db, 1)[0] + calls = [ + lambda: glyph_axis(db.inventory["a"], wrong, db=db), + lambda: word_axis(word, wrong, db=db), + lambda: definition_axis(definition, wrong, db=db), + lambda: glyph_space(db.inventory, wrong, scalar_field="R", db=db), + lambda: word_space(db, wrong, scalar_field="R"), + lambda: definition_space(db, wrong, 1, scalar_field="R"), + lambda: word_promotion(db, db.inventory, 1, wrong, scalar_field="R"), + lambda: definition_promotion(db, db.inventory, 1, wrong, scalar_field="R"), + ] + for call in calls: + with pytest.raises(HilbertInferenceError, match="reference does not match"): + call() + with pytest.raises(HilbertInferenceError, match="VerifiedConstruct is required"): + word_space(db._db, db.construct, scalar_field="R") + + +def test_snapshot_keeps_identity_after_source_changes_and_rejects_closed_handle(tmp_path: Path) -> None: + with _fixture_db(tmp_path) as db: + before = word_promotion(db, db.inventory, 1, db.construct, scalar_field="R") + with sqlite3.connect(tmp_path / "construct.db") as source: + source.execute("UPDATE words SET surface='ba' WHERE id=1") + assert word_promotion(db, db.inventory, 1, db.construct, scalar_field="R") == before + with pytest.raises(sqlite3.OperationalError, match="readonly"): + db._db.execute("UPDATE words SET surface='ba' WHERE id=1") + with pytest.raises(HilbertInferenceError, match="artifact SHA-256 mismatch"): + VerifiedConstruct(tmp_path / "construct.db", db.construct) + with pytest.raises(HilbertInferenceError, match="closed"): + word_space(db, db.construct, scalar_field="R") + + +def test_rejects_foreign_glyph_inventory_and_gonols(tmp_path: Path) -> None: + with _fixture_db(tmp_path) as db: + foreign = dict(db.inventory) + foreign["a"] = replace(foreign["a"], axis_index=99) + with pytest.raises(HilbertInferenceError, match="inventory"): + word_promotion(db, foreign, 1, db.construct, scalar_field="R") + with pytest.raises(HilbertInferenceError, match="glyph does not match"): + glyph_axis(foreign["a"], db.construct, db=db) + word = promote_word(db._db, 1)[0] + with pytest.raises(HilbertInferenceError, match="word does not match"): + word_axis(replace(word, glyph_ids=(2, 1)), db.construct, db=db) + + +@pytest.mark.parametrize("mutation", [ + "UPDATE words SET surface='ba' WHERE id=1", + "UPDATE word_characters SET character_id=1 WHERE word_id=1 AND ordinal=1", + "DELETE FROM word_characters WHERE word_id=1 AND ordinal=1", +]) +def test_word_factors_refuse_inconsistent_declared_glyphs(tmp_path: Path, mutation: str) -> None: + # Hashes are valid for these malformed artifacts; content consistency is a + # separate obligation, including equal-length disagreement and multiplicity. + with _fixture_db(tmp_path, mutation) as db: + with pytest.raises(HilbertInferenceError, match="surface disagrees"): + word_promotion(db, db.inventory, 1, db.construct, scalar_field="R") + + +@pytest.mark.parametrize("field, coefficient", [("R", 1e308), ("C", 1e308j)]) +def test_inner_product_and_norm_refuse_nonfinite_results(tmp_path: Path, field: str, coefficient: complex) -> None: + with _fixture_db(tmp_path) as db: + a = basis_vector(glyph_axis(db.inventory["a"], db.construct, db=db), scalar_field=field) + enormous = a.scale(coefficient) + for operation in (lambda: enormous.inner_product(enormous), enormous.norm_squared, enormous.norm): + with pytest.raises(HilbertInferenceError, match="finite"): + operation() + # Each product is finite, but their sum overflows. + b = basis_vector(glyph_axis(db.inventory["b"], db.construct, db=db), scalar_field=field) + accumulated = a.add(b).scale(1e154) + with pytest.raises(HilbertInferenceError, match="finite"): + accumulated.inner_product(accumulated) + + +@pytest.mark.parametrize("field", ["R", "C"]) +def test_zero_coordinates_have_one_equality_and_hash_identity(tmp_path: Path, field: str) -> None: + with _fixture_db(tmp_path) as db: + a = basis_vector(glyph_axis(db.inventory["a"], db.construct, db=db), scalar_field=field) + zero = HilbertStateVector(db.construct, "O_G", field, ()) + explicit = replace(a, coordinates=((a.coordinates[0][0], -0.0),)) + zeros = (zero, explicit, a.scale(0), a.add(a.scale(-1)), a.scale(1e-300).scale(1e-300)) + assert all(item.coordinates == () and item.norm_squared() == 0 for item in zeros) + assert len(set(zeros)) == 1 diff --git a/human/english/tests/test_hyperspace_geometry.py b/human/english/tests/test_hyperspace_geometry.py new file mode 100644 index 0000000..bf9e1ba --- /dev/null +++ b/human/english/tests/test_hyperspace_geometry.py @@ -0,0 +1,133 @@ +# === CHECKS === +# id: check_definition_inner_product_is_constructed_not_statistical +# proves: definition_inner_product_is_constructed_not_statistical +# call: self::test_definition_inner_product_is_constructed_not_statistical +# requires: python3 +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_word_axis_angle_is_glyph_walk_terminal_phase +# proves: word_axis_angle_is_glyph_walk_terminal_phase +# call: self::test_word_axis_angle_is_glyph_walk_terminal_phase +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_hyperspace_geometry_candidates_are_replayable +# proves: hyperspace_geometry_candidates_are_replayable +# call: self::test_candidates_are_replayable +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +from __future__ import annotations + +import os +import sqlite3 +from pathlib import Path + +from english_gonol.hyperspace_geometry import ( + definition_inner_product, + run_hyperspace_geometry_controls, + word_axis_angle, +) + +UCNS_SOURCE_ROOT = Path(os.environ.get("UCNS_SOURCE_ROOT", "/tmp/ucns-motion")) + + +def _fixture_state(tmp_path: Path) -> Path: + state_dir = tmp_path / "state" + state_dir.mkdir() + db = sqlite3.connect(state_dir / "construct.db") + db.executescript( + """ + CREATE TABLE characters (id INTEGER PRIMARY KEY, scalar TEXT NOT NULL UNIQUE, public_position INTEGER); + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT NOT NULL UNIQUE); + CREATE TABLE word_characters ( + word_id INTEGER NOT NULL REFERENCES words(id), + ordinal INTEGER NOT NULL, + character_id INTEGER NOT NULL REFERENCES characters(id), + PRIMARY KEY (word_id, ordinal) + ) WITHOUT ROWID; + CREATE TABLE definitions ( + id INTEGER PRIMARY KEY, + origin_word_id INTEGER NOT NULL REFERENCES words(id), + part_of_speech TEXT NOT NULL, + ordinal INTEGER NOT NULL, + sense_id TEXT NOT NULL, + synset_id TEXT NOT NULL, + definition_index INTEGER NOT NULL, + text TEXT NOT NULL, + previous_definition_id INTEGER REFERENCES definitions(id), + UNIQUE (origin_word_id, ordinal) + ); + CREATE TABLE definition_components ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + ordinal INTEGER NOT NULL, + kind TEXT NOT NULL, + word_id INTEGER REFERENCES words(id), + character_id INTEGER REFERENCES characters(id), + start_offset INTEGER NOT NULL, + end_offset INTEGER NOT NULL + ); + """ + ) + db.execute("INSERT INTO characters VALUES (1, 'a', 0)") + db.execute("INSERT INTO characters VALUES (2, 'b', 1)") + db.execute("INSERT INTO characters VALUES (3, 'c', 2)") + db.executemany( + "INSERT INTO words VALUES (?, ?)", + [(1, "abc"), (2, "a"), (3, "b"), (4, "c")], + ) + db.executemany( + "INSERT INTO word_characters VALUES (?, ?, ?)", + [(1, 0, 1), (1, 1, 2), (1, 2, 3), (2, 0, 1), (3, 0, 2), (4, 0, 3)], + ) + db.executemany( + "INSERT INTO definitions VALUES (?, 1, 'noun', ?, 's', 'syn', ?, 'x', NULL)", + [(1, 1, 1), (2, 2, 2), (3, 3, 3)], + ) + # def 1: words 2 and 3 -> {a, b}; def 2: word 4 -> {c}; def 3: words 2 and 4 -> {a, c} + db.executemany( + "INSERT INTO definition_components (id, definition_id, ordinal, kind, word_id, character_id, start_offset, end_offset) VALUES (?, ?, ?, 'word', ?, NULL, 0, 1)", + [(1, 1, 0, 2), (2, 1, 1, 3), (3, 2, 0, 4), (4, 3, 0, 2), (5, 3, 1, 4)], + ) + db.commit() + db.close() + return state_dir + + +def test_definition_inner_product_is_constructed_not_statistical(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + self_product = definition_inner_product(db, 1, 1, 1) + assert self_product["inner_product"] == self_product["norm_first"] == 2 + disjoint = definition_inner_product(db, 1, 1, 2) + assert disjoint["orthogonal"] is True and disjoint["inner_product"] == 0 + shared = definition_inner_product(db, 1, 1, 3) + assert shared["orthogonal"] is False and shared["inner_product"] == 1 + db.close() + + +def test_word_axis_angle_is_glyph_walk_terminal_phase(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + first = word_axis_angle(db, 1, UCNS_SOURCE_ROOT) + second = word_axis_angle(db, 1, UCNS_SOURCE_ROOT) + assert first["receipt_sha256"] == second["receipt_sha256"] + assert first["glyph_walk"] == [[0, 1, 0], [1, 2, 0], [2, 3, 0]] + db.close() + + +def test_candidates_are_replayable(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = run_hyperspace_geometry_controls(state_dir, UCNS_SOURCE_ROOT) + assert report["survivors"] == ["definition-inner-product", "word-axis-angle"] + assert report["selected"] == [] + again = run_hyperspace_geometry_controls(state_dir, UCNS_SOURCE_ROOT) + assert again["receipt_sha256"] == report["receipt_sha256"] diff --git a/human/english/tests/test_hyperspace_views.py b/human/english/tests/test_hyperspace_views.py new file mode 100644 index 0000000..24f7dcd --- /dev/null +++ b/human/english/tests/test_hyperspace_views.py @@ -0,0 +1,182 @@ +# === CHECKS === +# id: check_views_are_four_plus_synthesis +# proves: views_are_four_plus_synthesis +# call: self::test_views_are_four_plus_synthesis +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_views_adjudication_counts_are_exact +# proves: views_adjudication_counts_are_exact +# call: self::test_adjudication_counts_are_exact +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_synthesis_is_first_class_and_replayable +# proves: synthesis_is_first_class_and_replayable +# call: self::test_synthesis_is_first_class_and_replayable +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# +# id: check_views_do_not_select +# proves: views_do_not_select +# call: self::test_views_do_not_select +# requires: python3, git +# timeout: 30 +# mutates: none +# cleanup: none +# === END CHECKS === + +from __future__ import annotations + +import os +import sqlite3 +from pathlib import Path + +from english_gonol.hyperspace_views import run_view_adjudication, word_views + +UCNS_SOURCE_ROOT = Path(os.environ.get("UCNS_SOURCE_ROOT", "/tmp/ucns-motion")) + + +def _fixture_state(tmp_path: Path) -> Path: + state_dir = tmp_path / "state" + state_dir.mkdir() + db = sqlite3.connect(state_dir / "construct.db") + db.executescript( + """ + CREATE TABLE characters (id INTEGER PRIMARY KEY, scalar TEXT NOT NULL UNIQUE, public_position INTEGER); + CREATE TABLE words (id INTEGER PRIMARY KEY, surface TEXT NOT NULL UNIQUE); + CREATE TABLE word_characters ( + word_id INTEGER NOT NULL REFERENCES words(id), + ordinal INTEGER NOT NULL, + character_id INTEGER NOT NULL REFERENCES characters(id), + PRIMARY KEY (word_id, ordinal) + ) WITHOUT ROWID; + CREATE TABLE definitions ( + id INTEGER PRIMARY KEY, + origin_word_id INTEGER NOT NULL REFERENCES words(id), + part_of_speech TEXT NOT NULL, + ordinal INTEGER NOT NULL, + sense_id TEXT NOT NULL, + synset_id TEXT NOT NULL, + definition_index INTEGER NOT NULL, + text TEXT NOT NULL, + previous_definition_id INTEGER REFERENCES definitions(id), + UNIQUE (origin_word_id, ordinal) + ); + CREATE TABLE definition_components ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + ordinal INTEGER NOT NULL, + kind TEXT NOT NULL, + word_id INTEGER REFERENCES words(id), + character_id INTEGER REFERENCES characters(id), + start_offset INTEGER NOT NULL, + end_offset INTEGER NOT NULL + ); + CREATE TABLE semantic_evidence ( + id INTEGER PRIMARY KEY, + definition_id INTEGER NOT NULL REFERENCES definitions(id), + source_ordinal INTEGER NOT NULL, + channel TEXT NOT NULL, + relation TEXT NOT NULL, + target_word_id INTEGER NOT NULL REFERENCES words(id), + target_ref TEXT NOT NULL + ); + """ + ) + db.execute("INSERT INTO characters VALUES (1, 'a', 0)") + db.execute("INSERT INTO characters VALUES (2, 'b', 1)") + db.executemany( + "INSERT INTO words VALUES (?, ?)", + [(1, "ab"), (2, "a"), (3, "b")], + ) + db.executemany( + "INSERT INTO word_characters VALUES (?, ?, ?)", + [(1, 0, 1), (1, 1, 2), (2, 0, 1), (3, 0, 2)], + ) + db.executemany( + "INSERT INTO definitions VALUES (?, 1, 'noun', ?, 's', 'syn', ?, 'x', NULL)", + [(1, 1, 1), (2, 2, 2)], + ) + db.executemany( + "INSERT INTO definition_components (id, definition_id, ordinal, kind, word_id, character_id, start_offset, end_offset) VALUES (?, ?, ?, 'word', ?, NULL, 0, 1)", + [(1, 1, 0, 2), (2, 2, 0, 3)], + ) + db.commit() + db.close() + return state_dir + + +def test_views_are_four_plus_synthesis(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = word_views(db, 1, UCNS_SOURCE_ROOT) + db.close() + assert set(record["views"]) == { + "view1_definition_inner_product_density", + "view2_word_axis_angle", + "view3_provenance_interval_lift", + "view4_canonical_witness_lift", + } + assert len(record["synthesis"]) == 3 + assert record["synthesis_composition"] == "views one, two, and three together" + assert set(record["views"]["view2_word_axis_angle"]) == { + "glyph_walk", + "definition_walk", + } + assert record["views"]["view4_canonical_witness_lift"]["derived"] is True + assert record["views"]["view3_provenance_interval_lift"]["deck"] == 0 + assert record["views"]["view4_canonical_witness_lift"]["lift"] == 157 + record["views"]["view4_canonical_witness_lift"]["residue"] + + +def test_adjudication_counts_are_exact(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = run_view_adjudication(state_dir, UCNS_SOURCE_ROOT) + assert report["word_count"] == 3 + assert set(report["distinct_values"]) == { + "view1_definition_inner_product_density", + "view2_word_axis_angle", + "view3_provenance_interval_lift", + "synthesis", + } + assert report["view4_canonical_witness_lift"]["derived"] is True + for name, distinct in report["distinct_values"].items(): + assert distinct <= report["word_count"] + + +def test_views_do_not_select(tmp_path: Path) -> None: + state_dir = _fixture_state(tmp_path) + report = run_view_adjudication(state_dir, UCNS_SOURCE_ROOT) + assert "ranking_by_distinctness" in report + assert "select" not in report or report.get("selected") is None + assert "view four reduces to derivation" in report["hmmm"] + again = run_view_adjudication(state_dir, UCNS_SOURCE_ROOT) + assert again["receipt_sha256"] == report["receipt_sha256"] + + +def test_synthesis_is_first_class_and_replayable(tmp_path: Path) -> None: + from english_gonol.hyperspace_views import ( + build_synthesis_record, + synthesis_corpus_receipt, + verify_synthesis_replay, + ) + import json + + state_dir = _fixture_state(tmp_path) + db = sqlite3.connect(f"file:{state_dir / 'construct.db'}?mode=ro", uri=True) + record = build_synthesis_record(db, 1, UCNS_SOURCE_ROOT) + db.close() + assert record.word_id == 1 + assert record.surface == "ab" + assert "view1" in record.as_dict() and "view2" in record.as_dict() + + report = synthesis_corpus_receipt(state_dir, UCNS_SOURCE_ROOT) + data = json.dumps(report, sort_keys=True, separators=(",", ":")).encode("utf-8") + replayed = verify_synthesis_replay(data, state_dir, UCNS_SOURCE_ROOT) + assert replayed["receipt_sha256"] == report["receipt_sha256"] diff --git a/human/english/tests/test_system_set_trajectory.py b/human/english/tests/test_system_set_trajectory.py new file mode 100644 index 0000000..638a63a --- /dev/null +++ b/human/english/tests/test_system_set_trajectory.py @@ -0,0 +1,134 @@ +# === CHECKS === +# id: check_system_set_trajectory_order +# proves: system_set_trajectory_preserves_order +# call: self::test_order_and_multiplicity_are_load_bearing +# requires: python3 +# timeout: 10 +# mutates: none +# cleanup: none +# +# id: check_system_set_trajectory_evidence +# proves: system_set_trajectory_preserves_comparison_evidence +# call: self::test_comparison_input_carries_complete_steps +# requires: python3, git +# timeout: 10 +# mutates: none +# cleanup: none +# +# id: check_system_set_trajectory_boundary +# proves: system_set_trajectory_no_downstream_judgment +# call: self::test_no_downstream_judgment_is_encoded +# requires: python3 +# timeout: 10 +# mutates: none +# cleanup: none +# +# id: check_system_set_trajectory_immutable +# proves: system_set_trajectory_immutable_inputs +# call: self::test_mutable_inputs_are_frozen_before_identity +# requires: python3 +# timeout: 10 +# mutates: none +# cleanup: none +# === END CHECKS === + +from dataclasses import replace +from hashlib import sha256 +import json +from pathlib import Path +import subprocess + +import pytest + +from english_gonol.system_set_trajectory import SCHEMA, VERSION, SemanticStep, SystemSetTrajectory + + +def make(path_id, steps): + return SystemSetTrajectory( + construct_id="english:construct:v2", + origin_id="origin:" + path_id, + path_id=path_id, + steps=steps, + provenance_ids=["source:fixture"], + ) + + +def test_order_and_multiplicity_are_load_bearing(): + a = make("a", [ + SemanticStep("many", "relate", "system"), + SemanticStep("system", "recurs", "system"), + SemanticStep("system", "recurs", "system"), + ]) + b = make("a", [ + SemanticStep("system", "recurs", "system"), + SemanticStep("many", "relate", "system"), + SemanticStep("system", "recurs", "system"), + ]) + assert a.relation_signature != b.relation_signature + assert a.receipt_sha256 != b.receipt_sha256 + c = replace(a, steps=a.steps[:-1]) + for changed in (b, c): + original = a.to_dict(include_receipt=False) + variation = changed.to_dict(include_receipt=False) + assert original.pop("steps") != variation.pop("steps") + assert original == variation + assert a.receipt_sha256 != changed.receipt_sha256 + + +def test_comparison_input_carries_complete_steps(): + # Exact producer bytes are checked by tools/verify_package_extraction.py. + t = make("x", [SemanticStep("axis:a", "rel:r", "axis:b")]) + payload = t.to_ucns_comparison_input() + assert payload["construct_id"] == "english:construct:v2" + assert payload["origin_id"] == "origin:x" + assert payload["path_id"] == "x" + assert payload["steps"] == [ + {"axis_id": "axis:a", "relation_id": "rel:r", "target_axis_id": "axis:b"} + ] + assert payload["provenance_ids"] == ["source:fixture"] + assert payload["schema"] == SCHEMA + assert payload["version"] == VERSION + identity = payload.pop("structure_id") + assert identity == sha256(json.dumps( + payload, sort_keys=True, ensure_ascii=False, separators=(",", ":"), + allow_nan=False, + ).encode("utf-8")).hexdigest() + for malformed in ([], (), [""], [" "]): + with pytest.raises(ValueError): + replace(t, provenance_ids=malformed) + + +def test_no_downstream_judgment_is_encoded(): + forbidden = {"equivalence", "analogy", "equivalent", "analogous", "recurrence", "proof_status", "measurement"} + for label in ("r", *sorted(forbidden)): + trajectory = make("x", [SemanticStep("a", label, "b")]) + for payload in (trajectory.to_dict(), trajectory.to_ucns_comparison_input()): + assert payload["schema"] == "english-gonol.system-set-trajectory" + assert payload["steps"] == [{"axis_id": "a", "relation_id": label, "target_axis_id": "b"}] + assert forbidden.isdisjoint(payload) + assert forbidden.isdisjoint(payload["steps"][0]) + + +def test_mutable_inputs_are_frozen_before_identity(): + steps = [SemanticStep("a", "r", "b")] + provenance = ["source:fixture"] + unresolved = ["closure hmmm"] + t = SystemSetTrajectory("c", "o", "p", steps, provenance, unresolved) + before = t.receipt_sha256 + steps.append(SemanticStep("b", "r", "c")) + provenance.append("source:later") + unresolved.append("later") + assert t.receipt_sha256 == before + assert len(t.steps) == 1 + assert t.provenance_ids == ("source:fixture",) + assert t.unresolved == ("closure hmmm",) + for field in ("steps", "provenance_ids", "unresolved"): + for scalar in ("source:fixture", b"source:fixture", bytearray(b"source:fixture")): + with pytest.raises(ValueError, match=field): + replace(t, **{field: scalar}) + valid = getattr(t, field) + for unordered in (set(valid), frozenset(valid), dict.fromkeys(valid)): + with pytest.raises(ValueError, match=field): + replace(t, **{field: unordered}) + with pytest.raises(ValueError, match=field): + replace(t, **{field: iter(valid)}) diff --git a/pyproject.toml b/pyproject.toml index 43e3418..1cd04b5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "uchc" -version = "0.1.0a4" +version = "0.1.0" description = "Unit Circle Hyperspace Constructs: exact language construction and receipt-bound inference inputs" readme = "README.md" requires-python = ">=3.12" @@ -18,8 +18,11 @@ corpus-build = ["PyYAML==6.0.2"] test = ["pytest==8.3.5"] [tool.setuptools] -packages = ["english_gonol", "english_gonol.language", "python_gonol"] -package-dir = {english_gonol = "human/english/english_gonol", python_gonol = "programming/python/python_gonol"} +packages = ["english_gonol", "english_gonol.language", "english_gonol.language.data", "english_gonol.data", "python_gonol", "uchc_polyglot"] +package-dir = {english_gonol = "human/english/english_gonol", python_gonol = "programming/python/python_gonol", uchc_polyglot = "shared/polyglot/uchc_polyglot"} + +[tool.setuptools.package-data] +english_gonol = ["data/*.json", "language/data/*.json"] [tool.pytest.ini_options] testpaths = ["human/english/tests", "programming/python/tests", "shared/polyglot/tests"] diff --git a/tools/verify_installed_package.py b/tools/verify_installed_package.py new file mode 100644 index 0000000..b934e99 --- /dev/null +++ b/tools/verify_installed_package.py @@ -0,0 +1,104 @@ +# SPDX-License-Identifier: FSL-1.1-ALv2 +# === MODULE_BUILD === +# id: uchc_installed_package +# module_name: verify_installed_package +# module_kind: verification-tool +# summary: verify installed runtime completeness and packaged-resource usability +# owner: The-Interdependency/uchc +# public_surface: source_manifest, verify, CLI +# storage_boundary: source manifest write or installed package reads +# network_boundary: none +# user_data_boundary: public project source only +# tests: package-completeness workflow in separate wheel and source-archive environments +# rollout: required packaging gate before publication +# rollback: retain historical candidate artifacts +# unresolved: public distribution-path verification remains separate +# === END MODULE_BUILD === +# === CONTRACTS === +# id: uchc_installed_package_complete +# given: an exact source manifest and clean installed distribution +# then: require the complete runtime inventory, source and RECORD digests, local imports and usable packaged resources +# id: uchc_packaging_not_ratification +# given: successful imports and fixture loading +# then: report packaging evidence only, without mathematical or semantic promotion +# === END CONTRACTS === +"""Run with clean installed Python -I, outside either source checkout. + +Checks every runtime Python/data file against a source manifest, package RECORD, +and the interpreter's install prefix. Exercises packaged EDCM fixture loading and +label replacement. This is a packaging gate, not mathematical ratification. +""" +import argparse +import base64 +import hashlib +import importlib +import importlib.metadata +import json +from pathlib import Path +import sys +import tomllib + + +def source_manifest(root: Path) -> dict: + project = tomllib.loads((root / "pyproject.toml").read_text()) + files = {} + for package, location in project["tool"]["setuptools"]["package-dir"].items(): + for path in (root / location).rglob("*"): + if path.is_file() and path.suffix in (".py", ".json") and "__pycache__" not in path.parts: + name = package.replace(".", "/") + "/" + path.relative_to(root / location).as_posix() + files[name] = hashlib.sha256(path.read_bytes()).hexdigest() + return {"version": project["project"]["version"], "files": dict(sorted(files.items()))} + + +def verify(manifest: Path) -> dict: + expected = json.loads(manifest.read_text()) + distribution = importlib.metadata.distribution("uchc") + if distribution.version != expected["version"]: + raise ValueError("installed UCHC version mismatch") + entries = {str(entry): entry for entry in distribution.files or ()} + if not entries: + raise ValueError("installed package has no file inventory") + runtime = {name for name in entries if name.endswith((".py", ".json")) and ".dist-info/" not in name} + if runtime != set(expected["files"]): + raise ValueError("installed runtime inventory differs from source manifest") + checked = [] + for name, digest in expected["files"].items(): + entry = entries.get(name) + if entry is None or entry.hash is None or entry.hash.mode != "sha256": + raise ValueError("file missing from wheel RECORD: " + name) + path = Path(distribution.locate_file(entry)).resolve() + if not path.is_relative_to(Path(sys.prefix).resolve()): + raise ValueError("package is not installed in this environment: " + name) + actual = hashlib.sha256(path.read_bytes()).digest() + if actual.hex() != digest or base64.urlsafe_b64encode(actual).rstrip(b"=").decode() != entry.hash.value: + raise ValueError("installed file digest mismatch: " + name) + if name.endswith(".py") and not name.endswith("/__main__.py"): + module_name = name[:-3].replace("/", ".").removesuffix(".__init__") + module = importlib.import_module(module_name) + if Path(module.__file__).resolve() != path: + raise ValueError("import was shadowed: " + module_name) + checked.append(name) + from english_gonol.edcm_metric_origins import load_metric_origin_specs + from uchc_polyglot import PolyglotReferent, attach_label, build_label_attachment, same_referent + fixture = load_metric_origin_specs() + if fixture["producer_commit"] != "0873c105799681ea1f7ccb3e619d1f7aebbd85e0": + raise ValueError("metric-origin producer mismatch") + before = PolyglotReferent(ucns_identity_sha256="a" * 64) + after = attach_label(before, build_label_attachment( + ucns_identity_sha256=before.referent_identity, language_tag="es", + surface="cardíaco", scope="technical", source_id="packaging:smoke")) + if not same_referent(before, after): + raise ValueError("label attachment changed referent identity") + return {"version": distribution.version, "files": len(checked), + "status": "passed", "source_manifest_sha256": hashlib.sha256(manifest.read_bytes()).hexdigest()} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("manifest", type=Path) + parser.add_argument("--source", type=Path, help="write a source manifest instead of checking an installation") + args = parser.parse_args() + if args.source: + args.manifest.write_text(json.dumps(source_manifest(args.source), indent=2) + "\n") + else: + print(json.dumps(verify(args.manifest), sort_keys=True)) diff --git a/tools/verify_package_extraction.py b/tools/verify_package_extraction.py new file mode 100644 index 0000000..19574ba --- /dev/null +++ b/tools/verify_package_extraction.py @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: FSL-1.1-ALv2 +# === MODULE_BUILD === +# id: uchc_package_extraction +# module_name: verify_package_extraction +# module_kind: verification-tool +# summary: verify the complete runtime migration against exact forge Git objects +# owner: The-Interdependency/uchc +# public_surface: verify, CLI +# storage_boundary: read-only Git objects and declared extraction files +# network_boundary: none +# user_data_boundary: public project source only +# tests: package-completeness workflow; source inventory and digest verification +# rollout: required package provenance gate +# rollback: retain historical candidate identities +# unresolved: release and scoped authority transition +# === END MODULE_BUILD === +# === CONTRACTS === +# id: uchc_package_extraction_complete +# given: exact forge Git source and declared extraction inventory +# then: reject missing runtime files, changed source bytes or unrecorded adaptations +# id: uchc_package_extraction_no_authority_transfer +# given: matching source and target files +# then: provenance verification grants no implementation or domain authority +# === END CONTRACTS === +"""Verify the complete declared Stack runtime extraction without executing it. + +Usage: python tools/verify_package_extraction.py /path/to/stack +Reads exact Git objects, so the forge may be checked out at a later commit. +This proves byte provenance only; it does not transfer domain authority. +""" +import argparse +import hashlib +import json +from pathlib import Path +import subprocess + + +def verify(forge: Path, root: Path) -> dict: + record = json.loads((root / "docs/package-extraction.json").read_text()) + commit = record["source_commit"] + paths = subprocess.check_output( + ["git", "-C", str(forge), "ls-tree", "-r", "--name-only", commit, + "research/english-gonol/english_gonol", "research/python-gonol/python_gonol"], + text=True, + ).splitlines() + runtime = {p for p in paths if p.endswith((".py", ".json"))} + declared = {item["source"] for item in record["files"] if item["kind"] == "runtime"} + excluded = set(record["forge_only"]) + if runtime != declared | excluded or declared & excluded: + raise ValueError("runtime extraction inventory is incomplete or overlapping") + for item in record["files"]: + original = subprocess.check_output( + ["git", "-C", str(forge), "show", commit + ":" + item["source"]] + ) + target = (root / item["target"]).read_bytes() + if hashlib.sha256(original).hexdigest() != item["source_sha256"]: + raise ValueError("producer digest mismatch: " + item["source"]) + if hashlib.sha256(target).hexdigest() != item["target_sha256"]: + raise ValueError("extracted digest mismatch: " + item["target"]) + if item["adaptation"] is None and original != target: + raise ValueError("unrecorded extraction change: " + item["target"]) + if record["authority_transfer"] is not False: + raise ValueError("extraction cannot transfer authority") + return {"source_commit": commit, "files": len(record["files"]), + "runtime_files": len(declared), "forge_only": len(excluded), + "standing": "exact extraction; graduation gates remain separate"} + + +if __name__ == "__main__": + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("forge", type=Path) + args = parser.parse_args() + print(json.dumps(verify(args.forge, Path(__file__).resolve().parents[1]), sort_keys=True)) From 01a23bc4201ba769cc8684e0a26636a1cceb1ca7 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 2 Nov 2026 04:47:54 -0800 Subject: [PATCH 30/30] Record exact UCHC 0.1.0 candidate verification and release handoff --- docs/graduation/RELEASE_NOTES.md | 33 ++ docs/graduation/candidate-verification.json | 358 ++++++++++++++++++++ 2 files changed, 391 insertions(+) create mode 100644 docs/graduation/RELEASE_NOTES.md create mode 100644 docs/graduation/candidate-verification.json diff --git a/docs/graduation/RELEASE_NOTES.md b/docs/graduation/RELEASE_NOTES.md new file mode 100644 index 0000000..cc17a4b --- /dev/null +++ b/docs/graduation/RELEASE_NOTES.md @@ -0,0 +1,33 @@ +# UCHC 0.1.0 candidate + +This candidate completes the English/Python runtime extraction and the shared +polyglot package. It adds the exact Stack Hilbert, trajectory, describing-graph, +hyperspace-view, displacement and EDCM metric-origin modules, preserving their +candidate standing. The wheel now includes both language JSON fixtures and the +EDCM source fixture with its immutable producer registration. + +UCNS owns geometry; METAPAT retains semantic authority; EDCM retains measurement. +A package release does not select a Hilbert scalar field, a closed-word bearing, +a cross-origin inner product, or an unresolved geometric operation. + +Source: `b1d2c62fd55d2898bb37cba9ebec862c9a8d5980`. +Build epoch: `1793577600`. Python: `3.12.14`. + +The verified wheel SHA-256 is +`856d7bf01d9c55266ce3d50a20fcc7dd1e4efc729fad85120ccbf387b3454415`. +The verified source archive SHA-256 is +`ddcd9f0c29d75bb0d7e7f70c079d5d254a6ae1efcb2f8c4278c3382c1005daf6`. +Both clean-install checks and complete corpus byte replay pass for these exact +artifacts. Publish these files without rebuilding them. Two earlier structural +builds reported malformed-database errors; a subsequent unchanged-package build +passed and matched the historical database exactly. The earlier cause remains +unknown and is recorded in the verification receipt. + +Publication is pending. After publication, verify the downloaded bytes against +these digests, run Stack's artifact-only consumer tests, retire ordinary imports +from its English/Python implementation directories, and record the authorized +before/after implementation-authority transition. Ordinary work-graph +`authority_transfer` fields remain false. The transition receipt stays separate. + +Rollback before the transition: retain the previous pinned Stack implementation +and historical candidate locks. No production consumer has been switched yet. diff --git a/docs/graduation/candidate-verification.json b/docs/graduation/candidate-verification.json new file mode 100644 index 0000000..b106218 --- /dev/null +++ b/docs/graduation/candidate-verification.json @@ -0,0 +1,358 @@ +{ + "schema": "uchc.graduation-candidate-verification", + "version": "1.0.0", + "state": "extracted", + "mode": "execution", + "source_commit": "b1d2c62fd55d2898bb37cba9ebec862c9a8d5980", + "source_tree": "d7f89606dd46867cd53b1f3b574be0bd3a42d217", + "source_date_epoch": 1793577600, + "artifact_version": "0.1.0", + "artifacts": { + "uchc-0.1.0.tar.gz": "ddcd9f0c29d75bb0d7e7f70c079d5d254a6ae1efcb2f8c4278c3382c1005daf6", + "uchc-0.1.0-py3-none-any.whl": "856d7bf01d9c55266ce3d50a20fcc7dd1e4efc729fad85120ccbf387b3454415" + }, + "extraction": { + "source_repository": "The-Interdependency/stack", + "source_commit": "ca69c60032a079585ccb89d5cc7aba67f637df55", + "runtime_and_data_files": 41, + "migrated_test_files": 8, + "forge_only_audit_modules": 2 + }, + "geometry": { + "source_commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "merged_commit": "3f97f5292b0bd2dab911540062ccf79dea2be1bf", + "source_tests_passed": 303, + "contract_graph": "closed", + "wheel_and_sdist_twine": "passed" + }, + "tests": { + "source-english.xml": { + "tests": 344, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "c343135598ab8cea09ee7ff7c3bea114dd03c25fe6d0a0bf1213d60329ef74f2" + }, + "source-python-polyglot.xml": { + "tests": 10, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "292ddae40f64f8eb790108c232caa6293b2a70e3bca7d816a4ede2982b781690" + }, + "forge-metric-origins.xml": { + "tests": 15, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "9e14f532436df4878f163e7514a4a912869750d6a7cf7ede4fa3d6cdc7ae5e9e" + }, + "final-wheel-package.xml": { + "tests": 43, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "3169882de68550daa727ef1bd11bda2c27a6c1c49b54e3dc7ec5e31b42666c59" + }, + "final-sdist-package.xml": { + "tests": 43, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "80d0ace0ef87228f97a98c288229c6c1777aaacca6a446de0641f8d76f5f4f3a" + }, + "forge-candidate.xml": { + "tests": 2, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "3f57f00860354a63e35baff2482291b91c5d8b1e5fef4a95af83311ec5b6a06c" + }, + "installed-native-consumers.xml": { + "tests": 17, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "3bcaf605642e2d10d97d13b19a5b40ee934859fb988b7333149b550e2a026898" + }, + "installed-recursive-corpus.xml": { + "tests": 13, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "ad40b0f1004e417205911c617ef34d87f0ef10149c00fd864fb1c67cf360c6e5" + }, + "ahbg-candidate.xml": { + "tests": 5, + "failures": 0, + "errors": 0, + "skipped": 0, + "junit_sha256": "39345bc81917cf4deb0cce310929880d75fadcd54297d9a5bfd72242a2c6cd8e", + "source_commit": "f0cd194325cbc4960c6212252a5e5812b33f60fb", + "candidate_lock_override": "integration/uchc/candidate-0.1.0.json; active ZFAE lock unchanged" + } + }, + "installed_package": { + "wheel": { + "files": 49, + "source_manifest_sha256": "28784d7bb6d38edbb4ec03cdcda1340af5f6f6b6f7e0ef33758c0d74f9514c50", + "status": "passed", + "version": "0.1.0" + }, + "sdist": { + "files": 49, + "source_manifest_sha256": "28784d7bb6d38edbb4ec03cdcda1340af5f6f6b6f7e0ef33758c0d74f9514c50", + "status": "passed", + "version": "0.1.0" + } + }, + "full_corpus": { + "builder": "clean installed exact 0.1.0 wheel", + "runtime": { + "python": "3.12.14", + "sqlite": "3.45.1", + "provenance": "human/english/experiments/structural-profile-v1/verification.json#runtime_provenance" + }, + "database_sha256": "af609bbba504f95e349f3c1a30aa42923acc8e48c1e67bb481521dbf7e49162b", + "logical_receipt": "12277b4959c0c72b7af12097b8a77bf91866bbf669e7f4ac07b6a5f1426ebb57", + "counts": { + "characters": 118, + "definition_components": 3535375, + "definitions": 185155, + "semantic_evidence": 866183, + "unresolved_semantic_evidence": 0, + "word_characters": 1739949, + "words": 164864 + }, + "input_acceptance": { + "schema": "uchc.english.inference-input-acceptance", + "version": "1.0.0", + "standing": "SURVIVED", + "scope": "complete pinned English construct; no sample", + "construct": { + "database_sha256": "af609bbba504f95e349f3c1a30aa42923acc8e48c1e67bb481521dbf7e49162b", + "logical_receipt": "12277b4959c0c72b7af12097b8a77bf91866bbf669e7f4ac07b6a5f1426ebb57", + "metadata": [ + [ + "character_identity", + "one exact scalar -> one character id" + ], + [ + "corpus_commit", + "dc343f2683279ecbb13fab4e2fd778d7b162d287" + ], + [ + "corpus_repository", + "globalwordnet/english-wordnet" + ], + [ + "corpus_source_tree_sha256", + "3a46546a1ffbb4aed98990535ad5155c69be12ad09fdf093701b257d2a3e468f" + ], + [ + "corpus_tag", + "2025-edition" + ], + [ + "definition_component_rule", + "exact ordered source: each maximal non-whitespace run reuses one shared word identity; each whitespace scalar reuses one shared character identity; no normalization" + ], + [ + "definition_topologies", + "[\"direct\",\"chain\"]" + ], + [ + "evidence_channels", + "[\"ordinal\",\"semantic\",\"sentence-context\"]" + ], + [ + "geometry_state", + "hmmm" + ], + [ + "hmmm", + "the exact UCNS law mapping ordinal + semantic + sentence-context evidence to geometric displacement is unresolved; no weight, direction, distance, vector, coordinate, center, radius, tangency, motion, or substitute geometry is synthesized" + ], + [ + "invented_geometry", + "false" + ], + [ + "normalization", + "none" + ], + [ + "resolution_rule", + "preponderance relative to the rest of the sentence in which the word appears" + ], + [ + "schema", + "english-gonol.full-construct" + ], + [ + "ucns_public_gonol_sha256", + "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5" + ], + [ + "version", + "2.0.0" + ], + [ + "word_identity", + "one exact surface -> one word id" + ] + ], + "unicode_version": "15.0.0" + }, + "counts": { + "characters": 118, + "words": 164864, + "word_characters": 1739949, + "definitions": 185155, + "definition_components": 3535375, + "semantic_evidence": 866183, + "unresolved_semantic_evidence": 0 + }, + "word_records_sha256": "0b5e939e169e44711c66230f0de425ca78319cab04ba421dc621ff44986d72be", + "definition_records_sha256": "2e36ed80ae7a82b66e8c91a7608d59ff900c7d0cab6a7f9a4fbd04d6b1328b15", + "reader_source_sha256": "455df28ca61d9f69c230ffaac2c96f8843e6c1e31582274b9989fb3c053b4774", + "native_producer_sha256": "c5996470c6d3fe5387fa8f46e3d777deb44289d0b9e1e5d2f55c5d6348912a71", + "python": "3.12.14", + "hmmm": [ + "neural architecture, learning, propagation, readout and usefulness are not established by input acceptance" + ], + "receipt_sha256": "7be9bdc57cfecae9e1d42d71d804fdc3194945151987f8498f81fa81081dbef5", + "resources": { + "elapsed_seconds": 117.3560581809943 + } + } + }, + "recursive_corpus_replay": { + "status": "passed", + "builder": "unchanged clean-installed exact 0.1.0 wheel; Python 3.12.14 / SQLite 3.45.1", + "database_sha256": "13ba24116f0ff02cfdfeb4a6b060f2672fa409b46a3b7cf26e4421c65321b063", + "logical_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a", + "historical_byte_and_logical_identity": "exact match", + "counts": { + "characters": 118, + "components": 3895493, + "evidence": 243561, + "meta": 10, + "records": 316953, + "word_characters": 896806, + "words": 103053 + }, + "attachment_audit": { + "counts": { + "constructed_words": 103027, + "definitions": 185155, + "formerly_compound_definitions": 57155, + "refused_words": 26, + "words": 103053 + }, + "definition_stream_sha256": "9d28ce7be9d073498b20ebd1064a71911d05822d363ffa4e3a2f4a455d69d59f", + "field_receipt": "26ab095f73306ff4fbd9f67d1c282c1df79f926bb75cc081c879db8a6989b58a", + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "hmmm": [ + "Numerical definition attachment and bearing selection remain open." + ], + "receipt": "10b484f2e025f39160a6af7f67d3da5b3f88732d42288361347a2345f7216dd7", + "schema": "english.attachment-corpus-audit.v1", + "scope": "all corpus words and all definition ownership overlays; no bearing candidate selected", + "unplaced_glyph_word_counts": { + "\u00e1": 1, + "\u00e4": 1, + "\u00e7": 3, + "\u00e9": 8, + "\u00ea": 1, + "\u00eb": 1, + "\u00f0": 1, + "\u00f1": 3, + "\u00f2": 2, + "\u0161": 1, + "\u02b0": 1, + "\u03b8": 1, + "\u042a": 1, + "\u042c": 1, + "\u044a": 1, + "\u044c": 1 + }, + "word_stream_sha256": "a8a1c8248ad97711055dacb698f863a3fe8d36eb29013391900d7506da37edc1" + }, + "diagnostic_build": { + "status": "passed", + "same_database_sha256": true, + "instrumentation": "added query plans and table logging; preserved failed staging directory" + }, + "earlier_failed_attempts": [ + { + "runtime": "Python 3.12.14 / SQLite 3.53.1", + "stage": "structural_construct._receipt, ordered table reads", + "exception": "sqlite3.DatabaseError: database disk image is malformed" + }, + { + "runtime": "Python 3.12.14 / SQLite 3.45.1", + "stage": "structural_construct._receipt, ordered table reads", + "exception": "sqlite3.DatabaseError: database disk image is malformed" + } + ], + "diagnosis": "The unchanged artifact subsequently completed full build and verification in a fresh output directory, reproducing both expected hashes. Earlier failures were not reproduced in that run; their cause remains unknown. No source repair or runtime-version explanation is claimed." + }, + "publication": { + "status": "pending", + "published_immutable_identity": null, + "blocker": "An authenticated release-asset upload session is not available." + }, + "hosted_ci": { + "status": "did not start", + "run_url": "https://github.com/The-Interdependency/ucns/actions/runs/40988417301", + "attempt": 2, + "annotation": "The job was not started because your account is locked due to a billing issue." + }, + "authority_transfer": false, + "hmmm": [ + "Stable publication, public artifact reconsumption, forge-path retirement and scoped authority-transition receipt remain incomplete.", + "Canonical Hilbert field, cross-origin geometry and input-frame bridge remain unresolved.", + "Two earlier structural builds failed during SQLite reads; unchanged-package full replay later passed with exact historical byte identity. Failure cause remains unknown." + ], + "recursive_extraction": { + "files": 18, + "geometry_authority": { + "commit": "9cc00771e54336d58ee377faeec87a3a33dbd4bf", + "public_gonol_sha256": "55d10c84529a4d7bc7714786357e977b68d9df2ac3f73d20e229580b552c2ef5", + "repository": "The-Interdependency/ucns", + "source_blobs": { + "attachment_codec": "5e761f8e2169ddb24aa6744a8a577ee4aa4989bd", + "attachment_stack": "0ce3879257b40d264749c1b65fff23abf186fded", + "ordinal_affixiation": "9fa84ef20f19fe0c04df680f49b50ea307e6d624", + "public_gonol": "c1955e46e2dc918fb657cb346e42106d71937e91" + } + }, + "source_commit": "251ba2290675a21154582f0b3fb0d7a9d509ed50", + "standing": "exact", + "work_graph_sha256": "a17bdf8c1fda5fec60f7d1b819b48fa493b873c8e3f8997d83144b038fb14dd5" + }, + "merged_producer_chain": { + "ucns": "3f97f5292b0bd2dab911540062ccf79dea2be1bf", + "stack": "dd7fe7f7b05d51570373a18f04d53e3eb880b6cd", + "candidate_consumer_record": "c6adf610d7c1b3e92d3fce97b5207954b72540cb", + "ahbg_preflight": "1958c988806138e7d78f093181a9332616fc4e0d" + }, + "additional_checks": { + "package_extraction": "passed: 41 runtime/data files and eight migrated tests", + "stack_consistency": "passed: seven repositories and 48 research participant identities", + "work_graph_digests": "passed: seven UCHC work graphs", + "workflow_yaml": "passed", + "whitespace": "passed" + } +}