@mailwoman/codex 4.11.0 → 4.13.0

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.
@@ -9,8 +9,8 @@
9
9
  * detection instead of merely being nudged by it.
10
10
  *
11
11
  * Every row is a provenance-carrying claim about a national addressing convention — the same
12
- * no-load-bearing-trivia discipline as the rest of the codex. Add rows with a source, not from
13
- * vibes; an absent row means "no constraints known", never "no constraints exist".
12
+ * provenance-first discipline as the rest of the codex. Add rows with a source, not from vibes;
13
+ * an absent row means "no constraints known", never "no constraints exist".
14
14
  *
15
15
  * First consumer: `@mailwoman/neural`'s decoder applies `forbiddenTags` as a hard emission mask
16
16
  * before Viterbi and treats `postcodePattern` as the system's canonical shape for the snap-only
@@ -9,8 +9,8 @@
9
9
  * detection instead of merely being nudged by it.
10
10
  *
11
11
  * Every row is a provenance-carrying claim about a national addressing convention — the same
12
- * no-load-bearing-trivia discipline as the rest of the codex. Add rows with a source, not from
13
- * vibes; an absent row means "no constraints known", never "no constraints exist".
12
+ * provenance-first discipline as the rest of the codex. Add rows with a source, not from vibes;
13
+ * an absent row means "no constraints known", never "no constraints exist".
14
14
  *
15
15
  * First consumer: `@mailwoman/neural`'s decoder applies `forbiddenTags` as a hard emission mask
16
16
  * before Viterbi and treats `postcodePattern` as the system's canonical shape for the snap-only
@@ -27,18 +27,18 @@ export const ADDRESS_SYSTEM_CONVENTIONS = {
27
27
  * suffix decomposition has no French counterpart).
28
28
  *
