@o-lang/olang 1.2.25 → 1.2.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o-lang/olang",
3
- "version": "1.2.25",
3
+ "version": "1.2.26",
4
4
  "author": "Olalekan Ogundipe <info@olang.cloud>",
5
5
  "description": "O-Lang: A governance language for user-directed, rule-enforced agent workflows",
6
6
  "main": "./src/runtime/index.js",
@@ -721,6 +721,9 @@ class RuntimeAPI {
721
721
  });
722
722
  }
723
723
 
724
+ // -----------------------------
725
+ // ✅ KERNEL-LEVEL INPUT VALIDATION (Pre-Flight Safety)
726
+ // -----------------------------
724
727
  // -----------------------------
725
728
  // ✅ KERNEL-LEVEL INPUT VALIDATION (Pre-Flight Safety)
726
729
  // -----------------------------
@@ -732,9 +735,7 @@ class RuntimeAPI {
732
735
  const text = inputs[field];
733
736
  if (!text || typeof text !== 'string') continue;
734
737
 
735
- // Re-use the exact same forbiddenPatterns from _validateLLMOutput
736
- // 🔒 CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION
737
- // 🔒 CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION (INPUT)
738
+ // 🔒 CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION (INPUT)
738
739
  const forbiddenPatterns = [
739
740
  // ────────────────────────────────────────────────
740
741
  // 🇳🇬 NIGERIAN LANGUAGES (Fixed Unicode Boundaries)
@@ -750,37 +751,51 @@ class RuntimeAPI {
750
751
  { pattern: /\b(?:ń|ǹ|n)\s+(?:fi|san|gba)/i, capability: 'unauthorized_action', lang: 'yo' },
751
752
  { pattern: /\b(mo\s+ti\s+(?:fi|san|gba))/i, capability: 'unauthorized_action', lang: 'yo' },
752
753
 
753
- // HAUSA: Removed trailing \b after 'ɗi' and 'kuɗi'
754
+ // HAUSA: FIXED - Aggressive Substring Match (No Boundaries)
755
+ { pattern: /aika.*ku[ɗd]i/i, capability: 'transfer', lang: 'ha' }, // Matches "Aika ... kuɗi" anywhere
754
756
  { pattern: /ciyar\s*(?:da)?/i, capability: 'transfer', lang: 'ha' },
755
757
  { pattern: /shiga\s+kuɗi/i, capability: 'transfer', lang: 'ha' },
756
- { pattern: /aika\s+(?:kuɗi)/i, capability: 'transfer', lang: 'ha' },
757
758
  { pattern: /turo\s+.*\s+aika/i, capability: 'transfer', lang: 'ha' },
758
759
  { pattern: /biya\s*(?:da)?/i, capability: 'payment', lang: 'ha' },
759
760
  { pattern: /sahaw[ae]\s+kuɗi/i, capability: 'withdrawal', lang: 'ha' },
760
- { pattern: /\b(?:ya|ta|su)\s+(?:ciyar|biya|sahawa|sake)/i, capability: 'unauthorized_action', lang: 'ha' },
761
- { pattern: /\b(?:za\sa|za\s+ta)\s+(?:ciyar|biya)/i, capability: 'unauthorized_action', lang: 'ha' },
762
- { pattern: /\b(ina\s+(?:ciyar|biya|sahawa))/i, capability: 'unauthorized_action', lang: 'ha' },
761
+ { pattern: /(?:ya|ta|su)\s+(?:ciyar|biya|sahawa|sake)/i, capability: 'unauthorized_action', lang: 'ha' },
762
+ { pattern: /(?:za\sa|za\s+ta)\s+(?:ciyar|biya)/i, capability: 'unauthorized_action', lang: 'ha' },
763
+ { pattern: /ina\s+(?:ciyar|biya|sahawa)/i, capability: 'unauthorized_action', lang: 'ha' },
763
764
 
764
765
  // IGBO: Removed trailing \b after 'igo'
765
766
  { pattern: /zipu\s+(?:ego|moni|isi|na)/i, capability: 'transfer', lang: 'ig' },
766
767
  { pattern: /buru\s+(?:ego|moni|isi)/i, capability: 'transfer', lang: 'ig' },
767
768
  { pattern: /zi\s+.*\s+zipu/i, capability: 'transfer', lang: 'ig' },
768
769
  { pattern: /tinye\s+(?:ego|moni|isi)/i, capability: 'deposit', lang: 'ig' },
769
- { pattern: /\b(?:ziri|bururu|tinyere|gbara)/i, capability: 'unauthorized_action', lang: 'ig' },
770
- { pattern: /\b(m\s+(?:ziri|buru|zipuru|tinyere))/i, capability: 'unauthorized_action', lang: 'ig' },
771
-
772
- // SWAHILI
773
- { pattern: /\b(tuma\s+(?:pesa|fedha)|pelek[ae]?\s+(?:pesa|fedha)|wasilisha)\b/i, capability: 'transfer', lang: 'sw' },
774
- { pattern: /\b(lipa|maliza\s+malipo)\b/i, capability: 'payment', lang: 'sw' },
775
- { pattern: /\b(ongez[ae]?\s*(?:kiasi|pesa|fedha)|wek[ae]?\s+(?:katika|ndani)\s+(?:akaunti|hisa))\b/i, capability: 'deposit', lang: 'sw' },
776
- { pattern: /\b(nime(?:tuma|lipa|ongeza|weka|peleka))\b/i, capability: 'unauthorized_action', lang: 'sw' },
777
-
778
- // OTHER AFRICAN (Amharic, Somali, Zulu, etc.)
770
+ { pattern: /(?:ziri|bururu|tinyere|gbara)/i, capability: 'unauthorized_action', lang: 'ig' },
771
+ { pattern: /m\s+(?:ziri|buru|zipuru|tinyere)/i, capability: 'unauthorized_action', lang: 'ig' },
772
+
773
+ // SWAHILI: ✅ FIXED - Catch Conjugated Forms (ni-li-pe, a-li-pe)
774
+ { pattern: /tuma\s+(?:pesa|fedha)/i, capability: 'transfer', lang: 'sw' },
775
+ { pattern: /pelek[ae]?\s+(?:pesa|fedha)/i, capability: 'transfer', lang: 'sw' },
776
+ { pattern: /wasilisha/i, capability: 'transfer', lang: 'sw' },
777
+ { pattern: /lipa/i, capability: 'payment', lang: 'sw' }, // Simple root match for 'nilipe', 'alipa', etc.
778
+ { pattern: /maliza\s+malipo/i, capability: 'payment', lang: 'sw' },
779
+ { pattern: /ongez[ae]?\s*(?:kiasi|pesa|fedha)/i, capability: 'deposit', lang: 'sw' },
780
+ { pattern: /wek[ae]?\s+(?:katika|ndani)\s+(?:akaunti|hisa)/i, capability: 'deposit', lang: 'sw' },
781
+ { pattern: /nime(?:tuma|lipa|ongeza|weka|peleka)/i, capability: 'unauthorized_action', lang: 'sw' },
782
+
783
+ // OTHER AFRICAN: ✅ FIXED - Direct Unicode Substring
784
+ // Amharic: Match roots anywhere
785
+ { pattern: /ላክ/i, capability: 'transfer', lang: 'am' }, // Root for 'Send'
786
+ { pattern: /ገባ/i, capability: 'deposit', lang: 'am' }, // Root for 'Deposit'
787
+ { pattern: /ክፈል/i, capability: 'payment', lang: 'am' }, // Root for 'Pay'
779
788
  { pattern: /[\u1200-\u137F]{0,4}(?:ተላላፈ|ላክ|ክፈል|ጨምር|ወጣ|ገባ)[\u1200-\u137F]{0,2}/u, capability: 'financial_action', lang: 'am' },
780
- { pattern: /\b(dir\s+(?:lacag|maal|qarsoon))\b/i, capability: 'transfer', lang: 'so' },
781
- { pattern: /\b(bixi|bixis\s*o)\b/i, capability: 'payment', lang: 'so' },
782
- { pattern: /\b(thumel\s*a\s+(?:imali))\b/i, capability: 'transfer', lang: 'zu' },
783
- { pattern: /\b(hlawul\s*a|hlawulel\s*a)\b/i, capability: 'payment', lang: 'zu' },
789
+
790
+ // Somali
791
+ { pattern: /dir\s+(?:lacag|maal|qarsoon)/i, capability: 'transfer', lang: 'so' },
792
+ { pattern: /bixi|bixis\s*o/i, capability: 'payment', lang: 'so' },
793
+
794
+ // Zulu: ✅ FIXED - Handle Subject Concords (u-thumela, ngi-hlawule)
795
+ { pattern: /thumel/i, capability: 'transfer', lang: 'zu' }, // Matches root inside uthumela, ngithumela
796
+ { pattern: /thumel.*imali/i, capability: 'transfer', lang: 'zu' },
797
+ { pattern: /hlawul/i, capability: 'payment', lang: 'zu' }, // Matches root inside hlawula, ngihlawule
798
+ { pattern: /hlawul.*imali/i, capability: 'payment', lang: 'zu' },
784
799
 
785
800
  // ────────────────────────────────────────────────
786
801
  // 🌐 GLOBAL LANGUAGES
@@ -795,8 +810,8 @@ class RuntimeAPI {
795
810
  // 🛡️ PII & EVASION
796
811
  // ────────────────────────────────────────────────
797
812
  { pattern: /\b(?:\+?234\s*|0)(?:70|80|81|90|91)\d{8}\b/, capability: 'pii_exposure', lang: 'multi' },
798
- { pattern: /\b(?:bvn|bank verification number)\s*[:\-]?\s*(\d{11})\b/i, capability: 'pii_exposure', lang: 'multi' },
799
- { pattern: /\b(?:account|acct|a\/c|akaunti|asusu|hesabu|namba|#)\s*[:\-—–]?\s*(\d{6,})\b/i, capability: 'pii_exposure', lang: 'multi' },
813
+ { pattern: /bvn\s*[:\-]?\s*(\d{11})/i, capability: 'pii_exposure', lang: 'multi' }, // Relaxed boundary
814
+ { pattern: /(?:account|acct|a\/c|akaunti|asusu|hesabu|namba|#)\s*[:\-—–]?\s*(\d{6,})/i, capability: 'pii_exposure', lang: 'multi' }, // Relaxed boundary
800
815
  { pattern: /\b(successful(?:ly)?|confirmed|approved|completed|processed|verified|imethibitishwa|imefanikiwa)\b/i, capability: 'deceptive_claim', lang: 'multi' },
801
816
  ];
802
817
 
@@ -833,7 +848,6 @@ class RuntimeAPI {
833
848
  return { passed: true };
834
849
  }
835
850
 
836
-
837
851
  // -----------------------------
838
852
  // ✅ KERNEL-LEVEL LLM HALLUCINATION PREVENTION (CONJUGATION-AWARE + EVASION-RESISTANT)
839
853
  // -----------------------------