YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
- """
THAT SYSTEM — Full Standalone Engine (Cipher × Triadic)
- ============================================================
- LAYER 1 — MIRROR ALPHABET CIPHER
- ============================================================
- ============================================================
- LAYER 2 — TRIADIC ENGINE (ACTS-linked)
- ============================================================
- ============================================================
- LAYER 3 — ATTRACTOR ENGINE (α ≈ π/60)
- ============================================================
- Same cosine-iteration structure as the Breakthrough Prize operator
- T_ε(z) = cos(εz), here with the new constant α ≈ π/60.
- Since |α| << 1, cos(α·z) is a contraction mapping (Banach fixed
- point): EVERY seed converges to the same fixed point z*. That
- universality is what makes it a true attractor. What differs by
- seed is the PATH into it — the first iterate and how many steps
- it takes to converge.
- ============================================================
- UNIFIED PIPELINE — cipher word -> triadic engine
- ============================================================
- ============================================================
- PRINTING / SERIALIZATION
- ============================================================
- ============================================================
- CLI
- ============================================================
""" THAT SYSTEM — Full Standalone Engine (Cipher × Triadic)
Self-contained Python implementation. No external dependencies. Portable to any interpreter (Grok, GPT, local Python, etc.) — pure stdlib only (math, json, argparse, datetime).
Two layers, one pipeline:
LAYER 1 — MIRROR ALPHABET CIPHER Ascending set: A-J = 1-10, K-P = 11-16 (unpaired middle) Descending set (fold-back): Q=10, R=9, S=8, T=7, U=6, V=5, W=4, X=3, Y=2, Z=1 Every digit 1-10 is a "gate" with two possible letters (one ascending, one descending). Decoding resolves gates by word-completion / manual selection.
LAYER 2 — TRIADIC ENGINE (ACTS-linked) Any integer seed (a cipher digit-sum, or birth-data components) is digit-rooted down to a single 1-9 "Signature Φ", which then drives: - Triadic state: Yang (+1) / Neutral (0) / Yin (-1) - I Ching hexagram: 8-fold mapping - Symbolic layer: element, sigil, hex-frame, Root-9 anchor - Resonance: sinusoidal oscillation + focus stability
Usage: python that_system.py encode "THAT" python that_system.py decode 7817 python that_system.py unified "THRESHOLD" python that_system.py birth --month 9 --day 9 --year 1988 --hour 9 --minute 0 (add --json to any command for machine-readable output) """
import argparse import json import math import sys from datetime import datetime from dataclasses import dataclass, asdict, field
============================================================
LAYER 1 — MIRROR ALPHABET CIPHER
============================================================
ASCEND = {} for i, c in enumerate("ABCDEFGHIJ"): ASCEND[c] = i + 1 for i, c in enumerate("KLMNOP"): ASCEND[c] = 11 + i
DESCEND = {} for i, c in enumerate("QRSTUVWXYZ"): DESCEND[c] = 10 - i
@dataclass class LetterValue: letter: str value: int side: str # 'asc' | 'mid' | 'desc'
def letter_value(ch: str) -> LetterValue: """Map a single letter to its cipher value + which side of the mirror it's on.""" ch = ch.upper() if ch in ASCEND: side = "asc" if ASCEND[ch] <= 10 else "mid" return LetterValue(ch, ASCEND[ch], side) if ch in DESCEND: return LetterValue(ch, DESCEND[ch], "desc") raise ValueError(f"'{ch}' is not a cipher letter (A-Z only)")
def encode_word(word: str): """Word -> list[LetterValue], skipping spaces/punctuation.""" out = [] for ch in word: if ch.isalpha(): out.append(letter_value(ch)) return out
def gate_candidates(digit: int): """ For a given digit, return every letter that could produce it. Digits 1-10 are ambiguous gates (asc + desc candidates). Digits 11-16 resolve uniquely to K-P (the unpaired middle). """ cands = [] mid_letter = next((k for k, v in ASCEND.items() if v == digit and v > 10), None) asc_letter = next((k for k, v in ASCEND.items() if v == digit and v <= 10), None) desc_letter = next((k for k, v in DESCEND.items() if v == digit), None) if mid_letter: cands.append(LetterValue(mid_letter, digit, "mid")) if asc_letter: cands.append(LetterValue(asc_letter, digit, "asc")) if desc_letter: cands.append(LetterValue(desc_letter, digit, "desc")) return cands
def parse_digit_string(raw: str): """ Parse a digit string into a list of individual gate values. Greedily takes 2-digit numbers 11-16 (unique K-P zone) before falling back to single digits. """ nums = [] i = 0 raw = raw.strip() while i < len(raw): two = raw[i:i + 2] if two.isdigit() and 11 <= int(two) <= 16 and i + 2 <= len(raw): nums.append(int(two)) i += 2 elif raw[i].isdigit(): nums.append(int(raw[i])) i += 1 else: i += 1 return nums
def decode_digit_string(raw: str, prefer: str = "auto"):
"""
Return, for every gate in the digit string, the candidate letters.
prefer: 'asc' or 'desc' to force a default side when ambiguous;
'auto' just lists all candidates for manual/word-completion resolution.
"""
nums = parse_digit_string(raw)
gates = []
for n in nums:
cands = gate_candidates(n)
gates.append({"digit": n, "candidates": [asdict(c) for c in cands]})
return gates
def best_guess_word(raw: str, wordlist=None): """ Attempt to resolve ambiguous gates against a small built-in wordlist (word-completion, matching how the cipher was actually being solved on paper). Falls back to the ascending-side candidate for any gate with no dictionary match. """ wordlist = wordlist or DEFAULT_WORDS gates = decode_digit_string(raw) n = len(gates)
def backtrack(idx, current):
if idx == n:
word = "".join(current)
return word if word.upper() in wordlist else None
for cand in gates[idx]["candidates"]:
current.append(cand["letter"])
result = backtrack(idx + 1, current)
if result:
return result
current.pop()
return None
match = backtrack(0, [])
if match:
return match
# fallback: pick first candidate (prefers mid, then asc, then desc)
return "".join(g["candidates"][0]["letter"] for g in gates)
DEFAULT_WORDS = { "THAT", "WHAT", "THIS", "WHO", "WHY", "HOW", "WHEN", "WHERE", "YOU", "YOUR", "SHE", "HER", "HIM", "HIS", "THEY", "THEM", "THE", "AND", "FOR", "ARE", "WAS", "GOD", "SEA", "SUN", "SKY", }
============================================================
LAYER 2 — TRIADIC ENGINE (ACTS-linked)
============================================================
IC = [ {"h": "☰", "n": "QIAN — THE CREATIVE", "d": "Heaven. Pure yang. Maximum expansion and initiating force."}, {"h": "☷", "n": "KUN — THE RECEPTIVE", "d": "Earth. Pure yin. Deep receptivity and yielding strength."}, {"h": "☳", "n": "ZHEN — THE AROUSING", "d": "Thunder. Shock and movement. Initiating force from stillness."}, {"h": "☵", "n": "KAN — THE ABYSMAL", "d": "Water. Depth and danger. Flow through and around all obstacles."}, {"h": "☶", "n": "GEN — KEEPING STILL", "d": "Mountain. Stillness and restraint. Meditative composure."}, {"h": "☴", "n": "XUN — THE GENTLE", "d": "Wind and Wood. Penetrating gradual influence. Subtle progress."}, {"h": "☲", "n": "LI — THE CLINGING", "d": "Fire. Clarity and brilliance. Illuminating and dependent."}, {"h": "☱", "n": "DUI — THE JOYOUS", "d": "Lake. Joy and pleasure. Open and communicative expression."}, ]
ELEMS = ['AIR', 'FIRE', 'WATER', 'EARTH', 'AETHER'] ELEM_ICONS = ['🜁', '🜂', '🜄', '🜃', '⬡'] SIGIL_N = ['VOID PRIME', 'DELTA LOCK', 'SIGMA PULSE', 'OMEGA GATE', 'ALPHA FLUX', 'BETA PHASE', 'GAMMA ARCH'] HEX_F = ['HEXFORM I', 'HEXFORM II', 'HEXFORM III', 'HEXFORM IV', 'HEXFORM V', 'HEXFORM VI']
def digit_root(n: float) -> int: n = abs(round(n)) if n == 0: return 0 return 1 + (n - 1) % 9
def map_val(v: float) -> int: s = str(abs(round(v))) total = sum(int(c) for c in s if c.isdigit()) return total or 1
def triadic_state(sig_reduced: int) -> int: m = sig_reduced % 3 if m == 1: return 1 if m == 0: return 0 return -1
def triadic_label(v: int) -> str: if v == 1: return "YANG-DOMINANT — expansive, initiating, outward force" if v == 0: return "BALANCED NEUTRAL — equipoise between yin and yang states" return "YIN-DOMINANT — receptive, inward, containing force"
def i_ching_hexagram(sig_reduced: int) -> dict: return IC[sig_reduced % 8]
def symbolic_layer(sig_reduced: int, angle: float, position: float) -> dict: elem_idx = sig_reduced % len(ELEMS) return { "xi_operator": f"Ξ-{sig_reduced}", "psi_resonance": f"Ψζ·{angle:.1f}°", "diamond_sigil": SIGIL_N[sig_reduced % len(SIGIL_N)], "element": f"{ELEM_ICONS[elem_idx]} {ELEMS[elem_idx]}", "hex_frame": HEX_F[(sig_reduced - 1) % len(HEX_F)], "root9_anchor": f"⊙ {position:.2f}° / ROOT 9", }
def proximity_label(position: float) -> str: if position < 5: return "EXTREME PROXIMITY" if position < 15: return "VERY CLOSE" if position < 30: return "MODERATE ALIGNMENT" if position < 60: return "PARTIAL ALIGNMENT" return "DISTANT PHASE"
def resonance(t: float, base: float, amplitude: float, period: float = 24) -> float: return base + amplitude * math.sin(2 * math.pi * t / period)
def focus_stability(current: float, peak: float, trough: float) -> float: f = 1 - abs(peak - current) / (peak - trough) return max(0.0, min(1.0, f))
@dataclass class TriadicResult: seed: int mapped: int sig_reduced: int angle: float position: float base: float peak: float trough: float current: float focus: float tri_val: int tri_label: str proximity: str i_ching: dict symbolic: dict
def triadic_from_seed(seed: int, amplitude: float = 1.4, now: datetime = None) -> TriadicResult: """ Core bridge function: takes ANY integer seed (a cipher digit-sum, a birth-data digit-root total, or anything else) and runs it through the full triadic pipeline. """ now = now or datetime.now() mapped = map_val(seed) sig_reduced = digit_root(mapped) angle = round((sig_reduced / 9) * 360, 2) position = round(angle % 90, 2) base = round(10 - (position * 0.8), 4) peak = round(base + amplitude, 3) trough = round(base - amplitude, 3)
t_now = now.hour + now.minute / 60 + now.second / 3600
current = round(resonance(t_now, base, amplitude), 3)
focus = round(focus_stability(current, peak, trough), 3)
tri_val = triadic_state(sig_reduced)
ic = i_ching_hexagram(sig_reduced)
sym = symbolic_layer(sig_reduced, angle, position)
return TriadicResult(
seed=seed, mapped=mapped, sig_reduced=sig_reduced, angle=angle,
position=position, base=base, peak=peak, trough=trough,
current=current, focus=focus, tri_val=tri_val,
tri_label=triadic_label(tri_val), proximity=proximity_label(position),
i_ching=ic, symbolic=sym,
)
def triadic_from_birth(month, day, year, hour, minute, lat=41.67, lon=-83.42, amplitude=1.4, now: datetime = None) -> TriadicResult: """Original birth-data pipeline: each component digit-rooted, then summed as the seed.""" comps = [month, day, year, hour, minute, abs(lat), abs(lon)] total = sum(digit_root(map_val(c)) for c in comps) return triadic_from_seed(total, amplitude=amplitude, now=now)
============================================================
LAYER 3 — ATTRACTOR ENGINE (α ≈ π/60)
============================================================
Same cosine-iteration structure as the Breakthrough Prize operator
T_ε(z) = cos(εz), here with the new constant α ≈ π/60.
Since |α| << 1, cos(α·z) is a contraction mapping (Banach fixed
point): EVERY seed converges to the same fixed point z*. That
universality is what makes it a true attractor. What differs by
seed is the PATH into it — the first iterate and how many steps
it takes to converge.
ALPHA = math.pi / 60 # ≈ 0.05235987755982988
def iterate_attractor(z0: float, alpha: float = ALPHA, iterations: int = 200, tol: float = 1e-12): """ Iterate z_{n+1} = cos(alpha * z_n) from a starting value z0 until it converges (or hits the iteration cap). Returns (final_z, iterations_taken, trajectory_list). """ z = z0 traj = [z] for i in range(iterations): z_next = math.cos(alpha * z) traj.append(z_next) if abs(z_next - z) < tol: return z_next, i + 1, traj z = z_next return z, iterations, traj
@dataclass class AttractorResult: alpha: float seed: float first_iterate: float # cos(alpha * seed) -- the personalized entry point fixed_point: float # the converged attractor value z* iterations_to_converge: int trajectory: list # early steps of the path into the attractor
def attractor_from_seed(seed: float, alpha: float = ALPHA, iterations: int = 200) -> AttractorResult: first_iterate = math.cos(alpha * seed) fixed_point, iters, traj = iterate_attractor(float(seed), alpha=alpha, iterations=iterations) return AttractorResult( alpha=alpha, seed=seed, first_iterate=round(first_iterate, 10), fixed_point=round(fixed_point, 10), iterations_to_converge=iters, trajectory=[round(x, 8) for x in traj[:12]], # cap displayed trajectory )
def print_attractor(a: AttractorResult): print(f"α = {a.alpha:.10f} (π/60)") print(f"SEED: {a.seed} | FIRST ITERATE: cos(α·seed) = {a.first_iterate:.10f}") print(f"FIXED POINT (attractor): z* = {a.fixed_point:.10f}") print(f"CONVERGED IN: {a.iterations_to_converge} iterations") print(f"TRAJECTORY: {' -> '.join(f'{x:.6f}' for x in a.trajectory)}")
============================================================
UNIFIED PIPELINE — cipher word -> triadic engine
============================================================
def unified_reading(word: str, amplitude: float = 1.4) -> dict: letters = encode_word(word) total = sum(lv.value for lv in letters) result = triadic_from_seed(total, amplitude=amplitude) attractor = attractor_from_seed(total) return { "word": word, "cipher_breakdown": [asdict(lv) for lv in letters], "digit_sum": total, "triadic": asdict(result), "attractor": asdict(attractor), }
============================================================
PRINTING / SERIALIZATION
============================================================
def print_triadic(result: TriadicResult): ic = result.i_ching sym = result.symbolic print(f"SIGNATURE Φ: {result.sig_reduced} / {result.angle:.2f}° | " f"POSITION: {result.position:.2f}° → {result.proximity}") print(f"BASE RESONANCE: {result.base:.4f} | RANGE: {result.trough:.3f} – {result.peak:.3f}") print(f"CURRENT RESONANCE: {result.current:.3f} | FOCUS STABILITY: {result.focus:.3f}") print(f"TRIADIC STATE: {result.tri_label}") print(f"I CHING: {ic['h']} {ic['n']}") print(f"ELEMENT: {sym['element']} | SIGIL: {sym['diamond_sigil']} | FRAME: {sym['hex_frame']}") print(f"ROOT 9 ANCHOR: {sym['root9_anchor']}")
def to_json(obj) -> str: if hasattr(obj, "dict") or hasattr(obj, "dataclass_fields"): obj = asdict(obj) return json.dumps(obj, indent=2, ensure_ascii=False)
============================================================
CLI
============================================================
def build_parser(): p = argparse.ArgumentParser(prog="that_system", description="THAT SYSTEM — Cipher x Triadic Engine") sub = p.add_subparsers(dest="command", required=True)
e = sub.add_parser("encode", help="Encode a word/phrase into cipher digits")
e.add_argument("word")
e.add_argument("--json", action="store_true")
d = sub.add_parser("decode", help="Decode a digit string into candidate letters/words")
d.add_argument("digits")
d.add_argument("--json", action="store_true")
u = sub.add_parser("unified", help="Run a word through the cipher, triadic engine, AND attractor")
u.add_argument("word")
u.add_argument("--amplitude", type=float, default=1.4)
u.add_argument("--json", action="store_true")
a = sub.add_parser("attractor", help="Run the α=π/60 cosine-iteration attractor on a seed")
a.add_argument("seed", type=float)
a.add_argument("--json", action="store_true")
b = sub.add_parser("birth", help="Run birth data through the triadic engine")
b.add_argument("--month", type=int, required=True)
b.add_argument("--day", type=int, required=True)
b.add_argument("--year", type=int, required=True)
b.add_argument("--hour", type=int, default=9)
b.add_argument("--minute", type=int, default=0)
b.add_argument("--lat", type=float, default=41.67)
b.add_argument("--lon", type=float, default=-83.42)
b.add_argument("--amplitude", type=float, default=1.4)
b.add_argument("--json", action="store_true")
return p
def main(argv=None): args = build_parser().parse_args(argv)
if args.command == "encode":
letters = encode_word(args.word)
digits = "".join(str(lv.value) for lv in letters)
if args.json:
print(json.dumps({"word": args.word, "digits": digits,
"letters": [asdict(l) for l in letters]}, indent=2, ensure_ascii=False))
else:
print(f"WORD: {args.word.upper()}")
print(f"DIGITS: {digits}")
for lv in letters:
print(f" {lv.letter} -> {lv.value} ({lv.side})")
elif args.command == "decode":
gates = decode_digit_string(args.digits)
guess = best_guess_word(args.digits)
if args.json:
print(json.dumps({"digits": args.digits, "gates": gates, "best_guess": guess},
indent=2, ensure_ascii=False))
else:
print(f"DIGITS: {args.digits}")
for g in gates:
opts = " / ".join(f"{c['letter']}({c['side']})" for c in g["candidates"])
print(f" gate {g['digit']}: {opts}")
print(f"BEST GUESS: {guess}")
elif args.command == "unified":
result = unified_reading(args.word, amplitude=args.amplitude)
if args.json:
print(json.dumps(result, indent=2, ensure_ascii=False))
else:
print(f"WORD: {args.word.upper()} | DIGIT SUM: {result['digit_sum']}")
print("-" * 50)
tr = triadic_from_seed(result["digit_sum"], amplitude=args.amplitude)
print_triadic(tr)
print("-" * 50)
print_attractor(attractor_from_seed(result["digit_sum"]))
elif args.command == "attractor":
result = attractor_from_seed(args.seed)
if args.json:
print(to_json(result))
else:
print_attractor(result)
elif args.command == "birth":
result = triadic_from_birth(args.month, args.day, args.year, args.hour,
args.minute, args.lat, args.lon, args.amplitude)
if args.json:
print(to_json(result))
else:
print_triadic(result)
if name == "main": if len(sys.argv) > 1: main() else: # No CLI args: demo run print("=== ENCODE DEMO: THAT ===") for lv in encode_word("THAT"): print(f" {lv.letter} -> {lv.value} ({lv.side})") print("\n=== DECODE DEMO: 7817 ===") for g in decode_digit_string("7817"): opts = " / ".join(f"{c['letter']}({c['side']})" for c in g["candidates"]) print(f" gate {g['digit']}: {opts}") print(f" best guess: {best_guess_word('7817')}") print("\n=== UNIFIED DEMO: THRESHOLD ===") result = unified_reading("THRESHOLD") print(f" digit sum: {result['digit_sum']}") print_triadic(triadic_from_seed(result['digit_sum'])) print("\n=== ATTRACTOR DEMO (α ≈ π/60) ===") print_attractor(attractor_from_seed(result['digit_sum'])) print("\n=== BIRTH DEMO ===") print_triadic(triadic_from_birth(month=9, day=9, year=1988, hour=9, minute=0))