@mailwoman/codex 7.8.0 → 7.8.1
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.
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
|
|
21
21
|
import { CODE_POSTAL_PATTERN } from "./fr/code-postal.ts"
|
|
22
|
+
import { UK_POSTCODE_PATTERN } from "./gb/postcode.ts"
|
|
22
23
|
import type { SystemCode } from "./postcode-systems.ts"
|
|
23
24
|
|
|
24
25
|
export interface AddressSystemConventions {
|
|
@@ -58,6 +59,24 @@ export const ADDRESS_SYSTEM_CONVENTIONS: Partial<Record<SystemCode, AddressSyste
|
|
|
58
59
|
forbiddenTags: ["street_suffix"],
|
|
59
60
|
postcodePattern: CODE_POSTAL_PATTERN,
|
|
60
61
|
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* United Kingdom (Royal Mail / UK-gov postcode shape — see `gb/postcode.ts` for the full provenance note): the
|
|
65
|
+
* postcode is variable-length ALPHANUMERIC, outward + inward (`SW1A 1AA`, `M1 1AE`, `SK11 9PD`), the most complex
|
|
66
|
+
* shape of any system in the codex. That very shape is what makes the snap repair valuable: the model fragments it
|
|
67
|
+
* (`SK11 9PD` → region "S" + postcode "K11 9PD") and a fragment is a strict sub-match of the pattern-valid string in
|
|
68
|
+
* the raw text — exactly the shape-INVALID class `postcodePattern` exists to flag.
|
|
69
|
+
*
|
|
70
|
+
* Provenance (#1275, 2026-07-24): on the GB golden board's 106 postcode rows under the en-gb bundle, the clip class
|
|
71
|
+
* (parsed postcode = proper suffix of the truth) was 44/106 with this row absent — the repair gate never opened
|
|
72
|
+
* because `conventionsForSystem("gb")` returned null. With the repair reachable, exact 26 → 83 and the clip class
|
|
73
|
+
* goes to zero. No `forbiddenTags`: no measured GB-ungrammatical tag class exists (the FR street_suffix forbid's
|
|
74
|
+
* lesson — a forbid needs measured zero-cost receipts, and GB street grammar shares the trailing-suffix family with
|
|
75
|
+
* US/CA).
|
|
76
|
+
*/
|
|
77
|
+
gb: {
|
|
78
|
+
postcodePattern: UK_POSTCODE_PATTERN,
|
|
79
|
+
},
|
|
61
80
|
}
|
|
62
81
|
|
|
63
82
|
/** Look up conventions for a system. Absent row = no constraints KNOWN (parse unconstrained). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-system-conventions.d.ts","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"address-system-conventions.d.ts","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD,MAAM,WAAW,wBAAwB;IACxC;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CACjC;AAED,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAyC5F,CAAA;AAED,iGAAiG;AACjG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,GAAG,IAAI,CAI3G"}
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* by the caller) — an undetected system parses exactly as before.
|
|
19
19
|
*/
|
|
20
20
|
import { CODE_POSTAL_PATTERN } from "./fr/code-postal.js";
|
|
21
|
+
import { UK_POSTCODE_PATTERN } from "./gb/postcode.js";
|
|
21
22
|
export const ADDRESS_SYSTEM_CONVENTIONS = {
|
|
22
23
|
/**
|
|
23
24
|
* France (La Poste / AFNOR NF Z 10-011): the street TYPE is a LEADING particle of the street name ("Rue de Rivoli",
|
|
@@ -41,6 +42,23 @@ export const ADDRESS_SYSTEM_CONVENTIONS = {
|
|
|
41
42
|
forbiddenTags: ["street_suffix"],
|
|
42
43
|
postcodePattern: CODE_POSTAL_PATTERN,
|
|
43
44
|
},
|
|
45
|
+
/**
|
|
46
|
+
* United Kingdom (Royal Mail / UK-gov postcode shape — see `gb/postcode.ts` for the full provenance note): the
|
|
47
|
+
* postcode is variable-length ALPHANUMERIC, outward + inward (`SW1A 1AA`, `M1 1AE`, `SK11 9PD`), the most complex
|
|
48
|
+
* shape of any system in the codex. That very shape is what makes the snap repair valuable: the model fragments it
|
|
49
|
+
* (`SK11 9PD` → region "S" + postcode "K11 9PD") and a fragment is a strict sub-match of the pattern-valid string in
|
|
50
|
+
* the raw text — exactly the shape-INVALID class `postcodePattern` exists to flag.
|
|
51
|
+
*
|
|
52
|
+
* Provenance (#1275, 2026-07-24): on the GB golden board's 106 postcode rows under the en-gb bundle, the clip class
|
|
53
|
+
* (parsed postcode = proper suffix of the truth) was 44/106 with this row absent — the repair gate never opened
|
|
54
|
+
* because `conventionsForSystem("gb")` returned null. With the repair reachable, exact 26 → 83 and the clip class
|
|
55
|
+
* goes to zero. No `forbiddenTags`: no measured GB-ungrammatical tag class exists (the FR street_suffix forbid's
|
|
56
|
+
* lesson — a forbid needs measured zero-cost receipts, and GB street grammar shares the trailing-suffix family with
|
|
57
|
+
* US/CA).
|
|
58
|
+
*/
|
|
59
|
+
gb: {
|
|
60
|
+
postcodePattern: UK_POSTCODE_PATTERN,
|
|
61
|
+
},
|
|
44
62
|
};
|
|
45
63
|
/** Look up conventions for a system. Absent row = no constraints KNOWN (parse unconstrained). */
|
|
46
64
|
export function conventionsForSystem(system) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-system-conventions.js","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"address-system-conventions.js","sourceRoot":"","sources":["../address-system-conventions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;AAiBtD,MAAM,CAAC,MAAM,0BAA0B,GAA0D;IAChG;;;;;;;;;;;;;;;;;OAiBG;IACH,EAAE,EAAE;QACH,aAAa,EAAE,CAAC,eAAe,CAAC;QAChC,eAAe,EAAE,mBAAmB;KACpC;IAED;;;;;;;;;;;;;OAaG;IACH,EAAE,EAAE;QACH,eAAe,EAAE,mBAAmB;KACpC;CACD,CAAA;AAED,iGAAiG;AACjG,MAAM,UAAU,oBAAoB,CAAC,MAAqC;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAA;IAExB,OAAO,0BAA0B,CAAC,MAAM,CAAC,IAAI,IAAI,CAAA;AAClD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/codex",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.1",
|
|
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 OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -124,6 +124,6 @@
|
|
|
124
124
|
"type-fest": "^5.8.0"
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@mailwoman/annotations": "7.8.
|
|
127
|
+
"@mailwoman/annotations": "7.8.1"
|
|
128
128
|
}
|
|
129
129
|
}
|