Skip to content

feat(match): ignore-words dictionary reaching comparison (#799) - #853

Merged
athvin merged 2 commits into
mainfrom
issue/799-ignore-words
Nov 8, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/799-ignore-words

Conversation

@athvin

@athvin athvin commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Closes #799

🚧 Claimed by an agent session — 2026-11-08T11:43:48Z, codex session 01a1b861-d8a0-7400-8aae-17fdde0059ec on Mac.
The claim is this open draft PR: closing it releases the ticket.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Adds the spec's second dictionary type: a per-org ignore-words dictionary
(word, dictionary rows), reaching comparison exactly the way the synonym
lexicon does — per-org file (ER_IGNORE_WORDS_PATH), GET/PUT API, seeded per
run, consumed by a new ignore_words transform at standardize time, and
fingerprinted into the run ledger (runs.ignore_words_hash) so a dictionary
edit promotes the next incremental run to a full one.

Also fixes what the feature exposed: the Account standardize arm never
consumed transforms at all — a tenant config declaring one on an account
corpus was silently ignored.

Why

Acme Inc vs Acme LLC should agree under a tenant-editable dictionary. Zero
matches for ignore_words or stopword existed in the tree — the only suffix
handling was a hard-coded list inside company_name_norm that no tenant can
edit.

Proof

make check, make frontend both green. DuckLake e2e golden
(acct_e2e::ignore_words_dictionary_decides_an_account_pair): "Acme Pty" vs
"Acme" — pty deliberately outside company_name_norm's hard-coded list —
co-cluster exactly when legal_suffixes carries it, and the standardized
company_name_norm differs without it (the account comparison set is
company_name: [exact, null] alone, so the dictionary is decisive on both
sides). pg_ignore_words.rs covers GET/PUT (canonicalise+dedupe, both
validation refusals, the enqueued run_all_full). Box 3 (explanation names
the preprocessing) is deferred to spec unit 1.22 per the ticket's own escape
hatch — reasoning recorded in an issue comment on #799.

Risk & rollback

Additive: a new transform op (configs that don't declare it render
byte-identically — asserted by every pre-existing std golden passing), a new
nullable runs column reconciled at boot, a new endpoint. Legacy
ignore_words_hash = NULL rows drift once into one promoted full rebuild, the
same shape as the lexicon's introduction. git revert <merge-sha>.

Post-merge ledger

Closed by: agent · codex session 01a1b861-d8a0-7400-8aae-17fdde0059ec on brians-MacBook-Pro · 2026-11-08T14:15:00Z

  • main is green with this change on it — merge SHA 44f2e2e4; runs on that SHA all success: rust 42487756749, frontend 42487756744, infra 42487756727, devcontainer 42487756741
  • images built — run 42487756768 success on the merge SHA
  • deploy converged — run 42488145009; smoke lines er-api-preview /readyz -> 200, er-web-preview /api/healthz -> 200, the blue colour serves through its own Services
  • the push-only surface no pull request can pre-test (deploy, drift, kind's nightly leg) is green, or knowingly red for a reason that is not this change: deploy green with the smoke lines above; drift and kind's nightly leg are schedule-triggered rather than push-triggered, and nothing push-only is red
  • the board card reached Done through the automation rather than by hand, and the issue closed: feat(match): ignore-words dictionary, and preprocessing visible in the explanation #799 is CLOSED and the card reads Done (read back from the board after the merge)
  • follow-ups are open for everything deferred here — numbers: Settings UI: ignore-words dictionary editor #855 (settings-UI ignore-words editor), runctx lexicon/ignore-words loader seeds the CSV header row #856 (runctx loader seeds the CSV header row); done-when box 3 deferred to spec unit 1.22 via comment on feat(match): ignore-words dictionary, and preprocessing visible in the explanation #799
  • what was learned is written down where the next session will find it (a skill, a reference, memory) — or nothing new was learned: in this body's Discoveries and the commit message — DuckDB rejects subqueries inside lambdas (and map_extract wraps its values), the account stg arm silently dropped transforms, and the lake runs DDL lives in er-schema's S5 registry

Specific to this change

Context — plan, discoveries, measurements, files

Plan

  • er-config: TransformRule::IgnoreWords { dictionary } rendered by
    apply_sql as a token-wise filter. Case-insensitive match, survivors
    verbatim, NULL-propagating. Configs without the op are byte-identical.
  • er-std: ignore_words pure module — directed canonical_row (no
    orientation swap, unlike the lexicon) + ignore_words_hash reusing the
    lexicon's separators.
  • er-cli: seed_ignore_words (relation + macro, empty-safe both ways),
    PipelineInputs.ignore_words, Dictionaries grouping for
    resolve_record, --ignore-words on er standardize/run-all.
  • entities/run: nullable ignore_words_hash column + create/start and
    read/latest_fingerprint statements; regenerated (incl. the er-schema
    S5 registry + its golden, which is where the lake runs DDL actually
    comes from). er-versions: sixth RunFingerprint field +
    ignore_words_change rebuild reason.
  • er-server: runctx loads ER_IGNORE_WORDS_PATH; the dispatcher seeds
    it; the resolve probe re-seeds it (same dictionaries as the corpus);
    GET/PUT /v1/orgs/{org}/datasets/{ds}/ignore-words mirroring the
    lexicon API (Viewer+ read of the packaged legal-suffix default, Steward+
    canonicalise + validate + write + run_all_full skip-ingest apply job).
  • BFF: /api/orgs/[org]/datasets/[ds]/ignore-words route mirroring the
    lexicon's (viewer GET, steward PUT, zod shape check).
  • Golden (box 2): account-side, pty outside the hard-coded suffix list —
    see Proof. Box 3: deferred to 1.22, recorded on feat(match): ignore-words dictionary, and preprocessing visible in the explanation #799.
  • Follow-ups filed: Settings UI: ignore-words dictionary editor #855 (settings-UI editor), runctx lexicon/ignore-words loader seeds the CSV header row #856 (runctx loader seeds
    the CSV header row — pre-existing lexicon bug this feature inherits).

Discoveries

  • company_name_norm ALREADY strips one trailing legal suffix from a
    hard-coded list — the ticket's literal Acme Inc/Acme LLC example agrees
    today. The gap is the tenant-editable dictionary, so the golden uses a word
    outside the hard-coded list (a golden that passes without the dictionary
    proves nothing).
  • DuckDB's binder rejects subqueries inside lambda expressions, which
    rules out the lexicon's correlated-subquery shape for a token filter, and
    map_extract/element_at on a map(varchar, varchar[]) return
    varchar[][] besides. The transform therefore reads
    er_ignore_words(), a temp macro the seeder creates from the same rows: a
    flat varchar[] of dictionary ‖ chr(31) ‖ word entries (the hash's unit
    separator; the write path refuses control chars, so the encoding cannot
    collide). The seeded relation stays as the inspectable record, matching the
    lexicon's shape.
  • The Account stg arm never called transformed() — account configs'
    transforms were silently dropped. Fixed here (empty-transform SQL is
    byte-identical; every pre-existing acct std golden passes unchanged).
  • runctx's shared CSV loader does not skip the header row the PUT endpoints
    write, so a bogus header pair is seeded and hashed — pre-existing for the
    lexicon, inherited by ignore-words. Fixing it changes lexicon_hash for
    every tenant (a promoted rebuild each), so it is its own ticket: runctx lexicon/ignore-words loader seeds the CSV header row #856.
  • The lake runs table is created from er_schema::model's S5 registry, not
    the er-entities DDL file — the registry_matches_entities gate
    byte-compares the two, and model_registry_golden.json pins the rendered
    DDL.

Files

  • rust/crates/er-config/src/lib.rs — the op, the renderer, both consts
  • rust/crates/er-std/src/ignore_words.rs — pure core + hash
  • rust/crates/er-cli/src/lib.rs, cli.rs — seeder, Dictionaries, flags
  • rust/crates/er-standardize/src/lib.rs — account arm consumes transforms
  • entities/run/*, rust/crates/er-entities/*, rust/crates/er-schema/* —
    the ignore_words_hash column, three ways
  • rust/crates/er-versions/src/lib.rs — sixth fingerprint field
  • rust/crates/er-server/{lib,runctx,dags/tasks}.rs — API, loader, seeding
  • frontend/src/app/api/orgs/[org]/datasets/[ds]/ignore-words/route.ts — BFF
  • Tests: acct_e2e.rs golden, pg_ignore_words.rs, render-shape unit tests

The spec's second dictionary type (stop words), mirroring the synonym
lexicon's whole path:

- er-config: TransformRule::IgnoreWords { dictionary } rendering a
  whitespace-token filter; seeded per run via the er_ignore_words() temp
  macro (a flat dictionary‖chr(31)‖word literal list — DuckDB's binder
  rejects subqueries in lambdas, ruling out the lexicon's correlated-
  subquery shape)
- er-cli: seed_ignore_words (relation + macro), --ignore-words on
  standardize/run-all, Dictionaries grouping for resolve_record probes
- er-versions: runs.ignore_words_hash joins the run fingerprint (6th
  field); drift forces a promoted full rebuild, exactly like a lexicon
  edit. Legacy NULL rows drift once, same as the lexicon's introduction
- er-server: GET/PUT /v1/orgs/{org}/datasets/{ds}/ignore-words (Viewer+
  read of the packaged legal-suffix default, Steward+ write with
  canonicalise+validate, run_all_full skip_ingest apply job)
- er-standardize: the Account stg arm now consumes transforms at all —
  it silently ignored them, which this feature made observable
- Golden: 'Acme Pty' vs 'Acme' co-cluster exactly when legal_suffixes
  carries pty (outside company_name_norm's hard-coded list)

Closes #799
@athvin athvin changed the title feat(match): ignore-words dictionary, and preprocessing named in the explanation (#799) feat(match): ignore-words dictionary reaching comparison (#799) Nov 8, 2026
@athvin
athvin marked this pull request as ready for review November 8, 2026 13:51
@athvin
athvin merged commit 44f2e2e into main Nov 8, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(match): ignore-words dictionary, and preprocessing visible in the explanation

2 participants