KhalilAlgoWorks / ATLAS_INDEX.md
enver's picture
Release KhalilAlgoWorks v1.0: 16 classical books, 84 verified (121/121) AI & SWE algorithm principles
13310fd verified
|
Raw History Blame Contribute Delete
74.2 kB

KhalilAlgoWorks — Master Reverse Lookup Index (Engineering Problem → Classical Principle)

Use this table to jump straight from an active AI/ML, LLM, or coding problem to every applicable classical principle.

Training, RL & Preference Purification (training_rl · 20 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-03 PROVEN Al-Istiṣḥāb (Continuity of Sound Prior State) 01_ghazali_mustasfa (L6340, L6343) Reference-KL-Tethered RL / Asymmetric Non-Regression Penalty: Keep base policy $\pi_{\text{ref}}$ invariant unless execution-verified proof overrides it; penalize $\lambda\max(0,-\Delta_w)^2$ so passing behaviors never degrade.
GH-04 UNTAPPED Tanqīḥ al-Manāṭ & Ilghāʾ al-Fāriq (Causal Distillation) 01_ghazali_mustasfa (L11351, L11367–11368) Minimal-Diff Contrastive Preference Purification: Strip irrelevant stylistic/length confounders (line_sim >= 0.72, `
GH-05 PARTIAL Correlation ≠ Causation (Buṭlān al-Ṭard al-Maḥḍ) & Naqḍ vs. *Muʿāraḍah 01_ghazali_mustasfa (L12737–12746, L13391, L13477, L13753–13755) Confounder-Resistant Reward Modeling & Fault-Triage Differentiation: Reject pure observational correlation without interventional sabr; distinguish true invariant failure (naqḍ = bug in rule) from rule-priority override (muʿāraḍah = exception precedence, do not corrupt base rule).
KH-01 PROVEN Al-Taqālīb ($n!$ Combinatorial Search) × Mustaʿmal vs. Muhmal Pruning 02_khalil_al_ayn (L164) Structured Combinatorial Exploration + Deterministic Validity Pruning: Systematically explore orthogonal candidate permutations (on-policy rollouts / AST templates) and deterministically discard invalid (muhmal) branches before scoring.
MB-02 PARTIAL Completeness Stopping Criterion (Ḥusn al-Sukūt & Wujūb al-Fāʾidah) 05_mubarrad_al_muqtadab (L98–99, L13255) Semantic EOS Calibration & Anti-Early-EOS / Anti-Vacuous-Output Gate: Block premature <eos> before a self-contained semantic unit (fāʾidah) is closed; reject tautological outputs (X is X) that deliver zero new information gain.
MB-03 UNTAPPED Inverse Diagnostic Probing (al-Taṣghīr Yarudd ilā al-Aṣl) 05_mubarrad_al_muqtadab (L9863–9865, L10645) Perturbation / Downscaling Probe for Latent Structure Recovery: Apply a controlled simplifying transform (minimal-input fuzz probe, stripped AST skeleton, reduced-scale instance) that strips superficial wrappers (zawāʾid) and exposes the true underlying root/algorithm (aṣl).
JD-01 PARTIAL Maximal Feature-Space Separation / Orthogonality Law 06_ibn_durayd_jamhara (L207–213) Orthogonal Ensemble / Diversity-Regularized Decoding & Multi-Agent Design: Penalize near-duplicate representations/candidates in embedding space; force diverse candidate paradigms (taqlībāt) and orthogonal LoRA/expert subspaces to avoid representation collapse.
ZI-03 PROVEN Information-Theoretic Origin of Structural Markers (Iʿrāb Disambiguates Identical Bags) 08_zajjaji_idah_fi_ilal (L515–518) Role/Dependency Tag Injection at Layer-0: Because bag-of-tokens / raw BPE embeddings are role-blind (subj vs obj, caller vs callee, arg vs return), explicitly inject lightweight structural role embeddings (ʿāmil/maʿmūl AST roles).
ZI-05 UNTAPPED Exception Isolation (al-Khurūj bi-ʿIllah lā Yanquḍ al-Bāb) 08_zajjaji_idah_fi_ilal (L192–194) Modular Scoped Overrides Without Catastrophic Drift: Handle documented domain exceptions via localized conditional overrides/adapters rather than re-training or distorting global base weights/rules.
ZH-05 PARTIAL Context-Driven Polymorphic Operator Dispatch (ʿAlā 3-way, Siwā 4-way) 09_zajjaji_huruf_al_maani (L310–323) Syntactic-Frame Disambiguation for Overloaded Tokens/Symbols: Resolve overloaded operators (*, +, in, على, ما) deterministically via local grammatical/AST slot signatures before semantic scoring.
JK-02 PROVEN Al-Tadrīj (Non-Destructive Continual Gradualism) 10_ibn_jinni_khasais (L6118–6121) Continual-Learning Anti-Forgetting Schedule & Progressive Curriculum: Update models in small, low-LR, basis-aligned increments (sparse top-layer Native-BF16 LoRA, exact basin soup) so Stage $t+1$ strictly preserves Stage $t$'s manifold.
JK-05 PROVEN Tadākhul al-Uṣūl (Overlapping-Origin Ambiguity Separation) 10_ibn_jinni_khasais (L6344–6347) Boundary-Probe Disambiguation of Colliding Hypotheses: Design targeted separating inputs (e.g., negative/float/tie/empty probes) specifically where two plausible interpretations or code origins overlap on standard inputs.
JS-01 UNTAPPED Continuous–Discrete Duality (al-Ḥarakāt Abʿāḍ Ḥurūf al-Madd) 11_ibn_jinni_sirr_sinat_irab (L455–457, L469–471) Multi-Resolution Scale-Continuous Tokenization / Duration-Scaling Modulation: Model fine-grained modifiers (diacritics, scalar weights, soft gates) as fractional sub-components of macro structural tokens along the same continuous vector axis.
SK-01 PROVEN Surgical Minimal-Pair Contrast (Taqūl ... wa lā Taqul) 12_ibn_sikkit_islah_al_mantiq (L2488–2490) Diff-Weighted Minimal-Pair Contrastive DPO/SimPO: Pair near-identical (chosen, rejected) sequences differing by 1–few critical tokens (diff_w=4.5, shared_w=0.4) to laser-focus gradients onto exact failure tokens.
SK-03 UNTAPPED Valency & Participant-Arity Templates (Fāʿala Binary vs. Afʿala Unary) 12_ibn_sikkit_islah_al_mantiq (L2416–2419) Arity/Symmetry Contract Checking with Documented Overloads: Infer function symmetry/arity expectations (mutual_op(a, b) vs unary_op(a)) and flag unintended arity mismatches while permitting explicit legacy overloads.
SK-04 PROVEN Popular-Drift Purification (Mā Tarakathu al-ʿĀmmah) 12_ibn_sikkit_islah_al_mantiq (L1546, L2429–2430) Web-Corpus Pretraining Prior Debiasing: Explicitly identify high-frequency internet/colloquial errors baked into base LLMs (deprecated APIs, popular coding myths, modern false-friend Arabic meanings) and counteract them with targeted contrastive pairs.
AZ-02 PARTIAL Dataset Corruption & Taṣḥīf (OCR/Transcription Error) Purification 13_azhari_tahdhib_al_lughah (L82–87) Pre-Training / Fine-Tuning Corpus Sanitation & Noise-Lineage Auditing: Actively audit training corpora for OCR/dot-confusion/synthetic-contamination errors (taṣḥīf) and publish explicit error-correction logs rather than blindly ingesting scale.
AZ-05 UNTAPPED Selective Credit Preservation (Taṣḥīḥ Without Blanket Discard) 13_azhari_tahdhib_al_lughah (L607–612) Granular Per-Sample Filtering over Dataset-Level Blanket Rejection: Score and quarantine individual noisy rows/assertions rather than discarding an entire high-value dataset or model checkpoint due to isolated defects.
JW-01 PROVEN Precision-Only Curation (Mā Ṣaḥḥa ʿIndī) + Tri-Modal Verification 14_jawhari_al_sihah (L1152, L1156) High-Precision Goldilocks Curation via 3-Axis Verification (Lineage × Analytical Check × Live Execution): Smaller 100%-verified datasets beat massive noisy dumps when every item passes transmission provenance (riwāyah), structural logic (dirāyah), and live test (mushāfahah).
JW-03 PROVEN Canonical Root-Key Hashing (Index Under Underlying Radical, Not Surface Mutation) 14_jawhari_al_sihah (L1159–1163) Canonical Normalization Before Embedding/Cache Lookup: Hash mutated surface forms (case variants, aliases, dotless-ى, refactored identifiers) to their canonical root key before caching, RAG lookup, or cross-convention co-reference binding.

Constrained Decoding, Speculation & Pruning (decoding_pruning · 18 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-02 PROVEN Al-Sabr wa-l-Taqsīm (Exhaustive Partition & Elimination) 01_ghazali_mustasfa (L1206, L12534–12543) Disjunctive Hypothesis Elimination / Channel Pruning & Root-Cause Localization: Enumerate exhaustive failure/channel hypotheses, falsify invalid branches via execution/energy probes, retain the sole surviving operative cause.
KH-01 PROVEN Al-Taqālīb ($n!$ Combinatorial Search) × Mustaʿmal vs. Muhmal Pruning 02_khalil_al_ayn (L164) Structured Combinatorial Exploration + Deterministic Validity Pruning: Systematically explore orthogonal candidate permutations (on-policy rollouts / AST templates) and deterministically discard invalid (muhmal) branches before scoring.
KH-03 PARTIAL Articulatory-Axis Canonical Ordering (Makhārij Manifold) 02_khalil_al_ayn (L17, L158) Physical/Functional Coordinate Embeddings & Feature-Ordered Indexing: Index vocabulary/symbols along continuous generative-mechanism axes rather than arbitrary lexical/UTF-8 order for compact manifold sharing.
KH-04 PARTIAL Hard Adjacent-Pair Exclusion with Explicit Composition Exception 02_khalil_al_ayn (L179, L19594) Tiered Hard Grammar Masks with Provenance-Aware Escape Hatches: Block illegal token/AST transitions by default, while explicitly exempting cross-module/foreign-FFI/compound boundaries (loanword / external_lib namespace).
SB-03 PROVEN Sadd al-Masadd (Structural Substitution / Functional Absorption) 03_sibawayh_al_kitab (L7108–7111) Layer Elision + Low-Rank Residual Compensation: Prune redundant transformer blocks/modules and substitute a compact functional adapter that preserves downstream interface contracts.
SB-04 PROVEN Bāb al-Zakn (Contextual Intent Lookahead) 03_sibawayh_al_kitab (L3228–3230) Zero-Loss Prompt/Context-Grounded Speculative Decoding: Predict multi-token continuations deterministically from observable prompt/state trajectory cues and verify in one pass.
AK-01 UNTAPPED Semantics-Preserving Optimization Invariant 04_akhfash_maani_al_quran (L31–33) Semantics-Invariant Graph/Prompt/Quantization Rewriting: Allow cost-reducing structural transformations (kernel fusion, cache compression, prompt simplification) iff behavioral equivalence holds (la yughayyir al-ma'na).
AK-05 UNTAPPED Long-Distance Frame Binding Across Parenthetical Interruptions 04_akhfash_maani_al_quran (L4899–4900) Stack-Protected Long-Range Attention Masking / Parenthetical Bypass: Maintain an explicit open-frame stack (ammā ... fa-, try ... finally, nested <think>/tool calls) immune to intermediate digression/parenthetical token decay.
MB-01 PARTIAL Information-Theoretic Lossless Compression (al-Ḥadhf maʿa Amān al-Labs) 05_mubarrad_al_muqtadab (L5049–5057) Ambiguity-Safe KV-Cache / Context / Token Pruning: Prune a token, layer, or prompt clause for efficiency iff surviving context uniquely entails it (ma yabqa dallun 'alayh) with zero ambiguity risk (aman al-labs).
MB-02 PARTIAL Completeness Stopping Criterion (Ḥusn al-Sukūt & Wujūb al-Fāʾidah) 05_mubarrad_al_muqtadab (L98–99, L13255) Semantic EOS Calibration & Anti-Early-EOS / Anti-Vacuous-Output Gate: Block premature <eos> before a self-contained semantic unit (fāʾidah) is closed; reject tautological outputs (X is X) that deliver zero new information gain.
JD-01 PARTIAL Maximal Feature-Space Separation / Orthogonality Law 06_ibn_durayd_jamhara (L207–213) Orthogonal Ensemble / Diversity-Regularized Decoding & Multi-Agent Design: Penalize near-duplicate representations/candidates in embedding space; force diverse candidate paradigms (taqlībāt) and orthogonal LoRA/expert subspaces to avoid representation collapse.
ZI-04 PARTIAL Compute/Complexity Load Balancing (Takhfīf al-Thaqīl wa-Ilzām al-Khafīf) 08_zajjaji_idah_fi_ilal (L936, L1079–1081) Asymmetric Compute Budgeting across Pipeline Stages: Offload heavy work away from already-expensive components (e.g., trim/apocopate heavy reasoning loops via fast O(1) deterministic pre-checks; keep heavy models light by attaching extra metadata to cheap CPU/Layer-0 ops).
JS-04 PARTIAL Closed Finite Affix & Mutation Alphabets (10 Ziyādah, 11 Ibdāl) 11_ibn_jinni_sirr_sinat_irab (L1183–1190, L3115–3117) Closed-Vocabulary Structural Delta Channels & Context-Triggered Deterministic Normalization: Restrict permissible structural edits/affixes to a small verified closed set and run deterministic feature-conditioned rewrites before neural inference.
AZ-02 PARTIAL Dataset Corruption & Taṣḥīf (OCR/Transcription Error) Purification 13_azhari_tahdhib_al_lughah (L82–87) Pre-Training / Fine-Tuning Corpus Sanitation & Noise-Lineage Auditing: Actively audit training corpora for OCR/dot-confusion/synthetic-contamination errors (taṣḥīf) and publish explicit error-correction logs rather than blindly ingesting scale.
AZ-04 PROVEN Frequency-Driven Collocation Fusion (al-Naḥt bi-Kathrat al-Istiʿmāl) 13_azhari_tahdhib_al_lughah (L50369–50370) PMI-Guided Macro-Token / Phrase-Draft Fusion: Fuse recurring high-frequency multi-token collocations into O(1) macro-draft units for lossless speculative decoding and latency reduction.
JW-04 PROVEN Frequency-Driven Structural Compression with Plural/Inverse Recovery 14_jawhari_al_sihah (L42159–42160, L53202) Reversible Fast-Path Shorthand with Full-Expansion Fallback: Compress high-frequency operations/prompts in the hot path while retaining exact canonical expansion whenever complex/plural edge cases arise.
FS-04 PROVEN Al-Naḥt (Lossy-Surface / Lossless-Meaning Multi-Word Compression) 15_ibn_faris_al_sahibi (L3919–3920) Compositional Macro-Operation / Pipeline Fusion: Synthesize compact fused compound operators or multi-token speculative chunks from recurring multi-step idioms.
FM-01 PARTIAL Axiomatic Semantic Compression (Maqāyīs Ṣaḥīḥah wa-Uṣūl) 16_ibn_faris_maqayis_al_lughah (L1155–1156, L3760) Low-Rank Semantic Prototype / Root-Axiom Bottleneck: Compress sprawling lexical/API/skill inventories into 1–3 orthogonal core semantic invariants per root/module so models generalize to unseen derivatives without memorization.

Execution Verification, Testing & Search (verification_search · 34 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-02 PROVEN Al-Sabr wa-l-Taqsīm (Exhaustive Partition & Elimination) 01_ghazali_mustasfa (L1206, L12534–12543) Disjunctive Hypothesis Elimination / Channel Pruning & Root-Cause Localization: Enumerate exhaustive failure/channel hypotheses, falsify invalid branches via execution/energy probes, retain the sole surviving operative cause.
GH-03 PROVEN Al-Istiṣḥāb (Continuity of Sound Prior State) 01_ghazali_mustasfa (L6340, L6343) Reference-KL-Tethered RL / Asymmetric Non-Regression Penalty: Keep base policy $\pi_{\text{ref}}$ invariant unless execution-verified proof overrides it; penalize $\lambda\max(0,-\Delta_w)^2$ so passing behaviors never degrade.
GH-05 PARTIAL Correlation ≠ Causation (Buṭlān al-Ṭard al-Maḥḍ) & Naqḍ vs. *Muʿāraḍah 01_ghazali_mustasfa (L12737–12746, L13391, L13477, L13753–13755) Confounder-Resistant Reward Modeling & Fault-Triage Differentiation: Reject pure observational correlation without interventional sabr; distinguish true invariant failure (naqḍ = bug in rule) from rule-priority override (muʿāraḍah = exception precedence, do not corrupt base rule).
GH-06 UNTAPPED Non-Generalizability of Exceptional Precedents & Three-Way Conflict Resolution (Taʿāruḍ) 01_ghazali_mustasfa (L13122, L13246, L14782) Quarantine of Hardcoded Edge-Case Patches + 3-Mode Multi-Agent Conflict Arbitrator: Never generalize from ad-hoc/exceptional training examples; when two verifiers/agents conflict, resolve via (1) mutual cancellation + fallback (tasāquṭ), (2) tie-break freedom (takhyīr), or (3) domain-split routing (tafṣīl). Also enforce that identifier/API names are lookup-only (samāʿī), never analogically guessed!
KH-01 PROVEN Al-Taqālīb ($n!$ Combinatorial Search) × Mustaʿmal vs. Muhmal Pruning 02_khalil_al_ayn (L164) Structured Combinatorial Exploration + Deterministic Validity Pruning: Systematically explore orthogonal candidate permutations (on-policy rollouts / AST templates) and deterministically discard invalid (muhmal) branches before scoring.
KH-02 PROVEN Dhalāqah Structural Authenticity Gate & Adversarial Fabrication Detector 02_khalil_al_ayn (L58, L74, L84) O(1) Structural Hallucination & Adversarial Input/Output Filter: Fast distributional-invariant guard (zero-GPU) rejecting impossible long tokens, fabricated API names, or adversarial injections even when surface-plausible.
SB-01 PROVEN 5-State Validity × Truthfulness Verification Matrix (Bāb al-Istiqāmah) 03_sibawayh_al_kitab (L325–332) Orthogonal Syntax × Semantics × Runtime Truth Verifier: Separate (1) Mustaqīm Ḥasan (valid + true), (2) Mustaqīm Qabīḥ (runs, bad style/anti-pattern), (3) Mustaqīm Kadhib (runs, wrong spec answer), (4) Muḥāl (type/runtime contradiction), (5) Muḥāl Kadhib (contradiction + false).
SB-04 PROVEN Bāb al-Zakn (Contextual Intent Lookahead) 03_sibawayh_al_kitab (L3228–3230) Zero-Loss Prompt/Context-Grounded Speculative Decoding: Predict multi-token continuations deterministically from observable prompt/state trajectory cues and verify in one pass.
AK-01 UNTAPPED Semantics-Preserving Optimization Invariant 04_akhfash_maani_al_quran (L31–33) Semantics-Invariant Graph/Prompt/Quantization Rewriting: Allow cost-reducing structural transformations (kernel fusion, cache compression, prompt simplification) iff behavioral equivalence holds (la yughayyir al-ma'na).
MB-03 UNTAPPED Inverse Diagnostic Probing (al-Taṣghīr Yarudd ilā al-Aṣl) 05_mubarrad_al_muqtadab (L9863–9865, L10645) Perturbation / Downscaling Probe for Latent Structure Recovery: Apply a controlled simplifying transform (minimal-input fuzz probe, stripped AST skeleton, reduced-scale instance) that strips superficial wrappers (zawāʾid) and exposes the true underlying root/algorithm (aṣl).
MB-04 UNTAPPED Collision Repair (Iltiqāʾ al-Sākinayn) via Minimal-Conflict Perturbation 05_mubarrad_al_muqtadab (L65–70) Constraint-Guided Conflict Resolution (SAT/Merge Repair): When two incompatible adjacent states collide (dependency conflict, merge conflict, grammar deadlock), select the unique repair transition that minimizes secondary constraint violations.
JD-01 PARTIAL Maximal Feature-Space Separation / Orthogonality Law 06_ibn_durayd_jamhara (L207–213) Orthogonal Ensemble / Diversity-Regularized Decoding & Multi-Agent Design: Penalize near-duplicate representations/candidates in embedding space; force diverse candidate paradigms (taqlībāt) and orthogonal LoRA/expert subspaces to avoid representation collapse.
JD-02 PARTIAL Asymmetric Strength-First Ordering (al-Badʾ bi-l-Aqwā thumma al-Alyan) 06_ibn_durayd_jamhara (L215–220) Fail-Fast / Strongest-Constraint-First Verification Pipeline: Cap homogeneous repetition runs (<3 identical consecutive ops/retries) and always order verification gates from strongest/cheapest deterministic invariant first (Syntax/Type → Live API → Fuzzy LLM judge).
JD-03 PROVEN Strict Authenticity Rejection Gate (Fardudhu) 06_ibn_durayd_jamhara (L204–206, L298–301) Zero-Hesitation OOD / Hallucinated-Symbol Circuit Breaker: Reject generated symbols/imports/citations that violate domain structural invariants immediately rather than trying to softly repair fabricated artifacts.
ZI-01 PROVEN Three-Tier Explanatory Hierarchy (Taʿlīmiyyah / Qiyāsiyyah / Jadaliyyah) 08_zajjaji_idah_fi_ilal (L416–420) 3-Layer ML System Architecture: Separate (1) Operational Execution Rules (taʿlīmiyyah — compact executable priors), (2) Generalization/Transfer Mechanisms (qiyāsiyyah — representation sharing), and (3) Adversarial Stress-Testing/Verification (jadaliyyah — red-team & falsification).
ZI-02 PROVEN Defeasible-Theory Epistemology (Data Overrides Inferred Rule — al-Khalīl's House Metaphor) 08_zajjaji_idah_fi_ilal (L414–415, L454–459) Execution-Truth Supremacy over Heuristic Priors: Treat every learned heuristic, static analyzer warning, or LLM rationale as a defeasible hypothesis; empirical execution / verified ground truth always overrides an inferred rule.
ZH-01 UNTAPPED Counterfactual Dual Operators (Law vs. Lawlā) 09_zajjaji_huruf_al_maani (L37–40) Counterfactual Causality Testing (¬A → ¬B Necessity vs. A → ¬B Blocking): Structure ablation & debugging probes explicitly into necessary-cause removal (law: remove component, see if success vanishes) and blocker removal (lawlā: remove blocker, see if success emerges).
ZH-02 UNTAPPED Strict Polarity-Gated Response Protocol (Balā vs. Naʿam) 09_zajjaji_huruf_al_maani (L71–75) Unambiguous Boolean Verification Schemas: Eliminate sycophantic/ambiguous "Yes" answers to negative assertions ("Did it NOT fail? Yes") by enforcing typed 3-way verdicts (AFFIRM_POSITIVE / REFUTE_NEGATIVE / CONFIRM_NEGATIVE) in LLM judges and tool protocols.
ZH-03 UNTAPPED Temporal-Polarity Domain Licensing (Qaṭṭ & Lā Past-Existential Lock) 09_zajjaji_huruf_al_maani (L389–391, L444–447) State-History Immutability & Polarity-Licensed Assertions: Enforce monotonic append-only execution logs (past observed facts cannot be negated without contradiction) and restrict universal-history quantifiers (never/always) strictly to valid polarity/time domains.
ZH-04 UNTAPPED Precondition-Gated Correction Operator (Lākin / Bal) 09_zajjaji_huruf_al_maani (L191–194, L199–200) Structured Agent Revision Semantics (OVERRIDE vs. REFINEMENT): Distinguish bal (abort/replace failed plan completely) from lākin (preserve prior negation/constraint while adding targeted exception patch) in multi-turn repair loops.
JK-01 PROVEN Al-Ishtiqāq al-Akbar ($S_3$ Permutation-Orbit Invariance) 10_ibn_jinni_khasais (L266, L7625–7629) Orthogonal Paradigm Generation & Permutation-Equivariant Representation Sharing: Generate diverse algorithmic implementations across orthogonal paradigms that share the same invariant spec; share parameters across permutation-equivalent root orbits.
JK-03 PROVEN Imtināʿ min Naqḍ al-Gharaḍ (Goal-Monotonicity Lock) 10_ibn_jinni_khasais (L1861–1867, L16353–16354) Locked-Invariant Monotonic Repair & Objective Conflict Guard: Never apply an optimization/patch that breaks a previously satisfied objective or passing test; reject candidate edits that violate locked invariants (naqḍ al-gharaḍ).
JK-04 UNTAPPED Al-Iḥtiyāṭ fī Waṣf al-ʿIllah (Maximal Precondition Specification) 10_ibn_jinni_khasais (L2120–2121, L2166–2167) Upfront Invariant Specification vs. Ad-Hoc Patch Sprawl: Encode boundary conditions directly inside rule/prompt/function preconditions rather than layering brittle post-hoc exception patches (if special_case_17:).
JK-05 PROVEN Tadākhul al-Uṣūl (Overlapping-Origin Ambiguity Separation) 10_ibn_jinni_khasais (L6344–6347) Boundary-Probe Disambiguation of Colliding Hypotheses: Design targeted separating inputs (e.g., negative/float/tie/empty probes) specifically where two plausible interpretations or code origins overlap on standard inputs.
JK-06 PROVEN Compositional Generalization (Mā Qīsa ʿalā Kalām al-ʿArab) & Structure-Meaning Isomorphism 10_ibn_jinni_khasais (L5329, L7919) Zero-Shot Compositional Synthesis (P + mean(R) + W) & Structural-Similarity Embeddings: Predict unseen valid compound identifiers/forms compositionally from attested primitives; align structural complexity with semantic complexity.
JS-03 PROVEN 3-Tier Gradation Lattice (Shadīdah / Bayniyyah / Rikhwah) 11_ibn_jinni_sirr_sinat_irab (L1156–1160) Tri-State Constraint Severity Enforcement (HARD_KILL / CONDITIONAL_GATE / SOFT_TENDENCY): Replace brittle binary pass/fail rules with a 3-tier constraint spectrum (hard invariants, context-gated rules, soft penalties).
JS-04 PARTIAL Closed Finite Affix & Mutation Alphabets (10 Ziyādah, 11 Ibdāl) 11_ibn_jinni_sirr_sinat_irab (L1183–1190, L3115–3117) Closed-Vocabulary Structural Delta Channels & Context-Triggered Deterministic Normalization: Restrict permissible structural edits/affixes to a small verified closed set and run deterministic feature-conditioned rewrites before neural inference.
SK-02 PARTIAL Single-Bit / Diacritic Semantic Bifurcation (Bāb Faʿl wa-Fiʿl & Hamza Flip) 12_ibn_sikkit_islah_al_mantiq (L494–496, L2657–2660) High-Sensitivity Adversarial Minimal-Edit Test Generation: Auto-synthesize single-character/operator/flag flip test pairs (== vs =, // vs /, <= vs <, hamza/vowel flip) to probe semantic cliffs where tiny surface changes invert meaning.
AZ-01 UNTAPPED Single-Source Corroboration Quarantine (Tawaqquf Protocol) 13_azhari_tahdhib_al_lughah (L613–616) Multi-Witness Fact Verification & Selective Abstention Gate: Quarantine any uncorroborated single-source RAG/model claim (status=SUSPECT) until independently verified by a tiered trusted witness/tool; abstain (tawaqquf) rather than hallucinate.
AZ-03 PROVEN Primary Ground-Truth Field Verification (Mushāfahah / Execution Grounding) 13_azhari_tahdhib_al_lughah (L93–97) Live-Environment Ground-Truth Anchoring: Prefer direct execution/runtime inspection (pytest, live inspect.signature, verified Mushaf/OpenITI pri witnesses) over secondary commentary or synthetic LLM distillation.
JW-01 PROVEN Precision-Only Curation (Mā Ṣaḥḥa ʿIndī) + Tri-Modal Verification 14_jawhari_al_sihah (L1152, L1156) High-Precision Goldilocks Curation via 3-Axis Verification (Lineage × Analytical Check × Live Execution): Smaller 100%-verified datasets beat massive noisy dumps when every item passes transmission provenance (riwāyah), structural logic (dirāyah), and live test (mushāfahah).
FS-01 UNTAPPED 10-Class Speech-Act Router & 3-State Modal Logic (Wājib / Jāʾiz / Mumtaniʿ) 15_ibn_faris_al_sahibi (L2528–2538) Intent/Speech-Act Classifier + Tautology/SAT/UNSAT Spec Triage: Route user prompts by formal illocutionary act (assert vs query vs command vs prohibition) BEFORE tool selection; classify claims into TAUTOLOGY (wājib), CONTINGENT/TESTABLE (jāʾiz), or IMPOSSIBLE/UNSAT (mumtaniʿ).
FM-01 PARTIAL Axiomatic Semantic Compression (Maqāyīs Ṣaḥīḥah wa-Uṣūl) 16_ibn_faris_maqayis_al_lughah (L1155–1156, L3760) Low-Rank Semantic Prototype / Root-Axiom Bottleneck: Compress sprawling lexical/API/skill inventories into 1–3 orthogonal core semantic invariants per root/module so models generalize to unseen derivatives without memorization.
FM-05 UNTAPPED Bi-Radical Prefix/Sub-Root Structural Invariants 16_ibn_faris_maqayis_al_lughah (L24927–24929) Sub-Root / N-Gram Shared-Stem Feature Factoring: Capture shared directional/functional semantics across families sharing a 2-unit prefix/stem kernel (hierarchical multi-scale representation sharing).

Agentic Routing, Planning & Conflict Resolution (agentic_routing · 23 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-03 PROVEN Al-Istiṣḥāb (Continuity of Sound Prior State) 01_ghazali_mustasfa (L6340, L6343) Reference-KL-Tethered RL / Asymmetric Non-Regression Penalty: Keep base policy $\pi_{\text{ref}}$ invariant unless execution-verified proof overrides it; penalize $\lambda\max(0,-\Delta_w)^2$ so passing behaviors never degrade.
GH-05 PARTIAL Correlation ≠ Causation (Buṭlān al-Ṭard al-Maḥḍ) & Naqḍ vs. *Muʿāraḍah 01_ghazali_mustasfa (L12737–12746, L13391, L13477, L13753–13755) Confounder-Resistant Reward Modeling & Fault-Triage Differentiation: Reject pure observational correlation without interventional sabr; distinguish true invariant failure (naqḍ = bug in rule) from rule-priority override (muʿāraḍah = exception precedence, do not corrupt base rule).
GH-06 UNTAPPED Non-Generalizability of Exceptional Precedents & Three-Way Conflict Resolution (Taʿāruḍ) 01_ghazali_mustasfa (L13122, L13246, L14782) Quarantine of Hardcoded Edge-Case Patches + 3-Mode Multi-Agent Conflict Arbitrator: Never generalize from ad-hoc/exceptional training examples; when two verifiers/agents conflict, resolve via (1) mutual cancellation + fallback (tasāquṭ), (2) tie-break freedom (takhyīr), or (3) domain-split routing (tafṣīl). Also enforce that identifier/API names are lookup-only (samāʿī), never analogically guessed!
KH-05 PROVEN Bounded Radical Arity Taxonomy (2/3/4/5-Slot Canonical Schemas) 02_khalil_al_ayn (L18–22) Fixed-Arity Structured Latent Factorization: Decompose unbounded BPE token streams into fixed-arity canonical tuples (Root, Wazn, Affixes) or (Fāʾ_inputs, ʿAyn_kernel, Lām_contract).
SB-05 UNTAPPED Al-Tanāzuʿ (Multi-Governor Contention Resolution) 03_sibawayh_al_kitab (L934–936) Locality-Aware Scope Binding & Contention Arbitrator: When two active operators/tools compete for the same shared argument/resource, bind surface ownership to the nearest governor and pass a clean pointer/reference (ḍamīr) to the deferred governor.
SB-06 PARTIAL Priority-First Ordering (al-ʿInāyah wa-l-Ihtimām) & Istighnāʾ (Suppletion) 03_sibawayh_al_kitab (L320, L420) Attention-Salience Prompt/Context Front-Loading & Canonical Alias Collapse: Place highest-information constraints at the head of context windows (anti-"lost-in-the-middle"); prune obsolete duplicate operators when a suppletive canonical primitive covers them.
AK-03 UNTAPPED Semantic-Target Override (al-Ḥaml ʿalā al-Maʿnā) over Surface Type 04_akhfash_maani_al_quran (L484–489) Duck-Typed / Referent-Aware Type Inference in Co-Reference & Tool Binding: When an underspecified surface container (Any, dict, man/mā) dynamically holds a concrete typed referent, resolve downstream agreement and method dispatch from the runtime referent's true type.
AK-05 UNTAPPED Long-Distance Frame Binding Across Parenthetical Interruptions 04_akhfash_maani_al_quran (L4899–4900) Stack-Protected Long-Range Attention Masking / Parenthetical Bypass: Maintain an explicit open-frame stack (ammā ... fa-, try ... finally, nested <think>/tool calls) immune to intermediate digression/parenthetical token decay.
MB-04 UNTAPPED Collision Repair (Iltiqāʾ al-Sākinayn) via Minimal-Conflict Perturbation 05_mubarrad_al_muqtadab (L65–70) Constraint-Guided Conflict Resolution (SAT/Merge Repair): When two incompatible adjacent states collide (dependency conflict, merge conflict, grammar deadlock), select the unique repair transition that minimizes secondary constraint violations.
JD-01 PARTIAL Maximal Feature-Space Separation / Orthogonality Law 06_ibn_durayd_jamhara (L207–213) Orthogonal Ensemble / Diversity-Regularized Decoding & Multi-Agent Design: Penalize near-duplicate representations/candidates in embedding space; force diverse candidate paradigms (taqlībāt) and orthogonal LoRA/expert subspaces to avoid representation collapse.
DI-01 UNTAPPED Bounded-Depth Recursion Guard (Anti-Infinite Regress) 07_ibn_durayd_ishtiqaq (L13–16) Explicit Base-Case / Depth-Bounded Reasoning & RAG Expansion: Define irreducible terminal axioms (al-uwal) before launching recursive agentic decomposition or multi-hop retrieval so search terminates cleanly instead of spiraling.
DI-05 PARTIAL Anti-Arbitrariness Principle (Every Symbol Has Recoverable Grounding) 07_ibn_durayd_ishtiqaq (L17–21) Zero-Unexplained-Symbol Audit for Code & Translation: Flag any opaque magic constant, ungrounded variable, or untranslated proper noun in agent outputs as requiring explicit provenance back to prompt/source/library.
ZI-02 PROVEN Defeasible-Theory Epistemology (Data Overrides Inferred Rule — al-Khalīl's House Metaphor) 08_zajjaji_idah_fi_ilal (L414–415, L454–459) Execution-Truth Supremacy over Heuristic Priors: Treat every learned heuristic, static analyzer warning, or LLM rationale as a defeasible hypothesis; empirical execution / verified ground truth always overrides an inferred rule.
ZI-05 UNTAPPED Exception Isolation (al-Khurūj bi-ʿIllah lā Yanquḍ al-Bāb) 08_zajjaji_idah_fi_ilal (L192–194) Modular Scoped Overrides Without Catastrophic Drift: Handle documented domain exceptions via localized conditional overrides/adapters rather than re-training or distorting global base weights/rules.
ZI-06 PARTIAL Minimal Complete Type System (Entity / Predicate / Connector) 08_zajjaji_idah_fi_ilal (L36–38) Minimal Tripartite IR (Nodes / Operators / Edges): Canonicalize any domain graph (AST, knowledge graph, agent workflow) into exactly 3 primitive types: Entities, State-Transformers, and Relational Connectors.
ZH-04 UNTAPPED Precondition-Gated Correction Operator (Lākin / Bal) 09_zajjaji_huruf_al_maani (L191–194, L199–200) Structured Agent Revision Semantics (OVERRIDE vs. REFINEMENT): Distinguish bal (abort/replace failed plan completely) from lākin (preserve prior negation/constraint while adding targeted exception patch) in multi-turn repair loops.
JK-03 PROVEN Imtināʿ min Naqḍ al-Gharaḍ (Goal-Monotonicity Lock) 10_ibn_jinni_khasais (L1861–1867, L16353–16354) Locked-Invariant Monotonic Repair & Objective Conflict Guard: Never apply an optimization/patch that breaks a previously satisfied objective or passing test; reject candidate edits that violate locked invariants (naqḍ al-gharaḍ).
JS-05 UNTAPPED Anti-Cascaded Mutation Guard (Manʿ Tawālī Iʿlālayn) 11_ibn_jinni_sirr_sinat_irab (L260) Single-Step Rewrite Ceiling / Anti-Over-Normalization Guard: Prohibit stacking two destructive normalizations/mutations consecutively on the same span (preventing information wipeout in text normalization, code refactoring, or multi-pass edits).
AZ-01 UNTAPPED Single-Source Corroboration Quarantine (Tawaqquf Protocol) 13_azhari_tahdhib_al_lughah (L613–616) Multi-Witness Fact Verification & Selective Abstention Gate: Quarantine any uncorroborated single-source RAG/model claim (status=SUSPECT) until independently verified by a tiered trusted witness/tool; abstain (tawaqquf) rather than hallucinate.
FS-01 UNTAPPED 10-Class Speech-Act Router & 3-State Modal Logic (Wājib / Jāʾiz / Mumtaniʿ) 15_ibn_faris_al_sahibi (L2528–2538) Intent/Speech-Act Classifier + Tautology/SAT/UNSAT Spec Triage: Route user prompts by formal illocutionary act (assert vs query vs command vs prohibition) BEFORE tool selection; classify claims into TAUTOLOGY (wājib), CONTINGENT/TESTABLE (jāʾiz), or IMPOSSIBLE/UNSAT (mumtaniʿ).
FS-02 PROVEN Domain-Transfer Semantic Layering (Naql al-Alfāẓ bi-Sharāʾiṭ) 15_ibn_faris_al_sahibi (L834–835, L859–863) Domain-Scoped Terminological Override Tables (Iṣṭilāḥ Layering): Track how ordinary words (thread, yield, socket, ṣalāh, qiyās, zakāh) acquire strict extra preconditions (sharāʾiṭ) inside specialized domains; activate domain overrides strictly when domain markers fire.
FS-03 UNTAPPED Dominance Precedence in Heterogeneous Aggregates (Bāb al-Taghlīb) 15_ibn_faris_al_sahibi (L205–207) Lattice Join / Type-Promotion & Priority Routing Rules: When a mixed-type batch/container or multi-domain query combines heterogeneous items (int + float, safe + high-risk, simple + hard), promote the joint type/route to the highest-precedence dominant class.
FM-02 UNTAPPED Quadriliteral/Quinqueliteral Naḥt Decomposition into Binary Primitives 16_ibn_faris_maqayis_al_lughah (L10200–10214) Complex-Task Decomposition into Atomic Sub-Kernels + Opaque-Primitive Tagging: Decompose complex compound tasks/functions (length $\ge 4$ requirements) into blends of two simpler known primitives; explicitly flag non-decomposable primitives as atomic black-boxes (waḍʿ).

AST/API Contracts, Indexing & Representation (ast_representation · 49 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-01 PROVEN Dhātī vs. ʿAraḍī Feature Partition & Bi-Directional Definition (Ṭard wa-ʿAks) 01_ghazali_mustasfa (L322, L352, L611) Minimal Sufficient Feature Selection & Precision+Recall Specification Gates: Prune accidental/spurious channels; accept a classifier/spec only when both ṭard (precision/soundness) and ʿaks (completeness/boundary rejection) hold.
GH-04 UNTAPPED Tanqīḥ al-Manāṭ & Ilghāʾ al-Fāriq (Causal Distillation) 01_ghazali_mustasfa (L11351, L11367–11368) Minimal-Diff Contrastive Preference Purification: Strip irrelevant stylistic/length confounders (line_sim >= 0.72, `
GH-06 UNTAPPED Non-Generalizability of Exceptional Precedents & Three-Way Conflict Resolution (Taʿāruḍ) 01_ghazali_mustasfa (L13122, L13246, L14782) Quarantine of Hardcoded Edge-Case Patches + 3-Mode Multi-Agent Conflict Arbitrator: Never generalize from ad-hoc/exceptional training examples; when two verifiers/agents conflict, resolve via (1) mutual cancellation + fallback (tasāquṭ), (2) tie-break freedom (takhyīr), or (3) domain-split routing (tafṣīl). Also enforce that identifier/API names are lookup-only (samāʿī), never analogically guessed!
KH-01 PROVEN Al-Taqālīb ($n!$ Combinatorial Search) × Mustaʿmal vs. Muhmal Pruning 02_khalil_al_ayn (L164) Structured Combinatorial Exploration + Deterministic Validity Pruning: Systematically explore orthogonal candidate permutations (on-policy rollouts / AST templates) and deterministically discard invalid (muhmal) branches before scoring.
KH-02 PROVEN Dhalāqah Structural Authenticity Gate & Adversarial Fabrication Detector 02_khalil_al_ayn (L58, L74, L84) O(1) Structural Hallucination & Adversarial Input/Output Filter: Fast distributional-invariant guard (zero-GPU) rejecting impossible long tokens, fabricated API names, or adversarial injections even when surface-plausible.
KH-03 PARTIAL Articulatory-Axis Canonical Ordering (Makhārij Manifold) 02_khalil_al_ayn (L17, L158) Physical/Functional Coordinate Embeddings & Feature-Ordered Indexing: Index vocabulary/symbols along continuous generative-mechanism axes rather than arbitrary lexical/UTF-8 order for compact manifold sharing.
KH-04 PARTIAL Hard Adjacent-Pair Exclusion with Explicit Composition Exception 02_khalil_al_ayn (L179, L19594) Tiered Hard Grammar Masks with Provenance-Aware Escape Hatches: Block illegal token/AST transitions by default, while explicitly exempting cross-module/foreign-FFI/compound boundaries (loanword / external_lib namespace).
KH-05 PROVEN Bounded Radical Arity Taxonomy (2/3/4/5-Slot Canonical Schemas) 02_khalil_al_ayn (L18–22) Fixed-Arity Structured Latent Factorization: Decompose unbounded BPE token streams into fixed-arity canonical tuples (Root, Wazn, Affixes) or (Fāʾ_inputs, ʿAyn_kernel, Lām_contract).
SB-01 PROVEN 5-State Validity × Truthfulness Verification Matrix (Bāb al-Istiqāmah) 03_sibawayh_al_kitab (L325–332) Orthogonal Syntax × Semantics × Runtime Truth Verifier: Separate (1) Mustaqīm Ḥasan (valid + true), (2) Mustaqīm Qabīḥ (runs, bad style/anti-pattern), (3) Mustaqīm Kadhib (runs, wrong spec answer), (4) Muḥāl (type/runtime contradiction), (5) Muḥāl Kadhib (contradiction + false).
SB-02 PROVEN Dual-Layer Surface vs. Governed State Separation (8 Majārī → 4 Surfaces) & *ʿĀmil 03_sibawayh_al_kitab (L142–152, L10713) Typed Governor-Scoped State Machine & Strict Operator-Domain Typing: Disambiguate surface-identical tokens by dynamic governor (ʿāmil) vs static constant (mabnī); enforce strict type-domain signatures on every operator (e.g., jazm → verb only; AST call → typed args).
SB-05 UNTAPPED Al-Tanāzuʿ (Multi-Governor Contention Resolution) 03_sibawayh_al_kitab (L934–936) Locality-Aware Scope Binding & Contention Arbitrator: When two active operators/tools compete for the same shared argument/resource, bind surface ownership to the nearest governor and pass a clean pointer/reference (ḍamīr) to the deferred governor.
SB-06 PARTIAL Priority-First Ordering (al-ʿInāyah wa-l-Ihtimām) & Istighnāʾ (Suppletion) 03_sibawayh_al_kitab (L320, L420) Attention-Salience Prompt/Context Front-Loading & Canonical Alias Collapse: Place highest-information constraints at the head of context windows (anti-"lost-in-the-middle"); prune obsolete duplicate operators when a suppletive canonical primitive covers them.
AK-02 UNTAPPED De Morgan Scope Duality over Negated Disjunctions 04_akhfash_maani_al_quran (L438–443) Formal Logical-Constraint Compiler for Guardrails & Spec Extraction: Automatically compile natural-language prohibitions "Do not do A or B" into ¬A ∧ ¬B (conjunctive safety veto) vs permissions "Do A or B" into A ∨ B (disjunctive satisfaction).
AK-03 UNTAPPED Semantic-Target Override (al-Ḥaml ʿalā al-Maʿnā) over Surface Type 04_akhfash_maani_al_quran (L484–489) Duck-Typed / Referent-Aware Type Inference in Co-Reference & Tool Binding: When an underspecified surface container (Any, dict, man/mā) dynamically holds a concrete typed referent, resolve downstream agreement and method dispatch from the runtime referent's true type.
AK-04 UNTAPPED Set-Exclusion Exception Semantics (Istithnāʾ via Valency Saturation) 04_akhfash_maani_al_quran (L865–868) Saturated-Set Subtraction Operator for Query/Filter Parsing: Model "all X except Y" by evaluating full-predicate satisfaction first (saturating the main clause) and subtracting the residual exception set rather than negating the predicate globally.
MB-03 UNTAPPED Inverse Diagnostic Probing (al-Taṣghīr Yarudd ilā al-Aṣl) 05_mubarrad_al_muqtadab (L9863–9865, L10645) Perturbation / Downscaling Probe for Latent Structure Recovery: Apply a controlled simplifying transform (minimal-input fuzz probe, stripped AST skeleton, reduced-scale instance) that strips superficial wrappers (zawāʾid) and exposes the true underlying root/algorithm (aṣl).
MB-05 UNTAPPED Cross-Operator Semantic Interface Equivalence 05_mubarrad_al_muqtadab (L1279–1281) Behavioral Interface Duck-Typing & Structural Transfer: Allow an output schema/adapter from operator $A$ to serve operator $B$ whenever $A$ and $B$ share behavioral semantics, enabling zero-shot cross-library API substitution.
JD-01 PARTIAL Maximal Feature-Space Separation / Orthogonality Law 06_ibn_durayd_jamhara (L207–213) Orthogonal Ensemble / Diversity-Regularized Decoding & Multi-Agent Design: Penalize near-duplicate representations/candidates in embedding space; force diverse candidate paradigms (taqlībāt) and orthogonal LoRA/expert subspaces to avoid representation collapse.
JD-02 PARTIAL Asymmetric Strength-First Ordering (al-Badʾ bi-l-Aqwā thumma al-Alyan) 06_ibn_durayd_jamhara (L215–220) Fail-Fast / Strongest-Constraint-First Verification Pipeline: Cap homogeneous repetition runs (<3 identical consecutive ops/retries) and always order verification gates from strongest/cheapest deterministic invariant first (Syntax/Type → Live API → Fuzzy LLM judge).
JD-04 UNTAPPED Two-Tier Bucketed Lookup Index (Length × Canonical Alphabet) 06_ibn_durayd_jamhara (L47–53) Sharded Multi-Index Retrieval (Arity/Complexity Partitioning + Fast-Path Isolation): Separate clean common-case ("sound/triliteral") queries into an O(1) fast index and isolate complex/irregular ("weak/augmented/quadriliteral") queries into dedicated handlers.
JD-05 UNTAPPED Transition-Cost Minimization via Nearest-Neighbor Assimilation 06_ibn_durayd_jamhara (L332–336) Minimum-Edit-Distance Type Coercion / Nearest-Valid-Token Projection: When a generated token or type causes a high-cost transition clash with its neighbor, snap it to the nearest valid neighbor in feature space rather than restarting generation.
DI-02 UNTAPPED Adversarial vs. Cooperative Intent-Conditioned Naming / Framing 07_ibn_durayd_ishtiqaq (L27–30) Audience/Threat-Model-Aware Policy Conditioning: Model outputs/defenses differently depending on whether an interface faces external untrusted/adversarial callers (hardened strict validation) vs internal trusted components (ergonomic concise API).
DI-03 PARTIAL Morphological Pattern → Behavioral Property Inference (Mufaʿʿal Intensity) 07_ibn_durayd_ishtiqaq (L69–70) Identifier-Pattern Prior Extraction for Code Understanding: Infer function/class behavioral contracts directly from naming morphology (is_*/has_* → bool, *_cache/*_pool → stateful, *_iter → generator, retry_* → idempotent loop).
ZI-03 PROVEN Information-Theoretic Origin of Structural Markers (Iʿrāb Disambiguates Identical Bags) 08_zajjaji_idah_fi_ilal (L515–518) Role/Dependency Tag Injection at Layer-0: Because bag-of-tokens / raw BPE embeddings are role-blind (subj vs obj, caller vs callee, arg vs return), explicitly inject lightweight structural role embeddings (ʿāmil/maʿmūl AST roles).
ZI-04 PARTIAL Compute/Complexity Load Balancing (Takhfīf al-Thaqīl wa-Ilzām al-Khafīf) 08_zajjaji_idah_fi_ilal (L936, L1079–1081) Asymmetric Compute Budgeting across Pipeline Stages: Offload heavy work away from already-expensive components (e.g., trim/apocopate heavy reasoning loops via fast O(1) deterministic pre-checks; keep heavy models light by attaching extra metadata to cheap CPU/Layer-0 ops).
ZI-05 UNTAPPED Exception Isolation (al-Khurūj bi-ʿIllah lā Yanquḍ al-Bāb) 08_zajjaji_idah_fi_ilal (L192–194) Modular Scoped Overrides Without Catastrophic Drift: Handle documented domain exceptions via localized conditional overrides/adapters rather than re-training or distorting global base weights/rules.
ZI-06 PARTIAL Minimal Complete Type System (Entity / Predicate / Connector) 08_zajjaji_idah_fi_ilal (L36–38) Minimal Tripartite IR (Nodes / Operators / Edges): Canonicalize any domain graph (AST, knowledge graph, agent workflow) into exactly 3 primitive types: Entities, State-Transformers, and Relational Connectors.
ZH-01 UNTAPPED Counterfactual Dual Operators (Law vs. Lawlā) 09_zajjaji_huruf_al_maani (L37–40) Counterfactual Causality Testing (¬A → ¬B Necessity vs. A → ¬B Blocking): Structure ablation & debugging probes explicitly into necessary-cause removal (law: remove component, see if success vanishes) and blocker removal (lawlā: remove blocker, see if success emerges).
ZH-02 UNTAPPED Strict Polarity-Gated Response Protocol (Balā vs. Naʿam) 09_zajjaji_huruf_al_maani (L71–75) Unambiguous Boolean Verification Schemas: Eliminate sycophantic/ambiguous "Yes" answers to negative assertions ("Did it NOT fail? Yes") by enforcing typed 3-way verdicts (AFFIRM_POSITIVE / REFUTE_NEGATIVE / CONFIRM_NEGATIVE) in LLM judges and tool protocols.
ZH-03 UNTAPPED Temporal-Polarity Domain Licensing (Qaṭṭ & Lā Past-Existential Lock) 09_zajjaji_huruf_al_maani (L389–391, L444–447) State-History Immutability & Polarity-Licensed Assertions: Enforce monotonic append-only execution logs (past observed facts cannot be negated without contradiction) and restrict universal-history quantifiers (never/always) strictly to valid polarity/time domains.
ZH-04 UNTAPPED Precondition-Gated Correction Operator (Lākin / Bal) 09_zajjaji_huruf_al_maani (L191–194, L199–200) Structured Agent Revision Semantics (OVERRIDE vs. REFINEMENT): Distinguish bal (abort/replace failed plan completely) from lākin (preserve prior negation/constraint while adding targeted exception patch) in multi-turn repair loops.
ZH-05 PARTIAL Context-Driven Polymorphic Operator Dispatch (ʿAlā 3-way, Siwā 4-way) 09_zajjaji_huruf_al_maani (L310–323) Syntactic-Frame Disambiguation for Overloaded Tokens/Symbols: Resolve overloaded operators (*, +, in, على, ما) deterministically via local grammatical/AST slot signatures before semantic scoring.
JK-06 PROVEN Compositional Generalization (Mā Qīsa ʿalā Kalām al-ʿArab) & Structure-Meaning Isomorphism 10_ibn_jinni_khasais (L5329, L7919) Zero-Shot Compositional Synthesis (P + mean(R) + W) & Structural-Similarity Embeddings: Predict unseen valid compound identifiers/forms compositionally from attested primitives; align structural complexity with semantic complexity.
JS-02 UNTAPPED Articulatory Acoustic-Pipe Generative Model 11_ibn_jinni_sirr_sinat_irab (L335–337) Physics/Mechanism-Grounded Factorized Embeddings: Factorize discrete symbol embeddings into physical/structural constraint vectors (source + constriction + manner) rather than opaque lookup tables.
SK-01 PROVEN Surgical Minimal-Pair Contrast (Taqūl ... wa lā Taqul) 12_ibn_sikkit_islah_al_mantiq (L2488–2490) Diff-Weighted Minimal-Pair Contrastive DPO/SimPO: Pair near-identical (chosen, rejected) sequences differing by 1–few critical tokens (diff_w=4.5, shared_w=0.4) to laser-focus gradients onto exact failure tokens.
SK-02 PARTIAL Single-Bit / Diacritic Semantic Bifurcation (Bāb Faʿl wa-Fiʿl & Hamza Flip) 12_ibn_sikkit_islah_al_mantiq (L494–496, L2657–2660) High-Sensitivity Adversarial Minimal-Edit Test Generation: Auto-synthesize single-character/operator/flag flip test pairs (== vs =, // vs /, <= vs <, hamza/vowel flip) to probe semantic cliffs where tiny surface changes invert meaning.
SK-03 UNTAPPED Valency & Participant-Arity Templates (Fāʿala Binary vs. Afʿala Unary) 12_ibn_sikkit_islah_al_mantiq (L2416–2419) Arity/Symmetry Contract Checking with Documented Overloads: Infer function symmetry/arity expectations (mutual_op(a, b) vs unary_op(a)) and flag unintended arity mismatches while permitting explicit legacy overloads.
SK-04 PROVEN Popular-Drift Purification (Mā Tarakathu al-ʿĀmmah) 12_ibn_sikkit_islah_al_mantiq (L1546, L2429–2430) Web-Corpus Pretraining Prior Debiasing: Explicitly identify high-frequency internet/colloquial errors baked into base LLMs (deprecated APIs, popular coding myths, modern false-friend Arabic meanings) and counteract them with targeted contrastive pairs.
SK-05 UNTAPPED True Synonymy vs. Divergent Homograph Separation 12_ibn_sikkit_islah_al_mantiq (L1660–1662 vs. L494) Equivalence-Class Canonicalization vs. Strict Collision Blocking: Merge harmless syntactic variants (same_meaning → canonicalize) while hard-separating lookalike distinct symbols (different_meaning → block conflation).
AZ-03 PROVEN Primary Ground-Truth Field Verification (Mushāfahah / Execution Grounding) 13_azhari_tahdhib_al_lughah (L93–97) Live-Environment Ground-Truth Anchoring: Prefer direct execution/runtime inspection (pytest, live inspect.signature, verified Mushaf/OpenITI pri witnesses) over secondary commentary or synthetic LLM distillation.
JW-02 UNTAPPED 28×28 Reverse-Suffix Matrix Indexing (Bāb al-Lām, Faṣl al-Fāʾ) 14_jawhari_al_sihah (L1154–1155) Suffix/Return-Type-First Sparse 2D Retrieval Index: Index functions, schemas, or lexical entries primarily by their output/return signature (Lām) and secondarily by input/entry signature (Fāʾ), skipping empty (muhmal) buckets for instant O(1) type-directed retrieval.
JW-03 PROVEN Canonical Root-Key Hashing (Index Under Underlying Radical, Not Surface Mutation) 14_jawhari_al_sihah (L1159–1163) Canonical Normalization Before Embedding/Cache Lookup: Hash mutated surface forms (case variants, aliases, dotless-ى, refactored identifiers) to their canonical root key before caching, RAG lookup, or cross-convention co-reference binding.
JW-04 PROVEN Frequency-Driven Structural Compression with Plural/Inverse Recovery 14_jawhari_al_sihah (L42159–42160, L53202) Reversible Fast-Path Shorthand with Full-Expansion Fallback: Compress high-frequency operations/prompts in the hot path while retaining exact canonical expansion whenever complex/plural edge cases arise.
JW-05 UNTAPPED Explicit Rule-Deviation Tagging (Shādhdh Annotation with Base Law Citation) 14_jawhari_al_sihah (L1371–1372) Self-Documenting Exception Registry: Whenever an API/codebase/grammar item violates a general convention, explicitly store BOTH the violated general law AND the finite enumerated exception set (preventing LLM over-generalization).
FS-03 UNTAPPED Dominance Precedence in Heterogeneous Aggregates (Bāb al-Taghlīb) 15_ibn_faris_al_sahibi (L205–207) Lattice Join / Type-Promotion & Priority Routing Rules: When a mixed-type batch/container or multi-domain query combines heterogeneous items (int + float, safe + high-risk, simple + hard), promote the joint type/route to the highest-precedence dominant class.
FS-04 PROVEN Al-Naḥt (Lossy-Surface / Lossless-Meaning Multi-Word Compression) 15_ibn_faris_al_sahibi (L3919–3920) Compositional Macro-Operation / Pipeline Fusion: Synthesize compact fused compound operators or multi-token speculative chunks from recurring multi-step idioms.
FM-01 PARTIAL Axiomatic Semantic Compression (Maqāyīs Ṣaḥīḥah wa-Uṣūl) 16_ibn_faris_maqayis_al_lughah (L1155–1156, L3760) Low-Rank Semantic Prototype / Root-Axiom Bottleneck: Compress sprawling lexical/API/skill inventories into 1–3 orthogonal core semantic invariants per root/module so models generalize to unseen derivatives without memorization.
FM-03 UNTAPPED Phonetic-Mutation Canonicalization (Ibdāl Deduplication) 16_ibn_faris_maqayis_al_lughah (L7843–7844) Alias/Typo Collapse Before Concept-Graph Insertion: Never mint a spurious new latent root/entity/tool-schema when a candidate is a systematic single-feature variant (ibdāl) of an existing canonical primitive.
FM-04 PARTIAL Explicit Outlier Quarantine (Wa-mimmā Shadhdha ʿan al-Aṣl) 16_ibn_faris_maqayis_al_lughah (L5943, L7944) Residual Outlier Isolation (Anti-Prototype Contamination): Explicitly separate out-of-distribution/non-compositional exceptions into a dedicated residual lookup table instead of forcing a clean prototype vector to stretch and deform around noise.

Provenance, RAG & Data Hygiene (provenance_rag · 26 principles)

ID Status Principle Book & Line AI/SWE Algorithm Pattern
GH-05 PARTIAL Correlation ≠ Causation (Buṭlān al-Ṭard al-Maḥḍ) & Naqḍ vs. *Muʿāraḍah 01_ghazali_mustasfa (L12737–12746, L13391, L13477, L13753–13755) Confounder-Resistant Reward Modeling & Fault-Triage Differentiation: Reject pure observational correlation without interventional sabr; distinguish true invariant failure (naqḍ = bug in rule) from rule-priority override (muʿāraḍah = exception precedence, do not corrupt base rule).
GH-06 UNTAPPED Non-Generalizability of Exceptional Precedents & Three-Way Conflict Resolution (Taʿāruḍ) 01_ghazali_mustasfa (L13122, L13246, L14782) Quarantine of Hardcoded Edge-Case Patches + 3-Mode Multi-Agent Conflict Arbitrator: Never generalize from ad-hoc/exceptional training examples; when two verifiers/agents conflict, resolve via (1) mutual cancellation + fallback (tasāquṭ), (2) tie-break freedom (takhyīr), or (3) domain-split routing (tafṣīl). Also enforce that identifier/API names are lookup-only (samāʿī), never analogically guessed!
KH-02 PROVEN Dhalāqah Structural Authenticity Gate & Adversarial Fabrication Detector 02_khalil_al_ayn (L58, L74, L84) O(1) Structural Hallucination & Adversarial Input/Output Filter: Fast distributional-invariant guard (zero-GPU) rejecting impossible long tokens, fabricated API names, or adversarial injections even when surface-plausible.
KH-04 PARTIAL Hard Adjacent-Pair Exclusion with Explicit Composition Exception 02_khalil_al_ayn (L179, L19594) Tiered Hard Grammar Masks with Provenance-Aware Escape Hatches: Block illegal token/AST transitions by default, while explicitly exempting cross-module/foreign-FFI/compound boundaries (loanword / external_lib namespace).
SB-02 PROVEN Dual-Layer Surface vs. Governed State Separation (8 Majārī → 4 Surfaces) & *ʿĀmil 03_sibawayh_al_kitab (L142–152, L10713) Typed Governor-Scoped State Machine & Strict Operator-Domain Typing: Disambiguate surface-identical tokens by dynamic governor (ʿāmil) vs static constant (mabnī); enforce strict type-domain signatures on every operator (e.g., jazm → verb only; AST call → typed args).
AK-04 UNTAPPED Set-Exclusion Exception Semantics (Istithnāʾ via Valency Saturation) 04_akhfash_maani_al_quran (L865–868) Saturated-Set Subtraction Operator for Query/Filter Parsing: Model "all X except Y" by evaluating full-predicate satisfaction first (saturating the main clause) and subtracting the residual exception set rather than negating the predicate globally.
JD-03 PROVEN Strict Authenticity Rejection Gate (Fardudhu) 06_ibn_durayd_jamhara (L204–206, L298–301) Zero-Hesitation OOD / Hallucinated-Symbol Circuit Breaker: Reject generated symbols/imports/citations that violate domain structural invariants immediately rather than trying to softly repair fabricated artifacts.
DI-01 UNTAPPED Bounded-Depth Recursion Guard (Anti-Infinite Regress) 07_ibn_durayd_ishtiqaq (L13–16) Explicit Base-Case / Depth-Bounded Reasoning & RAG Expansion: Define irreducible terminal axioms (al-uwal) before launching recursive agentic decomposition or multi-hop retrieval so search terminates cleanly instead of spiraling.
DI-04 PARTIAL Multi-Hypothesis Origin Tracking (Preserve Ambiguous Provenance) 07_ibn_durayd_ishtiqaq (L146) Top-$k$ Hypothesis Beam Retention under Equivocal Evidence: When an identifier, bug trace, or ambiguous spec admits 2+ valid derivations, maintain a small hypothesis set until disambiguating execution evidence arrives (avoid premature argmax collapse).
DI-05 PARTIAL Anti-Arbitrariness Principle (Every Symbol Has Recoverable Grounding) 07_ibn_durayd_ishtiqaq (L17–21) Zero-Unexplained-Symbol Audit for Code & Translation: Flag any opaque magic constant, ungrounded variable, or untranslated proper noun in agent outputs as requiring explicit provenance back to prompt/source/library.
ZI-05 UNTAPPED Exception Isolation (al-Khurūj bi-ʿIllah lā Yanquḍ al-Bāb) 08_zajjaji_idah_fi_ilal (L192–194) Modular Scoped Overrides Without Catastrophic Drift: Handle documented domain exceptions via localized conditional overrides/adapters rather than re-training or distorting global base weights/rules.
ZI-06 PARTIAL Minimal Complete Type System (Entity / Predicate / Connector) 08_zajjaji_idah_fi_ilal (L36–38) Minimal Tripartite IR (Nodes / Operators / Edges): Canonicalize any domain graph (AST, knowledge graph, agent workflow) into exactly 3 primitive types: Entities, State-Transformers, and Relational Connectors.
ZH-03 UNTAPPED Temporal-Polarity Domain Licensing (Qaṭṭ & Lā Past-Existential Lock) 09_zajjaji_huruf_al_maani (L389–391, L444–447) State-History Immutability & Polarity-Licensed Assertions: Enforce monotonic append-only execution logs (past observed facts cannot be negated without contradiction) and restrict universal-history quantifiers (never/always) strictly to valid polarity/time domains.
ZH-04 UNTAPPED Precondition-Gated Correction Operator (Lākin / Bal) 09_zajjaji_huruf_al_maani (L191–194, L199–200) Structured Agent Revision Semantics (OVERRIDE vs. REFINEMENT): Distinguish bal (abort/replace failed plan completely) from lākin (preserve prior negation/constraint while adding targeted exception patch) in multi-turn repair loops.
JK-04 UNTAPPED Al-Iḥtiyāṭ fī Waṣf al-ʿIllah (Maximal Precondition Specification) 10_ibn_jinni_khasais (L2120–2121, L2166–2167) Upfront Invariant Specification vs. Ad-Hoc Patch Sprawl: Encode boundary conditions directly inside rule/prompt/function preconditions rather than layering brittle post-hoc exception patches (if special_case_17:).
AZ-01 UNTAPPED Single-Source Corroboration Quarantine (Tawaqquf Protocol) 13_azhari_tahdhib_al_lughah (L613–616) Multi-Witness Fact Verification & Selective Abstention Gate: Quarantine any uncorroborated single-source RAG/model claim (status=SUSPECT) until independently verified by a tiered trusted witness/tool; abstain (tawaqquf) rather than hallucinate.
AZ-02 PARTIAL Dataset Corruption & Taṣḥīf (OCR/Transcription Error) Purification 13_azhari_tahdhib_al_lughah (L82–87) Pre-Training / Fine-Tuning Corpus Sanitation & Noise-Lineage Auditing: Actively audit training corpora for OCR/dot-confusion/synthetic-contamination errors (taṣḥīf) and publish explicit error-correction logs rather than blindly ingesting scale.
AZ-03 PROVEN Primary Ground-Truth Field Verification (Mushāfahah / Execution Grounding) 13_azhari_tahdhib_al_lughah (L93–97) Live-Environment Ground-Truth Anchoring: Prefer direct execution/runtime inspection (pytest, live inspect.signature, verified Mushaf/OpenITI pri witnesses) over secondary commentary or synthetic LLM distillation.
AZ-05 UNTAPPED Selective Credit Preservation (Taṣḥīḥ Without Blanket Discard) 13_azhari_tahdhib_al_lughah (L607–612) Granular Per-Sample Filtering over Dataset-Level Blanket Rejection: Score and quarantine individual noisy rows/assertions rather than discarding an entire high-value dataset or model checkpoint due to isolated defects.
JW-01 PROVEN Precision-Only Curation (Mā Ṣaḥḥa ʿIndī) + Tri-Modal Verification 14_jawhari_al_sihah (L1152, L1156) High-Precision Goldilocks Curation via 3-Axis Verification (Lineage × Analytical Check × Live Execution): Smaller 100%-verified datasets beat massive noisy dumps when every item passes transmission provenance (riwāyah), structural logic (dirāyah), and live test (mushāfahah).
JW-03 PROVEN Canonical Root-Key Hashing (Index Under Underlying Radical, Not Surface Mutation) 14_jawhari_al_sihah (L1159–1163) Canonical Normalization Before Embedding/Cache Lookup: Hash mutated surface forms (case variants, aliases, dotless-ى, refactored identifiers) to their canonical root key before caching, RAG lookup, or cross-convention co-reference binding.
JW-05 UNTAPPED Explicit Rule-Deviation Tagging (Shādhdh Annotation with Base Law Citation) 14_jawhari_al_sihah (L1371–1372) Self-Documenting Exception Registry: Whenever an API/codebase/grammar item violates a general convention, explicitly store BOTH the violated general law AND the finite enumerated exception set (preventing LLM over-generalization).
FS-02 PROVEN Domain-Transfer Semantic Layering (Naql al-Alfāẓ bi-Sharāʾiṭ) 15_ibn_faris_al_sahibi (L834–835, L859–863) Domain-Scoped Terminological Override Tables (Iṣṭilāḥ Layering): Track how ordinary words (thread, yield, socket, ṣalāh, qiyās, zakāh) acquire strict extra preconditions (sharāʾiṭ) inside specialized domains; activate domain overrides strictly when domain markers fire.
FS-03 UNTAPPED Dominance Precedence in Heterogeneous Aggregates (Bāb al-Taghlīb) 15_ibn_faris_al_sahibi (L205–207) Lattice Join / Type-Promotion & Priority Routing Rules: When a mixed-type batch/container or multi-domain query combines heterogeneous items (int + float, safe + high-risk, simple + hard), promote the joint type/route to the highest-precedence dominant class.
FS-05 UNTAPPED Contextual Ellipsis Expansion (Ḥadhf al-Muḍāf) & Literal/Figurative Boundary 15_ibn_faris_al_sahibi (L2819–2824, L2969–2974) Implicit-Object Resolution & Literal-vs-Metaphorical Tool Disambiguation: Recover omitted intermediate objects in shorthand user prompts ("delete the user's repo" → "delete repo record + storage") and distinguish literal spec requirements (ḥaqīqah) from illustrative analogies (majāz).
FM-04 PARTIAL Explicit Outlier Quarantine (Wa-mimmā Shadhdha ʿan al-Aṣl) 16_ibn_faris_maqayis_al_lughah (L5943, L7944) Residual Outlier Isolation (Anti-Prototype Contamination): Explicitly separate out-of-distribution/non-compositional exceptions into a dedicated residual lookup table instead of forcing a clean prototype vector to stretch and deform around noise.