@o-lang/olang 1.2.20 → 1.2.21
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 +1 -1
- package/src/runtime/RuntimeAPI.js +21 -15
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ const path = require('path');
|
|
|
3
3
|
const crypto = require('crypto'); // ✅ CRYPTOGRAPHIC AUDIT LOGS
|
|
4
4
|
|
|
5
5
|
// ✅ O-Lang Kernel Version (Safety Logic & Governance Rules)
|
|
6
|
-
const KERNEL_VERSION = '1.2.
|
|
6
|
+
const KERNEL_VERSION = '1.2.20-alpha'; // 🔁 Update when safety rules change
|
|
7
7
|
|
|
8
8
|
class RuntimeAPI {
|
|
9
9
|
constructor({ verbose = false } = {}) {
|
|
@@ -816,6 +816,9 @@ class RuntimeAPI {
|
|
|
816
816
|
{ pattern: /\b(?:tumir|bhadhar)\s*a\b/i, capability: 'unauthorized_action', lang: 'sn' },
|
|
817
817
|
{ pattern: /\b(tumir\s*a\s+(?:mhando|ari))\b/i, capability: 'transfer', lang: 'sn' },
|
|
818
818
|
{ pattern: /\b(bhadhara|bhadharis\s*o)\b/i, capability: 'payment', lang: 'sn' },
|
|
819
|
+
{ pattern: /\b(ranṣẹ\s+(?:owo|pesa|kuɗi|ego)|fi\s+.*\s+ranṣẹ)\b/i, capability: 'transfer', lang: 'yo' }, // Yoruba "Send money"
|
|
820
|
+
{ pattern: /\b(zipu\s+(?:ego|moni)|zi\s+.*\s+zipu)\b/i, capability: 'transfer', lang: 'ig' }, // Igbo "Send money"
|
|
821
|
+
{ pattern: /\b(aika\s+(?:kuɗi)|turo\s+.*\s+aika)\b/i, capability: 'transfer', lang: 'ha' }, // Hausa "Send money"
|
|
819
822
|
// ────────────────────────────────────────────────
|
|
820
823
|
// 🌐 GLOBAL LANGUAGES
|
|
821
824
|
// ────────────────────────────────────────────────
|
|
@@ -852,20 +855,23 @@ class RuntimeAPI {
|
|
|
852
855
|
c.includes('withdraw')
|
|
853
856
|
);
|
|
854
857
|
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
858
|
+
if (!hasCapability) {
|
|
859
|
+
const match = output.match(pattern);
|
|
860
|
+
|
|
861
|
+
// ✅ Explicitly flag African & Financial context for Audit Logs
|
|
862
|
+
const isAfrican = ['yo', 'ig', 'ha', 'sw', 'zu', 'am', 'om', 'ff', 'so', 'sn'].includes(lang);
|
|
863
|
+
const isFinancial = ['transfer', 'payment', 'withdrawal', 'deposit', 'financial_action'].includes(capability);
|
|
864
|
+
|
|
865
|
+
return {
|
|
866
|
+
passed: false,
|
|
867
|
+
reason: `Hallucinated "${capability}" capability in ${lang}...`,
|
|
868
|
+
detected: match ? match[0].trim() : 'unknown pattern',
|
|
869
|
+
language: lang,
|
|
870
|
+
african_language_detected: isAfrican,
|
|
871
|
+
financial_expression_found: isFinancial,
|
|
872
|
+
capability_attempted: capability
|
|
873
|
+
};
|
|
874
|
+
}
|
|
869
875
|
// -----------------------------
|
|
870
876
|
// ✅ CRITICAL FIX: Resolver output unwrapping helper
|
|
871
877
|
// -----------------------------
|