880 lines
44 KiB
Python
Executable File
880 lines
44 KiB
Python
Executable File
#!/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"(?<![a-zA-Z0-9])([$€£]?\d[\d,]*(?:\.\d+)?(?:tn|bn|mn|b|m|k|%)?)\b", re.I)
|
||
for idx, h in enumerate(harvest.get("headlines", [])):
|
||
hl = h.get("headline_eng", "")
|
||
for qm in quant_re.finditer(hl):
|
||
q_tok = qm.group(1)
|
||
if q_tok in {"2025", "2026", "2027"}:
|
||
continue
|
||
sp_eng = token_to_spoken_english(q_tok)
|
||
quant_items.append(
|
||
{
|
||
"story": f"H{idx+1:02d}:{h.get('source', '')}",
|
||
"entity_context": hl[:40],
|
||
"q_digit": q_tok,
|
||
"q_spoken_eng": sp_eng,
|
||
"headline": hl,
|
||
}
|
||
)
|
||
|
||
unchanged_matches = []
|
||
detected_revisions = []
|
||
new_candidate_anchors = []
|
||
|
||
for qi in quant_items:
|
||
hl_low = qi.get("headline", "").lower()
|
||
q_dig = qi["q_digit"]
|
||
q_sp_eng = qi["q_spoken_eng"]
|
||
matched_tracked = None
|
||
for ta in tracked_anchors:
|
||
kws = ta.get("entity_match_keywords", [ta["entity"].lower()])
|
||
if any(kw in hl_low for kw in kws):
|
||
matched_tracked = ta
|
||
break
|
||
|
||
if matched_tracked:
|
||
if q_dig.lower() == matched_tracked["q_digit"].lower():
|
||
unchanged_matches.append(
|
||
{
|
||
"anchor_id": matched_tracked["anchor_id"],
|
||
"entity": matched_tracked["entity"],
|
||
"q_digit": q_dig,
|
||
"status": "unchanged",
|
||
"headline": qi.get("headline"),
|
||
}
|
||
)
|
||
else:
|
||
rev = revise_economic_anchor(
|
||
anchor_id=matched_tracked["anchor_id"],
|
||
new_digit=q_dig,
|
||
new_spoken_eng=q_sp_eng,
|
||
anchors_path=anchors_path,
|
||
base_report=base_report,
|
||
workdir=workdir,
|
||
)
|
||
rev["trigger_headline"] = qi.get("headline")
|
||
detected_revisions.append(rev)
|
||
else:
|
||
# Check if headline touches any S1-S6 technocapital keyword
|
||
matched_classes = []
|
||
for cid, cinfo in TAXONOMY_CLASSES.items():
|
||
if any(kw in hl_low for kw in cinfo["keywords"]):
|
||
matched_classes.append(cid)
|
||
if matched_classes:
|
||
new_candidate_anchors.append(
|
||
{
|
||
"story": qi.get("story"),
|
||
"q_digit": q_dig,
|
||
"q_digit_aq": compute_aq(q_dig),
|
||
"q_spoken_eng": q_sp_eng,
|
||
"taxonomy_classes": matched_classes,
|
||
"headline": qi.get("headline"),
|
||
}
|
||
)
|
||
|
||
return {
|
||
"quant_mode": quant_mode,
|
||
"harvest_file": harvest_path,
|
||
"target_date_utc": harvest.get("temporal_metadata", {}).get("target_date_utc"),
|
||
"counts": {
|
||
"quantitative_tokens_scanned": len(quant_items),
|
||
"tracked_anchors_unchanged": len(unchanged_matches),
|
||
"tracked_anchors_revised": len(detected_revisions),
|
||
"new_technocapital_quant_candidates": len(new_candidate_anchors),
|
||
},
|
||
"unchanged_tracked_anchors": unchanged_matches,
|
||
"detected_revisions": detected_revisions,
|
||
"new_technocapital_quant_candidates": new_candidate_anchors[:15],
|
||
}
|
||
|
||
|
||
def main() -> int:
|
||
import re
|
||
ap = argparse.ArgumentParser(description="Identify, taxonomize, and revise Landian-Deleuzean technocapital singularities (S1-S6).")
|
||
ap.add_argument("--terms", nargs="*", help="Custom list of terms to analyze (defaults to canonical S1-S6 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(
|
||
"--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 and new S1-S6 anchors.",
|
||
)
|
||
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"(?<![a-zA-Z0-9])[$€£]?\d[\d,]*(?:\.\d+)?(?:tn|bn|mn|b|m|k|%)?\b", "", t, flags=re.I)
|
||
clean_t = re.sub(r"\s+", " ", clean_t).strip()
|
||
if clean_t:
|
||
processed_terms.append(clean_t)
|
||
elif args.quant_mode == "spoken":
|
||
# Convert any numeric tokens to spoken English words before Ingglish translation
|
||
converted = re.sub(
|
||
r"(?<![a-zA-Z0-9])([$€£]?\d[\d,]*(?:\.\d+)?(?:tn|bn|mn|b|m|k|%)?)\b",
|
||
lambda m: token_to_spoken_english(m.group(1)),
|
||
t,
|
||
flags=re.I,
|
||
)
|
||
processed_terms.append(converted)
|
||
else:
|
||
processed_terms.append(t)
|
||
|
||
report = analyze_terms(processed_terms, workdir=args.workdir)
|
||
report["quant_mode"] = args.quant_mode
|
||
|
||
if args.revise_anchor:
|
||
anchor_id, new_digit, new_spoken_eng = args.revise_anchor
|
||
rev_report = revise_economic_anchor(
|
||
anchor_id=anchor_id,
|
||
new_digit=new_digit,
|
||
new_spoken_eng=new_spoken_eng,
|
||
anchors_path=args.anchors_file,
|
||
base_report=report,
|
||
workdir=args.workdir,
|
||
)
|
||
out_str = json.dumps(rev_report, indent=2, ensure_ascii=False)
|
||
elif args.scan_harvest:
|
||
eff_mode = "dual" if args.quant_mode == "off" else args.quant_mode
|
||
scan_res = scan_harvest_for_revisions(
|
||
harvest_path=args.scan_harvest,
|
||
anchors_path=args.anchors_file,
|
||
base_report=report,
|
||
quant_mode=eff_mode,
|
||
workdir=args.workdir,
|
||
)
|
||
out_str = json.dumps(scan_res, indent=2, ensure_ascii=False)
|
||
else:
|
||
out_str = json.dumps(report, indent=2, ensure_ascii=False)
|
||
|
||
if args.out:
|
||
Path(args.out).parent.mkdir(parents=True, exist_ok=True)
|
||
Path(args.out).write_text(out_str, encoding="utf-8")
|
||
print(out_str)
|
||
return 0
|
||
|
||
|
||
if __name__ == "__main__":
|
||
raise SystemExit(main())
|