Repository navigation
fix(api): evidence prefixes are a fixed contract — a model with others is refused, and the key format is documented (#871) - #1439
Merged
Conversation
…s is refused, and the key format is documented (#871) matched_fields, the matched_on filter and the evidence blobs are derived by stripping the hardcoded gamma_ / mw_ / mw_tf_adj_ prefixes. Since POST …/models/versions is a public admin operation, a customer could upload a model with custom *_column_prefix values and silently lose every explanation. Option (a) of the ticket: the defaults are the contract. create_model_version refuses a model whose comparison_vector_value / match_weight / term_frequency_adjustment prefixes are not gamma_ / mw_ / tf_, with a 422 naming each offending key. It does this before any Postgres work. The evidence fields on UncertainPair, ScoredPair and ResolveCandidate now document the key format, so it reaches openapi.public.json. Every fixture model already uses the defaults. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 29, 2026 12:31 — with
GitHub Actions
Inactive
This branch was previously deployed
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 #871
What
Option (a): the default evidence prefixes are the contract.
POST …/models/versionsrefuses a model whosecomparison_vector_value/match_weight/term_frequency_adjustmentcolumn prefixes are notgamma_/mw_/tf_. It returns 422 and names each offending key.evidencefields onUncertainPair,ScoredPairandResolveCandidatedocument the key format (gamma_<c>,mw_<c>,mw_tf_adj_<c>,match_weight), so it reachesopenapi.public.json.Why
A customer admin could upload a custom-prefix model and silently lose
matched_fields,matched_onand every evidence explanation. Choice: (a) over (b). Nothing needs custom prefixes, every fixture uses the defaults, and a fixed documented contract is what a public integrator can rely on. (b) stays possible later as an additive change.Proof
make checkexit 0. Lib testa_model_with_custom_evidence_prefixes_is_refused:match_weight_column_prefix: weight_gets a 422 naming the key, and the stock model passes the check. Grepped every fixture model: all 20 use the defaults.Risk & rollback
An existing custom-prefix model in a registry is not touched; only new uploads are checked. Rollback:
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-29T13:57:27Zmainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not: — 42dbb34, rust 46262703206 + frontend 46262703085 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 46262703065
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — its own deploy 46263120193 FAILED at er-schema-migrate: not this diff, but fix(boot): an org with two datasets each at config v1 fails every boot — ensure_default_dataset_for's config read returns two rows #1445 (my p3live/spill10m second dataset broke every boot). It reached er-dev in deploy 46268589537 (DEPLOY_SHA 6110fdb, contains 42dbb34), which went green; web-api-blue logged 'er-server listening' at 13:40:19Z
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — infra, devcontainer success on 42dbb34
Donethrough the automation rather than byhand, and the issue closed: — Evidence-key prefixes hardcoded in reader + frontend; custom-prefix models lose matched-fields #871 CLOSED by fix(api): evidence prefixes are a fixed contract — a model with others is refused, and the key format is documented (#871) #1439 via automation
(a skill, a reference, memory) — or nothing new was learned: — er-matching pipeline-stages records that the evidence prefixes are a fixed contract
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
🤖 Generated with Claude Code