From f380a5ee659f539b7721b19b4fc873f05195310f Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 5 Oct 2026 01:11:30 -0700 Subject: [PATCH 1/4] feat(weave): construct message-origin axis coupling candidate --- research/weave/stages/message_origin.py | 241 ++++++++++++++++++++++++ 1 file changed, 241 insertions(+) create mode 100644 research/weave/stages/message_origin.py diff --git a/research/weave/stages/message_origin.py b/research/weave/stages/message_origin.py new file mode 100644 index 00000000..f6779621 --- /dev/null +++ b/research/weave/stages/message_origin.py @@ -0,0 +1,241 @@ +# === MODULE_BUILD === +# id: weave_message_origin_coupling_candidate +# module_name: message_origin +# module_kind: candidate +# summary: message-scoped UCHC-style origin/axis coupling for the eight-circle/two-circle Weave research construction +# owner: Erin Spencer +# public_surface: MessageOrigin, CouplingKey, CoupledWitness, construct_origin, encode, public_recover +# internal_surface: exact key-set phase recurrence and public attack witness +# auth_boundary: none +# storage_boundary: none +# network_boundary: none +# user_data_boundary: raw bytes supplied by caller only +# admin_only: false +# tests: tests.test_message_origin +# rollout: bounded Weave research candidate only; not the native asymmetric relation +# rollback: remove this module and its tests without altering eight_circle.py +# requires: weave_eight_circle_candidate, UCHC origin/axis architecture +# since: 2026-10-05 +# unresolved: a trapdoor degeneration/lift relation that makes the six omitted circles necessary for efficient inversion remains hmmm +# === END MODULE_BUILD === + +# === CONTRACTS === +# id: weave_message_is_origin +# given: one admitted raw-byte message +# then: exactly one message origin O_M is constructed and every source-bit occurrence participates as a distinct ordered axis at that origin +# class: correctness +# +# id: weave_axis_occurrence_identity_preserved +# given: repeated equal bit values in one message +# then: their source-bit occurrences remain distinct by admission order +# class: correctness +# +# id: weave_coupling_is_key_set_data +# given: two different coupling key sets +# then: no universal circle/space/origin-step law is inferred from either +# class: boundary +# +# id: weave_public_attack_is_preserved +# given: this candidate's public pair and coupling data +# then: public recovery is executable and tested, so this candidate must not be promoted as asymmetric security +# class: falsification +# === END CONTRACTS === + +"""Message-scoped origin/axis coupling for Weave research. + +Usage: + origin = construct_origin(raw_bytes) + coupled = encode(raw_bytes, public_pair, coupling_key) + +The module copies the *architecture* already present in UCHC: participants are admitted +as distinct axes at a shared origin by construction order. It does not copy UCHC's +language participants or invent a UCNS cross-origin angle law. + +The phase recurrence below is an explicitly bounded Weave candidate. Its stride and +feedback values are concrete key-set data. It exists so the message-origin idea can +fail executable tests rather than remain prose. + +Important limitation: + public_recover() succeeds from the same public information used by encode(). + Therefore message-origin coupling by itself does not create the required asymmetric + trapdoor. The result is a useful construction/falsification scaffold, not encryption. +""" +from __future__ import annotations + +from dataclasses import dataclass +from fractions import Fraction +from typing import Iterable + +from .eight_circle import PublicPair, TURN_720, _phase + + +@dataclass(frozen=True) +class MessageAxis: + """One raw source-bit occurrence participating at O_M.""" + + index: int + byte_index: int + bit_index: int + + def __post_init__(self): + if type(self.index) is not int or self.index < 0: + raise ValueError("axis index must be a nonnegative integer") + if type(self.byte_index) is not int or self.byte_index < 0: + raise ValueError("byte index must be a nonnegative integer") + if type(self.bit_index) is not int or not 0 <= self.bit_index < 8: + raise ValueError("bit index must be in [0, 7]") + + +@dataclass(frozen=True) +class MessageOrigin: + """One message origin with ordered source-bit axes.""" + + identity: str + byte_length: int + axes: tuple[MessageAxis, ...] + + def __post_init__(self): + if self.identity != "O_M": + raise ValueError("message origin identity must be O_M") + if type(self.byte_length) is not int or self.byte_length < 0: + raise ValueError("byte length must be nonnegative") + if type(self.axes) is not tuple or len(self.axes) != self.byte_length * 8: + raise ValueError("message origin must contain exactly eight axes per byte") + if tuple(axis.index for axis in self.axes) != tuple(range(len(self.axes))): + raise ValueError("message axes must preserve contiguous admission order") + + +@dataclass(frozen=True) +class CouplingKey: + """Key-set-specific candidate parameters; no universal rule is asserted.""" + + initial_origin: Fraction + axis_step: Fraction + feedback_step: Fraction + + def __post_init__(self): + for name in ("initial_origin", "axis_step", "feedback_step"): + value = getattr(self, name) + if type(value) is not Fraction: + raise TypeError(f"{name} must be an exact Fraction") + object.__setattr__(self, name, _phase(value)) + + +@dataclass(frozen=True) +class CoupledWitness: + """Public two-circle witness plus the message-origin axis topology.""" + + origin: MessageOrigin + bits: tuple[int, ...] + + def __post_init__(self): + if type(self.origin) is not MessageOrigin: + raise TypeError("origin must be MessageOrigin") + if type(self.bits) is not tuple or len(self.bits) != len(self.origin.axes) * 2: + raise ValueError("coupled witness requires two public bits per source-bit axis") + if any(type(bit) is not int or bit not in (0, 1) for bit in self.bits): + raise TypeError("witness bits must be integer 0 or 1") + + +def construct_origin(data: bytes) -> MessageOrigin: + """Admit raw bytes losslessly as ordered bit-occurrence axes at one O_M.""" + if type(data) is not bytes: + raise TypeError("raw bytes required") + axes = tuple( + MessageAxis(index=byte_index * 8 + bit_index, + byte_index=byte_index, + bit_index=bit_index) + for byte_index in range(len(data)) + for bit_index in range(8) + ) + return MessageOrigin("O_M", len(data), axes) + + +def _source_bits(data: bytes) -> tuple[int, ...]: + return tuple((byte >> shift) & 1 for byte in data for shift in range(7, -1, -1)) + + +def _axis_origin(key: CouplingKey, axis: MessageAxis, + previous_public_pair: tuple[int, int]) -> Fraction: + """Bounded candidate: attach each admitted axis to a key-set-specific phase. + + The axis is identified by admission order, matching the UCHC architectural pattern. + Turning that axis index into a circle phase is *not* asserted as UCNS/UCHC canon; + it is this candidate's key-set-specific relation and remains replaceable. + """ + feedback = previous_public_pair[0] + 2 * previous_public_pair[1] + return _phase( + key.initial_origin + + key.axis_step * axis.index + + key.feedback_step * feedback + ) + + +def encode(data: bytes, public: PublicPair, key: CouplingKey) -> CoupledWitness: + """Construct one message-origin trajectory and emit two public bits per source bit.""" + if type(public) is not PublicPair: + raise TypeError("two-circle public key required") + if type(key) is not CouplingKey: + raise TypeError("CouplingKey required") + origin = construct_origin(data) + source = _source_bits(data) + out: list[int] = [] + previous = (0, 0) + for axis, bit in zip(origin.axes, source): + phase = _axis_origin(key, axis, previous) + pair = public.witness(bit, phase) + zero = public.witness(0, phase) + one = public.witness(1, phase) + if zero == one: + raise ValueError("candidate public degeneration is ambiguous at an admitted axis") + out.extend(pair) + previous = pair + return CoupledWitness(origin, tuple(out)) + + +def public_recover(public: PublicPair, key: CouplingKey, + witness: CoupledWitness) -> bytes: + """Attack witness: recover this candidate using public information only. + + Its existence is a falsification result, not a supported decryption design. + """ + if type(public) is not PublicPair: + raise TypeError("two-circle public key required") + if type(key) is not CouplingKey: + raise TypeError("CouplingKey required") + if type(witness) is not CoupledWitness: + raise TypeError("CoupledWitness required") + + recovered: list[int] = [] + previous = (0, 0) + for axis in witness.origin.axes: + offset = axis.index * 2 + observed = witness.bits[offset:offset + 2] + phase = _axis_origin(key, axis, previous) + zero = public.witness(0, phase) + one = public.witness(1, phase) + if zero == one: + raise ValueError("candidate public degeneration is ambiguous at an admitted axis") + if observed == zero: + recovered.append(0) + elif observed == one: + recovered.append(1) + else: + raise ValueError("witness is not admitted by this public trajectory") + previous = observed + + raw = bytearray() + for offset in range(0, len(recovered), 8): + value = 0 + for bit in recovered[offset:offset + 8]: + value = (value << 1) | bit + raw.append(value) + return bytes(raw) + + +def witness_bits(witness: Iterable[int]) -> tuple[int, ...]: + """Validate a raw witness-bit iterable for callers constructing test fixtures.""" + bits = tuple(witness) + if any(type(bit) is not int or bit not in (0, 1) for bit in bits): + raise TypeError("witness bits must be integer 0 or 1") + return bits From ee5793cd5e40f0ae1b4aeb3796926e03f2892a20 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 5 Oct 2026 01:12:05 -0700 Subject: [PATCH 2/4] test(weave): falsify public message-origin coupling baseline --- research/weave/tests/test_message_origin.py | 93 +++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 research/weave/tests/test_message_origin.py diff --git a/research/weave/tests/test_message_origin.py b/research/weave/tests/test_message_origin.py new file mode 100644 index 00000000..a761859a --- /dev/null +++ b/research/weave/tests/test_message_origin.py @@ -0,0 +1,93 @@ +"""Executable tests for the message-scoped UCHC-style Weave coupling candidate. + +Usage: + python -m unittest tests.test_message_origin + +The suite proves the message-origin/axis topology and preserves the public-recovery +falsification. Passing these tests does not establish encryption security. +""" +from fractions import Fraction +import unittest + +from stages.eight_circle import Circle, FullKeySet +from stages.message_origin import CouplingKey, construct_origin, encode, public_recover + + +def base_circle(i: int, *, hidden_shift: int = 0) -> Circle: + shift = 0 if i in (0, 1) else hidden_shift + return Circle( + identity=f"g{i}", + space=Fraction((i * 3 + shift) % 16, 8), + zero=Fraction((i * 3 + shift + 1) % 16, 8), + one=Fraction((i * 3 + shift + 9) % 16, 8), + ) + + +def keyset(*, hidden_shift: int = 0) -> FullKeySet: + return FullKeySet(tuple(base_circle(i, hidden_shift=hidden_shift) for i in range(8))) + + +COUPLING = CouplingKey( + initial_origin=Fraction(1, 16), + axis_step=Fraction(3, 16), + feedback_step=Fraction(5, 16), +) + + +class MessageOriginTests(unittest.TestCase): + def test_one_message_is_one_origin_with_ordered_occurrence_axes(self): + origin = construct_origin(b"AA") + self.assertEqual(origin.identity, "O_M") + self.assertEqual(origin.byte_length, 2) + self.assertEqual(len(origin.axes), 16) + self.assertEqual(tuple(axis.index for axis in origin.axes), tuple(range(16))) + # Equal byte/bit values remain different occurrences by source position. + self.assertNotEqual(origin.axes[0], origin.axes[8]) + self.assertEqual((origin.axes[0].byte_index, origin.axes[8].byte_index), (0, 1)) + + def test_coupled_candidate_preserves_two_bits_per_source_bit(self): + public = keyset().degenerate(0, 1) + data = b"origin" + result = encode(data, public, COUPLING) + self.assertEqual(result.origin.byte_length, len(data)) + self.assertEqual(len(result.bits), len(data) * 16) + + def test_key_set_coupling_changes_trajectory(self): + public = keyset().degenerate(0, 1) + data = b"same message" + first = encode(data, public, COUPLING) + second = encode( + data, + public, + CouplingKey(Fraction(7, 16), Fraction(1, 8), Fraction(3, 8)), + ) + self.assertNotEqual(first.bits, second.bits) + + def test_public_recovery_falsifies_this_coupling_as_asymmetric(self): + public = keyset().degenerate(0, 1) + for data in (b"", b"\x00", b"\xff", bytes(range(32)), b"message origin"): + witness = encode(data, public, COUPLING) + self.assertEqual(public_recover(public, COUPLING, witness), data) + + def test_six_hidden_circles_are_not_causal_in_this_candidate(self): + first_full = keyset(hidden_shift=0) + second_full = keyset(hidden_shift=5) + first_public = first_full.degenerate(0, 1) + second_public = second_full.degenerate(0, 1) + self.assertEqual(first_public, second_public) + + data = bytes(range(64)) + first = encode(data, first_public, COUPLING) + second = encode(data, second_public, COUPLING) + self.assertEqual(first, second) + self.assertEqual(public_recover(first_public, COUPLING, first), data) + + def test_nonbyte_input_and_bad_coupling_fail_closed(self): + with self.assertRaises(TypeError): + construct_origin("not bytes") + with self.assertRaises(TypeError): + CouplingKey(Fraction(0), Fraction(1, 8), 1) + + +if __name__ == "__main__": + unittest.main() From 0f6f54ff26c2213bcad71bc9cc3a348b02f45616 Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 5 Oct 2026 01:12:36 -0700 Subject: [PATCH 3/4] test(weave): include message-origin coupling evidence --- research/weave/test.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/research/weave/test.py b/research/weave/test.py index 981e6263..82f4c6f0 100644 --- a/research/weave/test.py +++ b/research/weave/test.py @@ -35,7 +35,7 @@ def main(): after = snapshot() passed = (result.wasSuccessful() and not result.skipped and not result.expectedFailures and not result.unexpectedSuccesses - and result.testsRun == 58 and before == after) + and result.testsRun == 64 and before == after) receipt = { 'schema':'weave.transport-evidence/v1', 'status':'PASSED' if passed else 'FAILED', @@ -43,7 +43,7 @@ def main(): 'tests':result.testsRun, 'failures':len(result.failures),'errors':len(result.errors),'skipped':len(result.skipped), 'source_unchanged':before == after, - 'expected_test_methods':58, + 'expected_test_methods':64, 'coverage_status':'WITNESSED' if passed else 'NOT_ACCEPTED', 'source_sha256':hashlib.sha256(json.dumps(before,sort_keys=True,separators=(',',':')).encode()).hexdigest(), 'source_files':before, @@ -52,14 +52,16 @@ def main(): 'valid_transport_masks':28,'incompatible_transport_masks':4, 'largest_roundtrip_bytes':65536,'separate_process_roundtrip_bytes':1026, 'eight_circle_full_members':8,'degenerate_public_members':2, - 'candidate_expansion_bits_per_byte':16}, + 'candidate_expansion_bits_per_byte':16, + 'message_origin_axes_per_byte':8}, 'full_weave':Pipeline().plan(), 'native_corpus_replay':'NOT_EXECUTED: source inspected; no constructed database materialized here', 'native_adapter_tests':'missing-input/source-identity refusal only; not successful real-corpus replay', 'security_observations':[ 'fixed-map recovery succeeds against the older transport candidate at 137 bits in 8 queries', 'wrong material can yield wrong plaintext without an authentication error', - 'independent-bit eight-to-two sheet projection is publicly brute-forceable and is preserved only as a falsified baseline' + 'independent-bit eight-to-two sheet projection is publicly brute-forceable and is preserved only as a falsified baseline', + 'message-origin axis coupling preserves occurrence topology but remains publicly recoverable; the six omitted circles are not yet causal' ], 'nonclaim':'No complete native Weave or asymmetric security result; no independent researcher review.' } From 36f5f4bf04fa8d050dd56bbac8e3e2ca6616da8a Mon Sep 17 00:00:00 2001 From: Erin Spencer Date: Mon, 5 Oct 2026 01:13:28 -0700 Subject: [PATCH 4/4] docs(weave): record message-origin candidate and falsification --- research/weave/EIGHT_CIRCLE.md | 134 +++++++++++++++++++++++++++------ 1 file changed, 109 insertions(+), 25 deletions(-) diff --git a/research/weave/EIGHT_CIRCLE.md b/research/weave/EIGHT_CIRCLE.md index 38c59550..860dc331 100644 --- a/research/weave/EIGHT_CIRCLE.md +++ b/research/weave/EIGHT_CIRCLE.md @@ -1,9 +1,9 @@ # Weave eight-circle / two-circle candidate -Status: **implemented candidate; asymmetric security not established.** +Status: **implemented construction research; asymmetric security not established.** -This construction records the current user-specified boundary without adding a -selection law that has not been supplied. +This workspace preserves the current Weave geometry and records candidate failures +instead of silently promoting them into a cipher. ## Preserved construction @@ -27,7 +27,7 @@ many possible positions. No rule is imposed for how key sets choose their circle positions, their relations to space, or which two circles are exposed. Those are construction-instance data. -## Executable object +## Executable geometry `stages/eight_circle.py` provides: @@ -38,35 +38,119 @@ space, or which two circles are exposed. Those are construction-instance data. - `decode_byte`: full-key-set recovery API; - raw-byte `encode` / `decode` helpers. -The candidate is deliberately separate from the older transport profile and is not -silently installed as the complete Weave `bind` law. +The candidate remains separate from the older transport profile and is not silently +installed as the complete Weave `bind` law. -## Falsification already obtained +## Message origin / UCHC-axis candidate + +`stages/message_origin.py` consumes the UCHC architectural distinction currently +implemented in `The-Interdependency/uchc`: + +- participants are individually addressable axes at one declared origin; +- axis identity follows construction/admission order; +- occurrence identity is preserved; +- attachment happens at the participation point; +- unresolved cross-origin geometry is not silently promoted. + +For Weave, one raw-byte message constructs one origin `O_M`. Every source-bit +occurrence participates as its own ordered axis at that origin. The candidate then +uses exact key-set-specific phase/feedback parameters to couple successive axes before +the same two-circle public degeneration is applied. + +Usage: + +```python +origin = construct_origin(raw_bytes) +witness = encode(raw_bytes, public_pair, coupling_key) +``` + +The phase recurrence is deliberately a bounded Weave candidate, not UCNS or UCHC +canon. It is present so the message-origin construction can be executed and attacked. + +## Falsifications obtained + +### Independent-bit projection The first independent-bit implementation fails the intended asymmetric property. +A public holder can evaluate the two public forward images for 0 and 1 and recover +every source bit directly. + +Therefore the bare geometry + +```text +8 full circles -> 2 public circles +``` + +survives, while independent per-bit projection is falsified as the cryptographic +relation. + +### Message-origin coupling + +The second candidate adds the message-scoped origin and ordered axis trajectory. +That preserves the requested topology, but it still fails the asymmetric requirement: +the sender's public coupling parameters and public two-circle state are sufficient to +replay the trajectory and recover the message. -Because each source bit is independently mapped to one of two public two-bit witnesses, -a holder of the public pair can evaluate the public forward image of 0 and 1 and recover -every source bit by comparison. The test -`test_independent_bit_baseline_is_publicly_bruteforceable` preserves that attack as -required evidence. +The tests additionally perturb all six omitted circles while holding the two public +circles fixed. The ciphertext is unchanged. Therefore the six private circles are +**not causal** in this candidate. -Therefore: +This is a useful narrowing result: -[ -8 \to 2 -] +```text +message origin + ordered axes + public feedback +!= +trapdoor degeneration/lift +``` -is implemented as a geometric degeneration, but **independent per-bit projection is -falsified as the cryptographic relation**. +The UCHC architecture supplies the origin/axis topology. It does not, by itself, +supply the missing asymmetric mathematical relation. -This does not falsify the eight-circle construction. It identifies what the next -construction must actually use: the message-scoped UCHC origin/axis relational state -must couple the eight circles so that the six omitted circles change the recoverable -trajectory rather than merely sitting unused in the private object. +## Authority and provenance + +UCHC source inspected for this candidate: +`human/english/english_gonol/hyperspace_construct.py`, +Git blob `8b55823805c87ad8c4cc9d7451dc2eb90bdedd3a`. + +The source explicitly keeps carrier position and axis participation distinct and +leaves cross-origin angles / continuum lift-selection as `hmmm`. Weave therefore +does not invent those as UCNS/UCHC laws. + +Relevant construction discipline was read from +`The-Interdependency/skill-lib` `gonol-build/SKILL.md` and +`the-interdependency/SKILL.md`. Current METAPAT was consulted before selecting the +candidate relation; its boundary-state guidance permits a domain boundary/state to +alter a transformation only where the domain evidence supplies the mechanism. No +METAPAT security claim is inferred. + +## Usage guidance + +Run all Weave evidence: + +```bash +cd research/weave +python test.py --receipt /tmp/weave-check.json +``` + +Run only the message-origin candidate: + +```bash +python -m unittest tests.test_message_origin +``` + +Interpret a passing run as reproducibility of the candidate and its falsification +witnesses, not evidence of cryptographic strength. ## hmmm -The remaining construction is the coupled UCHC relation itself. No additional policy -decision is introduced here. The next candidate must make the full eight-circle state -causally necessary for inversion and then be attacked. +The remaining construction is now narrower than "couple the message." + +We need a **native degeneration/lift relation** in which: + +- the public two-circle object permits the forward operation; +- the six omitted circles materially alter the full lift; +- the full eight-circle key can recover the lift efficiently; +- the public two-circle holder cannot replay the same inverse efficiently. + +No additional circle-selection or space-placement policy is required before that +relation is constructed. The relation itself is the unresolved work.