| |
| """ |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
| โ USLaP โ Universal Scientific Laws and Principles v2.0 โ |
| โ ุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู โ |
| โ โ |
| โ SINGLE MASTER CONTROL: USLAP_LATTICE.xlsx โ |
| โ Edit the XLSX โ this file reads it automatically. โ |
| โ One file to edit. One file to run. โ |
| โ โ |
| โ ุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ โ Response Algorithm โ |
| โ Step 0: Terminology Scan (ููุญูุต ุงูู
ูุตูุทูููุญูุงุช) โ |
| โ Step 1: Ibn Sฤซnฤ FIRST (ุงุจู ุณููุง ุฃูููุงู) โ |
| โ Step 2: Al-Khwฤrizmฤซ Method (ุงูุฎููุงุฑูุฒู
ููููุฉ) โ |
| โ Step 3: Tools & Applications (ุฃูุฏูููุงุช) โ |
| โ Step 4: Output (ุงูู
ูุฎูุฑูุฌูุงุช) โ |
| โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ |
| |
| Usage: |
| python3 uslap.py # Interactive menu |
| python3 uslap.py --scan "text" # Quick scan |
| python3 uslap.py --process "query" # Run Response Algorithm |
| python3 uslap.py --export-json # Export all data as JSON |
| python3 uslap.py --info # Show master control status |
| |
| Requires: pip install openpyxl |
| Master control: Place USLAP_LATTICE.xlsx in same directory as this file. |
| """ |
|
|
| import json, re, sys, os |
| from pathlib import Path |
|
|
| |
| |
| |
|
|
| MASTER_FILE = "USLAP_LATTICE.xlsx" |
|
|
| def find_master(): |
| """Find USLAP_LATTICE.xlsx โ same dir as script, or current dir.""" |
| script_dir = Path(__file__).parent |
| candidates = [ |
| script_dir / MASTER_FILE, |
| Path.cwd() / MASTER_FILE, |
| Path.home() / MASTER_FILE, |
| ] |
| for p in candidates: |
| if p.exists(): |
| return p |
| return None |
|
|
| def load_master(path): |
| """Load all data from USLAP_LATTICE.xlsx master control.""" |
| try: |
| import openpyxl |
| except ImportError: |
| print("ERROR: openpyxl required. Run: pip install openpyxl") |
| sys.exit(1) |
|
|
| wb = openpyxl.load_workbook(path, data_only=True) |
| data = { |
| "path": str(path), |
| "modified": os.path.getmtime(path), |
| "terms": [], |
| "rejected": [], |
| "sciences": [], |
| "evidence": [], |
| "applications": [], |
| "meta": [], |
| "two_systems": [], |
| "deep_dive": [], |
| "iqra_moments": [], |
| } |
|
|
| |
| if "All Terms" in wb.sheetnames: |
| ws = wb["All Terms"] |
| for r in range(2, ws.max_row + 1): |
| term = ws.cell(r, 1).value |
| if not term: |
| continue |
| data["terms"].append({ |
| "term": str(term).strip(), |
| "status": str(ws.cell(r, 2).value or "").strip(), |
| "domain_q": str(ws.cell(r, 3).value or "").strip(), |
| "domain_t": str(ws.cell(r, 4).value or "").strip(), |
| "replacement": str(ws.cell(r, 5).value or "").strip(), |
| "root": str(ws.cell(r, 6).value or "").strip(), |
| "ref": str(ws.cell(r, 7).value or "").strip(), |
| "contamination": str(ws.cell(r, 8).value or "").strip(), |
| }) |
|
|
| |
| if "Rejected" in wb.sheetnames: |
| ws = wb["Rejected"] |
| for r in range(2, ws.max_row + 1): |
| term = ws.cell(r, 1).value |
| if not term: |
| continue |
| data["rejected"].append({ |
| "term": str(term).strip(), |
| "etymology": str(ws.cell(r, 2).value or "").strip(), |
| "domain": str(ws.cell(r, 3).value or "").strip(), |
| "replacement": str(ws.cell(r, 4).value or "").strip(), |
| "root": str(ws.cell(r, 5).value or "").strip(), |
| "ref": str(ws.cell(r, 6).value or "").strip(), |
| }) |
|
|
| |
| if "111 Sciences" in wb.sheetnames: |
| ws = wb["111 Sciences"] |
| for r in range(2, ws.max_row + 1): |
| sid = ws.cell(r, 1).value |
| if not sid: |
| continue |
| data["sciences"].append({ |
| "id": int(sid) if str(sid).isdigit() else 0, |
| "root": str(ws.cell(r, 2).value or "").strip(), |
| "meaning": str(ws.cell(r, 3).value or "").strip(), |
| "verse": str(ws.cell(r, 4).value or "").strip(), |
| "name_ar": str(ws.cell(r, 5).value or "").strip(), |
| "name_t": str(ws.cell(r, 6).value or "").strip(), |
| }) |
|
|
| |
| if "Evidence" in wb.sheetnames: |
| ws = wb["Evidence"] |
| for r in range(3, ws.max_row + 1): |
| ev = ws.cell(r, 1).value |
| if not ev: |
| continue |
| data["evidence"].append({ |
| "evidence": str(ev).strip(), |
| "type": str(ws.cell(r, 2).value or "").strip(), |
| "domain": str(ws.cell(r, 3).value or "").strip(), |
| }) |
|
|
| |
| if "Applications" in wb.sheetnames: |
| ws = wb["Applications"] |
| for r in range(2, ws.max_row + 1): |
| app = ws.cell(r, 1).value |
| if not app: |
| continue |
| data["applications"].append({ |
| "application": str(app).strip(), |
| "domain": str(ws.cell(r, 2).value or "").strip(), |
| }) |
|
|
| |
| if "Meta FAQ" in wb.sheetnames: |
| ws = wb["Meta FAQ"] |
| for r in range(2, ws.max_row + 1): |
| q = ws.cell(r, 1).value |
| if not q: |
| continue |
| data["meta"].append({ |
| "question": str(q).strip(), |
| "domain": str(ws.cell(r, 2).value or "").strip(), |
| }) |
|
|
| |
| if "Two Systems" in wb.sheetnames: |
| ws = wb["Two Systems"] |
| for r in range(3, ws.max_row + 1): |
| dim = ws.cell(r, 1).value |
| if not dim: |
| continue |
| data["two_systems"].append({ |
| "dimension": str(dim).strip(), |
| "moloch": str(ws.cell(r, 2).value or "").strip(), |
| "quran": str(ws.cell(r, 3).value or "").strip(), |
| }) |
|
|
| |
| if "Deep Dive" in wb.sheetnames: |
| ws = wb["Deep Dive"] |
| for r in range(3, ws.max_row + 1): |
| chain = ws.cell(r, 1).value |
| if not chain: |
| continue |
| data["deep_dive"].append({ |
| "chain": str(chain).strip(), |
| "crime": str(ws.cell(r, 2).value or "").strip(), |
| "evidence": str(ws.cell(r, 3).value or "").strip(), |
| "pre_trace": str(ws.cell(r, 4).value or "").strip(), |
| "sources": str(ws.cell(r, 5).value or "").strip(), |
| "quran_warning": str(ws.cell(r, 6).value or "").strip(), |
| }) |
|
|
| |
| if "IQRA Moments" in wb.sheetnames: |
| ws = wb["IQRA Moments"] |
| for r in range(3, ws.max_row + 1): |
| num = ws.cell(r, 1).value |
| if not num: |
| continue |
| data["iqra_moments"].append({ |
| "number": int(num) if str(num).isdigit() else 0, |
| "target_lie": str(ws.cell(r, 2).value or "").strip(), |
| "kill_shot": str(ws.cell(r, 3).value or "").strip(), |
| "time": str(ws.cell(r, 4).value or "").strip(), |
| }) |
|
|
| wb.close() |
| return data |
|
|
|
|
| |
| |
| |
|
|
| FOUR_SOURCES = [ |
| {"n": 1, "ar": "ุงูููุฑูุขู", "t": "al-Qur'ฤn", "role": "Root + Meaning. Is it Qur'anic Arabic? FAIL โ Deep Trace โ Confession."}, |
| {"n": 2, "ar": "ุงูุญูุฏููุซ", "t": "al-แธคadฤซth", "role": "Prophetic confirmation. Sunnah confirms, explains, applies."}, |
| {"n": 3, "ar": "ุงูุนูููู
ุงููุณุทุงููู", "t": "al-สฟIlm al-Waแนฃแนญฤnฤซ", "role": "Ibn Sฤซnฤ FIRST (framework), then al-Khwฤrizmฤซ (method). ุฃูู
ููุฉู ููุณูุทูุง scholars."}, |
| {"n": 4, "ar": "ุนูููู
ูุงุก ุฅูุถูุงููููููู", "t": "สฟUlamฤสพ Iแธฤfiyyลซn", "role": "Additional scholars. Subject to ุจูุณูู
ู ุงูููููู + Qur'anic terminology verification."}, |
| ] |
|
|
| CONTAM_HIERARCHY = [ |
| {"level": 1, "name": "PRE-civilizational", "desc": "Parasite 'elite' vocabulary BEFORE host civilization. 100% criminal."}, |
| {"level": 2, "name": "Persian", "desc": "Most dangerous active contaminator. Corrupts Arabic + Turkic."}, |
| {"level": 3, "name": "Jahilian / corrupted Arabic", "desc": "Arabic-script wrapping Greek/PRE- contamination."}, |
| {"level": 4, "name": "Greek / Latin", "desc": "Surface HOST wrappers carrying PRE- vocabulary."}, |
| ] |
|
|
| RESPONSE_ALGORITHM = [ |
| {"step": 0, "ar": "ููุญูุต ุงูู
ูุตูุทูููุญูุงุช", "en": "Terminology Scan", "mandatory": True, |
| "action": "Scan ALL terms through Source 1. Replace contamination before proceeding.", |
| "anti": "NEVER skip. NEVER use contaminated terms even casually."}, |
| {"step": 1, "ar": "ุงุจู ุณููุง ุฃูููุงู", "en": "Ibn Sฤซnฤ FIRST", "mandatory": True, |
| "action": "Apply ุงููุงููู ูู ุงูุทุจ framework BEFORE any practical advice.", |
| "subs": ["SYSTEM: What is the ููููุณ (bow/system)?", "WARP: Longitudinal chain?", |
| "WEFT: Lateral connections?", "BIAS: Where does pressure create change?", |
| "ุตูููุงุฉ DIAGNOSTIC: Do prayer positions test this?"], |
| "anti": "NEVER jump to tools before this. #1 contamination trap."}, |
| {"step": 2, "ar": "ุงูุฎููุงุฑูุฒูู
ููููุฉ", "en": "Al-Khwฤrizmฤซ Method", "mandatory": True, |
| "action": "Define structured method: MEASURE โ SEQUENCE โ DECISION โ VERIFY.", |
| "anti": "NEVER give unstructured advice."}, |
| {"step": 3, "ar": "ุฃูุฏูููุงุช", "en": "Tools & Applications", "mandatory": False, |
| "action": "Practical interventions. Source 4. ONLY after Steps 0-2.", |
| "anti": "Tools SERVE the framework."}, |
| {"step": 4, "ar": "ุงูู
ูุฎูุฑูุฌูุงุช", "en": "Output", "mandatory": True, |
| "action": "Deliver what user asked for. ALL USLaP-compliant.", |
| "anti": "NEVER deliver with contaminated terminology."}, |
| ] |
|
|
| |
| |
| |
|
|
| class ContaminationScanner: |
| """Scans text using the master control term database.""" |
|
|
| def __init__(self, master_data): |
| self.terms = master_data["terms"] |
| self.rejected = master_data["rejected"] |
| self._build_index() |
|
|
| |
| |
| SCAN_TERMS = { |
| "medical": {"repl": "ุงูุทููุจู / al-แนฌibb (Return to Purity)", "ct": "Greek/Latin", "pre": "PRE-Latin *med- โ Medea (child-killer)"}, |
| "medicine": {"repl": "ุงูุทููุจู / al-แนฌibb", "ct": "Greek/Latin", "pre": "PRE-Latin *med- โ Medea โ Medici"}, |
| "surgery": {"repl": "ุงูุฌูุฑูุงุญูุฉ / al-Jirฤแธฅah (root ุฌ ุฑ ุญ, Q5:4)", "ct": "Greek/Latin", "pre": "Greek ฯฮตฮนฯฮฟฯ
ฯฮณฮฏฮฑ โ PRE-Greek"}, |
| "surgical": {"repl": "ุฌูุฑูุงุญููู / Jirฤแธฅฤซ", "ct": "Greek/Latin", "pre": "Greek ฯฮตฮนฯฮฟฯ
ฯฮณฮฏฮฑ"}, |
| "pharmaceutical": {"repl": "ุงูุตููููุฏูููุฉ / al-แนขaydalah", "ct": "Greek/Latin", "pre": "ฯฮฑฯฮผฮฑฮบฮตฮฏฮฑ โ PRE-Greek *pharmak- = POISON RITUAL"}, |
| "pharmacy": {"repl": "ุงูุตููููุฏููููููุฉ", "ct": "Greek/Latin", "pre": "ฯฮฑฯฮผฮฑฮบฮตฮฏฮฑ โ poison ritual"}, |
| "robot": {"repl": "ู
ูุตููููุน / Maแนฃnลซสฟ (Q20:39 ุตูููุนู ุงูููููู)", "ct": "European", "pre": "Czech robota = SLAVERY"}, |
| "anatomy": {"repl": "ุนูููู
ุงูุจูููููุฉ / สฟIlm al-Binyah", "ct": "Greek/Latin", "pre": "แผฮฝฮฑฯฮฟฮผฮฎ โ cutting corpses"}, |
| "biology": {"repl": "ุนูููู
ุงูุญูููุงุฉ / สฟIlm al-แธคayฤh", "ct": "Greek/Latin", "pre": "Greek ฮฒฮฏฮฟฯ+ฮปฯฮณฮฟฯ"}, |
| "physics": {"repl": "ุนูููู
ุงูุทููุจููุนูุฉ / สฟIlm al-แนฌabฤซสฟah", "ct": "Greek/Latin", "pre": "Greek ฯฯฯฮนฯ"}, |
| "chemistry": {"repl": "ุนูููู
ุงูุชููุญููููู / สฟIlm al-Taแธฅwฤซl", "ct": "Greek/Latin", "pre": "ฯฮทฮผฮตฮฏฮฑ โ dark transmutation"}, |
| "geometry": {"repl": "ุนูููู
ุงูู
ูุณูุงุญูุฉ", "ct": "Greek/Latin", "pre": "ฮณฮตฯฮผฮตฯฯฮฏฮฑ โ land seizure"}, |
| "therapy": {"repl": "ุนูููุงุฌ / สฟIlฤj", "ct": "Greek/Latin", "pre": "ฮธฮตฯฮฑฯฮตฮฏฮฑ โ ritual servitude"}, |
| "diagnosis": {"repl": "ุชููููููู
/ Taqyฤซm", "ct": "Greek/Latin", "pre": "Greek ฮดฮนฮฌฮณฮฝฯฯฮนฯ"}, |
| "symptom": {"repl": "ุฅูุดูุงุฑูุฉ / Ishฤrah (signal)", "ct": "Greek/Latin", "pre": "Greek ฯฯฮผฯฯฯฮผฮฑ"}, |
| "patient": {"repl": "ุดูุฎูุต / Shakhs (person)", "ct": "Greek/Latin", "pre": "Latin patiens = one who SUFFERS"}, |
| "doctor": {"repl": "ู
ูุฑูุดูุฏ / Murshid (guide)", "ct": "Greek/Latin", "pre": "Latin docฤre"}, |
| "hospital": {"repl": "ู
ูุฑูููุฒ ุงูุงูุณูุชูุนูุงุฏูุฉ", "ct": "Greek/Latin", "pre": "Latin hospitale โ hospes = HOST"}, |
| "sensor": {"repl": "ุญูุงุณููุฉ / แธคฤssah", "ct": "Greek/Latin", "pre": "Latin sentire"}, |
| "actuator": {"repl": "ู
ูุญูุฑููู / Muแธฅarrik", "ct": "Greek/Latin", "pre": "Latin actuare"}, |
| "haptic": {"repl": "ููู
ูุณููู / Lamsฤซ", "ct": "Greek/Latin", "pre": "Greek แผฯฯฮนฮบฯฯ โ sensory ritual"}, |
| "servo": {"repl": "ู
ูุญูุฑููู / Muแธฅarrik", "ct": "Greek/Latin", "pre": "Latin servus = SLAVE"}, |
| "cortisone": {"repl": "ููุฑูู
ููู ุตูููุงุนููู", "ct": "Greek/Latin", "pre": "Weakens tissue โ ฯฮฑฯฮผฮฑฮบฮตฮฏฮฑ product"}, |
| "skeleton": {"repl": "ููููููู / Haykal (Q2:247)", "ct": "Greek/Latin", "pre": "ฯฮบฮตฮปฮตฯฯฯ = dried corpse"}, |
| "medieval": {"repl": "ุงูุนุตุฑ ุงููุณุทุงููู", "ct": "Greek/Latin", "pre": "PRE-Latin *med- = Medea's era"}, |
| "science": {"repl": "ุนูููู
/ สฟIlm (Q17:36)", "ct": "Greek/Latin", "pre": "Latin scindere = to CUT"}, |
| "technology": {"repl": "ุชูููุงููุฉ / Tiqฤnah", "ct": "Greek/Latin", "pre": "Greek ฯฮญฯฮฝฮท โ craft-ritual"}, |
| "psychology": {"repl": "ุนูููู
ุงููููููุณ / สฟIlm al-Nafs", "ct": "Greek/Latin", "pre": "ฯฯ
ฯฮฎ โ soul-ritual"}, |
| "neurology": {"repl": "ุนูููู
ุงูุฃูุนูุตูุงุจ", "ct": "Greek/Latin", "pre": "Greek ฮฝฮตแฟฆฯฮฟฮฝ"}, |
| "pathology": {"repl": "ุนูููู
ุงูุนูููู", "ct": "Greek/Latin", "pre": "Greek ฯฮฌฮธฮฟฯ = suffering"}, |
| "philosophy": {"repl": "ุนูููู
ุงูุญูููู
ูุฉ (Q2:269)", "ct": "Greek/Latin", "pre": "ฯฮนฮปฮฟฯฮฟฯฮฏฮฑ"}, |
| "algorithm": {"repl": "CLEAN โ ุฎููุงุฑูุฒู
ููููุฉ (al-Khwฤrizmฤซ)", "ct": "CLEAN", "pre": ""}, |
| "algebra": {"repl": "CLEAN โ ุงูุฌูุจูุฑ (ุงูุฌูุจููุงุฑ Name of Allah)", "ct": "CLEAN", "pre": ""}, |
| } |
|
|
| def _build_index(self): |
| """Build lookup index: XLSX data + hardcoded single-word terms.""" |
| self.index = {} |
|
|
| |
| for word, info in self.SCAN_TERMS.items(): |
| self.index[word] = { |
| "term": word, |
| "status": "CLEAN" if info["ct"] == "CLEAN" else "REJECT", |
| "domain_q": "", "domain_t": "", |
| "replacement": info["repl"], |
| "root": "", "ref": "", |
| "contamination": info["ct"], |
| "_pre": info["pre"], |
| } |
|
|
| |
| for t in self.terms: |
| if t["status"] == "REJECT": |
| key = t["term"].lower().strip() |
| self.index[key] = t |
| |
| for word in key.split(): |
| if len(word) > 3 and word not in self.SCAN_TERMS: |
| if word not in self.index: |
| self.index[word] = t |
|
|
| |
| self.rej_index = {} |
| for r in self.rejected: |
| self.rej_index[r["term"].lower().strip()] = r |
|
|
| def scan(self, text): |
| """Scan text and return all contamination found.""" |
| results = [] |
| text_lower = text.lower() |
| seen = set() |
|
|
| |
| for key, entry in self.index.items(): |
| if key in text_lower and key not in seen: |
| seen.add(key) |
| rej_detail = self.rej_index.get(key, {}) |
| results.append({ |
| "term": entry["term"], |
| "status": entry["status"], |
| "domain": entry["domain_q"], |
| "replacement": entry["replacement"], |
| "root": entry["root"], |
| "ref": entry["ref"], |
| "contamination": entry["contamination"], |
| "etymology": rej_detail.get("etymology", entry["contamination"]), |
| }) |
|
|
| return results |
|
|
| def clean(self, text): |
| """Replace contaminated terms with USLaP replacements.""" |
| cleaned = text |
| for key, entry in sorted(self.index.items(), key=lambda x: -len(x[0])): |
| if entry["replacement"]: |
| pattern = re.compile(re.escape(key), re.IGNORECASE) |
| |
| repl = entry["replacement"].split("(")[0].strip() if "(" in entry["replacement"] else entry["replacement"] |
| cleaned = pattern.sub(repl, cleaned) |
| return cleaned |
|
|
| def drill_down(self, term, level=1): |
| """Three-level drill-down.""" |
| entry = self.index.get(term.lower().strip()) |
| if not entry: |
| |
| for key, val in self.index.items(): |
| if term.lower() in key: |
| entry = val |
| break |
| if not entry: |
| return f'"{term}" not in contamination database.' |
| if entry["status"] != "REJECT": |
| return f'โ
"{term}" is CLEAN.' |
|
|
| rej = self.rej_index.get(entry["term"].lower().strip(), {}) |
| out = [] |
| out.append(f'\nโ "{entry["term"]}" โ REJECTED at Source 1 (ุงูููุฑูุขู)') |
| out.append(f' Domain: {entry["domain"]}') |
| out.append(f' Contamination type: {entry["contamination"]}') |
|
|
| if level >= 1: |
| out.append(f'\n LEVEL 1 โ SURFACE:') |
| out.append(f' "{entry["term"]}" is not Qur\'anic Arabic.') |
| out.append(f' Etymology: {rej.get("etymology", entry["contamination"])}') |
| out.append(f' โ
Replacement: {entry["replacement"]}') |
| if entry["root"]: |
| out.append(f' Root: {entry["root"]}') |
| if entry["ref"]: |
| out.append(f' Qur\'an: {entry["ref"]}') |
|
|
| if level >= 2: |
| out.append(f'\n LEVEL 2 โ PRE-CIVILIZATIONAL TRACE:') |
| out.append(f' The "{entry["contamination"]}" label is a HOST wrapper.') |
| out.append(f' The actual vocabulary predates the host civilization.') |
| out.append(f' = CONFESSION โ the word confesses its own crime.') |
|
|
| if level >= 3: |
| out.append(f'\n LEVEL 3 โ CRIMINAL NETWORK:') |
| out.append(f' Connects to multi-era global criminal network.') |
| out.append(f' 100%: sacrifice / trafficking / weapons / ritual.') |
| out.append(f' Qur\'anic warning: Q2:204-206 โ ูููููููู ุงููุญูุฑูุซู ููุงููููุณููู') |
|
|
| out.append(f'\n โฉ CLEAN PATH: {entry["replacement"]}') |
| return '\n'.join(out) |
|
|
|
|
| |
| |
| |
|
|
| class ResponseAlgorithmEngine: |
| """ุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ โ processes any query through Steps 0-4.""" |
|
|
| def __init__(self, master_data): |
| self.scanner = ContaminationScanner(master_data) |
| self.data = master_data |
|
|
| def process(self, user_input, verbose=True): |
| """Run full Response Algorithm.""" |
| out = [] |
| out.append("=" * 60) |
| out.append("ุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ โ Response Algorithm") |
| out.append("ุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู") |
| out.append("=" * 60) |
|
|
| |
| out.append(f'\n{"โ" * 40}') |
| out.append(f'STEP 0: ููุญูุต ุงูู
ูุตูุทูููุญูุงุช (Terminology Scan)') |
| out.append(f'{"โ" * 40}') |
| results = self.scanner.scan(user_input) |
| if results: |
| for r in results: |
| out.append(f' โ "{r["term"]}"') |
| out.append(f' โ {r["replacement"]}') |
| out.append(f' Type: {r["contamination"]}') |
| out.append(f'\n Cleaned: {self.scanner.clean(user_input)}') |
| else: |
| out.append(f' โ
No contamination detected. All terms clean.') |
|
|
| |
| out.append(f'\n{"โ" * 40}') |
| out.append(f'STEP 1: ุงุจู ุณููุง ุฃูููุงู (Ibn Sฤซnฤ FIRST)') |
| out.append(f'{"โ" * 40}') |
| out.append(f' Source 3: ุงููุงููู ูู ุงูุทุจ โ Framework BEFORE tools') |
| out.append(f' โโโ ููููุณ: What is the system/framework?') |
| out.append(f' โโโ WARP: What longitudinal chain?') |
| out.append(f' โโโ WEFT: What lateral connections?') |
| out.append(f' โโโ BIAS: Where does pressure create change?') |
| out.append(f' โโโ ุตูููุงุฉ: Do prayer positions test this?') |
| out.append(f' โ Complete this BEFORE any tools/advice.') |
|
|
| |
| out.append(f'\n{"โ" * 40}') |
| out.append(f'STEP 2: ุงูุฎููุงุฑูุฒูู
ููููุฉ (Al-Khwฤrizmฤซ Method)') |
| out.append(f'{"โ" * 40}') |
| out.append(f' โโโ MEASURE (ุญูุงุณููุงุช): What to observe?') |
| out.append(f' โโโ SEQUENCE (ุชูุฑูุชููุจ): What order?') |
| out.append(f' โโโ DECISION (ุญูููู
): What determines next step?') |
| out.append(f' โโโ VERIFY (ุชูุญููููู): How to confirm?') |
|
|
| |
| out.append(f'\n{"โ" * 40}') |
| out.append(f'STEP 3: ุฃูุฏูููุงุช (Tools โ ONLY after Steps 0-2)') |
| out.append(f'{"โ" * 40}') |
| |
| relevant = [] |
| for app in self.data["applications"]: |
| for word in user_input.lower().split(): |
| if word in app["application"].lower(): |
| relevant.append(app) |
| break |
| if relevant: |
| out.append(f' Relevant applications from master control:') |
| for app in relevant[:5]: |
| out.append(f' โข {app["application"]} [{app["domain"]}]') |
| else: |
| out.append(f' Source 4 tools serve the framework from Step 1.') |
|
|
| |
| out.append(f'\n{"โ" * 40}') |
| out.append(f'STEP 4: ุงูู
ูุฎูุฑูุฌูุงุช (Output)') |
| out.append(f'{"โ" * 40}') |
| out.append(f' Deliver in USLaP-compliant terminology.') |
| out.append(f' All terms verified through Step 0.') |
| out.append(f' Framework attributed: Ibn Sฤซnฤ + al-Khwฤrizmฤซ.') |
|
|
| return '\n'.join(out) |
|
|
|
|
| |
| |
| |
|
|
| class AppGenerator: |
| def __init__(self, master_data): |
| self.sciences = master_data["sciences"] |
|
|
| def list_sciences(self): |
| out = [] |
| for s in self.sciences: |
| out.append(f' [{s["id"]:>3}] {s["name_ar"]:<24} {s["root"]:<18} {s.get("verse","")[:30]}') |
| return '\n'.join(out) |
|
|
| def generate(self, name, science_ids, components): |
| selected = [s for s in self.sciences if s["id"] in science_ids] |
| out = [] |
| out.append(f'\n{"โ" * 60}') |
| out.append(f'USLaP APPLICATION: {name}') |
| out.append(f'ุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู') |
| out.append(f'{"โ" * 60}') |
| out.append(f'\nROOT SCIENCES:') |
| for s in selected: |
| out.append(f' [{s["id"]:>3}] {s["name_ar"]} ({s["name_t"]})') |
| out.append(f' Root: {s["root"]} | {s.get("verse","")}') |
| out.append(f'\nCOMPONENTS:') |
| for i, c in enumerate(components, 1): |
| out.append(f' {i}. {c}') |
| out.append(f' Q-U-F: [ ] Quantifiable [ ] Universal [ ] Falsifiable') |
| out.append(f'\nุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ COMPLIANCE:') |
| for s in RESPONSE_ALGORITHM: |
| m = "โ MANDATORY" if s["mandatory"] else " optional" |
| out.append(f' Step {s["step"]}: {s["ar"]} / {s["en"]} [{m}]') |
| return '\n'.join(out) |
|
|
|
|
| |
| |
| |
|
|
| class QUFTool: |
| @staticmethod |
| def verify(metrics=None, limits=None, conditions=None): |
| out = [] |
| out.append(f'\nQ-U-F VERIFICATION') |
| out.append(f'Not a source โ a tool for doubters.\n') |
| if metrics is not None: |
| fails = [m for m in metrics if not m.get("unit")] |
| status = "โ
PASS" if not fails else "โ FAIL" |
| out.append(f' Q โ Quantifiable: {status} (Q54:49 ุจูููุฏูุฑู)') |
| for f in fails: |
| out.append(f' Missing unit: {f.get("name","?")}') |
| if limits is not None: |
| fails = {k: v for k, v in limits.items() if v != "NONE"} |
| status = "โ
PASS" if not fails else "โ FAIL" |
| out.append(f' U โ Universal: {status} (Q34:28 ููุงูููุฉู ูููููููุงุณู)') |
| for k, v in fails.items(): |
| out.append(f' Limitation: {k} = {v}') |
| if conditions is not None: |
| fails = [c for c in conditions if not c.get("test")] |
| status = "โ
PASS" if not fails else "โ FAIL" |
| out.append(f' F โ Falsifiable: {status} (Q17:36)') |
| for f in fails: |
| out.append(f' Missing test: {f.get("name","?")}') |
| return '\n'.join(out) |
|
|
|
|
| |
| |
| |
|
|
| def export_json(master_data, output_path=None): |
| """Export everything as JSON โ paste into any AI system prompt.""" |
| export = { |
| "uslap_version": "2.0", |
| "bismillah": "ุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู", |
| "four_source_lattice": FOUR_SOURCES, |
| "contamination_hierarchy": CONTAM_HIERARCHY, |
| "response_algorithm": RESPONSE_ALGORITHM, |
| "master_data": { |
| "terms_count": len(master_data["terms"]), |
| "reject_count": len([t for t in master_data["terms"] if t["status"] == "REJECT"]), |
| "pass_count": len([t for t in master_data["terms"] if t["status"] == "PASS"]), |
| "sciences_count": len(master_data["sciences"]), |
| "evidence_count": len(master_data["evidence"]), |
| "applications_count": len(master_data["applications"]), |
| }, |
| "terms": master_data["terms"], |
| "sciences": master_data["sciences"], |
| "evidence": master_data["evidence"], |
| "applications": master_data["applications"], |
| "two_systems": master_data["two_systems"], |
| "deep_dive": master_data["deep_dive"], |
| "iqra_moments": master_data["iqra_moments"], |
| } |
| if output_path: |
| with open(output_path, "w", encoding="utf-8") as f: |
| json.dump(export, f, ensure_ascii=False, indent=2) |
| print(f"Exported to {output_path}") |
| print(f" Terms: {export['master_data']['terms_count']}") |
| print(f" Sciences: {export['master_data']['sciences_count']}") |
| size = os.path.getsize(output_path) |
| print(f" Size: {size // 1024}KB") |
| return export |
|
|
|
|
| |
| |
| |
|
|
| def print_header(master_data): |
| t = master_data["terms"] |
| rej = len([x for x in t if x["status"] == "REJECT"]) |
| pas = len([x for x in t if x["status"] == "PASS"]) |
| con = len([x for x in t if x["status"] == "CONCEPT"]) |
| print("\n" + "โ" * 60) |
| print(" USLaP โ Universal Scientific Laws and Principles v2.0") |
| print(" ุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู") |
| print("โ" * 60) |
| print(f" Master: {master_data['path']}") |
| print(f" Terms: {len(t)} ({rej} REJECT ยท {pas} PASS ยท {con} CONCEPT)") |
| print(f" Sciences: {len(master_data['sciences'])} ยท Evidence: {len(master_data['evidence'])} ยท Apps: {len(master_data['applications'])}") |
|
|
| def print_menu(): |
| print("\n [1] ุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ โ Response Algorithm (process query)") |
| print(" [2] ููุญูุต ุงูุชูููููููุซ โ Contamination Scanner") |
| print(" [3] ู
ููููููุฏ ุงูุชููุทูุจููููุงุช โ Application Generator") |
| print(" [4] ุนููููู
โ Browse Sciences") |
| print(" [5] ุฃูุฏูุงุฉ Q-U-F โ Verification Tool") |
| print(" [6] ุงูุฃูุตููู ุงูุฃูุฑูุจูุนูุฉ โ Four-Source Lattice") |
| print(" [7] ุฎููุงุฑูุฒู
ููููุฉ โ View Response Algorithm") |
| print(" [8] ุชูุตูุฏููุฑ โ Export JSON (for any AI)") |
| print(" [9] โ Two Systems") |
| print(" [A] ๐ Deep Dive โ Criminal Networks") |
| print(" [B] ุงููุฑูุฃู โ IQRA Moments (one-prompt destroyers)") |
| print(" [0] ุฎูุฑููุฌ โ Exit") |
|
|
| def menu_response_algorithm(data): |
| engine = ResponseAlgorithmEngine(data) |
| print("\nEnter query (Response Algorithm will process it):") |
| user_input = input("> ").strip() |
| if user_input: |
| print(engine.process(user_input)) |
|
|
| def menu_scanner(data): |
| scanner = ContaminationScanner(data) |
| print("\nPaste text to scan (Enter twice when done):") |
| lines = [] |
| while True: |
| try: |
| line = input() |
| if line == "": |
| break |
| lines.append(line) |
| except EOFError: |
| break |
| text = '\n'.join(lines) |
| if not text: |
| return |
|
|
| results = scanner.scan(text) |
| contam = [r for r in results if r["status"] == "REJECT"] |
| if contam: |
| print(f"\nโ {len(contam)} contaminated term(s):\n") |
| for r in contam: |
| print(f' โ "{r["term"]}" [{r["contamination"]}]') |
| print(f' โ {r["replacement"]}') |
| print(f'\n{"โ" * 40}') |
| print(f'CLEANED:\n{scanner.clean(text)}') |
|
|
| print("\nDrill-down? Enter term (or Enter to skip):") |
| term = input("> ").strip() |
| if term: |
| print("Depth? [1] Surface [2] PRE-trace [3] Criminal network") |
| try: |
| lvl = int(input("> ").strip()) |
| except: |
| lvl = 1 |
| print(scanner.drill_down(term, lvl)) |
| else: |
| print("\nโ
No contamination detected.") |
|
|
| def menu_app_gen(data): |
| gen = AppGenerator(data) |
| print("\nApplication name:") |
| name = input("> ").strip() |
| if not name: |
| return |
| print(f"\n{gen.list_sciences()}") |
| print("\nEnter science IDs (space-separated):") |
| try: |
| ids = [int(x) for x in input("> ").strip().split()] |
| except: |
| return |
| print("\nComponents (one per line, empty to finish):") |
| comps = [] |
| while True: |
| c = input(f" {len(comps)+1}: ").strip() |
| if not c: |
| break |
| comps.append(c) |
| print(gen.generate(name, ids, comps)) |
|
|
| def menu_sciences(data): |
| print(f"\n{'โ' * 60}") |
| print(f"{len(data['sciences'])} SCIENCES") |
| print(f"{'โ' * 60}") |
| for s in data["sciences"]: |
| print(f' [{s["id"]:>3}] {s["name_ar"]:<24} Root: {s["root"]:<18}') |
| if s.get("verse"): |
| print(f' {s["verse"][:60]}') |
|
|
| def menu_quf(): |
| print(QUFTool.verify( |
| metrics=[{"name": "example", "unit": "Hz"}], |
| limits={"cultural": "NONE", "geographic": "NONE", "temporal": "NONE", "economic": "NONE"}, |
| conditions=[{"name": "example", "test": "measure X"}], |
| )) |
|
|
| def menu_four_sources(): |
| print(f"\n{'โ' * 60}") |
| print(f"FOUR-SOURCE LATTICE") |
| print(f"{'โ' * 60}") |
| for s in FOUR_SOURCES: |
| print(f"\n Source {s['n']}: {s['ar']} / {s['t']}") |
| print(f" {s['role']}") |
| print(f"\n{'โ' * 40}") |
| print(f"CONTAMINATION HIERARCHY:") |
| for h in CONTAM_HIERARCHY: |
| print(f" {h['level']}. {h['name']}: {h['desc'][:65]}") |
|
|
| def menu_view_algorithm(): |
| print(f"\n{'โ' * 60}") |
| print(f"ุฎููุงุฑูุฒู
ููููุฉ ุงูุงูุณูุชูุฌูุงุจูุฉ โ Response Algorithm") |
| print(f"{'โ' * 60}") |
| for s in RESPONSE_ALGORITHM: |
| m = "MANDATORY" if s["mandatory"] else "AFTER 0-2" |
| print(f'\n Step {s["step"]}: {s["ar"]} / {s["en"]} [{m}]') |
| print(f' {s["action"]}') |
| if "subs" in s: |
| for sub in s["subs"]: |
| print(f' โข {sub}') |
| print(f' โ {s["anti"]}') |
|
|
| def menu_two_systems(data): |
| print(f"\n{'โ' * 60}") |
| print(f"Moloch vs Qur'an โ Bukhari 6069") |
| print(f"{'โ' * 60}") |
| for row in data["two_systems"]: |
| print(f'\n {row["dimension"]}:') |
| print(f' โ Moloch: {row["moloch"]}') |
| print(f' โช Qur\'an: {row["quran"]}') |
|
|
| def menu_deep_dive(data): |
| print(f"\n{'โ' * 60}") |
| print(f"๐ DEEP DIVE โ Criminal Networks & Concealment Chains") |
| print(f"{'โ' * 60}") |
| |
| chains = {} |
| for d in data["deep_dive"]: |
| chains.setdefault(d["chain"], []).append(d) |
| for chain_name, entries in chains.items(): |
| print(f'\n{"โ" * 50}') |
| print(f' โ {chain_name}') |
| print(f'{"โ" * 50}') |
| for e in entries: |
| print(f'\n CRIME: {e["crime"]}') |
| print(f' EVIDENCE: {e["evidence"]}') |
| print(f' PRE-TRACE: {e["pre_trace"]}') |
| print(f' SOURCES: {e["sources"]}') |
| print(f' QUR\'AN: {e["quran_warning"]}') |
|
|
| print(f'\n{"โ" * 50}') |
| print(f'Drill deeper? Enter chain name (or Enter to return):') |
| choice = input("> ").strip().upper() |
| if choice and choice in chains: |
| for e in chains[choice]: |
| print(f'\n {"=" * 40}') |
| print(f' {e["crime"]}') |
| print(f' {"=" * 40}') |
| print(f' {e["evidence"]}') |
| print(f'\n PRE-CIVILIZATIONAL TRACE:') |
| print(f' {e["pre_trace"]}') |
| print(f'\n PRIMARY SOURCES:') |
| print(f' {e["sources"]}') |
| print(f'\n QUR\'ANIC WARNING:') |
| print(f' {e["quran_warning"]}') |
|
|
| def menu_iqra(data): |
| print(f"\n{'โ' * 60}") |
| print(f"ุงููุฑูุฃู MOMENTS โ One prompt. One corner. No escape.") |
| print(f"{'โ' * 60}") |
| print(f"\n Each takes 5 seconds. Each destroys centuries of lies.\n") |
| for m in data["iqra_moments"]: |
| print(f' #{m["number"]:>2} LIE: {m["target_lie"]}') |
| print(f' KILL: {m["kill_shot"][:75]}') |
| print() |
|
|
| print(f'Pick a number for full details (or Enter to return):') |
| try: |
| choice = int(input("> ").strip()) |
| for m in data["iqra_moments"]: |
| if m["number"] == choice: |
| print(f'\n {"โ" * 50}') |
| print(f' ุงููุฑูุฃู MOMENT #{m["number"]}') |
| print(f' {"โ" * 50}') |
| print(f'\n THE LIE: {m["target_lie"]}') |
| print(f'\n THE KILL SHOT:') |
| print(f' {m["kill_shot"]}') |
| print(f'\n TIME TO EXPOSE: {m["time"]}') |
| break |
| except: |
| pass |
|
|
| def menu_export(data): |
| out = Path(__file__).parent / "uslap_export.json" |
| export_json(data, str(out)) |
|
|
| def interactive(data): |
| print_header(data) |
| while True: |
| print_menu() |
| choice = input("\n Select: ").strip() |
| if choice == "1": menu_response_algorithm(data) |
| elif choice == "2": menu_scanner(data) |
| elif choice == "3": menu_app_gen(data) |
| elif choice == "4": menu_sciences(data) |
| elif choice == "5": menu_quf() |
| elif choice == "6": menu_four_sources() |
| elif choice == "7": menu_view_algorithm() |
| elif choice == "8": menu_export(data) |
| elif choice == "9": menu_two_systems(data) |
| elif choice.upper() == "A": menu_deep_dive(data) |
| elif choice.upper() == "B": menu_iqra(data) |
| elif choice == "0": |
| print("\nุจูุณูู
ู ุงูููููู ุงูุฑููุญูู
ููฐูู ุงูุฑููุญููู
ู") |
| break |
| else: |
| print(" Invalid.") |
|
|
|
|
| |
| |
| |
|
|
| def main(): |
| master_path = find_master() |
| if not master_path: |
| print(f"ERROR: {MASTER_FILE} not found.") |
| print(f"Place it in same directory as uslap.py or current directory.") |
| sys.exit(1) |
|
|
| data = load_master(master_path) |
|
|
| |
| if len(sys.argv) > 1: |
| if sys.argv[1] == "--scan" and len(sys.argv) > 2: |
| scanner = ContaminationScanner(data) |
| text = ' '.join(sys.argv[2:]) |
| results = scanner.scan(text) |
| for r in results: |
| if r["status"] == "REJECT": |
| print(f'โ "{r["term"]}" โ {r["replacement"]}') |
| if not results: |
| print("โ
Clean.") |
| return |
|
|
| elif sys.argv[1] == "--process" and len(sys.argv) > 2: |
| engine = ResponseAlgorithmEngine(data) |
| print(engine.process(' '.join(sys.argv[2:]))) |
| return |
|
|
| elif sys.argv[1] == "--export-json": |
| out = sys.argv[2] if len(sys.argv) > 2 else "uslap_export.json" |
| export_json(data, out) |
| return |
|
|
| elif sys.argv[1] == "--info": |
| print_header(data) |
| return |
|
|
| else: |
| print(f"Unknown option: {sys.argv[1]}") |
| print(__doc__) |
| return |
|
|
| |
| interactive(data) |
|
|
|
|
| if __name__ == "__main__": |
| main() |
|
|