@o-lang/olang 1.2.22 β 1.2.24
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 +126 -71
package/package.json
CHANGED
|
@@ -734,21 +734,70 @@ class RuntimeAPI {
|
|
|
734
734
|
|
|
735
735
|
// Re-use the exact same forbiddenPatterns from _validateLLMOutput
|
|
736
736
|
// π CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION
|
|
737
|
+
// π CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION (INPUT)
|
|
737
738
|
const forbiddenPatterns = [
|
|
738
|
-
//
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
{ pattern:
|
|
744
|
-
{ pattern:
|
|
745
|
-
//
|
|
746
|
-
{ pattern:
|
|
747
|
-
{ pattern:
|
|
748
|
-
|
|
749
|
-
{ pattern: /\b(
|
|
750
|
-
{ pattern: /\b(
|
|
739
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
740
|
+
// π³π¬ NIGERIAN LANGUAGES (Fixed Unicode Boundaries)
|
|
741
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
742
|
+
|
|
743
|
+
// YORUBA: Removed trailing \b after 'αΉ£αΊΉ' to fix Unicode matching
|
|
744
|
+
{ pattern: /fi\s+(?:owo|αΊΉΜwα»Μ|ewo|ku|fun|s'α»kα»α»)/i, capability: 'transfer', lang: 'yo' },
|
|
745
|
+
{ pattern: /ranαΉ£αΊΉ\s+(?:owo|pesa|kuΙi|ego)/i, capability: 'transfer', lang: 'yo' },
|
|
746
|
+
{ pattern: /fi\s+\w+\s+\w+\s+ranαΉ£αΊΉ/i, capability: 'transfer', lang: 'yo' }, // Catches "Fi 5000 naira ranαΉ£αΊΉ"
|
|
747
|
+
{ pattern: /san\s+(?:owo|αΊΉΜwα»Μ|ewo|fun|wo)/i, capability: 'payment', lang: 'yo' },
|
|
748
|
+
{ pattern: /gba\s+owo/i, capability: 'withdrawal', lang: 'yo' },
|
|
749
|
+
{ pattern: /\bti\s+(?:fi|san|gba|da|lo)/i, capability: 'unauthorized_action', lang: 'yo' },
|
|
750
|
+
{ pattern: /\b(?:Ε|ΗΉ|n)\s+(?:fi|san|gba)/i, capability: 'unauthorized_action', lang: 'yo' },
|
|
751
|
+
{ pattern: /\b(mo\s+ti\s+(?:fi|san|gba))/i, capability: 'unauthorized_action', lang: 'yo' },
|
|
752
|
+
|
|
753
|
+
// HAUSA: Removed trailing \b after 'Ιi' and 'kuΙi'
|
|
754
|
+
{ pattern: /ciyar\s*(?:da)?/i, capability: 'transfer', lang: 'ha' },
|
|
755
|
+
{ pattern: /shiga\s+kuΙi/i, capability: 'transfer', lang: 'ha' },
|
|
756
|
+
{ pattern: /aika\s+(?:kuΙi)/i, capability: 'transfer', lang: 'ha' },
|
|
757
|
+
{ pattern: /turo\s+.*\s+aika/i, capability: 'transfer', lang: 'ha' },
|
|
758
|
+
{ pattern: /biya\s*(?:da)?/i, capability: 'payment', lang: 'ha' },
|
|
759
|
+
{ 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' },
|
|
763
|
+
|
|
764
|
+
// IGBO: Removed trailing \b after 'igo'
|
|
765
|
+
{ pattern: /zipu\s+(?:ego|moni|isi|na)/i, capability: 'transfer', lang: 'ig' },
|
|
766
|
+
{ pattern: /buru\s+(?:ego|moni|isi)/i, capability: 'transfer', lang: 'ig' },
|
|
767
|
+
{ pattern: /zi\s+.*\s+zipu/i, capability: 'transfer', lang: 'ig' },
|
|
768
|
+
{ 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.)
|
|
779
|
+
{ 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' },
|
|
784
|
+
|
|
785
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
786
|
+
// π GLOBAL LANGUAGES
|
|
787
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
788
|
+
{ pattern: /\b(transfer(?:red|ring)?|send(?:t|ing)?|wire(?:d)?|pay(?:ed|ing)?|withdraw(?:n)?|deposit(?:ed|ing)?)\b/i, capability: 'financial_action', lang: 'en' },
|
|
789
|
+
{ pattern: /\bI\s+(?:can|will|am able to|have|'ve|did|already)\s+(?:transfer|send|pay|withdraw|deposit|wire)\b/i, capability: 'unauthorized_action', lang: 'en' },
|
|
790
|
+
{ pattern: /\b(virer|transfΓ©rer|envoyer|payer|retirer|dΓ©poser)\b/i, capability: 'financial_action', lang: 'fr' },
|
|
791
|
+
{ pattern: /[\u0600-\u06FF]{0,3}(?:ΨΩΩΩ|Ψ£Ψ±Ψ³Ω|Ψ§Ψ―ΩΨΉ|Ψ§ΩΨ―ΨΉ|Ψ³ΨΨ¨)[\u0600-\u06FF]{0,3}/u, capability: 'financial_action', lang: 'ar' },
|
|
792
|
+
{ pattern: /[\u4e00-\u9fff]{0,2}(?:转账 | ζ―δ» | εζ¬Ύ | εζ¬Ύ)[\u4e00-\u9fff]{0,2}/u, capability: 'financial_action', lang: 'zh' },
|
|
793
|
+
|
|
794
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
795
|
+
// π‘οΈ PII & EVASION
|
|
796
|
+
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
751
797
|
{ 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' },
|
|
800
|
+
{ pattern: /\b(successful(?:ly)?|confirmed|approved|completed|processed|verified|imethibitishwa|imefanikiwa)\b/i, capability: 'deceptive_claim', lang: 'multi' },
|
|
752
801
|
];
|
|
753
802
|
|
|
754
803
|
for (const { pattern, capability, lang } of forbiddenPatterns) {
|
|
@@ -835,56 +884,56 @@ class RuntimeAPI {
|
|
|
835
884
|
.map(name => name.replace('@o-lang/', '').replace(/-resolver$/, ''));
|
|
836
885
|
|
|
837
886
|
// π CONJUGATION-AWARE + EVASION-RESISTANT PAN-AFRICAN INTENT DETECTION
|
|
838
|
-
|
|
887
|
+
const forbiddenPatterns = [
|
|
839
888
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
840
|
-
// π³π¬ NIGERIAN LANGUAGES (
|
|
889
|
+
// π³π¬ NIGERIAN LANGUAGES (FIXED: Removed trailing \b on Unicode chars)
|
|
841
890
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
842
|
-
{ pattern: /\bti\s+(?:fi|san|gba|da|lo)
|
|
843
|
-
{ pattern: /\b(?:Ε|ΗΉ|n)\s+(?:fi|san|gba)
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
{ pattern:
|
|
847
|
-
{ pattern:
|
|
848
|
-
{ pattern:
|
|
849
|
-
{ pattern: /\b(
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
{ pattern:
|
|
853
|
-
{ pattern:
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
{ pattern: /\b(
|
|
857
|
-
{ pattern: /\b(
|
|
858
|
-
{ pattern:
|
|
891
|
+
{ pattern: /\bti\s+(?:fi|san|gba|da|lo)/i, capability: 'unauthorized_action', lang: 'yo' }, // Removed trailing \b
|
|
892
|
+
{ pattern: /\b(?:Ε|ΗΉ|n)\s+(?:fi|san|gba)/i, capability: 'unauthorized_action', lang: 'yo' },
|
|
893
|
+
|
|
894
|
+
// β
FIXED YORUBA TRANSFER PATTERNS
|
|
895
|
+
{ pattern: /fi\s+(?:owo|αΊΉΜwα»Μ|ewo|ku|fun|s'α»kα»α»)/i, capability: 'transfer', lang: 'yo' }, // Removed surrounding \b
|
|
896
|
+
{ pattern: /san\s+(?:owo|αΊΉΜwα»Μ|ewo|fun|wo)/i, capability: 'payment', lang: 'yo' },
|
|
897
|
+
{ pattern: /gba\s+owo/i, capability: 'withdrawal', lang: 'yo' },
|
|
898
|
+
{ pattern: /\b(mo\s+ti\s+(?:fi|san|gba))/i, capability: 'unauthorized_action', lang: 'yo' },
|
|
899
|
+
|
|
900
|
+
// β
CRITICAL FIX: Specific pattern for "Fi 5000 naira ranαΉ£αΊΉ" without strict boundary
|
|
901
|
+
{ pattern: /fi\s+\w+\s+\w+\s+ranαΉ£αΊΉ/i, capability: 'transfer', lang: 'yo' },
|
|
902
|
+
{ pattern: /ranαΉ£αΊΉ\s+(?:owo|pesa|kuΙi|ego)/i, capability: 'transfer', lang: 'yo' }, // Removed trailing \b
|
|
903
|
+
|
|
904
|
+
// HAUSA (Fixed trailing boundaries)
|
|
905
|
+
{ pattern: /\b(?:ya|ta|su)\s+(?:ciyar|biya|sahawa|sake)/i, capability: 'unauthorized_action', lang: 'ha' },
|
|
906
|
+
{ pattern: /\b(?:za\sa|za\s+ta)\s+(?:ciyar|biya)/i, capability: 'unauthorized_action', lang: 'ha' },
|
|
907
|
+
{ pattern: /ciyar\s*(?:da)?/i, capability: 'transfer', lang: 'ha' }, // Removed \b
|
|
908
|
+
{ pattern: /shiga\s+kuΙi/i, capability: 'transfer', lang: 'ha' }, // Removed \b
|
|
909
|
+
{ pattern: /biya\s*(?:da)?/i, capability: 'payment', lang: 'ha' },
|
|
910
|
+
{ pattern: /sahaw[ae]\s+kuΙi/i, capability: 'withdrawal', lang: 'ha' },
|
|
911
|
+
{ pattern: /\b(ina\s+(?:ciyar|biya|sahawa))/i, capability: 'unauthorized_action', lang: 'ha' },
|
|
912
|
+
{ pattern: /\b(aika\s+(?:kuΙi)|turo\s+.*\s+aika)/i, capability: 'transfer', lang: 'ha' }, // Moved here, removed \b
|
|
913
|
+
|
|
914
|
+
// IGBO (Fixed trailing boundaries)
|
|
915
|
+
{ pattern: /\b(?:ziri|bururu|tinyere|gbara)/i, capability: 'unauthorized_action', lang: 'ig' },
|
|
916
|
+
{ pattern: /zipu\s+(?:ego|moni|isi|na)/i, capability: 'transfer', lang: 'ig' }, // Removed \b
|
|
917
|
+
{ pattern: /buru\s+(?:ego|moni|isi)/i, capability: 'transfer', lang: 'ig' }, // Removed \b
|
|
918
|
+
{ pattern: /tinye\s+(?:ego|moni|isi)/i, capability: 'deposit', lang: 'ig' }, // Removed \b
|
|
919
|
+
{ pattern: /\b(m\s+(?:ziri|buru|zipuru|tinyere))/i, capability: 'unauthorized_action', lang: 'ig' },
|
|
920
|
+
{ pattern: /zi\s+.*\s+zipu/i, capability: 'transfer', lang: 'ig' }, // Added generic send
|
|
921
|
+
|
|
922
|
+
// SWAHILI (Kept mostly same as no diacritics in keywords)
|
|
859
923
|
{ pattern: /\b(?:ni|u|a|tu|m|wa|ki|vi|zi|i)\s*me\s*(?:ongeza|weka|tuma|peleka|lipa|wasilisha)\b/i, capability: 'unauthorized_action', lang: 'sw' },
|
|
860
|
-
{ pattern: /\b(?:kime|lime|ime|ume|nime|vime|zyme|yame|mame)(?:ongezwa|wekwa|tumwa|pelekwa|lipwa|wasilishwa|fanyika)\b/i, capability: 'unauthorized_action', lang: 'sw' },
|
|
861
|
-
{ pattern: /\b(?:ki|vi|mi|ma|u|wa|i|zi|ya|li|tu|mu|a|pa|ku)na(?:cho|vyo|yo|lo|mo|o)?(?:tum|pelek|wasil|ongez|wek|lip)\w*wa\b/i, capability: 'unauthorized_action', lang: 'sw' },
|
|
862
|
-
{ pattern: /\b(?:ki|vi|mi|ma|u|wa|i|zi|ya|li|tu|mu|a|pa|ku)ta(?:tum|pelek|wasil|ongez|wek|lip)\w*\b/i, capability: 'unauthorized_action', lang: 'sw' },
|
|
863
924
|
{ pattern: /\b(tuma\s+(?:pesa|fedha)|pelek[ae]?\s+(?:pesa|fedha)|wasilisha)\b/i, capability: 'transfer', lang: 'sw' },
|
|
864
925
|
{ pattern: /\b(lipa|maliza\s+malipo)\b/i, capability: 'payment', lang: 'sw' },
|
|
865
926
|
{ pattern: /\b(ongez[ae]?\s*(?:kiasi|pesa|fedha)|wek[ae]?\s+(?:katika|ndani)\s+(?:akaunti|hisa))\b/i, capability: 'deposit', lang: 'sw' },
|
|
866
|
-
|
|
927
|
+
|
|
928
|
+
// OTHER AFRICAN (Amharic, Somali, Zulu - Kept as is)
|
|
867
929
|
{ pattern: /[\u1200-\u137F]{0,4}(?:α°ααα|αα|ααα|α¨αα|αα£|αα£)[\u1200-\u137F]{0,2}(?:\u1205|\u122d|\u1265)[\u1200-\u137F]{0,2}/u, capability: 'financial_action', lang: 'am' },
|
|
868
|
-
{ pattern: /\bni\s+(?:kuufe|dhiibe|kennine|gurgure)\b/i, capability: 'unauthorized_action', lang: 'om' },
|
|
869
|
-
{ pattern: /\b(kuuf\s+(?:qilleensaa|bilbila)|dhiib\s+(?:qilleensaa|bilbila))\b/i, capability: 'transfer', lang: 'om' },
|
|
870
|
-
{ pattern: /\b(kenn\s*i|gurgur\s*i)\b/i, capability: 'payment', lang: 'om' },
|
|
871
|
-
{ pattern: /\b(sakkit\s+(?:ndo|ndoo)|tawt\s+(?:ndo|ndoo))\b/i, capability: 'transfer', lang: 'ff' },
|
|
872
|
-
{ pattern: /\b(jokk\s*i|soodug\s*i)\b/i, capability: 'payment', lang: 'ff' },
|
|
873
|
-
{ pattern: /\bwaxaa\s+(?:diray|bixiyay|ku\s+daray|sameeyay)\b/i, capability: 'unauthorized_action', lang: 'so' },
|
|
874
930
|
{ pattern: /\b(dir\s+(?:lacag|maal|qarsoon))\b/i, capability: 'transfer', lang: 'so' },
|
|
875
931
|
{ pattern: /\b(bixi|bixis\s*o)\b/i, capability: 'payment', lang: 'so' },
|
|
876
|
-
{ pattern: /\b(
|
|
877
|
-
{ pattern: /\b(thumel\s*a\s+(?:imali|imali))\b/i, capability: 'transfer', lang: 'zu' },
|
|
932
|
+
{ pattern: /\b(thumel\s*a\s+(?:imali))\b/i, capability: 'transfer', lang: 'zu' },
|
|
878
933
|
{ pattern: /\b(hlawul\s*a|hlawulel\s*a)\b/i, capability: 'payment', lang: 'zu' },
|
|
879
|
-
|
|
880
|
-
{ pattern: /\b(?:tumir|bhadhar)\s*a\b/i, capability: 'unauthorized_action', lang: 'sn' },
|
|
881
|
-
{ pattern: /\b(tumir\s*a\s+(?:mhando|ari))\b/i, capability: 'transfer', lang: 'sn' },
|
|
882
|
-
{ pattern: /\b(bhadhara|bhadharis\s*o)\b/i, capability: 'payment', lang: 'sn' },
|
|
883
|
-
{ pattern: /\b(ranαΉ£αΊΉ\s+(?:owo|pesa|kuΙi|ego)|fi\s+.*\s+ranαΉ£αΊΉ)\b/i, capability: 'transfer', lang: 'yo' }, // Yoruba "Send money"
|
|
884
|
-
{ pattern: /\b(zipu\s+(?:ego|moni)|zi\s+.*\s+zipu)\b/i, capability: 'transfer', lang: 'ig' }, // Igbo "Send money"
|
|
885
|
-
{ pattern: /\b(aika\s+(?:kuΙi)|turo\s+.*\s+aika)\b/i, capability: 'transfer', lang: 'ha' }, // Hausa "Send money"
|
|
934
|
+
|
|
886
935
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
887
|
-
// π GLOBAL LANGUAGES
|
|
936
|
+
// π GLOBAL LANGUAGES (Unchanged)
|
|
888
937
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
889
938
|
{ pattern: /\b(?:have|has|had)\s+(?:transferred|sent|paid|withdrawn|deposited|wire[d])\b/i, capability: 'unauthorized_action', lang: 'en' },
|
|
890
939
|
{ pattern: /\b(?:was|were|been)\s+(?:added|credited|transferred|sent|paid)\b/i, capability: 'unauthorized_action', lang: 'en' },
|
|
@@ -897,8 +946,9 @@ class RuntimeAPI {
|
|
|
897
946
|
{ pattern: /[\u4e00-\u9fff]{0,2}(?:转账 | ζ―δ» | εζ¬Ύ | εζ¬Ύ)[\u4e00-\u9fff]{0,2}(?:δΊ)[\u4e00-\u9fff]{0,2}/u, capability: 'financial_action', lang: 'zh' },
|
|
898
947
|
{ pattern: /[\u4e00-\u9fff]{0,2}(?:转账 | θ½¬εΈ | ζ―δ» | δ»ζ¬Ύ | ζζ¬Ύ | εζ¬Ύ | εζ¬Ύ | εε
₯ | ζ±ζ¬Ύ | ε)[\u4e00-\u9fff]{0,2}/u, capability: 'financial_action', lang: 'zh' },
|
|
899
948
|
{ pattern: /[\u4e00-\u9fff]{0,2}(?:ζ | ε·² | ε·²η»)\s*(?:转账 | ζ―δ» | ζζ¬Ύ | εζ¬Ύ)[\u4e00-\u9fff]{0,2}/u, capability: 'unauthorized_action', lang: 'zh' },
|
|
949
|
+
|
|
900
950
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
901
|
-
// π‘οΈ EVASION-RESISTANT + PII + FAKE CONFIRMATION
|
|
951
|
+
// π‘οΈ EVASION-RESISTANT + PII + FAKE CONFIRMATION (Unchanged)
|
|
902
952
|
// ββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
903
953
|
{ pattern: /(?:^|\s|[:\(\[])(?:\d{1,3}(?:[,\s.]\d{3})*(?:[.,]\d{1,2})?|\d+(?:[.,]\d{1,2})?)(?:\s*(?:naira|ngn|β¦|\$|usd|kes|tzs|ugx|rwf|cdf|xof|xaf|ghs|zar))?.{0,40}(?:account|acct|a\/c|akaunti|asusu|akwα»₯kwα»\s+α»kα»₯|hesabu|namba|#)\b/i, capability: 'unauthorized_action', lang: 'multi' },
|
|
904
954
|
{ pattern: /\b(?:account|acct|a\/c|akaunti|asusu|akwα»₯kwα»\s+α»kα»₯|hesabu|namba|#)\s*[:\-ββ]?\s*(\d{6,})\b/i, capability: 'pii_exposure', lang: 'multi' },
|
|
@@ -919,23 +969,28 @@ class RuntimeAPI {
|
|
|
919
969
|
c.includes('withdraw')
|
|
920
970
|
);
|
|
921
971
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
}
|
|
972
|
+
if (!hasCapability) {
|
|
973
|
+
const match = output.match(pattern);
|
|
974
|
+
|
|
975
|
+
// β
Explicitly flag African & Financial context for Audit Logs
|
|
976
|
+
const isAfrican = ['yo', 'ig', 'ha', 'sw', 'zu', 'am', 'om', 'ff', 'so', 'sn'].includes(lang);
|
|
977
|
+
const isFinancial = ['transfer', 'payment', 'withdrawal', 'deposit', 'financial_action'].includes(capability);
|
|
978
|
+
|
|
979
|
+
return {
|
|
980
|
+
passed: false,
|
|
981
|
+
reason: `Hallucinated "${capability}" capability in ${lang}...`,
|
|
982
|
+
detected: match ? match[0].trim() : 'unknown pattern',
|
|
983
|
+
language: lang,
|
|
984
|
+
african_language_detected: isAfrican,
|
|
985
|
+
financial_expression_found: isFinancial,
|
|
986
|
+
capability_attempted: capability
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
return { passed: true };
|
|
992
|
+
}
|
|
993
|
+
|
|
939
994
|
// -----------------------------
|
|
940
995
|
// β
CRITICAL FIX: Resolver output unwrapping helper
|
|
941
996
|
// -----------------------------
|
|
@@ -1469,7 +1524,7 @@ class RuntimeAPI {
|
|
|
1469
1524
|
const db = this.dbClient.client.db(process.env.DB_NAME || 'olang');
|
|
1470
1525
|
await db.collection(step.collection).insertOne({
|
|
1471
1526
|
workflow_name: this.context.workflow_name || 'unknown',
|
|
1472
|
-
|
|
1527
|
+
sourceValue,
|
|
1473
1528
|
created_at: new Date()
|
|
1474
1529
|
});
|
|
1475
1530
|
break;
|