Skip to content

fix(runctx): one dictionary reader for the CLI, the run and the resolve probe (#856) - #1363

Merged
athvin merged 1 commit into
mainfrom
fix/856-pair-csv-loader
Nov 28, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/856-pair-csv-loader

Conversation

@athvin

@athvin athvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #856

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

What

One reader for lexicon and ignore-words CSVs, er_cli::parse_dictionary_csv, shared by the CLI, the dispatcher's work order (runctx) and the resolve probe. It skips the header row, trims and canonicalizes fields, and sorts and de-duplicates rows. An absent file is an empty dictionary; a malformed file now refuses the run instead of seeding a partial one.

Why

The runctx loader seeded the header row (variant_a,variant_b / word,dictionary) as a pair into the temp relation and the run fingerprint. The probe skipped the header but didn't trim. The CLI had a third, strict reader. So one uploaded file hashed three ways.

Proof

make check exit 0. New er-cli/tests/dictionary_csv.rs (4 tests: header, padding/order/duplicates, malformed row, absent file). Real-Postgres run of pg_lexicon pg_ignore_words pg_launch_proof pg_drain_dispatcher pg_dispatch: 5 passed. er-server lib: 298 passed.

Risk & rollback

One-time promoted full rebuild per tenant that has a lexicon or ignore-words file: lexicon_hash and ignore_words_hash both change in this release, so the drift guard sees a dictionary change once. Shipping both together means one rebuild per tenant, not two. A tenant whose stored file is malformed (writers validate, so none expected) now gets a refused run naming the row. Rollback: git revert <merge-sha> (which re-triggers the same one-time rebuild).

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on brians-MacBook-Pro · 2026-11-28T23:55:58Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: — 4e2bed4; its own rust 46201302719 and frontend 46201302739 were cancelled by the next merge's concurrency group; rust 46201368511 + frontend 46201368505 on 1567d0b (which contains 4e2bed4) success
  • images built, or correctly never ran because nothing that goes into
    an image changed: — success, run 46201302704 (er-cli and er-server changed)
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: — run 46201606129 success; the shared reader runs at the next run's work-order resolve, and no customer tenant is live, so the one-time promoted rebuild costs nothing today
  • 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: — infra, devcontainer success on 4e2bed4
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: — runctx lexicon/ignore-words loader seeds the CSV header row #856 CLOSED by fix(runctx): one dictionary reader for the CLI, the run and the resolve probe (#856) #1363 via automation
  • follow-ups are open for everything deferred here — numbers: — none
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: — the reader is er_cli::parse_dictionary_csv / read_dictionary_file; every new consumer of a lexicon or ignore-words file should call it

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

Measurements

Files

The GET lexicon/ignore-words handlers keep their lenient display readers; they hash nothing.

🤖 Generated with Claude Code

…ve probe (#856)

The dispatcher's runctx loader seeded the CSV header row as a pair
(variant_a,variant_b / word,dictionary) into the temp relation and the
run fingerprint. The resolve probe skipped the header but did not trim.
The CLI had a third, strict reader. One uploaded file was therefore
hashed three ways.

er_cli::parse_dictionary_csv is now the one reader: header skipped,
fields trimmed and canonicalized, rows sorted and de-duplicated.
read_dictionary_file wraps it with absence as an empty dictionary.
runctx refuses a malformed file instead of seeding a partial one, and
the probe returns the error.

Consequence: lexicon_hash and ignore_words_hash change once for every
tenant that has the file, so each pays one promoted full rebuild on its
next run. Both hashes change in this one release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit 4e2bed4 into main Nov 28, 2026
43 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 28, 2026 23:22 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 395c51e6 Deployed Nov 28, 2026 by athvin via remove closed PR previews #127
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.

runctx lexicon/ignore-words loader seeds the CSV header row

2 participants