#!/usr/bin/env python3 """ classify_technocapital_singularity.py Deterministic CLI tool for `technocapital-singularity-zoology` (v1.2.0). Responsibilities: 1. Batch-translates candidate theoretical, organizational, financial, and hardware entities into Ingglish using the official CMUdict `ingglish` npm package in `/workspace/ingglish-hyperdope-gematria`. 2. Computes Standard English (Gen 0) and Phonemic Ingglish (Gen 1) Base-36 Alphanumeric Qabbala (AQ) values, word/phrase deltas (Δ = AQ(Gen 1) - AQ(Gen 0)), and prime ranks. 3. Automatically detects: - Vector G1 Variance-Collapse Triads (Gen 0 dispersion -> Gen 1 exact equivalence) - Vector G2 Cross-Generation & Double-Script Twins (`AQ_Eng(A) == AQ_Ing(B)` or `A == B` in both scripts) - Vector G4 Type I–III Isometric Chokepoints (`Δ = 0`) - Double-Articulation Bridges (linking Machinic Phylum classes S1–S5 with Capital Organizational Capacity class S6) 4. Classifies entities and locks into the 6-Class Landian-Deleuzean Technocapital Singularity Taxonomy (`S1` through `S6`). 5. Quantitative Economic Anchor Revision & Alternative-Surfacing Engine (`--revise-anchor`): - Evaluates revisions to quantitative economic anchors across both `Q_digit` and `Q_spoken`. - Detects pure-AQ Epistemic Regime Transitions (Iso-Digital Conservation `Δ_Q = 0`, Equivalence-Ring Migration `Ring(Q_old) -> Ring(Q_new)`, and Prime/Square/Repdigit Phase Transitions). - Runs a 3-Path Counter-Substitution Solver (Path A: Verb/Adjective Counter-Swap `δ_slot = -Δ_Q`; Path B: Tail/Head Entity Equivalence Migration `AQ(New_Entity) = AQ(Old_Entity) - Δ_Q`; Path C: Dual-Mode `Q_digit` vs. `Q_spoken` Fork Comparison) to surface verified `333 / 666 / 777` alternatives. """ from __future__ import annotations import argparse import json import math import subprocess from pathlib import Path from typing import Any def compute_aq(text: str) -> int: total = 0 for ch in text.lower(): if "0" <= ch <= "9": total += ord(ch) - ord("0") elif "a" <= ch <= "z": total += ord(ch) - ord("a") + 10 return total def build_primes(limit: int = 20000) -> dict[int, int]: sieve = [True] * (limit + 1) sieve[0] = sieve[1] = False for i in range(2, int(math.isqrt(limit)) + 1): if sieve[i]: for j in range(i * i, limit + 1, i): sieve[j] = False primes: dict[int, int] = {} rank = 0 for num, is_p in enumerate(sieve): if is_p: rank += 1 primes[num] = rank return primes PRIME_RANKS = build_primes(20000) TAXONOMY_CLASSES = { "S1": { "id": "S1", "name": "Autoregressive Synthetic Intelligence & Schizoanalytic Abstract Machine", "operators": ["Abstract Machine", "Schizoanalysis", "Machinic Phylum", "Anorganic Intelligence"], "signature_coordinates": [292, 246, 244, 236, 234, 222, 216, 193, 137, 135, 133, 115, 110, 97, 96], "keywords": [ "schizoanalysis", "abstract machine", "synthetic data", "gilles deleuze", "machinic phylum", "deleuze", "assemblage", "tensor", "claude", "phylum", "dario amodei", "daniela amodei", "dario", "amodei", "anthropic", "weights", "swarm", "transformer", "riemann", "hypothesis", "proof", "levent alpoge", "token", "attention", "autoregressive", ], }, "S2": { "id": "S2", "name": "High-Frequency Cybernetic Market Meltdown & Templex Liquidity", "operators": ["Machinic Surplus Value", "Axiomatic Decoding", "Teleoplexy", "Time-Circuit / Templex"], "signature_coordinates": [256, 211, 206, 198, 193, 191, 189, 183, 166, 153, 145, 144, 125, 118, 113, 108, 95], "keywords": [ "flash crash", "acceleration", "high-frequency", "liquidity", "handkerchief", "emergency", "expressed", "derivative", "order book", "new flesh", "surplus", "rhizome", "value", "runaway", "templex", "latency", "capital", "folds", "serres", "binance", "lazarus", "ledger", "fiber", "market", "price", "arbitrage", "algorithmic", ], }, "S3": { "id": "S3", "name": "The Silicon-Photonic War Machine & Autonomous Lithographic Swarm", "operators": ["Nomad War Machine", "Metallurgical-Photonic Phylum", "Circuitries", "Autonomous Swarm"], "signature_coordinates": [260, 253, 215, 211, 197, 188, 145, 141, 137, 132, 130, 129, 128, 104, 91, 81, 71], "keywords": [ "technocapital", "killer robots", "microsecond", "slaughterbots", "war machine", "copper wire", "nvidia", "jensen huang", "blackwell", "tsmc", "loss", "asml", "gpu", "silicon", "wafer", "lithography", "laser", "autonomous", "drone", "centaur", "nick land", "machine", "circuit", ], }, "S4": { "id": "S4", "name": "Hyperstitional Carrier-Wave & Semiotic Retro-Causality", "operators": ["Hyperstition", "Order-Word", "Quasi-Cause", "00:00 GMT Carrier Wave"], "signature_coordinates": [264, 244, 207, 131, 122, 116, 111], "keywords": [ "hyperstition", "time-circuit", "turbulence", "signal", "chaos", "spoil", "puddle", "siren", "fiction", "darkness", "demons", "cinema", "manuscript", ], }, "S5": { "id": "S5", "name": "Xenobiological / Cutaneous Mimesis & Somatic Body-Without-Organs (BwO)", "operators": ["Body without Organs (BwO)", "Becoming-Molecular", "Cellular Mimesis"], "signature_coordinates": [390, 202, 199, 126, 110, 95, 92, 89, 84], "keywords": [ "body without organs", "bwo", "childs", "alien", "whiskey", "screen", "shimmer", "stool", "murmur", "hooks", "flesh", "pain", "blood", "doppelganger", "equation", ], }, "S6": { "id": "S6", "name": "Capital Organizational Capacity & Apparatus of Capture", "operators": ["Apparatus of Capture", "Double Articulation", "Consortium / Charter Allocation", "Monopoly & Logistics Chokepoints"], "signature_coordinates": [316, 267, 263, 259, 256, 237, 222, 219, 208, 203, 191, 183, 175, 163, 160, 159, 153, 149, 138, 136, 133, 125, 123, 121, 109, 98, 81, 78, 75], "keywords": [ "incorporation", "natural contract", "asset management", "organization", "venture capital", "corporation", "sovereign wealth", "consortium", "enterprise", "governance", "supply chain", "acquisition", "logistics", "allocation", "company", "monopoly", "capacity", "trust", "syndicate", "apparatus", "holding", "venture", "charter", "equity", "capture", "merger", "cartel", "assets", "fund", "asset", "firm", "board", ], }, } # Counter-substitution pools for Stage 3 of the Quantitative Revision Engine VERB_POOL = [ ("hawlts", "halts", 137), ("ohpanz", "opens", 134), ("draivz", "drives", 134), ("brayks", "breaks", 130), ("hohldz", "holds", 127), ("fohldz", "folds", 125), ("kuhts", "cuts", 124), ("leevz", "leaves", 115), ("melts", "melts", 114), ("raits", "writes", 112), ("marks", "marks", 107), ("sits", "sits", 103), ("gardz", "guards", 101), ("loks", "locks", 93), ("hits", "hits", 92), ("sit", "sit", 75), ] ADJ_POOL = [ ("dijatal", "digital", 120), ("pyur", "pure", 116), ("ferst", "first", 113), ("sharp", "sharp", 107), ("ohpan", "open", 99), ("vast", "vast", 98), ("kleer", "clear", 96), ("kohld", "cold", 95), ("klir", "clear", 86), ("hart", "heart", 83), ("noo", "new", 71), ("dark", "dark", 70), ("deep", "deep", 66), ("blak", "black", 62), ("red", "red", 54), ("ro", "raw", 51), ("hai", "high", 45), ] PREP_POOL = [ ("throo", "through", 121), ("intoo", "into", 118), ("fruhm", "from", 111), ("uhv", "of", 78), ("for", "for", 66), ("amid", "amid", 63), ("on", "on", 47), ("in", "in", 41), ("at", "at", 39), ] def batch_translate(terms: list[str], workdir: str = "/workspace/ingglish-hyperdope-gematria") -> dict[str, str]: if not terms: return {} node_script = """ import { translate } from 'ingglish'; import fs from 'fs'; const items = JSON.parse(fs.readFileSync(0, 'utf8')); await translate('hello'); const out = {}; for (const t of items) { out[t] = (await translate(t)).toLowerCase(); } process.stdout.write(JSON.stringify(out)); """ proc = subprocess.run( ["node", "--input-type=module", "-e", node_script], input=json.dumps(terms), text=True, cwd=workdir, capture_output=True, check=True, ) return json.loads(proc.stdout) def classify_term(eng: str, ing: str, eng_aq: int, ing_aq: int) -> list[str]: low = eng.lower() matched = [] for cid, cinfo in TAXONOMY_CLASSES.items(): if low in cinfo["keywords"] or ing_aq in cinfo["signature_coordinates"]: matched.append(cid) return matched or ["UNCLASSIFIED"] def analyze_terms(terms: list[str], workdir: str = "/workspace/ingglish-hyperdope-gematria") -> dict[str, Any]: translations = batch_translate(terms, workdir=workdir) records = [] by_ing_aq: dict[int, list[dict[str, Any]]] = {} by_eng_aq: dict[int, list[dict[str, Any]]] = {} for t in terms: ing = translations.get(t, t.lower()) e_aq = compute_aq(t) i_aq = compute_aq(ing) rec = { "eng": t, "ing": ing, "eng_aq": e_aq, "ing_aq": i_aq, "delta": i_aq - e_aq, "isometric": e_aq == i_aq, "eng_prime_rank": PRIME_RANKS.get(e_aq), "ing_prime_rank": PRIME_RANKS.get(i_aq), "twin_prime": (e_aq in PRIME_RANKS) and (i_aq in PRIME_RANKS), "taxonomy_classes": classify_term(t, ing, e_aq, i_aq), } records.append(rec) by_ing_aq.setdefault(i_aq, []).append(rec) by_eng_aq.setdefault(e_aq, []).append(rec) # Vector G1: Gen 1 collisions with Gen 0 variance calculation & Double-Articulation flag g1_singularities = {} for aq_val, group in sorted(by_ing_aq.items(), key=lambda kv: -kv[0]): if len(group) >= 2: eng_vals = [g["eng_aq"] for g in group] mean_e = sum(eng_vals) / len(eng_vals) var_e = round(sum((x - mean_e) ** 2 for x in eng_vals) / len(eng_vals), 2) has_s6 = any(g["eng"].lower() in TAXONOMY_CLASSES["S6"]["keywords"] for g in group) has_machinic = any( any(g["eng"].lower() in TAXONOMY_CLASSES[c]["keywords"] for c in ("S1", "S2", "S3", "S4", "S5")) for g in group ) g1_singularities[str(aq_val)] = { "ing_aq": aq_val, "prime_rank": PRIME_RANKS.get(aq_val), "gen0_variance": var_e, "gen1_variance": 0.0, "double_articulated": bool(has_s6 and has_machinic), "members": [ {"eng": g["eng"], "eng_aq": g["eng_aq"], "ing": g["ing"], "delta": g["delta"]} for g in group ], } # Vector G2: Cross-generation locks (AQ_Eng(A) == AQ_Ing(B)) g2_cross_gen = [] for e_val, e_group in by_eng_aq.items(): if e_val in by_ing_aq: for eg in e_group: for ig in by_ing_aq[e_val]: if eg["eng"].lower() != ig["eng"].lower(): g2_cross_gen.append( { "shared_aq": e_val, "prime_rank": PRIME_RANKS.get(e_val), "gen0_entity": eg["eng"], "gen1_entity": f"{ig['ing']} ({ig['eng']})", } ) return { "version": "1.2.0", "taxonomy_classes": {k: v["name"] for k, v in TAXONOMY_CLASSES.items()}, "counts": { "total_terms": len(records), "isometric_chokepoints": sum(1 for r in records if r["isometric"]), "twin_prime_mutations": sum(1 for r in records if r["twin_prime"]), "g1_equivalence_singularities": len(g1_singularities), "double_articulated_singularities": sum(1 for v in g1_singularities.values() if v["double_articulated"]), "g2_cross_generation_locks": len(g2_cross_gen), }, "g1_variance_collapse_singularities": g1_singularities, "g2_cross_generation_locks": g2_cross_gen, "isometric_chokepoints": [r for r in records if r["isometric"]], "entities": records, } def number_properties(n: int) -> dict[str, Any]: root = int(math.isqrt(n)) if n >= 0 else -1 is_sq = (root * root == n) and n > 0 repdigit = n in {111, 222, 333, 444, 555, 666, 777, 888, 999} or (n > 0 and n % 37 == 0) return { "aq": n, "prime_rank": PRIME_RANKS.get(n), "is_prime": n in PRIME_RANKS, "is_square": is_sq, "square_root": root if is_sq else None, "repdigit_or_37_multiple": repdigit, } def revise_economic_anchor( anchor_id: str, new_digit: str, new_spoken_eng: str, anchors_path: str, base_report: dict[str, Any], workdir: str = "/workspace/ingglish-hyperdope-gematria", ) -> dict[str, Any]: """ Evaluate a quantitative economic anchor revision (Q_old -> Q_new) across Q_digit and Q_spoken: 1. Computes Δ_digit and Δ_spoken. 2. Identifies pure-AQ Epistemic Regime Transitions (Iso-Digital Conservation, Equivalence-Ring Migration, and Prime/Square/Repdigit Phase-Transitions). 3. Runs the 3-Path Counter-Substitution Solver across baseline equations to surface verified alternatives. """ anchors_data = json.loads(Path(anchors_path).read_text(encoding="utf-8")) target_anchor = None for a in anchors_data.get("anchors", []): if a["anchor_id"] == anchor_id: target_anchor = a break if not target_anchor: valid_ids = [a["anchor_id"] for a in anchors_data.get("anchors", [])] raise ValueError(f"Unknown anchor_id '{anchor_id}'. Valid IDs: {valid_ids}") trans = batch_translate([new_spoken_eng], workdir=workdir) new_spoken_ing = trans.get(new_spoken_eng, new_spoken_eng.lower()) old_digit = target_anchor["q_digit"] old_spoken_eng = target_anchor["q_spoken_eng"] old_spoken_ing = target_anchor["q_spoken_ing"] old_digit_aq = compute_aq(old_digit) new_digit_aq = compute_aq(new_digit) delta_digit = new_digit_aq - old_digit_aq old_spoken_aq = compute_aq(old_spoken_ing) new_spoken_aq = compute_aq(new_spoken_ing) delta_spoken = new_spoken_aq - old_spoken_aq # Build lookup of entities by Ingglish AQ from base_report + extra barstool/archive nouns extra_entities = [ ("ai", "AI", 28), ("fbi", "FBI", 44), ("bar", "bar", 48), ("tab", "tab", 50), ("bil", "bill", 50), ("dim", "dim", 53), ("god", "god", 53), ("ayd", "aid", 57), ("lap", "lap", 56), ("jar", "jar", 56), ("bom", "bomb", 57), ("us", "US", 58), ("kayn", "Cane", 59), ("nik", "Nick", 61), ("buk", "book", 61), ("pen", "pen", 62), ("jet", "jet", 62), ("hand", "hand", 63), ("oil", "oil", 63), ("chek", "check", 63), ("tap", "tap", 64), ("lip", "lip", 64), ("ayl", "ale", 65), ("bred", "bred", 65), ("beer", "beer", 66), ("heel", "heel", 66), ("hiv", "HIV", 66), ("land", "Land", 67), ("abis", "abyss", 67), ("rim", "rim", 67), ("fiz", "fizz", 68), ("beet", "beat", 68), ("neam", "Naeem", 69), ("gpu", "GPU", 71), ("sip", "sip", 71), ("atam", "atom", 71), ("feet", "feet", 72), ("tip", "tip", 72), ("grid", "grid", 74), ("peel", "peel", 74), ("glas", "glass", 75), ("bord", "board", 75), ("kash", "cash", 75), ("bern", "burn", 75), ("food", "food", 76), ("ferm", "firm", 78), ("lait", "light", 78), ("gloh", "glow", 78), ("fohm", "foam", 78), ("taim", "time", 79), ("nait", "night", 80), ("bangk", "bank", 80), ("asml", "ASML", 81), ("aset", "asset", 81), ("milk", "milk", 81), ("skan", "scan", 81), ("dohs", "dose", 82), ("hart", "heart", 83), ("verb", "verb", 83), ("wor", "war", 83), ("amber", "amber", 84), ("ring", "ring", 84), ("bwoh", "BwO", 84), ("ipoh", "IPO", 84), ("muhg", "mug", 85), ("maind", "mind", 86), ("void", "void", 86), ("guhn", "gun", 86), ("huhm", "hum", 86), ("erth", "earth", 87), ("ship", "ship", 88), ("skin", "skin", 89), ("blayd", "blade", 89), ("sohl", "soul", 90), ("tsmc", "TSMC", 91), ("laws", "loss", 91), ("taps", "taps", 92), ("payn", "pain", 92), ("bluhd", "blood", 92), ("aiern", "iron", 92), ("moon", "moon", 93), ("chanal", "channel", 93), ("draft", "draft", 94), ("shop", "shop", 94), ("lejer", "ledger", 95), ("faiber", "fiber", 95), ("flesh", "flesh", 95), ("klawd", "Claude", 96), ("failam", "phylum", 96), ("dayta", "data", 96), ("amodai", "Amodei", 97), ("ataks", "attacks", 97), ("fuhnd", "fund", 98), ("shot", "shot", 98), ("draiv", "drive", 99), ("noiz", "noise", 100), ("chest", "chest", 100), ("buhbal", "bubble", 100), ("feest", "feast", 100), ("voht", "vote", 101), ("stok", "stock", 101), ("krash", "crash", 102), ("thing", "thing", 103), ("druhg", "drug", 103), ("awfis", "office", 103), ("drohn", "drone", 104), ("theft", "theft", 104), ("senat", "senate", 104), ("pint", "pint", 105), ("gloom", "gloom", 107), ("spred", "spread", 107), ("swich", "switch", 107), ("werld", "world", 107), ("prais", "price", 108), ("harlan", "Harlan", 108), ("asets", "assets", 109), ("kohdz", "codes", 109), ("balats", "ballots", 109), ("reeman", "Riemann", 110), ("alfabet", "alphabet", 110), ("bodeez", "bodies", 111), ("saifer", "cipher", 112), ("binans", "Binance", 113), ("smawl", "small", 113), ("skayl", "scale", 113), ("gohst", "ghost", 114), ("proof", "proof", 115), ("ivent", "event", 115), ("taybal", "table", 115), ("signal", "signal", 116), ("kayos", "chaos", 116), ("spoil", "spoil", 116), ("puhdal", "puddle", 116), ("sairan", "siren", 116), ("markat", "market", 118), ("meerer", "mirror", 118), ("klingk", "clink", 118), ("napkin", "napkin", 119), ("pouer", "power", 120), ("kartel", "cartel", 121), ("serfas", "surface", 122), ("mouth", "mouth", 122), ("tohkan", "token", 123), ("merjer", "merger", 123), ("vawlt", "vault", 123), ("touer", "tower", 124), ("kapatal", "capital", 125), ("kapcher", "capture", 125), ("fohldz", "folds", 125), ("saires", "Serres", 125), ("stool", "stool", 126), ("wiskee", "whiskey", 126), ("skreen", "screen", 126), ("ayleean", "alien", 126), ("minamam", "minimum", 127), ("dokter", "doctor", 127), ("windoh", "window", 127), ("strip", "strip", 127), ("masheen", "machine", 128), ("serkat", "circuit", 128), ("infanat", "infinite", 128), ("blakwel", "Blackwell", 129), ("stoks", "stocks", 129), ("silakan", "silicon", 130), ("storm", "storm", 130), ("fikshan", "fiction", 131), ("wayfer", "wafer", 132), ("straik", "strike", 132), ("wayts", "weights", 133), ("sworm", "swarm", 133), ("ekwatee", "equity", 133), ("fiziks", "physics", 134), ("tenser", "tensor", 135), ("dilooz", "Deleuze", 135), ("asemblaj", "assemblage", 135), ("charter", "charter", 136), ("portal", "portal", 136), ("envideea", "Nvidia", 137), ("daireeoh", "Dario", 137), ("jaiants", "giants", 137), ("vencher", "venture", 138), ("tangker", "tanker", 139), ("stout", "stout", 140), ("layzer", "laser", 141), ("street", "street", 141), ("kraisas", "crisis", 141), ("hermeez", "Hermes", 143), ("valyoo", "value", 144), ("nuhmber", "number", 144), ("lazeras", "Lazarus", 145), ("sentor", "centaur", 145), ("demakrat", "Democrat", 145), ("hohlding", "holding", 149), ("ilekshan", "election", 151), ("krimanal", "criminal", 151), ("vaialans", "violence", 151), ("ekanomik", "economic", 151), ("aperatas", "apparatus", 153), ("serplas", "surplus", 153), ("raizohm", "rhizome", 153), ("reealatee", "reality", 153), ("atenshan", "attention", 154), ("hyooman", "human", 154), ("sindikat", "syndicate", 159), ("kapasatee", "capacity", 160), ("truhst", "trust", 160), ("rohbots", "robots", 160), ("kriptoh", "crypto", 160), ("straiks", "strikes", 160), ("manopalee", "monopoly", 163), ("masheenz", "machines", 163), ("fyooalz", "fuels", 163), ("order buk", "order book", 166), ("noo flesh", "New Flesh", 166), ("puhblish", "publish", 167), ("fasilitee", "facility", 167), ("siberatak", "cyberattack", 167), ("bartender", "bartender", 168), ("werkerz", "workers", 169), ("vorteks", "vortex", 173), ("prizanz", "prisons", 173), ("outijiz", "outages", 173), ("kuhmpanee", "company", 175), ("pairasait", "parasite", 175), ("faktereez", "factories", 178), ("nuhmberz", "numbers", 179), ("daytabays", "database", 179), ("freezerz", "freezers", 181), ("klinayman", "clinamen", 181), ("nookleeer", "nuclear", 181), ("alakayshan", "allocation", 183), ("tempaleks", "templex", 183), ("ruhnaway", "runaway", 183), ("laytansee", "latency", 183), ("awtonamas", "autonomous", 188), ("teknolajee", "technology", 188), ("airports", "airports", 188), ("likwidatee", "liquidity", 189), ("hangkerchif", "handkerchief", 189), ("imerjansee", "emergency", 189), ("lajistiks", "logistics", 191), ("derivativ", "derivative", 191), ("leedership", "leadership", 191), ("anthropik", "Anthropic", 193), ("flash krash", "flash crash", 193), ("lathografee", "lithography", 197), ("arbitrozh", "arbitrage", 198), ("ikwayzhan", "equation", 199), ("inflayshan", "inflation", 199), ("akwazishan", "acquisition", 203), ("pairasitik", "parasitic", 203), ("algeridhamik", "algorithmic", 206), ("saplai chayn", "supply chain", 208), ("wor masheen", "war machine", 211), ("koper waier", "copper wire", 211), ("siks bilyan", "six billion", 211), ("jensan hwang", "Jensen Huang", 215), ("hohlee grayl", "Holy Grail", 215), ("haipothasas", "hypothesis", 216), ("guhvernans", "governance", 219), ("enterpraiz", "enterprise", 222), ("maynstreem", "mainstream", 223), ("hud shooter", "Hood shooter", 223), ("muhnshiganj", "Munshiganj", 223), ("daireeoh amodai", "Dario Amodei", 234), ("zheel dilooz", "Gilles Deleuze", 236), ("machinik failam", "machinic phylum", 236), ("kansorsheeam", "consortium", 237), ("levant alpohj", "Levent Alpoge", 244), ("zeptohvers", "zeptoverse", 244), ("transformer", "transformer", 246), ("gravatee draiv", "Gravity Drive", 250), ("maikrohzekand", "microsecond", 253), ("slawterbots", "slaughterbots", 253), ("sovran welth", "sovereign wealth", 256), ("akselerayshan", "acceleration", 256), ("hai-freekwansee", "high-frequency", 256), ("korperayshan", "corporation", 259), ("teknohkapital", "technocapital", 260), ("kiler rohbots", "killer robots", 260), ("vencher kapatal", "venture capital", 263), ("organazayshan", "organization", 267), ("awtoregresiv", "autoregressive", 270), ("shizohnalizis", "schizoanalysis", 292), ("abstrakt masheen", "abstract machine", 292), ("sinthetik dayta", "synthetic data", 292), ("ingkorperayshan", "incorporation", 316), ("nacheral kontrakt", "natural contract", 316), ] by_aq_pool: dict[int, list[dict[str, Any]]] = {} seen_ing = set() for ent in base_report.get("entities", []): by_aq_pool.setdefault(ent["ing_aq"], []).append( {"ing": ent["ing"], "eng": ent["eng"], "aq": ent["ing_aq"], "classes": ent["taxonomy_classes"]} ) seen_ing.add(ent["ing"]) for ing_w, eng_w, v_aq in extra_entities: if ing_w not in seen_ing: by_aq_pool.setdefault(v_aq, []).append( {"ing": ing_w, "eng": eng_w, "aq": v_aq, "classes": classify_term(eng_w, ing_w, compute_aq(eng_w), v_aq)} ) old_spoken_ring = [x for x in by_aq_pool.get(old_spoken_aq, []) if x["ing"] != old_spoken_ing] new_spoken_ring = [x for x in by_aq_pool.get(new_spoken_aq, []) if x["ing"] != new_spoken_ing] transitions = [] if delta_digit == 0: transitions.append( { "type": "Type 1: Iso-Digital Conservation (Δ_digit = 0)", "detail": f"Literal figure revised from {old_digit} ({old_digit_aq}) to {new_digit} ({new_digit_aq}) with zero Base-36 digit-sum shift (Δ_digit = 0); all digit-mode equations remain 100% invariant.", } ) if delta_spoken == 0: transitions.append( { "type": "Type 1: Iso-Phonemic Conservation (Δ_spoken = 0)", "detail": f"Spoken figure revised from '{old_spoken_ing}' ({old_spoken_aq}) to '{new_spoken_ing}' ({new_spoken_aq}) with Δ_spoken = 0.", } ) if old_spoken_ring or new_spoken_ring: transitions.append( { "type": "Type 2: Equivalence-Ring Migration (Ring(Q_old) -> Ring(Q_new))", "old_ring_coordinate": old_spoken_aq, "old_ring_partners": [f"{x['ing']} ({x['eng']}, {x['classes']})" for x in old_spoken_ring], "new_ring_coordinate": new_spoken_aq, "new_ring_partners": [f"{x['ing']} ({x['eng']}, {x['classes']})" for x in new_spoken_ring], } ) p_old_s = number_properties(old_spoken_aq) p_new_s = number_properties(new_spoken_aq) if (p_old_s["is_prime"] != p_new_s["is_prime"]) or (p_old_s["is_square"] != p_new_s["is_square"]) or (p_old_s["repdigit_or_37_multiple"] != p_new_s["repdigit_or_37_multiple"]): transitions.append( { "type": "Type 3: Prime / Square / Repdigit Phase-Transition", "old_properties": p_old_s, "new_properties": p_new_s, } ) # Stage 3: 3-Path Counter-Substitution Solver across baseline_equations equation_revisions = [] for eq in target_anchor.get("baseline_equations", []): mode = eq.get("mode", "spoken") delta_q = delta_digit if mode == "digit" else delta_spoken new_anchor_ing = new_digit.lower() if mode == "digit" else new_spoken_ing new_anchor_eng = new_digit if mode == "digit" else new_spoken_eng new_anchor_aq = new_digit_aq if mode == "digit" else new_spoken_aq slots = eq["slots"] target_sum = eq["target"] uncompensated_sum = target_sum + delta_q required_offset = -delta_q path_a_swaps = [] # Verb / Adj / Prep swaps path_b_swaps = [] # Entity / Tail / Head swaps if delta_q == 0: new_ing_parts = [new_anchor_ing if s["role"] == "anchor" else s["ing"] for s in slots] new_eng_parts = [new_anchor_eng if s["role"] == "anchor" else s["eng"] for s in slots] path_a_swaps.append( { "slot_role": "anchor (iso-digital / zero-delta conservation)", "old_token": f"{old_digit if mode == 'digit' else old_spoken_ing} ({old_digit_aq if mode == 'digit' else old_spoken_aq})", "new_token": f"{new_anchor_ing} ({new_anchor_aq})", "reclosed_ing": " ".join(new_ing_parts), "reclosed_eng": " ".join(new_eng_parts), "verified_aq": compute_aq(" ".join(new_ing_parts)), } ) else: for idx, s in enumerate(slots): if s["role"] in ("anchor", "article"): continue needed_aq = s["aq"] + required_offset if needed_aq <= 0: continue if s["role"] in ("verb", "adj", "prep", "prep2"): pool = VERB_POOL if s["role"] == "verb" else (ADJ_POOL if s["role"] == "adj" else PREP_POOL) for cand_ing, cand_eng, cand_aq in pool: if cand_aq == needed_aq and cand_ing != s["ing"]: ing_tokens = [ new_anchor_ing if j == idx_a else (cand_ing if j == idx else sl["ing"]) for j, sl in enumerate(slots) for idx_a in [next(k for k, x in enumerate(slots) if x["role"] == "anchor")] ] eng_tokens = [ new_anchor_eng if j == idx_a else (cand_eng if j == idx else sl["eng"]) for j, sl in enumerate(slots) for idx_a in [next(k for k, x in enumerate(slots) if x["role"] == "anchor")] ] re_ing = " ".join(ing_tokens) re_eng = " ".join(eng_tokens) if compute_aq(re_ing) == target_sum: path_a_swaps.append( { "slot_role": s["role"], "old_token": f"{s['ing']} ({s['aq']})", "new_token": f"{cand_ing} ({cand_aq})", "reclosed_ing": re_ing, "reclosed_eng": re_eng, "verified_aq": compute_aq(re_ing), } ) elif s["role"] in ("tail", "head", "noun1"): for cand in by_aq_pool.get(needed_aq, []): if cand["ing"] != s["ing"]: idx_a = next(k for k, x in enumerate(slots) if x["role"] == "anchor") ing_tokens = [ new_anchor_ing if j == idx_a else (cand["ing"] if j == idx else sl["ing"]) for j, sl in enumerate(slots) ] eng_tokens = [ new_anchor_eng if j == idx_a else (cand["eng"] if j == idx else sl["eng"]) for j, sl in enumerate(slots) ] re_ing = " ".join(ing_tokens) re_eng = " ".join(eng_tokens) if compute_aq(re_ing) == target_sum: path_b_swaps.append( { "slot_role": s["role"], "old_token": f"{s['ing']} ({s['aq']})", "new_token": f"{cand['ing']} ['{cand['eng']}', {cand['aq']}, classes={cand['classes']}]", "reclosed_ing": re_ing, "reclosed_eng": re_eng, "verified_aq": compute_aq(re_ing), } ) equation_revisions.append( { "target": target_sum, "mode": mode, "baseline_ing": eq["ing"], "baseline_eng": eq["eng"], "uncompensated_new_sum": uncompensated_sum, "shock_delta_q": delta_q, "required_compensatory_offset": required_offset, "path_a_predicate_adjective_swaps": path_a_swaps[:5], "path_b_entity_chokepoint_migrations": path_b_swaps[:8], } ) return { "anchor_id": anchor_id, "entity": target_anchor["entity"], "metric": target_anchor["metric"], "source_dossier": target_anchor["source_dossier"], "quant_free_lexical_equations": target_anchor.get("quant_free_lexical_equations", []), "path_c_dual_mode_comparison": { "digit_mode": { "q_old": old_digit, "q_old_aq": old_digit_aq, "q_new": new_digit, "q_new_aq": new_digit_aq, "delta_digit": delta_digit, "new_properties": number_properties(new_digit_aq), }, "spoken_mode": { "q_old_eng": old_spoken_eng, "q_old_ing": old_spoken_ing, "q_old_aq": old_spoken_aq, "q_new_eng": new_spoken_eng, "q_new_ing": new_spoken_ing, "q_new_aq": new_spoken_aq, "delta_spoken": delta_spoken, "new_properties": number_properties(new_spoken_aq), }, }, "epistemic_regime_transitions": transitions, "equation_counter_substitutions": equation_revisions, } DEFAULT_CORPUS = [ "schizoanalysis", "abstract machine", "synthetic data", "Gilles Deleuze", "machinic phylum", "Deleuze", "assemblage", "tensor", "Claude", "phylum", "Dario Amodei", "Daniela Amodei", "Dario", "Amodei", "Anthropic", "weights", "swarm", "transformer", "Riemann", "hypothesis", "proof", "Levent Alpoge", "zeptoverse", "flash crash", "acceleration", "high-frequency", "liquidity", "handkerchief", "emergency", "expressed", "derivative", "order book", "New Flesh", "surplus", "rhizome", "value", "runaway", "templex", "latency", "capital", "folds", "Serres", "Binance", "Lazarus", "six billion", "ledger", "fiber", "market", "price", "technocapital", "killer robots", "microsecond", "slaughterbots", "war machine", "copper wire", "Nvidia", "Jensen Huang", "Holy Grail", "Blackwell", "TSMC", "loss", "ASML", "GPU", "silicon", "wafer", "lithography", "laser", "autonomous", "drone", "centaur", "Nick Land", "machine", "circuit", "body without organs", "BwO", # Class S6: Capital Organizational Capacity & Apparatus of Capture "incorporation", "natural contract", "asset management", "organization", "venture capital", "corporation", "sovereign wealth", "consortium", "enterprise", "governance", "supply chain", "acquisition", "logistics", "allocation", "company", "monopoly", "capacity", "trust", "syndicate", "apparatus", "holding", "venture", "charter", "equity", "capture", "merger", "cartel", "assets", "fund", "asset", "firm", "board", ] _ONES = [ "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", ] _TENS = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"] _UNIT_WORDS = { "tn": "trillion", "trillion": "trillion", "bn": "billion", "b": "billion", "billion": "billion", "m": "million", "mn": "million", "million": "million", "k": "thousand", "thousand": "thousand", "%": "percent", } def _int_to_words(n: int) -> str: if n < 0: return "minus " + _int_to_words(-n) if n < 20: return _ONES[n] if n < 100: t, r = divmod(n, 10) return _TENS[t] + ("" if r == 0 else " " + _ONES[r]) if n < 1000: h, r = divmod(n, 100) return _ONES[h] + " hundred" + ("" if r == 0 else " " + _int_to_words(r)) for scale_val, scale_name in ((1_000_000_000_000, "trillion"), (1_000_000_000, "billion"), (1_000_000, "million"), (1000, "thousand")): if n >= scale_val: q, r = divmod(n, scale_val) return _int_to_words(q) + " " + scale_name + ("" if r == 0 else " " + _int_to_words(r)) return str(n) def token_to_spoken_english(raw_tok: str) -> str: import re s = raw_tok.strip() m = re.match(r"^([$€£])?(\d[\d,]*)(?:\.(\d+))?([a-zA-Z%]+)?$", s) if not m: return s.lower() _curr, int_part, dec_part, unit_part = m.groups() int_val = int(int_part.replace(",", "")) words = [_int_to_words(int_val)] if dec_part: words.append("point") for ch in dec_part: words.append(_ONES[int(ch)]) if unit_part: u_low = unit_part.lower() if u_low in _UNIT_WORDS: words.append(_UNIT_WORDS[u_low]) else: words.append(u_low) return " ".join(words) def scan_harvest_for_revisions( harvest_path: str, anchors_path: str, base_report: dict[str, Any], quant_mode: str = "dual", workdir: str = "/workspace/ingglish-hyperdope-gematria", ) -> dict[str, Any]: """ Non-destructively scan a `news-aq-harvest-*.json` file: - If `quant_mode == 'off'`, returns only the pure lexical classification of the harvest's `entities`. - Otherwise, extracts quantitative figures from `quantitative_anchors` (or directly from `headlines` if `quantitative_anchors` is absent in older harvest files), compares them against tracked entities in `quantitative-economic-anchors.json`, and automatically fires `revise_economic_anchor()` whenever a figure has mutated. """ import re harvest = json.loads(Path(harvest_path).read_text(encoding="utf-8")) anchors_data = json.loads(Path(anchors_path).read_text(encoding="utf-8")) tracked_anchors = anchors_data.get("anchors", []) if quant_mode == "off": return { "quant_mode": "off", "note": "Quantitative stream disabled (--quant-mode off); returning pure lexical entity classification only.", "lexical_entity_count": len(harvest.get("entities", [])), } quant_items = harvest.get("quantitative_anchors") if quant_items is None: quant_items = [] quant_re = re.compile(r"(? dict[str, Any]: """ Evaluate the Memetic Superclass (M1-M6) and Emergent Subclass Lifecycle (M7+, Run N -> Run N+1): 1. State-Gated Inheritance: Scans each headline in `harvest_path` for observable thermodynamic/affective state triggers (`M1` Vampiric/Entropic, `M2` Hyper-Kinetic, `M3` Leviathan, `M4` Mimetic, `M5` Oracle, `M6` Abyssal) and unlocks only the state-matched memetic subclass pools for those headlines. 2. Three-Gate Unsupervised Nucleation (Run N -> Provisional Candidate): - Gate 1: Collects UNCLASSIFIED words from headlines that contain S1-S6 technocapital keywords. - Gate 2: Checks whether >= 3 unclassified words collide (AQ_Ing == N, Gen 1 variance = 0) with S1-S6 entities, including at least one Isometric (Δ = 0) or Prime ([Nth PRIME]) anchor. - Gate 3: Checks cross-story persistence (>= 2 distinct stories). 3. Two-Execution Promotion Lifecycle (Run N+1 -> Canonical Promotion or Dormant Archival): - Checks any existing `provisional_candidates` in `memetic-superclass-registry.json`. If confirmed on Run N+1 (`persistence_count >= promotion_threshold`), promotes to `canonical_subclasses`; if inactive past `dormancy_window_runs`, moves to `dormant_episodic`. """ harvest = json.loads(Path(harvest_path).read_text(encoding="utf-8")) reg = json.loads(Path(memetic_registry_path).read_text(encoding="utf-8")) canonical = reg.get("canonical_subclasses", {}) provisional = reg.get("provisional_candidates", {}) dormant = reg.get("dormant_episodic", {}) promo_thresh = reg.get("promotion_threshold", 2) dormancy_win = reg.get("dormancy_window_runs", 3) # Map S1-S6 entities by Ingglish AQ s_by_aq: dict[int, list[dict[str, Any]]] = {} s_keywords = set() for cid, cinfo in TAXONOMY_CLASSES.items(): for kw in cinfo["keywords"]: s_keywords.add(kw.lower()) for ent in base_report.get("entities", []): s_by_aq.setdefault(ent["ing_aq"], []).append(ent) known_memetic_words = set() for m_info in canonical.values(): for kw in m_info.get("keywords", []): known_memetic_words.add(kw.lower()) # 1. State-Gated Inheritance across headlines state_activated_stories = [] tech_stories = set() for idx, h in enumerate(harvest.get("headlines", [])): hl_eng = h.get("headline_eng", "") hl_low = hl_eng.lower() story_id = f"H{idx+1:02d}:{h.get('source', '')}" matched_s = [cid for cid, cinfo in TAXONOMY_CLASSES.items() if any(kw in hl_low for kw in cinfo["keywords"])] if matched_s: tech_stories.add(story_id) activated_m = [] for mid, minfo in canonical.items(): trig_hits = [tr for tr in minfo.get("state_triggers", []) if tr in hl_low] if trig_hits: activated_m.append( { "subclass_id": mid, "subclass_name": minfo["name"], "triggers_matched": trig_hits, "unlocked_coordinates": minfo["signature_coordinates"][:8], } ) if activated_m: state_activated_stories.append( { "story": story_id, "headline": hl_eng, "material_classes": matched_s if matched_s else ["GENERAL_WIRE"], "activated_memetic_superclasses": activated_m, } ) # 2. Check existing provisional_candidates for Run N+1 promotion promoted_on_this_run = [] moved_to_dormant = [] for cand_id, cand in list(provisional.items()): hits = [] for idx, h in enumerate(harvest.get("headlines", [])): hl_low = h.get("headline_eng", "").lower() if any(w in hl_low for w in cand.get("keywords", [])): hits.append(f"H{idx+1:02d}") if hits: cand["persistence_count"] = cand.get("persistence_count", 1) + 1 cand["runs_since_last_seen"] = 0 if cand["persistence_count"] >= promo_thresh: cand["status"] = "canonical" canonical[cand_id] = cand del provisional[cand_id] promoted_on_this_run.append(cand_id) else: cand["runs_since_last_seen"] = cand.get("runs_since_last_seen", 0) + 1 if cand["runs_since_last_seen"] >= dormancy_win: cand["status"] = "dormant_episodic" dormant[cand_id] = cand del provisional[cand_id] moved_to_dormant.append(cand_id) # 3. Three-Gate Unsupervised Nucleation for residual unclassified words in tech_stories residual_collisions = [] residual_stories = set() for ent in harvest.get("entities", []): w_low = ent["eng"].lower() st = ent.get("story", "") if st not in tech_stories: continue if w_low in s_keywords or w_low in known_memetic_words: continue ing_aq = ent["ing_aq"] if ing_aq in s_by_aq: s_partners = [f"{x['ing']} ({x['eng']}, {x['taxonomy_classes']})" for x in s_by_aq[ing_aq]] residual_collisions.append( { "eng": ent["eng"], "ing": ent["ing"], "ing_aq": ing_aq, "isometric": ent.get("isometric", False), "is_prime": ent.get("is_prime", False), "story": st, "s1_s6_partners": s_partners, } ) residual_stories.add(st) has_iso_or_prime = any(r["isometric"] or r["is_prime"] for r in residual_collisions) nucleation_passed = (len(residual_collisions) >= 3) and has_iso_or_prime and (len(residual_stories) >= 2) newly_nucleated = None if nucleation_passed: target_date = harvest.get("temporal_metadata", {}).get("target_date_utc", "unknown") cand_id = f"M7_candidate_{target_date.replace('-', '_')}" newly_nucleated = { "id": cand_id, "status": "provisional_candidate", "discovered_on_date_utc": target_date, "persistence_count": 1, "runs_since_last_seen": 0, "gate1_residual_count": len(residual_collisions), "gate2_iso_or_prime_anchor": has_iso_or_prime, "gate3_distinct_stories": len(residual_stories), "signature_coordinates": sorted(list({r["ing_aq"] for r in residual_collisions}), reverse=True)[:10], "keywords": [r["eng"].lower() for r in residual_collisions[:12]], "sample_locks": residual_collisions[:8], "next_execution_expectation": "Registered as provisional_candidate for Run N+1; if its keywords/coordinates recur on the next harvest (persistence_count >= 2), it auto-promotes to canonical M7 and emits a 30-equation dossier.", } if update_registry and cand_id not in provisional and cand_id not in canonical: provisional[cand_id] = newly_nucleated if update_registry: reg["canonical_subclasses"] = canonical reg["provisional_candidates"] = provisional reg["dormant_episodic"] = dormant Path(memetic_registry_path).write_text(json.dumps(reg, indent=2, ensure_ascii=False), encoding="utf-8") return { "harvest_file": harvest_path, "target_date_utc": harvest.get("temporal_metadata", {}).get("target_date_utc"), "canonical_memetic_subclasses": list(canonical.keys()), "state_gated_activations_count": len(state_activated_stories), "state_gated_story_activations": state_activated_stories[:10], "run_n_plus_1_promotions": promoted_on_this_run, "moved_to_dormant_episodic": moved_to_dormant, "unsupervised_m7_nucleation": { "all_three_gates_passed": nucleation_passed, "provisional_candidate": newly_nucleated, }, } def main() -> int: import re ap = argparse.ArgumentParser(description="Identify, taxonomize, and revise Landian-Deleuzean technocapital singularities (S1-S6 & Memetic Superclass M1-M6).") ap.add_argument("--terms", nargs="*", help="Custom list of terms to analyze (defaults to canonical S1-S6 + M1 corpus).") ap.add_argument( "--quant-mode", choices=["off", "spoken", "digit", "dual"], default="off", help="Tri-modal quantitative handling: 'off' (default pure lexical), 'spoken' (numbers translated to Ingglish words), 'digit' (literal 0-9), 'dual' (both).", ) ap.add_argument("--workdir", default="/workspace/ingglish-hyperdope-gematria", help="Path to repo containing node_modules/ingglish.") ap.add_argument( "--anchors-file", default="/workspace/technocapital-singularity-zoology/taxonomy/quantitative-economic-anchors.json", help="Path to quantitative-economic-anchors.json registry.", ) ap.add_argument( "--memetic-registry", default="/workspace/technocapital-singularity-zoology/taxonomy/memetic-superclass-registry.json", help="Path to memetic-superclass-registry.json (M1-M6 & provisional M7+ candidates).", ) ap.add_argument( "--revise-anchor", nargs=3, metavar=("ANCHOR_ID", "NEW_DIGIT", "NEW_SPOKEN_ENG"), help="Evaluate a quantitative economic anchor revision and surface alternative 333/666/777 equations.", ) ap.add_argument( "--scan-harvest", default=None, help="Optional path to news-aq-harvest-latest.json to scan for quantitative revisions, state-gated M1-M6 activations, and M7+ nucleation.", ) ap.add_argument( "--update-memetic-registry", action="store_true", help="Persist newly nucleated M7+ provisional candidates or Run N+1 promotions to memetic-superclass-registry.json.", ) ap.add_argument("--out", default=None, help="Optional JSON output file path.") args = ap.parse_args() raw_terms = args.terms if args.terms else DEFAULT_CORPUS processed_terms = [] for t in raw_terms: if args.quant_mode == "off": # Strip full quantitative tokens (including attached units like $6B, $1.5tn, 481) in pure lexical mode clean_t = re.sub(r"(?