@conarium-ai/core 0.3.3 → 0.3.5
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/CHANGELOG.md +75 -0
- package/dist/mask/detectors/iban.d.ts.map +1 -1
- package/dist/mask/detectors/iban.js +48 -35
- package/dist/mask/detectors/iban.js.map +1 -1
- package/dist/mask/detectors/iban_lengths.d.ts +9 -0
- package/dist/mask/detectors/iban_lengths.d.ts.map +1 -0
- package/dist/mask/detectors/iban_lengths.js +134 -0
- package/dist/mask/detectors/iban_lengths.js.map +1 -0
- package/dist/mask/speech.d.ts +10 -0
- package/dist/mask/speech.d.ts.map +1 -0
- package/dist/mask/speech.js +474 -0
- package/dist/mask/speech.js.map +1 -0
- package/dist/mask-text.d.ts +1 -1
- package/dist/mask-text.d.ts.map +1 -1
- package/dist/mask-text.js +60 -2
- package/dist/mask-text.js.map +1 -1
- package/docs/API-STABILITY.md +1 -0
- package/docs/claims/reviews/0.3.4.md +137 -0
- package/docs/claims/reviews/0.3.5.md +51 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.5 - IBAN spans start at a country code and end at a word; a glued spoken address is read
|
|
4
|
+
|
|
5
|
+
Both changes come from a real large-v3-turbo transcript of an operator's own
|
|
6
|
+
test recording read through the `speech` pipeline.
|
|
7
|
+
|
|
8
|
+
The IBAN detector took any two letters followed by two digits as a start,
|
|
9
|
+
including the end of a word (`numaram 296-…` started at `am`), read up to 34
|
|
10
|
+
letters and digits, and shortened the run one character at a time until the
|
|
11
|
+
mod-97 check passed. A long run passed by chance often: 223 of 3 000
|
|
12
|
+
generated sentences with a digit run between words gave an IBAN span, and a
|
|
13
|
+
valid IBAN followed by a name took the first letters of the name with it.
|
|
14
|
+
A start now needs a country code with a known IBAN length (`IBAN_LENGTHS` in
|
|
15
|
+
`src/mask/detectors/iban_lengths.ts`, generated from the ibantools 4.5.4 and
|
|
16
|
+
iban 0.0.14 data sets), two letters inside a word count only when the check
|
|
17
|
+
digits follow them directly (`acctTR33…`), the candidate is exactly that
|
|
18
|
+
country's length, and it ends where a word or a digit run ends or where its
|
|
19
|
+
digits meet letters (`…3000ABC`). On the same 3 000 sentences one span is
|
|
20
|
+
left (`no`, Norway, whose 15 characters pass mod-97 by chance).
|
|
21
|
+
|
|
22
|
+
What the 0.2.54 steps masked is still masked: the belt is unchanged, so a
|
|
23
|
+
region the stricter detector no longer reads as an IBAN but 0.2.54 did is
|
|
24
|
+
masked and counted as `unclassified` instead of `iban`. On the transcript
|
|
25
|
+
above the masked text is the same as in 0.3.4 (`TC kimlik [MASKED_PII]imlik`
|
|
26
|
+
is still the 0.2.54 region); the class counts change.
|
|
27
|
+
|
|
28
|
+
The `speech` pipeline reads an address whose spoken `et` / `at` the speech
|
|
29
|
+
model glued to a mailbox provider: `ZAKDIRIZUTDURU.ETGMAIL.COM`, a dotted run
|
|
30
|
+
of three or more labels with a middle label that is `et` or `at` followed by
|
|
31
|
+
`gmail`, `hotmail`, `outlook`, `yahoo`, `icloud`, `yandex`, `protonmail` or
|
|
32
|
+
`live`, ending in a listed word, is one `email` span. `rapor.etiket.com` is
|
|
33
|
+
left. A glued provider after a space (`ali etgmail.com`) is not read.
|
|
34
|
+
|
|
35
|
+
## 0.3.4 - a speech pipeline for hyphenated digits and spoken addresses
|
|
36
|
+
|
|
37
|
+
`maskField` now accepts `pipeline: 'speech'` for text a local speech model
|
|
38
|
+
wrote from a recording. That pipeline masks digit runs of 7 or more digits
|
|
39
|
+
split by spaces or hyphens (a valid TCKN, a phone shape the text pipeline
|
|
40
|
+
already accepts, a Luhn-valid 13-to-19-digit card, or a run with no class,
|
|
41
|
+
which is always masked), `TR` plus digits split the same way when there are
|
|
42
|
+
at least four of them as an IBAN, and addresses said with `et` / `at` and
|
|
43
|
+
`nokta` or written as four or more dotted labels whose first two are
|
|
44
|
+
letters only, without `@`, when a word is in the fixed list
|
|
45
|
+
`DOMAIN_ENDINGS` in `src/mask/speech.ts`: the last label of a dotted run;
|
|
46
|
+
a spoken address is read up to its last listed word, so
|
|
47
|
+
`example nokta dev nokta jp` leaves `nokta jp`. An address may mix written
|
|
48
|
+
dots and spoken `nokta` on either side of `et` / `at`
|
|
49
|
+
(`ayse.yilmaz et example nokta com`, `ayse nokta yilmaz et example.com`,
|
|
50
|
+
`ayse.yilmaz et example.com`) and is one `email` span. An ending written
|
|
51
|
+
with a Turkish dotted capital I (U+0130) is read: for the ending lookup
|
|
52
|
+
only, the word is lowercased, U+0307 is dropped and U+0131 is read as `i`,
|
|
53
|
+
so `AI` with U+0130 matches `ai`.
|
|
54
|
+
`biz` is in the list and is also the Turkish word "we": a spoken address
|
|
55
|
+
is read up to `biz` only when no other listed word is on its chain, so
|
|
56
|
+
`example nokta com nokta Biz` is masked up to `com` and leaves `nokta Biz`,
|
|
57
|
+
while `firma nokta biz` and a dotted `ali.yilmaz.firma.biz` are masked.
|
|
58
|
+
An address with no listed word is not masked by these rules. Classes come
|
|
59
|
+
from the text pipeline's core detectors first, as in 0.3.3, so a
|
|
60
|
+
Luhn-valid card written in phone-shaped groups (`4111-11-111-111-1111`)
|
|
61
|
+
counts as `phone`, and an 11-digit run that fails the TCKN checksum counts
|
|
62
|
+
as `tckn`; when the core and the speech rules name different classes for
|
|
63
|
+
one number (`1-000-000-0146`: `phone` and `tckn`), both are counted and it
|
|
64
|
+
is masked if either class is asked for. It leaves an amount with thousands
|
|
65
|
+
separators (`1.250.000`, `1.250,00`) or under 7 digits before its decimal
|
|
66
|
+
comma, and a time with a colon, dates (`28-10-2026`, `28.10.2026`,
|
|
67
|
+
`28 10 2026`), two years joined by one space or one hyphen (`2025-2026`,
|
|
68
|
+
`2025 2026`), and a six-digit run: `8-4-23-26` is the broken-up tail of an
|
|
69
|
+
IBAN, and this pipeline does not close that leak. The same digits written
|
|
70
|
+
with spaces (`1 250 000`) are a run and are masked. `1234567,89` is a run
|
|
71
|
+
of 7 digits and is masked, and so is a decimal part of 7 or more digits
|
|
72
|
+
(`0,1234567`). The text pipeline is unchanged.
|
|
73
|
+
|
|
74
|
+
`re2js`, which runs operator patterns, is 2.8.7 in both packages: 2.8.6 has
|
|
75
|
+
quadratic-time lookbehind matching (GHSA-gg6h-894w-4m9c), and an operator
|
|
76
|
+
pattern may use lookbehind.
|
|
77
|
+
|
|
3
78
|
## 0.3.3 - the masking engine as a library: @conarium-ai/mask, and per-class masking
|
|
4
79
|
|
|
5
80
|
Importing `@conarium-ai/core` runs the stdio gateway: `dist/index.js` calls
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iban.d.ts","sourceRoot":"","sources":["../../../src/mask/detectors/iban.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"iban.d.ts","sourceRoot":"","sources":["../../../src/mask/detectors/iban.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AA6DtC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,CA2BpD"}
|
|
@@ -1,59 +1,75 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Checksum-valid IBAN spans. An IBAN-shaped word that fails mod-97 is not a span.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* A start is a letter pair whose country code is in `IBAN_LENGTHS`: a
|
|
5
|
+
* word-initial pair, or a pair glued inside a word with its check digits
|
|
6
|
+
* right after it (`acctTR33…`). A pair inside a word with a separator before
|
|
7
|
+
* the digits (`numaram 29…`) is the end of a word, not a country code. The
|
|
8
|
+
* candidate is exactly that country's length in alphanumerics, and it ends
|
|
9
|
+
* where a word or a digit run ends, or where its digits meet letters
|
|
10
|
+
* (`…3000ABC`); it never ends inside a word or a digit run. A hit is not
|
|
11
|
+
* consumed. The next search begins one character later, so a later valid
|
|
12
|
+
* IBAN that overlaps the first is still returned. apply merges overlaps.
|
|
8
13
|
*/
|
|
9
14
|
import { ibanMod97Ok, looksLikeIban, normalizeIban } from '../../iban.js';
|
|
15
|
+
import { IBAN_LENGTHS } from './iban_lengths.js';
|
|
10
16
|
const PII = '[MASKED_PII]';
|
|
11
17
|
const ANCHOR_SRC = /[A-Za-z]{2}[\s-]*\d{2}/g;
|
|
12
18
|
function isAlnum(c) {
|
|
13
|
-
return /[A-Za-z0-9]/.test(c);
|
|
19
|
+
return c !== undefined && /[A-Za-z0-9]/.test(c);
|
|
20
|
+
}
|
|
21
|
+
function isDigit(c) {
|
|
22
|
+
return c !== undefined && c >= '0' && c <= '9';
|
|
14
23
|
}
|
|
15
24
|
function isSep(c) {
|
|
16
25
|
return /[\s-]/.test(c);
|
|
17
26
|
}
|
|
18
|
-
|
|
27
|
+
/** End index of the first `count` alphanumerics from `start`, separators allowed between them; -1 when the run is shorter. */
|
|
28
|
+
function endAfter(s, start, count) {
|
|
19
29
|
let i = start;
|
|
20
30
|
let alnum = 0;
|
|
21
|
-
|
|
22
|
-
while (i < s.length && alnum < 34) {
|
|
31
|
+
while (i < s.length) {
|
|
23
32
|
if (isAlnum(s[i])) {
|
|
24
33
|
alnum++;
|
|
25
34
|
i++;
|
|
26
|
-
|
|
35
|
+
if (alnum === count)
|
|
36
|
+
return i;
|
|
27
37
|
continue;
|
|
28
38
|
}
|
|
29
39
|
if (isSep(s[i])) {
|
|
30
40
|
let j = i;
|
|
31
41
|
while (j < s.length && isSep(s[j]))
|
|
32
42
|
j++;
|
|
33
|
-
if (
|
|
43
|
+
if (isAlnum(s[j])) {
|
|
34
44
|
i = j;
|
|
35
45
|
continue;
|
|
36
46
|
}
|
|
37
47
|
}
|
|
38
48
|
break;
|
|
39
49
|
}
|
|
40
|
-
return
|
|
50
|
+
return -1;
|
|
41
51
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
52
|
+
function endsCleanly(s, end) {
|
|
53
|
+
if (!isAlnum(s[end]))
|
|
54
|
+
return true;
|
|
55
|
+
return isDigit(s[end - 1]) && !isDigit(s[end]);
|
|
44
56
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
57
|
+
function validAt(text, at) {
|
|
58
|
+
const glued = isAlnum(text[at - 1]);
|
|
59
|
+
if (glued && !isDigit(text[at + 2]))
|
|
60
|
+
return -1;
|
|
61
|
+
const lengths = IBAN_LENGTHS[text.slice(at, at + 2).toUpperCase()];
|
|
62
|
+
if (!lengths)
|
|
63
|
+
return -1;
|
|
64
|
+
for (let k = lengths.length - 1; k >= 0; k--) {
|
|
65
|
+
const end = endAfter(text, at, lengths[k]);
|
|
66
|
+
if (end < 0 || !endsCleanly(text, end))
|
|
67
|
+
continue;
|
|
68
|
+
const normalized = normalizeIban(text.slice(at, end));
|
|
49
69
|
if (looksLikeIban(normalized) && ibanMod97Ok(normalized))
|
|
50
|
-
return
|
|
51
|
-
const next = trimTrailingIbanChar(candidate);
|
|
52
|
-
if (next === candidate)
|
|
53
|
-
break;
|
|
54
|
-
candidate = next;
|
|
70
|
+
return end;
|
|
55
71
|
}
|
|
56
|
-
return
|
|
72
|
+
return -1;
|
|
57
73
|
}
|
|
58
74
|
export function detectIbanSpans(text) {
|
|
59
75
|
if (!/[A-Za-z]{2}/.test(text) || !/\d{2}/.test(text))
|
|
@@ -65,18 +81,15 @@ export function detectIbanSpans(text) {
|
|
|
65
81
|
let anchor;
|
|
66
82
|
while ((anchor = ANCHOR_SRC.exec(text)) !== null) {
|
|
67
83
|
const at = anchor.index;
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
source: 'iban',
|
|
78
|
-
});
|
|
79
|
-
}
|
|
84
|
+
const end = validAt(text, at);
|
|
85
|
+
if (end > at) {
|
|
86
|
+
out.push({
|
|
87
|
+
start: at,
|
|
88
|
+
end,
|
|
89
|
+
cls: 'iban',
|
|
90
|
+
token: PII,
|
|
91
|
+
source: 'iban',
|
|
92
|
+
});
|
|
80
93
|
}
|
|
81
94
|
const next = at + 1;
|
|
82
95
|
if (next > text.length)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iban.js","sourceRoot":"","sources":["../../../src/mask/detectors/iban.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"iban.js","sourceRoot":"","sources":["../../../src/mask/detectors/iban.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,GAAG,GAAG,cAAc,CAAA;AAC1B,MAAM,UAAU,GAAG,yBAAyB,CAAA;AAE5C,SAAS,OAAO,CAAC,CAAqB;IACpC,OAAO,CAAC,KAAK,SAAS,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,OAAO,CAAC,CAAqB;IACpC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,CAAA;AAChD,CAAC;AAED,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACxB,CAAC;AAED,8HAA8H;AAC9H,SAAS,QAAQ,CAAC,CAAS,EAAE,KAAa,EAAE,KAAa;IACvD,IAAI,CAAC,GAAG,KAAK,CAAA;IACb,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;QACpB,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAClB,KAAK,EAAE,CAAA;YACP,CAAC,EAAE,CAAA;YACH,IAAI,KAAK,KAAK,KAA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AG,EAAE,GAAG,CAAC,CAAA;YACnB,IAAI,IAAI,GAAG,IAAI,CAAC,MAAM;gBAAE,MAAK;YAC7B,UAAU,CAAC,SAAS,GAAG,IAAI,CAAA;QAC7B,CAAC;IACH,CAAC;YAAS,CAAC;QACT,UAAU,CAAC,SAAS,GAAG,IAAI,CAAA;IAC7B,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IBAN length per country code, generated from two published data sets:
|
|
3
|
+
* ibantools 4.5.4 `countrySpecs` (`chars`) and iban 0.0.14 `Specification`.
|
|
4
|
+
* A country in the SWIFT IBAN Registry has one length, and the two sets agree
|
|
5
|
+
* on every such country they share. A country outside the registry keeps every
|
|
6
|
+
* length either set gives, so an account the masker used to catch is not lost.
|
|
7
|
+
*/
|
|
8
|
+
export declare const IBAN_LENGTHS: Readonly<Record<string, readonly number[]>>;
|
|
9
|
+
//# sourceMappingURL=iban_lengths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iban_lengths.d.ts","sourceRoot":"","sources":["../../../src/mask/detectors/iban_lengths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CA6HpE,CAAA"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IBAN length per country code, generated from two published data sets:
|
|
3
|
+
* ibantools 4.5.4 `countrySpecs` (`chars`) and iban 0.0.14 `Specification`.
|
|
4
|
+
* A country in the SWIFT IBAN Registry has one length, and the two sets agree
|
|
5
|
+
* on every such country they share. A country outside the registry keeps every
|
|
6
|
+
* length either set gives, so an account the masker used to catch is not lost.
|
|
7
|
+
*/
|
|
8
|
+
export const IBAN_LENGTHS = {
|
|
9
|
+
AD: [24],
|
|
10
|
+
AE: [23],
|
|
11
|
+
AL: [28],
|
|
12
|
+
AO: [25],
|
|
13
|
+
AT: [20],
|
|
14
|
+
AX: [18],
|
|
15
|
+
AZ: [28],
|
|
16
|
+
BA: [20],
|
|
17
|
+
BE: [16],
|
|
18
|
+
BF: [27, 28],
|
|
19
|
+
BG: [22],
|
|
20
|
+
BH: [22],
|
|
21
|
+
BI: [16, 27],
|
|
22
|
+
BJ: [28],
|
|
23
|
+
BL: [27],
|
|
24
|
+
BR: [29],
|
|
25
|
+
BY: [28],
|
|
26
|
+
CF: [27],
|
|
27
|
+
CG: [27],
|
|
28
|
+
CH: [21],
|
|
29
|
+
CI: [28],
|
|
30
|
+
CM: [27],
|
|
31
|
+
CR: [22],
|
|
32
|
+
CV: [25],
|
|
33
|
+
CY: [28],
|
|
34
|
+
CZ: [24],
|
|
35
|
+
DE: [22],
|
|
36
|
+
DJ: [27],
|
|
37
|
+
DK: [18],
|
|
38
|
+
DO: [28],
|
|
39
|
+
DZ: [24, 26],
|
|
40
|
+
EE: [20],
|
|
41
|
+
EG: [29],
|
|
42
|
+
ES: [24],
|
|
43
|
+
FI: [18],
|
|
44
|
+
FK: [18],
|
|
45
|
+
FO: [18],
|
|
46
|
+
FR: [27],
|
|
47
|
+
GA: [27],
|
|
48
|
+
GB: [22],
|
|
49
|
+
GE: [22],
|
|
50
|
+
GF: [27],
|
|
51
|
+
GI: [23],
|
|
52
|
+
GL: [18],
|
|
53
|
+
GP: [27],
|
|
54
|
+
GQ: [27],
|
|
55
|
+
GR: [27],
|
|
56
|
+
GT: [28],
|
|
57
|
+
GW: [25],
|
|
58
|
+
HN: [28],
|
|
59
|
+
HR: [21],
|
|
60
|
+
HU: [28],
|
|
61
|
+
IE: [22],
|
|
62
|
+
IL: [23],
|
|
63
|
+
IQ: [23],
|
|
64
|
+
IR: [26],
|
|
65
|
+
IS: [26],
|
|
66
|
+
IT: [27],
|
|
67
|
+
JO: [30],
|
|
68
|
+
KM: [27],
|
|
69
|
+
KW: [30],
|
|
70
|
+
KZ: [20],
|
|
71
|
+
LB: [28],
|
|
72
|
+
LC: [32],
|
|
73
|
+
LI: [21],
|
|
74
|
+
LT: [20],
|
|
75
|
+
LU: [20],
|
|
76
|
+
LV: [21],
|
|
77
|
+
LY: [25],
|
|
78
|
+
MA: [28],
|
|
79
|
+
MC: [27],
|
|
80
|
+
MD: [24],
|
|
81
|
+
ME: [22],
|
|
82
|
+
MF: [27],
|
|
83
|
+
MG: [27],
|
|
84
|
+
MK: [19],
|
|
85
|
+
ML: [28],
|
|
86
|
+
MN: [20],
|
|
87
|
+
MQ: [27],
|
|
88
|
+
MR: [27],
|
|
89
|
+
MT: [31],
|
|
90
|
+
MU: [30],
|
|
91
|
+
MZ: [25],
|
|
92
|
+
NC: [27],
|
|
93
|
+
NE: [28],
|
|
94
|
+
NI: [28],
|
|
95
|
+
NL: [18],
|
|
96
|
+
NO: [15],
|
|
97
|
+
OM: [23],
|
|
98
|
+
PF: [27],
|
|
99
|
+
PK: [24],
|
|
100
|
+
PL: [28],
|
|
101
|
+
PM: [27],
|
|
102
|
+
PS: [29],
|
|
103
|
+
PT: [25],
|
|
104
|
+
QA: [29],
|
|
105
|
+
RE: [27],
|
|
106
|
+
RO: [24],
|
|
107
|
+
RS: [22],
|
|
108
|
+
RU: [33],
|
|
109
|
+
SA: [24],
|
|
110
|
+
SC: [31],
|
|
111
|
+
SD: [18],
|
|
112
|
+
SE: [24],
|
|
113
|
+
SI: [19],
|
|
114
|
+
SK: [24],
|
|
115
|
+
SM: [27],
|
|
116
|
+
SN: [28],
|
|
117
|
+
SO: [23],
|
|
118
|
+
ST: [25],
|
|
119
|
+
SV: [28],
|
|
120
|
+
TD: [27],
|
|
121
|
+
TF: [27],
|
|
122
|
+
TG: [28],
|
|
123
|
+
TL: [23],
|
|
124
|
+
TN: [24],
|
|
125
|
+
TR: [26],
|
|
126
|
+
UA: [29],
|
|
127
|
+
VA: [22],
|
|
128
|
+
VG: [24],
|
|
129
|
+
WF: [27],
|
|
130
|
+
XK: [20],
|
|
131
|
+
YE: [30],
|
|
132
|
+
YT: [27],
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=iban_lengths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iban_lengths.js","sourceRoot":"","sources":["../../../src/mask/detectors/iban_lengths.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgD;IACvE,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACZ,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IACZ,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,E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C;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;IACR,EAAE,EAAE,CAAC,EAAE,CAAC;CACT,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Span } from './core.js';
|
|
2
|
+
export interface SpeechHit {
|
|
3
|
+
classified: Span[];
|
|
4
|
+
unclassified: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
export declare function detectSpeechSpans(text: string): SpeechHit;
|
|
10
|
+
//# sourceMappingURL=speech.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speech.d.ts","sourceRoot":"","sources":["../../src/mask/speech.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAa,MAAM,WAAW,CAAA;AA8DhD,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,IAAI,EAAE,CAAA;IAClB,YAAY,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAC/C;AA2ZD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CASzD"}
|
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Speech-pipeline spans: digits a local model split with spaces or hyphens,
|
|
3
|
+
* TR plus such a run, and addresses said with et/at and nokta or written
|
|
4
|
+
* as four or more dotted labels. Called only when pipeline is `speech`.
|
|
5
|
+
* Every walk is linear; no open-ended backtracking.
|
|
6
|
+
*/
|
|
7
|
+
import { luhnOk } from '../digit_pii.js';
|
|
8
|
+
import { tcknChecksumOk } from '../tckn.js';
|
|
9
|
+
import { detectNumericSpans } from './detectors/numeric.js';
|
|
10
|
+
const PII = '[MASKED_PII]';
|
|
11
|
+
// Shared by the spoken `et`/`at`+`nokta` rule and the dotted-label rule.
|
|
12
|
+
// An address whose last label is not in this list is not masked by either.
|
|
13
|
+
// `at` is omitted: it is also the spoken `@`.
|
|
14
|
+
const DOMAIN_ENDINGS = new Set([
|
|
15
|
+
'com',
|
|
16
|
+
'net',
|
|
17
|
+
'org',
|
|
18
|
+
'edu',
|
|
19
|
+
'gov',
|
|
20
|
+
'mil',
|
|
21
|
+
'int',
|
|
22
|
+
'info',
|
|
23
|
+
'biz',
|
|
24
|
+
'io',
|
|
25
|
+
'ai',
|
|
26
|
+
'app',
|
|
27
|
+
'dev',
|
|
28
|
+
'co',
|
|
29
|
+
'me',
|
|
30
|
+
'tv',
|
|
31
|
+
'xyz',
|
|
32
|
+
'online',
|
|
33
|
+
'site',
|
|
34
|
+
'tech',
|
|
35
|
+
'cloud',
|
|
36
|
+
'email',
|
|
37
|
+
'tr',
|
|
38
|
+
'uk',
|
|
39
|
+
'de',
|
|
40
|
+
'fr',
|
|
41
|
+
'nl',
|
|
42
|
+
'it',
|
|
43
|
+
'es',
|
|
44
|
+
'eu',
|
|
45
|
+
'us',
|
|
46
|
+
'ca',
|
|
47
|
+
'au',
|
|
48
|
+
'ch',
|
|
49
|
+
'be',
|
|
50
|
+
'se',
|
|
51
|
+
'no',
|
|
52
|
+
'dk',
|
|
53
|
+
'fi',
|
|
54
|
+
'pl',
|
|
55
|
+
'ru',
|
|
56
|
+
'az',
|
|
57
|
+
'cy',
|
|
58
|
+
]);
|
|
59
|
+
// Endings that are also Turkish words (`biz` is "we"). A spoken nokta
|
|
60
|
+
// chain reads one only when no other listed ending is on that chain; a
|
|
61
|
+
// dotted run reads it as any other ending.
|
|
62
|
+
const WORD_ENDINGS = new Set(['biz']);
|
|
63
|
+
// Mailbox providers a speech model glues a spoken `et` / `at` onto:
|
|
64
|
+
// `ali et gmail nokta com` comes out as `ali.etgmail.com`.
|
|
65
|
+
const FUSED_PROVIDERS = new Set(['gmail', 'hotmail', 'outlook', 'yahoo', 'icloud', 'yandex', 'protonmail', 'live']);
|
|
66
|
+
const SCHEMES = new Set(['http', 'https', 'ftp', 'mailto', 'file']);
|
|
67
|
+
const MAX_LABELS = 32;
|
|
68
|
+
function isDigit(c) {
|
|
69
|
+
return c !== undefined && c >= '0' && c <= '9';
|
|
70
|
+
}
|
|
71
|
+
function isLetter(c) {
|
|
72
|
+
return c !== undefined && /\p{L}/u.test(c);
|
|
73
|
+
}
|
|
74
|
+
function isLabelChar(c) {
|
|
75
|
+
if (c === undefined)
|
|
76
|
+
return false;
|
|
77
|
+
if (isLetter(c) || isDigit(c))
|
|
78
|
+
return true;
|
|
79
|
+
return c === '-';
|
|
80
|
+
}
|
|
81
|
+
function lettersOnly(s) {
|
|
82
|
+
if (s.length === 0)
|
|
83
|
+
return false;
|
|
84
|
+
for (let i = 0; i < s.length; i++) {
|
|
85
|
+
if (!isLetter(s[i]))
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
/** Ending lookup only: U+0130 lowercases to `i` + U+0307, which misses `ai`. */
|
|
91
|
+
function endingKey(s) {
|
|
92
|
+
const lower = s.toLowerCase();
|
|
93
|
+
let out = '';
|
|
94
|
+
for (let i = 0; i < lower.length; i++) {
|
|
95
|
+
const c = lower[i];
|
|
96
|
+
if (c === '\u0307')
|
|
97
|
+
continue;
|
|
98
|
+
out += c === '\u0131' ? 'i' : c;
|
|
99
|
+
}
|
|
100
|
+
return out;
|
|
101
|
+
}
|
|
102
|
+
function isDomainEnding(s) {
|
|
103
|
+
return DOMAIN_ENDINGS.has(endingKey(s));
|
|
104
|
+
}
|
|
105
|
+
function isFusedProvider(s) {
|
|
106
|
+
const key = endingKey(s);
|
|
107
|
+
return (key.startsWith('et') || key.startsWith('at')) && FUSED_PROVIDERS.has(key.slice(2));
|
|
108
|
+
}
|
|
109
|
+
function isolatedRun(text, start, end) {
|
|
110
|
+
const left = start === 0 ? '' : text[start - 1];
|
|
111
|
+
const right = end >= text.length ? '' : text[end];
|
|
112
|
+
if (isDigit(left) || isDigit(right))
|
|
113
|
+
return false;
|
|
114
|
+
if (isLetter(left) || isLetter(right))
|
|
115
|
+
return false;
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
function isDateRun(raw) {
|
|
119
|
+
if (raw.length < 8 || raw.length > 10)
|
|
120
|
+
return false;
|
|
121
|
+
let i = 0;
|
|
122
|
+
let day = 0;
|
|
123
|
+
let n = 0;
|
|
124
|
+
while (i < raw.length && isDigit(raw[i]) && n < 2) {
|
|
125
|
+
day = day * 10 + (raw.charCodeAt(i) - 48);
|
|
126
|
+
i++;
|
|
127
|
+
n++;
|
|
128
|
+
}
|
|
129
|
+
if (n === 0 || i >= raw.length)
|
|
130
|
+
return false;
|
|
131
|
+
const sep = raw[i];
|
|
132
|
+
if (sep !== '-' && sep !== '.' && sep !== ' ')
|
|
133
|
+
return false;
|
|
134
|
+
i++;
|
|
135
|
+
let month = 0;
|
|
136
|
+
n = 0;
|
|
137
|
+
while (i < raw.length && isDigit(raw[i]) && n < 2) {
|
|
138
|
+
month = month * 10 + (raw.charCodeAt(i) - 48);
|
|
139
|
+
i++;
|
|
140
|
+
n++;
|
|
141
|
+
}
|
|
142
|
+
if (n === 0 || raw[i] !== sep)
|
|
143
|
+
return false;
|
|
144
|
+
i++;
|
|
145
|
+
n = 0;
|
|
146
|
+
while (i < raw.length && isDigit(raw[i])) {
|
|
147
|
+
n++;
|
|
148
|
+
i++;
|
|
149
|
+
}
|
|
150
|
+
if (n !== 4 || i !== raw.length)
|
|
151
|
+
return false;
|
|
152
|
+
return day >= 1 && day <= 31 && month >= 1 && month <= 12;
|
|
153
|
+
}
|
|
154
|
+
function yearValue(raw, from) {
|
|
155
|
+
if (from + 4 > raw.length)
|
|
156
|
+
return null;
|
|
157
|
+
let y = 0;
|
|
158
|
+
for (let k = 0; k < 4; k++) {
|
|
159
|
+
const c = raw[from + k];
|
|
160
|
+
if (!isDigit(c))
|
|
161
|
+
return null;
|
|
162
|
+
y = y * 10 + (c.charCodeAt(0) - 48);
|
|
163
|
+
}
|
|
164
|
+
if (y < 1900 || y > 2099)
|
|
165
|
+
return null;
|
|
166
|
+
return y;
|
|
167
|
+
}
|
|
168
|
+
/** Exactly two 4-digit years 1900–2099 joined by one space or one hyphen. */
|
|
169
|
+
function isYearRange(raw) {
|
|
170
|
+
if (raw.length !== 9)
|
|
171
|
+
return false;
|
|
172
|
+
const sep = raw[4];
|
|
173
|
+
if (sep !== '-' && sep !== ' ')
|
|
174
|
+
return false;
|
|
175
|
+
return yearValue(raw, 0) !== null && yearValue(raw, 5) !== null;
|
|
176
|
+
}
|
|
177
|
+
function readDigitRun(text, start) {
|
|
178
|
+
if (!isDigit(text[start]))
|
|
179
|
+
return null;
|
|
180
|
+
let i = start;
|
|
181
|
+
let digits = '';
|
|
182
|
+
while (i < text.length) {
|
|
183
|
+
const c = text[i];
|
|
184
|
+
if (isDigit(c)) {
|
|
185
|
+
digits += c;
|
|
186
|
+
i++;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if ((c === ' ' || c === '-') && i + 1 < text.length && isDigit(text[i + 1])) {
|
|
190
|
+
i++;
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
return { end: i, digits };
|
|
196
|
+
}
|
|
197
|
+
function classifyDigits(digits, runText) {
|
|
198
|
+
if (digits.length === 11 && tcknChecksumOk(digits))
|
|
199
|
+
return 'tckn';
|
|
200
|
+
if (detectNumericSpans(runText).some((sp) => sp.cls === 'phone'))
|
|
201
|
+
return 'phone';
|
|
202
|
+
if (digits.length === 10)
|
|
203
|
+
return 'phone';
|
|
204
|
+
if (digits.length === 11 && digits.charCodeAt(0) === 48)
|
|
205
|
+
return 'phone';
|
|
206
|
+
if (digits.length >= 13 && digits.length <= 19 && luhnOk(digits))
|
|
207
|
+
return 'card';
|
|
208
|
+
return null;
|
|
209
|
+
}
|
|
210
|
+
function pushClassified(out, start, end, cls) {
|
|
211
|
+
if (end <= start)
|
|
212
|
+
return;
|
|
213
|
+
out.push({ start, end, cls, token: PII, source: 'speech' });
|
|
214
|
+
}
|
|
215
|
+
function findDigitRuns(text, classified, unclassified) {
|
|
216
|
+
let i = 0;
|
|
217
|
+
while (i < text.length) {
|
|
218
|
+
if (!isDigit(text[i])) {
|
|
219
|
+
i++;
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
const run = readDigitRun(text, i);
|
|
223
|
+
if (!run) {
|
|
224
|
+
i++;
|
|
225
|
+
continue;
|
|
226
|
+
}
|
|
227
|
+
const start = i;
|
|
228
|
+
const end = run.end;
|
|
229
|
+
i = end;
|
|
230
|
+
if (run.digits.length < 7)
|
|
231
|
+
continue;
|
|
232
|
+
if (!isolatedRun(text, start, end))
|
|
233
|
+
continue;
|
|
234
|
+
const raw = text.slice(start, end);
|
|
235
|
+
if (isDateRun(raw) || isYearRange(raw))
|
|
236
|
+
continue;
|
|
237
|
+
const cls = classifyDigits(run.digits, raw);
|
|
238
|
+
if (cls)
|
|
239
|
+
pushClassified(classified, start, end, cls);
|
|
240
|
+
else
|
|
241
|
+
unclassified.push({ start, end });
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function findIbans(text, classified) {
|
|
245
|
+
let i = 0;
|
|
246
|
+
while (i < text.length) {
|
|
247
|
+
const a = text[i];
|
|
248
|
+
const b = text[i + 1];
|
|
249
|
+
if ((a !== 'T' && a !== 't') || (b !== 'R' && b !== 'r')) {
|
|
250
|
+
i++;
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
if (i > 0 && isLetter(text[i - 1])) {
|
|
254
|
+
i++;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
let j = i + 2;
|
|
258
|
+
if (j < text.length && (text[j] === ' ' || text[j] === '-') && j + 1 < text.length && isDigit(text[j + 1])) {
|
|
259
|
+
j++;
|
|
260
|
+
}
|
|
261
|
+
const run = readDigitRun(text, j);
|
|
262
|
+
if (!run || run.digits.length < 4) {
|
|
263
|
+
i++;
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
pushClassified(classified, i, run.end, 'iban');
|
|
267
|
+
i = run.end;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function collectWords(text) {
|
|
271
|
+
const out = [];
|
|
272
|
+
let i = 0;
|
|
273
|
+
while (i < text.length) {
|
|
274
|
+
if (!isLetter(text[i])) {
|
|
275
|
+
i++;
|
|
276
|
+
continue;
|
|
277
|
+
}
|
|
278
|
+
const start = i;
|
|
279
|
+
while (i < text.length && isLetter(text[i]))
|
|
280
|
+
i++;
|
|
281
|
+
out.push({ start, end: i, lower: text.slice(start, i).toLowerCase() });
|
|
282
|
+
}
|
|
283
|
+
return out;
|
|
284
|
+
}
|
|
285
|
+
function singleSpace(text, from, to) {
|
|
286
|
+
return to === from + 1 && text.charCodeAt(from) === 32;
|
|
287
|
+
}
|
|
288
|
+
function noktaLink(words, text, left, right) {
|
|
289
|
+
if (right !== left + 2)
|
|
290
|
+
return false;
|
|
291
|
+
const mid = words[left + 1];
|
|
292
|
+
return (mid.lower === 'nokta'
|
|
293
|
+
&& singleSpace(text, words[left].end, mid.start)
|
|
294
|
+
&& singleSpace(text, mid.end, words[right].start));
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* For each word, how far a nokta chain extends left and right, plus the
|
|
298
|
+
* rightmost TLD that sits on that right-hand chain, and separately the
|
|
299
|
+
* rightmost one of `WORD_ENDINGS`. Built in two linear passes so each
|
|
300
|
+
* `et` / `at` is then a constant-time lookup.
|
|
301
|
+
*/
|
|
302
|
+
function noktaExtents(words, text) {
|
|
303
|
+
const n = words.length;
|
|
304
|
+
const leftExtent = new Array(n);
|
|
305
|
+
const rightExtent = new Array(n);
|
|
306
|
+
const rightmostTld = new Array(n);
|
|
307
|
+
const rightmostWordTld = new Array(n);
|
|
308
|
+
for (let i = 0; i < n; i++) {
|
|
309
|
+
leftExtent[i] = i >= 2 && noktaLink(words, text, i - 2, i) ? leftExtent[i - 2] : i;
|
|
310
|
+
}
|
|
311
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
312
|
+
const key = endingKey(words[i].lower);
|
|
313
|
+
const word = WORD_ENDINGS.has(key) ? i : -1;
|
|
314
|
+
const tld = word < 0 && DOMAIN_ENDINGS.has(key) ? i : -1;
|
|
315
|
+
if (i + 2 < n && noktaLink(words, text, i, i + 2)) {
|
|
316
|
+
rightExtent[i] = rightExtent[i + 2];
|
|
317
|
+
const further = rightmostTld[i + 2];
|
|
318
|
+
rightmostTld[i] = further >= 0 ? further : tld;
|
|
319
|
+
const furtherWord = rightmostWordTld[i + 2];
|
|
320
|
+
rightmostWordTld[i] = furtherWord >= 0 ? furtherWord : word;
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
rightExtent[i] = i;
|
|
324
|
+
rightmostTld[i] = tld;
|
|
325
|
+
rightmostWordTld[i] = word;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return { leftExtent, rightExtent, rightmostTld, rightmostWordTld };
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* For each word, the start of the dotted run it sits in, and, when the
|
|
332
|
+
* word begins a dotted run of two or more labels whose last is a listed
|
|
333
|
+
* ending, that run's end. One left-to-right pass so each `et` / `at`
|
|
334
|
+
* then reads these in constant time.
|
|
335
|
+
*/
|
|
336
|
+
function dottedExtents(words, text) {
|
|
337
|
+
const n = words.length;
|
|
338
|
+
const runStart = new Array(n);
|
|
339
|
+
const endingEnd = new Array(n);
|
|
340
|
+
for (let w = 0; w < n; w++) {
|
|
341
|
+
runStart[w] = words[w].start;
|
|
342
|
+
endingEnd[w] = -1;
|
|
343
|
+
}
|
|
344
|
+
let i = 0;
|
|
345
|
+
let wi = 0;
|
|
346
|
+
while (i < text.length) {
|
|
347
|
+
if (!isLetter(text[i]) && !isDigit(text[i])) {
|
|
348
|
+
i++;
|
|
349
|
+
continue;
|
|
350
|
+
}
|
|
351
|
+
if (i > 0 && isLabelChar(text[i - 1])) {
|
|
352
|
+
i++;
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
const parsed = parseDotted(text, i);
|
|
356
|
+
if (!parsed) {
|
|
357
|
+
i++;
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
const { labels, end } = parsed;
|
|
361
|
+
while (wi < n && words[wi].start < i)
|
|
362
|
+
wi++;
|
|
363
|
+
const first = wi;
|
|
364
|
+
while (wi < n && words[wi].start < end) {
|
|
365
|
+
runStart[wi] = i;
|
|
366
|
+
wi++;
|
|
367
|
+
}
|
|
368
|
+
if (first < n
|
|
369
|
+
&& words[first].start === i
|
|
370
|
+
&& labels.length >= 2
|
|
371
|
+
&& isDomainEnding(labels[labels.length - 1].lower)
|
|
372
|
+
&& (end === text.length || !isLabelChar(text[end]))) {
|
|
373
|
+
endingEnd[first] = end;
|
|
374
|
+
}
|
|
375
|
+
i = end;
|
|
376
|
+
}
|
|
377
|
+
return { runStart, endingEnd };
|
|
378
|
+
}
|
|
379
|
+
function findSpokenEmails(text, classified) {
|
|
380
|
+
const words = collectWords(text);
|
|
381
|
+
if (words.length === 0)
|
|
382
|
+
return;
|
|
383
|
+
const { leftExtent, rightExtent, rightmostTld, rightmostWordTld } = noktaExtents(words, text);
|
|
384
|
+
const { runStart, endingEnd } = dottedExtents(words, text);
|
|
385
|
+
for (let e = 0; e < words.length; e++) {
|
|
386
|
+
const mark = words[e].lower;
|
|
387
|
+
if (mark !== 'et' && mark !== 'at')
|
|
388
|
+
continue;
|
|
389
|
+
if (e === 0 || e + 1 >= words.length)
|
|
390
|
+
continue;
|
|
391
|
+
if (!singleSpace(text, words[e - 1].end, words[e].start))
|
|
392
|
+
continue;
|
|
393
|
+
if (!singleSpace(text, words[e].end, words[e + 1].start))
|
|
394
|
+
continue;
|
|
395
|
+
const left = leftExtent[e - 1];
|
|
396
|
+
const start = runStart[left];
|
|
397
|
+
const tld = rightmostTld[e + 1];
|
|
398
|
+
const spokenRight = tld >= e + 3 ? tld : rightmostWordTld[e + 1];
|
|
399
|
+
if (spokenRight >= e + 3 && spokenRight <= rightExtent[e + 1]) {
|
|
400
|
+
pushClassified(classified, start, words[spokenRight].end, 'email');
|
|
401
|
+
continue;
|
|
402
|
+
}
|
|
403
|
+
const dottedEnd = endingEnd[e + 1];
|
|
404
|
+
if (dottedEnd > words[e + 1].start) {
|
|
405
|
+
pushClassified(classified, start, dottedEnd, 'email');
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function parseDotted(text, start) {
|
|
410
|
+
const labels = [];
|
|
411
|
+
let i = start;
|
|
412
|
+
while (labels.length < MAX_LABELS && i < text.length) {
|
|
413
|
+
if (!isLetter(text[i]) && !isDigit(text[i]))
|
|
414
|
+
break;
|
|
415
|
+
const ls = i;
|
|
416
|
+
while (i < text.length && isLabelChar(text[i]))
|
|
417
|
+
i++;
|
|
418
|
+
if (i === ls)
|
|
419
|
+
break;
|
|
420
|
+
const raw = text.slice(ls, i);
|
|
421
|
+
labels.push({ start: ls, end: i, raw, lower: raw.toLowerCase() });
|
|
422
|
+
if (text[i] !== '.')
|
|
423
|
+
break;
|
|
424
|
+
i++;
|
|
425
|
+
}
|
|
426
|
+
if (labels.length === 0)
|
|
427
|
+
return null;
|
|
428
|
+
return { end: labels[labels.length - 1].end, labels };
|
|
429
|
+
}
|
|
430
|
+
function findDottedEmails(text, classified) {
|
|
431
|
+
let i = 0;
|
|
432
|
+
while (i < text.length) {
|
|
433
|
+
if (!isLetter(text[i]) && !isDigit(text[i])) {
|
|
434
|
+
i++;
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
if (i > 0 && isLabelChar(text[i - 1])) {
|
|
438
|
+
i++;
|
|
439
|
+
continue;
|
|
440
|
+
}
|
|
441
|
+
const parsed = parseDotted(text, i);
|
|
442
|
+
if (!parsed) {
|
|
443
|
+
i++;
|
|
444
|
+
continue;
|
|
445
|
+
}
|
|
446
|
+
const { labels, end } = parsed;
|
|
447
|
+
const first = labels[0];
|
|
448
|
+
if (first.lower === 'www' || SCHEMES.has(first.lower) || (i >= 3 && text.slice(i - 3, i) === '://')) {
|
|
449
|
+
i = end;
|
|
450
|
+
continue;
|
|
451
|
+
}
|
|
452
|
+
const ending = isDomainEnding(labels[labels.length - 1].lower) && (end === text.length || !isLabelChar(text[end]));
|
|
453
|
+
const fused = labels.length >= 3 && labels.slice(1, -1).some((l) => isFusedProvider(l.lower));
|
|
454
|
+
if (ending
|
|
455
|
+
&& ((labels.length >= 4 && lettersOnly(labels[0].raw) && lettersOnly(labels[1].raw)) || fused)) {
|
|
456
|
+
pushClassified(classified, first.start, end, 'email');
|
|
457
|
+
i = end;
|
|
458
|
+
continue;
|
|
459
|
+
}
|
|
460
|
+
i = end;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
export function detectSpeechSpans(text) {
|
|
464
|
+
const classified = [];
|
|
465
|
+
const unclassified = [];
|
|
466
|
+
if (text.length === 0)
|
|
467
|
+
return { classified, unclassified };
|
|
468
|
+
findDigitRuns(text, classified, unclassified);
|
|
469
|
+
findIbans(text, classified);
|
|
470
|
+
findSpokenEmails(text, classified);
|
|
471
|
+
findDottedEmails(text, classified);
|
|
472
|
+
return { classified, unclassified };
|
|
473
|
+
}
|
|
474
|
+
//# sourceMappingURL=speech.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"speech.js","sourceRoot":"","sources":["../../src/mask/speech.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,GAAG,GAAG,cAAc,CAAA;AAC1B,yEAAyE;AACzE,2EAA2E;AAC3E,8CAA8C;AAC9C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC;IAC7B,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,MAAM;IACN,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,QAAQ;IACR,MAAM;IACN,MAAM;IACN,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;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,UAAU,EAAE,YAAY,EAAE,CAAA;AACrC,CAAC"}
|
package/dist/mask-text.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export interface MaskTextOptions {
|
|
|
9
9
|
export declare const SECRET_VALUE_RE: RegExp;
|
|
10
10
|
export declare function maskSecretShapedValues(text: string, token?: string): string;
|
|
11
11
|
export interface MaskFieldOptions extends MaskTextOptions {
|
|
12
|
-
pipeline: 'text' | 'governance';
|
|
12
|
+
pipeline: 'text' | 'governance' | 'speech';
|
|
13
13
|
column?: string;
|
|
14
14
|
maskLabelledNames?: boolean;
|
|
15
15
|
only?: readonly SpanClass[];
|
package/dist/mask-text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-text.d.ts","sourceRoot":"","sources":["../src/mask-text.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;
|
|
1
|
+
{"version":3,"file":"mask-text.d.ts","sourceRoot":"","sources":["../src/mask-text.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAIzE,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,cAAc,CAAC,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,eAAO,MAAM,eAAe,QAC0I,CAAA;AAEtK,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,MAAM,CAGtF;AAKD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,CAAA;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,IAAI,CAAC,EAAE,SAAS,SAAS,EAAE,CAAA;CAC5B;AAmPD,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,CAqDA;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,MAAM,CAOlF"}
|
package/dist/mask-text.js
CHANGED
|
@@ -6,6 +6,7 @@ import { normalizePiiText } from './pii_normalize.js';
|
|
|
6
6
|
import { resolveScanCharCap } from './digit_pii.js';
|
|
7
7
|
import { apply, detect } from './mask/core.js';
|
|
8
8
|
import { beltCover } from './mask/belt.js';
|
|
9
|
+
import { detectSpeechSpans } from './mask/speech.js';
|
|
9
10
|
export const SECRET_VALUE_RE = /\b(?:sk-[A-Za-z0-9]{12,}|sk_live_[A-Za-z0-9]{6,}|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{20,}|gsk_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{8,}|eyJ[A-Za-z0-9._-]{20,})\b/g;
|
|
10
11
|
export function maskSecretShapedValues(text, token = '[MASKED_SECRET]') {
|
|
11
12
|
SECRET_VALUE_RE.lastIndex = 0;
|
|
@@ -186,6 +187,54 @@ function wholeMasked() {
|
|
|
186
187
|
addCount(bag, 'whole');
|
|
187
188
|
return bag;
|
|
188
189
|
}
|
|
190
|
+
// Fold each speech span into a core span of its class that it overlaps
|
|
191
|
+
// (widening that core span); otherwise add it. Core spans stay as the
|
|
192
|
+
// text pipeline produced them — two overlapping operator patterns stay
|
|
193
|
+
// two. Sort the speech spans and walk each class's cores once; do not
|
|
194
|
+
// walk every span for every speech span.
|
|
195
|
+
function absorbSpeech(spans, extra) {
|
|
196
|
+
if (extra.length === 0)
|
|
197
|
+
return;
|
|
198
|
+
const speech = extra.slice();
|
|
199
|
+
speech.sort((a, b) => (a.cls < b.cls ? -1 : a.cls > b.cls ? 1 : a.start - b.start || a.end - b.end));
|
|
200
|
+
const byClass = Object.create(null);
|
|
201
|
+
for (let i = 0; i < spans.length; i++) {
|
|
202
|
+
const sp = spans[i];
|
|
203
|
+
const list = Object.prototype.hasOwnProperty.call(byClass, sp.cls)
|
|
204
|
+
? byClass[sp.cls]
|
|
205
|
+
: (byClass[sp.cls] = []);
|
|
206
|
+
list.push(sp);
|
|
207
|
+
}
|
|
208
|
+
for (const key of Object.keys(byClass)) {
|
|
209
|
+
byClass[key].sort((a, b) => a.start - b.start || a.end - b.end);
|
|
210
|
+
}
|
|
211
|
+
let cls = '';
|
|
212
|
+
let cores = [];
|
|
213
|
+
let c = 0;
|
|
214
|
+
for (let i = 0; i < speech.length; i++) {
|
|
215
|
+
const sp = speech[i];
|
|
216
|
+
if (sp.cls !== cls) {
|
|
217
|
+
cls = sp.cls;
|
|
218
|
+
cores = Object.prototype.hasOwnProperty.call(byClass, cls) ? byClass[cls] : [];
|
|
219
|
+
c = 0;
|
|
220
|
+
}
|
|
221
|
+
while (c < cores.length && cores[c].end <= sp.start)
|
|
222
|
+
c++;
|
|
223
|
+
let folded = false;
|
|
224
|
+
for (let k = c; k < cores.length && cores[k].start < sp.end; k++) {
|
|
225
|
+
if (sp.start < cores[k].end) {
|
|
226
|
+
if (sp.start < cores[k].start)
|
|
227
|
+
cores[k].start = sp.start;
|
|
228
|
+
if (sp.end > cores[k].end)
|
|
229
|
+
cores[k].end = sp.end;
|
|
230
|
+
folded = true;
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (!folded)
|
|
235
|
+
spans.push(sp);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
189
238
|
function coreToApply(spans, only) {
|
|
190
239
|
if (!only)
|
|
191
240
|
return spans;
|
|
@@ -215,10 +264,16 @@ export function maskField(text, opts) {
|
|
|
215
264
|
column: opts.column,
|
|
216
265
|
maskLabelledNames: opts.maskLabelledNames,
|
|
217
266
|
});
|
|
267
|
+
let speechUnclassified = [];
|
|
268
|
+
if (opts.pipeline === 'speech') {
|
|
269
|
+
const found = detectSpeechSpans(normalized);
|
|
270
|
+
absorbSpeech(detected.spans, found.classified);
|
|
271
|
+
speechUnclassified = found.unclassified;
|
|
272
|
+
}
|
|
218
273
|
const belt = beltCover({
|
|
219
274
|
raw: text,
|
|
220
275
|
normalized,
|
|
221
|
-
pipeline: opts.pipeline,
|
|
276
|
+
pipeline: opts.pipeline === 'governance' ? 'governance' : 'text',
|
|
222
277
|
policy: {
|
|
223
278
|
detectors: opts.detectors,
|
|
224
279
|
scanCharCap: opts.scanCharCap,
|
|
@@ -236,7 +291,10 @@ export function maskField(text, opts) {
|
|
|
236
291
|
if (whole)
|
|
237
292
|
return wholeFieldResult(whole, byClass, classes);
|
|
238
293
|
const coreApplied = coreToApply(detected.spans, opts.only);
|
|
239
|
-
const
|
|
294
|
+
const beltRanges = speechUnclassified.length === 0
|
|
295
|
+
? belt.spans
|
|
296
|
+
: belt.spans.concat(speechUnclassified);
|
|
297
|
+
const beltOnly = beltOnlySpans(detected.spans, beltRanges);
|
|
240
298
|
const applied = apply(normalized, coreApplied.concat(beltOnly));
|
|
241
299
|
return {
|
|
242
300
|
text: applied.text,
|
package/dist/mask-text.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-text.js","sourceRoot":"","sources":["../src/mask-text.ts"],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iBAAiB,CAAC,IAAY,EAAE,IAAI,GAAoB,EAAE;IACxE,OAAO,SAAS,CAAC,IAAI,EAAE;QACrB,QAAQ,EAAE,MAAM;QAChB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;KACpC,CAAC,CAAC,IAAI,CAAA;AACT,CAAC"}
|
package/docs/API-STABILITY.md
CHANGED
|
@@ -166,6 +166,7 @@ Env: `CONARIUM_CONSOLE_HOST`, `CONARIUM_CONSOLE_PORT`,
|
|
|
166
166
|
| `"main": "./dist/index.js"`, `exports["."]` | experimental — process entry, not a library; importing it starts the stdio gateway |
|
|
167
167
|
| `exports["./mask"]` → `./dist/mask.js` | experimental — `maskField`, `maskSensitiveText`, `compileCustomPatterns` and their types; importing it starts no server (`test/mask_entry.mjs`) |
|
|
168
168
|
| `maskField` options `only`, results `classes` and `masked` | experimental — `only` lists the classes to mask; `classes` counts what the core found per class, `masked` what was replaced (`unclassified`, or `{ whole: 1 }`); counts, never values (`src/mask-classes.test.ts`) |
|
|
169
|
+
| `maskField` option `pipeline: 'speech'` | experimental — text a local speech model wrote from a recording; digit runs of 7 or more digits split by spaces or hyphens, spoken `et` / `at` and `nokta` addresses and four or more dotted labels whose first two are letters only, with a word in the fixed list `DOMAIN_ENDINGS` in `src/mask/speech.ts` (a dotted run's last label; a spoken address is read up to its last listed word, so `example nokta dev nokta jp` leaves `nokta jp`; an address that mixes written dots and spoken `nokta` on either side of `et` / `at` (`ayse.yilmaz et example nokta com`, `ayse nokta yilmaz et example.com`, `ayse.yilmaz et example.com`) is one `email` span; a dotted run of three or more labels with a middle label that is `et` or `at` followed by a provider in the fixed list `FUSED_PROVIDERS` (`ZAKDIRIZUTDURU.ETGMAIL.COM`) is one `email` span; an ending written with a Turkish dotted capital I (U+0130) is read — for the ending lookup only, the word is lowercased, U+0307 is dropped and U+0131 is read as `i`; a spoken chain reads `biz` only when no other listed word is on it, so `example nokta com nokta Biz` leaves `nokta Biz`; an address with no listed word is not masked by these rules), and `TR` plus at least four such digits as an IBAN. Classes come from the text pipeline's core detectors first, as in 0.3.3, so a Luhn-valid card written in phone-shaped groups (`4111-11-111-111-1111`) counts as `phone`, and an 11-digit run that fails the TCKN checksum counts as `tckn`; when the core and the speech rules name different classes for one number (`1-000-000-0146`: `phone` and `tckn`), both are counted and it is masked if either class is asked for. An amount with thousands separators (`1.250.000`, `1.250,00`) or under 7 digits before its decimal comma stays; `1234567,89` is a run of 7 digits and is masked, and so is a decimal part of 7 or more digits (`0,1234567`). The same digits with spaces (`1 250 000`) are a run. The speech rules do not change the text pipeline. |
|
|
169
170
|
| package `@conarium-ai/mask` (`packages/mask`) | experimental — the same `src/mask.ts`, built on its own with `@eslint-community/regexpp` and `re2js` as its only dependencies (`test/mask_package.mjs`) |
|
|
170
171
|
| `exports["./*"]` → `./*` | a deep path that names a file, extension included, resolves to that file; extensionless `require` paths, which resolved before the map existed, no longer do. What it reaches is **internal** |
|
|
171
172
|
| `dist/governance.js`, `dist/ots/*`, `dist/http.js`, … | **internal** |
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Claims review — 0.3.4
|
|
2
|
+
|
|
3
|
+
- base: v0.3.3
|
|
4
|
+
- head: ff89678
|
|
5
|
+
- surface: sha256:529c447e52d294b7d38c67d281c12bd415d1cbeda1f1c85723ccc3f9beb3c783
|
|
6
|
+
- verdict: pass
|
|
7
|
+
- reviewer: Cursor; findings 3 and 4 from a read-only model review, reworded by Claude; finding 6 from an automated security review, fixed by Claude. One claim surface changed between v0.3.3 and HEAD:
|
|
8
|
+
`docs/API-STABILITY.md` (`node test/denetci.mjs input v0.3.3 HEAD`).
|
|
9
|
+
|
|
10
|
+
The release adds `src/mask/speech.ts`, `src/mask/speech.test.ts` and the
|
|
11
|
+
`pipeline: 'speech'` option on `maskField` (`src/mask-text.ts`), the version
|
|
12
|
+
fields (`package.json`, `package-lock.json`, `server.json`,
|
|
13
|
+
`packages/mask/package.json`), the version assertion in
|
|
14
|
+
`src/demo-mode.test.ts`, the changelog entry, and the one row in
|
|
15
|
+
`docs/API-STABILITY.md` below.
|
|
16
|
+
|
|
17
|
+
The new row was set against what establishes it: `MaskFieldOptions.pipeline`
|
|
18
|
+
accepts `'speech'` (`src/mask-text.ts`); `detectSpeechSpans` walks digit runs
|
|
19
|
+
of 7 or more digits split by a single space or hyphen, `TR` plus at least
|
|
20
|
+
four such digits as an IBAN, spoken `et` / `at` + `nokta` addresses and
|
|
21
|
+
four or more dotted labels whose first two are letters only and whose last
|
|
22
|
+
label is in the fixed list `DOMAIN_ENDINGS` (`src/mask/speech.ts`), a spoken
|
|
23
|
+
address being read up to its last word in that list; a spoken address that
|
|
24
|
+
mixes written dots and spoken `nokta` on either side of `et` / `at` is one
|
|
25
|
+
`email` span (`ayse.yilmaz et example nokta com` and the two forms with
|
|
26
|
+
`example.com` on the right — `src/mask/speech.test.ts`); an ending written
|
|
27
|
+
with a Turkish dotted capital I (U+0130) is read (`endingKey` lowercases,
|
|
28
|
+
drops U+0307 and reads U+0131 as `i`); a spoken chain reads `biz` only when
|
|
29
|
+
no other listed word is on it (`WORD_ENDINGS`: `example nokta com nokta Biz`
|
|
30
|
+
leaves `nokta Biz`, while `firma nokta biz` and `ali.yilmaz.firma.biz` are
|
|
31
|
+
masked — `src/mask/speech.test.ts`). The text
|
|
32
|
+
pipeline's output on
|
|
33
|
+
the spoken-numbers fixture is unchanged (`src/mask/speech.test.ts`). An
|
|
34
|
+
amount with thousands separators (`1.250.000`, `1.250,00`) or under 7
|
|
35
|
+
digits before its decimal comma stays; `1234567,89` is a run of 7 digits
|
|
36
|
+
and is masked, and so is a decimal part of 7 or more digits (`0,1234567`).
|
|
37
|
+
Dates include `dd mm yyyy` with one space between parts. Two years
|
|
38
|
+
1900–2099, a six-digit run, and `TR` plus fewer than four digits are also
|
|
39
|
+
left, which the row does not claim to mask.
|
|
40
|
+
|
|
41
|
+
Classes come from the text pipeline's core detectors first, as in 0.3.3
|
|
42
|
+
(`detect` then `absorbSpeech` in `src/mask-text.ts`; `findPhones` before
|
|
43
|
+
later digit runs in `src/mask/detectors/numeric.ts`):
|
|
44
|
+
`4111-11-111-111-1111` is a Luhn-valid 16-digit card and counts as
|
|
45
|
+
`phone`; `12345678901` fails the TCKN checksum and counts as `tckn`;
|
|
46
|
+
`1-000-000-0146` is `phone` from the core and `tckn` from the speech
|
|
47
|
+
rules, so both are counted and either class in `only` masks it.
|
|
48
|
+
|
|
49
|
+
The changelog is not a claim surface, but its sentences were checked the
|
|
50
|
+
same way: the 7-digit floor, the IBAN's four-digit floor, the dotted-label
|
|
51
|
+
rule, the fixed ending list, the three mixed forms, the U+0130 ending lookup,
|
|
52
|
+
when `biz` is read as an ending, the class limits above, what is left
|
|
53
|
+
(including that a six-digit broken-up IBAN tail can leak, that spaced
|
|
54
|
+
digits are a run, and that `1234567,89` is a run), and that the text
|
|
55
|
+
pipeline is unchanged are what `src/mask/speech.test.ts` and the core
|
|
56
|
+
detectors assert.
|
|
57
|
+
|
|
58
|
+
The previous wording of the row, the changelog, and this record said more
|
|
59
|
+
than that. Those two overclaims are the findings below; they were reworded
|
|
60
|
+
in `bf49021`. The earlier dotted-label and spaced-amount overclaims were
|
|
61
|
+
reworded in `1072dac`. This round's new sentences (mixed forms, U+0130,
|
|
62
|
+
`biz`, class limits) were set against the tests and the core detectors and
|
|
63
|
+
hold after finding 5 was reworded.
|
|
64
|
+
|
|
65
|
+
## Findings
|
|
66
|
+
|
|
67
|
+
### 1. docs/API-STABILITY.md:169 — spoken and dotted addresses without a named ending list
|
|
68
|
+
|
|
69
|
+
- Claim: "spoken `et` / `at` and `nokta` addresses and four or more dotted
|
|
70
|
+
labels whose first two are letters only"
|
|
71
|
+
- Mechanism: `findSpokenEmails` and `findDottedEmails` in `src/mask/speech.ts`
|
|
72
|
+
keep a run only when the last label is in `DOMAIN_ENDINGS`
|
|
73
|
+
- Why it falls short: `ayse.yilmaz.example.xyzzy` is four dotted labels
|
|
74
|
+
whose first two are letters only and is not masked — `xyzzy` is not in
|
|
75
|
+
the list
|
|
76
|
+
- Disposition: reworded in `bf49021` to name `DOMAIN_ENDINGS` in
|
|
77
|
+
`src/mask/speech.ts` and that an address ending in anything else is not
|
|
78
|
+
masked by these rules
|
|
79
|
+
|
|
80
|
+
### 2. CHANGELOG.md (0.3.4, previous wording) — "an amount written with dots or commas"
|
|
81
|
+
|
|
82
|
+
- Claim: "It leaves an amount written with dots or commas"
|
|
83
|
+
- Mechanism: `findDigitRuns` masks a run of 7 or more digits; thousands
|
|
84
|
+
separators (`1.250.000`, `1.250,00`) break the run, and fewer than 7
|
|
85
|
+
digits before a decimal comma stay
|
|
86
|
+
- Why it falls short: `1234567,89` is written with a comma and is a run
|
|
87
|
+
of 7 digits, so it is masked
|
|
88
|
+
- Disposition: reworded in `bf49021`
|
|
89
|
+
|
|
90
|
+
### 3. docs/API-STABILITY.md:169 — "an address ending in anything else is not masked"
|
|
91
|
+
|
|
92
|
+
- Claim: "ending in the fixed list `DOMAIN_ENDINGS` … (an address ending in
|
|
93
|
+
anything else is not masked by these rules)"
|
|
94
|
+
- Mechanism: `findSpokenEmails` in `src/mask/speech.ts` takes the rightmost
|
|
95
|
+
word in `DOMAIN_ENDINGS` on the nokta chain after `et` / `at`, not the
|
|
96
|
+
chain's last word
|
|
97
|
+
- Why it falls short: `ayse et example nokta dev nokta jp` ends in `jp`,
|
|
98
|
+
which is not in the list, and becomes `[MASKED_PII] nokta jp`
|
|
99
|
+
- Disposition: reworded in `026a6f4`: a dotted run's last label, and a spoken
|
|
100
|
+
address read up to its last listed word
|
|
101
|
+
|
|
102
|
+
### 4. docs/API-STABILITY.md:169 — "under 7 digits before its decimal comma stays"
|
|
103
|
+
|
|
104
|
+
- Claim: "An amount … under 7 digits before its decimal comma stays"
|
|
105
|
+
- Mechanism: `findDigitRuns` reads each side of the comma as its own run
|
|
106
|
+
- Why it falls short: `0,1234567 BTC` has one digit before the comma and
|
|
107
|
+
becomes `0,[MASKED_PII] BTC`
|
|
108
|
+
- Disposition: reworded in `026a6f4`: a decimal part of 7 or more digits is
|
|
109
|
+
masked too
|
|
110
|
+
|
|
111
|
+
### 5. docs/API-STABILITY.md:169 — Turkish-specific letters on an English surface
|
|
112
|
+
|
|
113
|
+
- Claim: the first wording of this round wrote the mixed-form examples and
|
|
114
|
+
the dotted capital I with Turkish-specific letters (U+015F, U+0130, U+0131)
|
|
115
|
+
- Mechanism: `test/locale_letters.mjs` and `test/claim_discipline.mjs` reject
|
|
116
|
+
those letters on English claim surfaces; `test/pack_locale.mjs` rejects
|
|
117
|
+
them in `dist/`
|
|
118
|
+
- Why it falls short: that wording failed `locale_letters` on this row, and
|
|
119
|
+
`endingKey` with a literal U+0131 failed `pack_locale` on
|
|
120
|
+
`dist/mask/speech.js`
|
|
121
|
+
- Disposition: reworded in `8336ca7` to ASCII local parts and to U+0130 /
|
|
122
|
+
U+0131 by code point
|
|
123
|
+
|
|
124
|
+
### 6. docs/API-STABILITY.md:169 — "`biz` is not in the list"
|
|
125
|
+
|
|
126
|
+
- Claim: "`biz` is not in the list", which `62e1aac` wrote after `d08d8fb`
|
|
127
|
+
removed `biz` from `DOMAIN_ENDINGS` so the Turkish word "we" was not
|
|
128
|
+
masked after a spoken address
|
|
129
|
+
- Mechanism: both the dotted rule and the spoken `nokta` rule keep a run only
|
|
130
|
+
when its ending is in `DOMAIN_ENDINGS`
|
|
131
|
+
- Why it falls short: the sentence was true, and the behaviour was a leak:
|
|
132
|
+
`ali.yilmaz.firma.biz`, `ali et firma nokta biz`, `ali et firma.biz` and
|
|
133
|
+
`ali nokta yilmaz et firma nokta biz` were left unmasked
|
|
134
|
+
- Disposition: fixed in `ff89678`: `biz` is back in the list, and a spoken
|
|
135
|
+
chain reads it only when no other listed word is on it (`WORD_ENDINGS`), so
|
|
136
|
+
`example nokta com nokta Biz` still leaves `nokta Biz`; the row, the
|
|
137
|
+
changelog and this record were reworded in the same commit
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Claims review — 0.3.5
|
|
2
|
+
|
|
3
|
+
- base: v0.3.4
|
|
4
|
+
- head: 1657582
|
|
5
|
+
- surface: sha256:edea5f7c28c753f004e0db3faf6ff5c83135e25bce8cbd1417083307f172a9fc
|
|
6
|
+
- verdict: pass
|
|
7
|
+
- reviewer: Claude. One claim surface changed between v0.3.4 and HEAD:
|
|
8
|
+
`docs/API-STABILITY.md` (`node test/denetci.mjs input v0.3.4 HEAD`).
|
|
9
|
+
|
|
10
|
+
The release changes `src/mask/detectors/iban.ts`, adds
|
|
11
|
+
`src/mask/detectors/iban_lengths.ts` and `src/mask/iban-anchor.test.ts`,
|
|
12
|
+
changes `src/mask/speech.ts` and its tests, one case in
|
|
13
|
+
`src/mask/core.test.ts`, the version fields (`package.json`,
|
|
14
|
+
`package-lock.json`, `server.json`, `packages/mask/package.json`), the
|
|
15
|
+
version assertion in `src/demo-mode.test.ts`, the changelog entry, and the
|
|
16
|
+
`pipeline: 'speech'` row in `docs/API-STABILITY.md`.
|
|
17
|
+
|
|
18
|
+
The row's new sentence was set against what establishes it: a dotted run of
|
|
19
|
+
three or more labels with a middle label that is `et` or `at` followed by a
|
|
20
|
+
word in `FUSED_PROVIDERS` and a last label in `DOMAIN_ENDINGS` is one
|
|
21
|
+
`email` span (`findDottedEmails` and `isFusedProvider` in
|
|
22
|
+
`src/mask/speech.ts`; `ZAKDIRIZUTDURU.ETGMAIL.COM`, `ali.atoutlook.com` and
|
|
23
|
+
`rapor.etiket.com` in `src/mask/speech.test.ts`). The row's last sentence
|
|
24
|
+
said "The text pipeline is unchanged", which was about the speech rules;
|
|
25
|
+
this release changes the IBAN detector both pipelines share, so it now says
|
|
26
|
+
the speech rules do not change the text pipeline.
|
|
27
|
+
|
|
28
|
+
The row makes no claim about the IBAN detector. The changelog is not a claim
|
|
29
|
+
surface, but its sentences were checked the same way: 223 of 3 000 generated
|
|
30
|
+
sentences gave an IBAN span before and one after (`no`, Norway), the cases
|
|
31
|
+
named (`numaram 296-…`, a valid IBAN followed by a name, `acctTR33…`,
|
|
32
|
+
`…3000ABC`) are what `src/mask/iban-anchor.test.ts` asserts and failed six
|
|
33
|
+
of seven on `src/mask/detectors/iban.ts` from v0.3.4, the transcript's masked
|
|
34
|
+
text matches 0.3.4 while its class counts change, and the three shapes the
|
|
35
|
+
stricter detector refuses (an IBAN glued to more digits, a glued prefix with
|
|
36
|
+
a separator, a country code with no listed length) are still masked through
|
|
37
|
+
the 0.2.54 belt in both pipelines. `ali etgmail.com` is left, as the
|
|
38
|
+
changelog says.
|
|
39
|
+
|
|
40
|
+
## Findings
|
|
41
|
+
|
|
42
|
+
### 1. docs/API-STABILITY.md:169 — "The text pipeline is unchanged"
|
|
43
|
+
|
|
44
|
+
- Claim: "The text pipeline is unchanged" at the end of the
|
|
45
|
+
`pipeline: 'speech'` row
|
|
46
|
+
- Mechanism: `detectIbanSpans` in `src/mask/detectors/iban.ts` is called by
|
|
47
|
+
`detect` in `src/mask/core.ts` for every pipeline
|
|
48
|
+
- Why it falls short: in this release the text pipeline's IBAN spans and
|
|
49
|
+
class counts change
|
|
50
|
+
- Disposition: reworded in `1657582` to "The speech rules do not change the
|
|
51
|
+
text pipeline"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conarium-ai/core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"mcpName": "io.github.dogrucanemek-alt/conarium",
|
|
5
5
|
"//files-artefakt": "Generated files under examples/ (private key, receipt/audit JSONL) are EXCLUDED. .gitignore does not bind npm: because the allow-list contained 'examples', `npm publish` on a machine that had run the demo was shipping _keys/audit-ed25519.pem (PRIVATE KEY) and the receipts. test/pack_artefakt.mjs locks this. The exclusions are LIMITED to examples/: receipts.jsonl and .pub.pem under test-vectors/ MUST ship, or a third party cannot run the conformance vectors.",
|
|
6
6
|
"//files": "Allow-list of what enters the package. Without it npm sent everything: 296 files / 1.5 MB — CI workflows, gitleaks config, a 137 KB marketing image, the site's api/chat.js. A bank security team opens the tarball and sees those. scripts/ is here ON PURPOSE: conarium-reconcile references scripts/pg-snapshot.sql at runtime; without it the user files a support mail.",
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"node-sql-parser": "^5.4.0",
|
|
133
133
|
"pgsql-ast-parser": "^12.0.2",
|
|
134
134
|
"postgres": "^3.4.4",
|
|
135
|
-
"re2js": "2.8.
|
|
135
|
+
"re2js": "2.8.7",
|
|
136
136
|
"zod": "4.6.7"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|