29
29
  * Provenance / why this is NOT a blanket prefix+suffix forbid (#719, 2026-06-18): an earlier
30
- * model mis-tagged the leading "Rue" as a US-style `street_suffix` (RUE is genuinely a Pub-28
31
- * suffix variant) — the 2026-06-10 v1.1.0 gate — so #511 forbade BOTH affix tags to stop that
32
- * leakage. That forbid was correct for THAT model but became a live production bug for the
33
- * current one: the shipped model (v1.5.0) emits the FR `street_prefix` correctly, but the
34
- * conventions mask was a hard −1e9 on every B-/I-street_prefix emission, so the detected-FR parse
35
- * could never KEEP a prefix — it destroyed `street_prefix` wholesale (measured on
36
- * data/eval/external/ fr-street-prefix-real.jsonl at conventions=auto: F1 0.0 with the forbid on
37
- * → 80.0 with it off; the larger real-FR eval reported the same collapse, ~96 → ~0.6). We keep
38
- * ONLY `street_suffix` forbidden: the current model with the forbid OFF shows zero FR
39
- * street_suffix leakage (fp=0 on that same slice) and FR genuinely has no trailing street suffix,
40
- * so the constraint costs nothing while still guarding against any future suffix mis-tag.
41
- * Postcode: exactly five digits (NF Z 10-011; see fr/code-postal).
30
+ * model mis-tagged the leading "Rue" as a US-style `street_suffix` (RUE is a Pub-28 suffix
31
+ * variant) — the 2026-06-10 v1.1.0 gate — so #511 forbade BOTH affix tags to stop that leakage.
32
+ * That forbid was correct for THAT model but became a live production bug for the current one:
33
+ * the shipped model (v1.5.0) emits the FR `street_prefix` correctly, but the conventions mask was
34
+ * a hard −1e9 on every B-/I-street_prefix emission, so the detected-FR parse could never KEEP a
35
+ * prefix — it destroyed `street_prefix` wholesale (measured on data/eval/external/
36
+ * fr-street-prefix-real.jsonl at conventions=auto: F1 0.0 with the forbid on → 80.0 with it off;
37
+ * the larger real-FR eval reported the same collapse, ~96 → ~0.6). We keep ONLY `street_suffix`
38
+ * forbidden: the current model with the forbid OFF shows zero FR street_suffix leakage (fp=0 on
39
+ * that same slice) and FR has no trailing street suffix, so the constraint costs nothing while
40
+ * still guarding against any future suffix mis-tag. Postcode: exactly five digits (NF Z 10-011;
41
+ * see fr/code-postal).
42
42
  */
43
43
  fr: {
44
44
  forbiddenTags: ["street_suffix"],
package/out/fr/cedex.d.ts CHANGED
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * This slice closes the gap PR #516 documented: the shard builder sourced the shape from SCHEMA.mdx
13
13
  * prose because codex had no cedex home. Now it does — the builder and any future consumer import
14
- * from here (the no-load-bearing-trivia discipline: one provenanced source).
14
+ * from here (the provenance-first discipline: one provenanced source).
15
15
  */
16
16
  /** Matches a CEDEX phrase: the keyword plus an optional 1–2 digit office number. */
17
17
  export declare const CEDEX_PATTERN: RegExp;
package/out/fr/cedex.js CHANGED
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * This slice closes the gap PR #516 documented: the shard builder sourced the shape from SCHEMA.mdx
13
13
  * prose because codex had no cedex home. Now it does — the builder and any future consumer import
14
- * from here (the no-load-bearing-trivia discipline: one provenanced source).
14
+ * from here (the provenance-first discipline: one provenanced source).
15
15
  */
16
16
  /** Matches a CEDEX phrase: the keyword plus an optional 1–2 digit office number. */
17
17
  export const CEDEX_PATTERN = /\bCEDEX(?:\s+(\d{1,2}))?\b/i;
@@ -6,9 +6,9 @@
6
6
  * The 101 French départements (96 metropolitan including Corsica's 2A/2B, plus the 5 overseas DOM),
7
7
  * each mapped to its région.
8
8
  *
9
- * The département is the load-bearing admin unit for French postal geography: a code postal's first
10
- * two digits ARE the département number (see `code-postal.ts`), and the région is derived from
11
- * the département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
9
+ * The département is the key admin unit for French postal geography: a code postal's first two
10
+ * digits ARE the département number (see `code-postal.ts`), and the région is derived from the
11
+ * département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
12
12
  */
13
13
  import type { FrenchRegionCode } from "./region.js";
14
14
  /** Per-département record: code (2-digit, or `2A`/`2B`, or 3-digit DOM) + name + its région. */
@@ -6,9 +6,9 @@
6
6
  * The 101 French départements (96 metropolitan including Corsica's 2A/2B, plus the 5 overseas DOM),
7
7
  * each mapped to its région.
8
8
  *
9
- * The département is the load-bearing admin unit for French postal geography: a code postal's first
10
- * two digits ARE the département number (see `code-postal.ts`), and the région is derived from
11
- * the département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
9
+ * The département is the key admin unit for French postal geography: a code postal's first two
10
+ * digits ARE the département number (see `code-postal.ts`), and the région is derived from the
11
+ * département. This table is therefore the hinge between `code-postal.ts` and `region.ts`.
12
12
  */
13
13
  /** Département code → info. 96 metropolitan (incl. 2A/2B) + 5 overseas = 101. */
14
14
  export const FR_DEPARTEMENTS = {
@@ -39,11 +39,11 @@ import type { Tagged } from "type-fest";
39
39
  */
40
40
  export type Postcode = Tagged<string, "UkPostcode">;
41
41
  /**
42
- * UK postcode shape. A robust, slightly permissive form of the Royal Mail / UK-gov regex: one or
43
- * two leading letters (the area), a district digit, an optional district letter-or-digit, then the
44
- * inward sector digit and two unit letters, with the inward space optional so an un-spaced
45
- * `SW1A1AA` still validates. The full UK-gov pattern additionally whitelists the British Overseas
46
- * Territory codes (`ASCN`, `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
42
+ * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters
43
+ * (the area), a district digit, an optional district letter-or-digit, then the inward sector digit
44
+ * and two unit letters, with the inward space optional so an un-spaced `SW1A1AA` still validates.
45
+ * The full UK-gov pattern additionally whitelists the British Overseas Territory codes (`ASCN`,
46
+ * `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
47
47
  */
48
48
  export declare const UK_POSTCODE_PATTERN: RegExp;
49
49
  /**
@@ -27,11 +27,11 @@
27
27
  * internal space, and cleaving outward from inward — not a prefix→admin lookup.
28
28
  */
29
29
  /**
30
- * UK postcode shape. A robust, slightly permissive form of the Royal Mail / UK-gov regex: one or
31
- * two leading letters (the area), a district digit, an optional district letter-or-digit, then the
32
- * inward sector digit and two unit letters, with the inward space optional so an un-spaced
33
- * `SW1A1AA` still validates. The full UK-gov pattern additionally whitelists the British Overseas
34
- * Territory codes (`ASCN`, `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
30
+ * UK postcode shape. A permissive form of the Royal Mail / UK-gov regex: one or two leading letters
31
+ * (the area), a district digit, an optional district letter-or-digit, then the inward sector digit
32
+ * and two unit letters, with the inward space optional so an un-spaced `SW1A1AA` still validates.
33
+ * The full UK-gov pattern additionally whitelists the British Overseas Territory codes (`ASCN`,
34
+ * `STHL`, `BBND`, …); those are rare enough to leave to the gazetteer.
35
35
  */
36
36
  export const UK_POSTCODE_PATTERN = /^[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}$/i;
37
37
  /**
@@ -88,7 +88,7 @@ export function isJapanesePrefectureCode(input) {
88
88
  *
89
89
  * The suffix is only stripped when it is a genuine appendage — separated by a
90
90
  * hyphen/space/middle-dot (`Tokyo-to`, `Osaka fu`) or trailing the macron-bearing long-vowel form.
91
- * That guard is load-bearing: four bare romaji names already END in a suffix syllable (Kyo**to**,
91
+ * That guard is essential: four bare romaji names already END in a suffix syllable (Kyo**to**,
92
92
  * Gi**fu**, Hokkai**do**, Kumamo**to**), and a blind trailing-strip would maim them. We never strip
93
93
  * from an unseparated bare name, so `kyoto` stays `kyoto`.
94
94
  */
@@ -32,8 +32,8 @@ export type ZipCodeDigit = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
32
32
  * (City)
33
33
  * ```
34
34
  *
35
- * Note that ZIP codes are not truly areas, but rather a group of deliverable addresses, which can
36
- * and do change over time.
35
+ * Note that ZIP codes are not areas, but rather a group of deliverable addresses, which can and do
36
+ * change over time.
37
37
  *
38
38
  * @category Delivery
39
39
  * @category Postal
@@ -59,8 +59,8 @@ export type ZipCode = Tagged<string, "ZipCode">;
59
59
  * (Post Office)
60
60
  * ```
61
61
  *
62
- * Note that ZIP codes are not truly areas, but rather a group of deliverable addresses, which can
63
- * and do change over time.
62
+ * Note that ZIP codes are not areas, but rather a group of deliverable addresses, which can and do
63
+ * change over time.
64
64
  *
65
65
  * @category Delivery
66
66
  * @category Postal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/codex",
3
- "version": "4.11.0",
3
+ "version": "4.13.0",
4
4
  "description": "Per-address-system postal reference data + branded types (USPS street suffixes, US ZIP codes). Pure, zero-runtime-dep — the shared canonical home for postal-system primitives the parser, resolver, and synthesis layers all reach for.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {