@mailwoman/neural-weights-de-de 8.6.0 → 9.1.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.
package/model-card.json CHANGED
@@ -10,7 +10,8 @@
10
10
  "format": "PIX1 placetype-pair index \u2014 a retrieval-augmented (Ortsteil, Gemeinde) dependent_locality prior, e.g. (\"Nippes\", \"K\u00f6ln\")",
11
11
  "source": "Who's On First admin hierarchy ($MAILWOMAN_DATA_ROOT/wof/admin-global-priority.db). Children: borough + neighbourhood (WOF's typing for Ortsteile/Stadtteile). Parents: locality, localadmin, borough. No postal register: Deutsche Post routes 'PLZ Stadt' and carries no Ortsteil field, so WOF is the source \u2014 the same call the US instance made and the opposite of France's, where BAN's lieu-dit field IS the postal line.",
12
12
  "pairs": 85603,
13
- "bytes": 2160583,
13
+ "bytes": 2246525,
14
+ "$comment_pix2": "PIX2 (schema 3, 2026-08-04): every record now carries the PARENT's ComponentTag alongside the child's \u2014 +1 byte per pair, pair COUNT unchanged. The recorded parent tag is the WOF parent ROW's placetype projected through PLACETYPE_PROJECTION, so a locality/localadmin parent reads `locality` and a borough parent reads `dependent_locality`. This artifact deliberately ships WITHOUT a `parentDelta`: no board has graded the parent side for this locale, and the D-rule's answer to an unmeasured locale is a per-locale gate rather than a magnitude inherited from us/gb/nz/fr. Absent means the parent bias is OFF here, not zero.",
14
15
  "delta_calibration": "\u03b4=10, transitionBeta=5 \u2014 inherited from the GB calibration per R5's finding that the classifier's dependent_locality deficit is uniform across locales.",
15
16
  "country_gate": "hard-gated on the header's country (de).",
16
17
  "requires_leading_postcode_strip": "This artifact is INERT without the `de` entries in SEGMENT_PARENT_POSTCODE_SHAPES and LEADING_POSTCODE_COUNTRIES (neural/placetype-pair-prior.ts). German addresses write '50733 K\u00f6ln', so a parent segment folds to a key no bare-Gemeinde entry matches \u2014 measured: the index alone changed nothing until both entries landed. Same dependency FR's artifact carries.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/neural-weights-de-de",
3
- "version": "8.6.0",
3
+ "version": "9.1.0",
4
4
  "description": "German (de-DE) weights overlay for mailwoman — data-only; shares the base model with @mailwoman/neural-weights-en-us and ships the DE placetype-pair index.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -15,14 +15,15 @@
15
15
  "*.ts",
16
16
  "**/*.ts",
17
17
  "!*.test.ts",
18
- "!**/*.test.ts"
18
+ "!**/*.test.ts",
19
+ "!scripts/**"
19
20
  ],
20
21
  "type": "module",
21
22
  "publishConfig": {
22
23
  "access": "public"
23
24
  },
24
25
  "dependencies": {
25
- "@mailwoman/neural-weights-en-us": "8.6.0"
26
+ "@mailwoman/neural-weights-en-us": "9.1.0"
26
27
  },
27
28
  "mailwoman": {
28
29
  "baseWeights": "@mailwoman/neural-weights-en-us"
package/pair-index-de.bin CHANGED
Binary file
@@ -1,117 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Dev-weights linker for `@mailwoman/neural-weights-de-de` (hierarchy campaign R9).
7
- *
8
- * This overlay ships exactly ONE artifact — `pair-index-de.bin` — because it declares
9
- * `mailwoman.baseWeights` and shares the base model/tokenizer with the en-us package. There is
10
- * nothing to symlink; the only job is building the index so `resolveWeights({locale: "de-de"})`
11
- * surfaces `pairIndexPath` in local dev.
12
- *
13
- * The index is INERT without the `de` entries in `SEGMENT_PARENT_POSTCODE_SHAPES` and
14
- * `LEADING_POSTCODE_COUNTRIES` (`neural/placetype-pair-prior.ts`): German addresses write
15
- * "50733 Köln", so a parent segment folds to a key no bare-Gemeinde entry matches. Measured
16
- * during R9 — the artifact alone changed nothing until both landed.
17
- */
18
-
19
- import { spawnSync } from "node:child_process"
20
- import { existsSync, readFileSync } from "node:fs"
21
- import { resolve } from "node:path"
22
-
23
- import { dataRootPath, repoRootPath } from "@mailwoman/core/utils"
24
-
25
- const PKG_DIR = String(repoRootPath("neural-weights-de-de"))
26
- const CLI = String(repoRootPath("mailwoman", "out", "cli.js"))
27
- const PAIR_INDEX_BIN_DEST = resolve(PKG_DIR, "pair-index-de.bin")
28
- /**
29
- * Checked-in WOF-derived (Ortsteil, Gemeinde) pairs — the same posture as the GB secondary sources.
30
- */
31
- const WOF_ADMIN_DB = String(dataRootPath("wof", "admin-global-priority.db"))
32
- /**
33
- * Calibrated magnitudes — the pair the R9 bars were measured at (0/70 confound FPs, 60/60 tag-correct).
34
- */
35
- const PAIR_INDEX_DELTA = 10
36
- const PAIR_INDEX_TRANSITION_BETA = 5
37
-
38
- /**
39
- * Minimal PIX1 header reader — magic + header only, reimplemented so this data-only package gains no dependency on
40
- * `@mailwoman/neural` (which pulls onnxruntime-node) to read two fields.
41
- */
42
- function peekPairIndexHeaderFields(path: string): { delta: number; transitionBeta: number | undefined } {
43
- const bytes = readFileSync(path)
44
- const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength)
45
- // "PIX1" little-endian.
46
- const MAGIC = 0x31_58_49_50
47
-
48
- if (view.getUint32(0, true) !== MAGIC) {
49
- throw new Error(`pair index: bad magic reading ${path}`)
50
- }
51
-
52
- const headerLen = view.getUint32(4, true)
53
- const header = JSON.parse(Buffer.from(bytes.subarray(8, 8 + headerLen)).toString("utf8")) as {
54
- delta: number
55
- transitionBeta?: number
56
- }
57
-
58
- return { delta: header.delta, transitionBeta: header.transitionBeta }
59
- }
60
-
61
- if (!existsSync(CLI)) {
62
- console.error(`WARNING: ${CLI} not built — run \`yarn compile\` first, then re-run for pair-index-de.bin.`)
63
- } else if (!existsSync(WOF_ADMIN_DB)) {
64
- console.error(`WARNING: missing ${WOF_ADMIN_DB} — pair-index-de.bin not built.`)
65
- } else {
66
- let needsRebuild = true
67
-
68
- if (existsSync(PAIR_INDEX_BIN_DEST)) {
69
- try {
70
- const header = peekPairIndexHeaderFields(PAIR_INDEX_BIN_DEST)
71
-
72
- if (header.delta !== PAIR_INDEX_DELTA) {
73
- console.log(`rebuilding pair-index-de.bin — delta ${header.delta} → ${PAIR_INDEX_DELTA}`)
74
- } else if (header.transitionBeta !== PAIR_INDEX_TRANSITION_BETA) {
75
- console.log(
76
- `rebuilding pair-index-de.bin — transitionBeta ${header.transitionBeta} → ${PAIR_INDEX_TRANSITION_BETA}`
77
- )
78
- } else {
79
- needsRebuild = false
80
- }
81
- } catch (error) {
82
- console.log(`rebuilding pair-index-de.bin — header unreadable (${(error as Error).message})`)
83
- }
84
- }
85
-
86
- if (!needsRebuild) {
87
- console.log(`skipped pair-index-de.bin build — ${PAIR_INDEX_BIN_DEST} is current`)
88
- } else {
89
- const result = spawnSync(
90
- process.execPath,
91
- [
92
- CLI,
93
- "gazetteer",
94
- "pair-index",
95
- "--out",
96
- PKG_DIR,
97
- "--country",
98
- "de",
99
- "--delta",
100
- String(PAIR_INDEX_DELTA),
101
- "--transition-beta",
102
- String(PAIR_INDEX_TRANSITION_BETA),
103
- "--borough-db",
104
- WOF_ADMIN_DB,
105
- ],
106
- { stdio: "inherit" }
107
- )
108
-
109
- if (result.status !== 0 || !existsSync(PAIR_INDEX_BIN_DEST)) {
110
- console.error(`FAILED: gazetteer pair-index --country de (exit ${result.status})`)
111
-
112
- process.exit(1)
113
- }
114
-
115
- console.log(`built pair-index-de.bin ← ${WOF_ADMIN_DB}`)
116
- }
117
- }