263 lines
11 KiB
Python
Executable File
263 lines
11 KiB
Python
Executable File
#!/usr/bin/env python3
|
||
"""
|
||
classify_technocapital_singularity.py
|
||
Deterministic CLI tool for `technocapital-singularity-zoology`.
|
||
|
||
Responsibilities:
|
||
1. Batch-translates candidate theoretical, 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`)
|
||
4. Classifies entities and locks into the 5-Class Landian-Deleuzean Technocapital Singularity
|
||
Taxonomy (`S1` through `S5`).
|
||
"""
|
||
|
||
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",
|
||
],
|
||
},
|
||
}
|
||
|
||
|
||
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
|
||
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)
|
||
g1_singularities[str(aq_val)] = {
|
||
"ing_aq": aq_val,
|
||
"prime_rank": PRIME_RANKS.get(aq_val),
|
||
"gen0_variance": var_e,
|
||
"gen1_variance": 0.0,
|
||
"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.0.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),
|
||
"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,
|
||
}
|
||
|
||
|
||
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",
|
||
]
|
||
|
||
|
||
def main() -> int:
|
||
ap = argparse.ArgumentParser(description="Identify and taxonomize Landian-Deleuzean technocapital singularities.")
|
||
ap.add_argument("--terms", nargs="*", help="Custom list of terms to analyze (defaults to canonical S1-S5 corpus).")
|
||
ap.add_argument("--workdir", default="/workspace/ingglish-hyperdope-gematria", help="Path to repo containing node_modules/ingglish.")
|
||
ap.add_argument("--out", default=None, help="Optional JSON output file path.")
|
||
args = ap.parse_args()
|
||
|
||
terms = args.terms if args.terms else DEFAULT_CORPUS
|
||
report = analyze_terms(terms, workdir=args.workdir)
|
||
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())
|