Repository navigation
fix(match): variant_match resolves its variants column by entity type (#662) - #843
Merged
Merged
Conversation
…#662) er-compile emitted the person lexicon's name_variants column for every entity type, so an account config declaring variant_match compiled, passed config_check, published, and failed every run at predict with a Binder Error. The compiler now resolves the column from config.entity_type — name_variants for person (byte-identical output, the compile oracle is unmoved), company_variants for account (the byte string the hand-authored acct_model_v1.json already pins). The issue's part 1 — a config_check refusal — is deliberately NOT here: it was the stopgap for a compiler that could not resolve the column, and with the column resolved the refusal would reject a config that now works. Coverage: the unit assertion beside the person one in the_committed_models_level_sql_is_what_the_tokens_render, and a new acct e2e (fixtures/static/acct_10/config_variant.yaml = the measured config_domain_jw.yaml + the level) that compiles it and resolves the corpus exactly at the measured scale — the issue's repro, kept green.
athvin
marked this pull request as ready for review
November 8, 2026 07:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #662
What
Why
Proof
Risk & rollback
Post-merge ledger
Closed by: agent · codex session
01a1b861-d8a0-7400-8aae-17fdde0059econbrians-MacBook-Pro· 2026-11-08T07:44:47Zmainis green with this change on it — 7fdf5b3: rust, frontend,infra, devcontainer, images, deploy all success on the merge SHA itself:
imagesbuilt — the compiler ships inside the engine image, so imageinputs changed; run 42458643027 success, deploy fired off it:
deployconverged — run 42458919308's smoke step loggeder-api-preview /readyz -> 200ander-web-preview /api/healthz -> 200("the blue colour serves through its own Services") before cutover. A
pod-level log line beyond the smoke probe was not observable from this
session — no cluster credentials (kubectl: "the server has asked for the
client to provide credentials"):
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy success on 7fdf5b3; drift's and kind's scheduled
legs were green this morning (b4b0b0f 06:02Z, b586498 04:40Z), both
pre-merge as their schedules dictate:
Donethrough the automation rather than byhand, and the issue closed: variant_match is person-only in er-compile — an account config that declares it publishes, then fails every run #662 CLOSED, card Done — verified:
deferred; the ticket's part 1 (a config_check refusal) is deliberately
absent because part 2 makes it a refusal of a config that works:
(a skill, a reference, memory) — or nothing new was learned: the
Discoveries below carry the line-drift correction, the level-vs-exact
semantics of a one-element variants list, and the grid-stability reason
the fix's fixture is its own file:
Specific to this change
Context — plan, discoveries, measurements, files
Plan
variants_column(entity_type)helper — person →name_variants, account →company_variants— threaded fromcompile_with(which hasconfig.entity_type) throughcompile_comparison/compile_groupintoresolve_level/resolve_level_pair/resolve_group_level. Thevariant_matcharm emitsarray_length(list_intersect("<col>_l", "<col>_r")) >= 1via the sameside()quoting every other level uses.side("name_variants", …)renders exactly the string the arm hardcodes today, so thereproduces_committed_modeloracle and the existing unit assertions stay byte-identical on the person path.variant_matchoncompany_name_normcompiles to thecompany_variantsSQL (the byte string the hand-authoredacct_model_v1.jsonalready carries); the person assertion is unchanged.fixtures/static/acct_10/config_variant.yaml) declaringvariant_matchoncompany_name_norm, plus oneacct_e2etest that compiles it and runs the pipeline — the issue's repro, kept green. The sharedacct_10/config.yamlkeeps its levels unchanged so the scale-grid assertions do not move; its stale bug comment is rewritten to point at the working config.make check; the acct e2e withDEDUPE_E2E_DUCKLAKE=1.What this deliberately does not do
config_checkrefusal (part 1) is the stopgap for a compiler that cannot resolve the column; with the column resolved, refusing would reject a config that now works.variant_matchstays non-group_capable— a cross-field group over it has no pairwise reading, unchanged.Discoveries
resolve_level_pair— plus a test assertion. The second site was line-drift.company_variantsis genuinely populated:er-std::sql::company_variantsfills it in standardize, andacct_int_std_recorddeclares itLIST(VARCHAR) NOT NULL.acct_model_v1.jsonalready carries the target level byte-for-byte:array_length(list_intersect("company_variants_l", "company_variants_r")) >= 1— the fix's SQL is pinned by the model, not invented.CompileOptionsis documented as scale-only ("nothing here varies it — not even byentity_type"), so the entity type threads as its own parameter rather than riding the options struct.Measurements
make checkgreen on the branch head (b6f4bc8) — full workspace, incl. the compile-oracle and entities gates.DEDUPE_E2E_DUCKLAKE=1 cargo test -p er-cli --test main acct_→ 5/5 in 26s, including the newvariant_match_runs_on_an_account_config(compiles, runs, resolves acct_10 to truth at 44 bits + auto_merge 0.99).detectjobs.Files
rust/crates/er-compile/src/lib.rs— the threading + the resolved arm + testsfixtures/static/acct_10/config_variant.yaml(new),fixtures/static/acct_10/config.yaml(comment rewrite)rust/crates/er-cli/tests/acct_e2e.rs— the compiles-and-runs coverage