feat: migrate scoring features to namespaced keys - #10
Merged
Merged
Conversation
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.
Feature keys now use
core.*,email.*, andbrand.*namespaces. For example,key_totalbecomescore.credential_total. Rules, weights, extraction, stage gating, CLI inputs, corpus exports, stored reasons, and evaluation artifacts move together; legacy score/corpus inputs fail withfeature_renamedand the replacement name.This implements P1 of the approved generic-feature design. The local scorer keeps the original summation order through immutable registry metadata, and
core.Vectorcarries hash-bucket widths without rounding scorer inputs. Three new namespaced oracles preserve all 8,671 P0 points on ARM64 and both AMD64 math paths. Original flat references remain unchanged; a permanent parity test permits only name/hash/version changes.Corpus-v2 and cassettes carry
feature_key_space: ns-v1. Migration 008 atomically rewrites stored feature keys and rejects unknown flat keys or collisions. Historical reason text remains version 1; new reasons carry version 2 through storage and the Go client. This is a deliberate predeployment format break, with migration guidance in README; no production operations or deployment changes.Validation:
ABUSEKIT_REQUIRE_DB=1 go test ./..., lint, and synthetic evaluation gate pass.Independent and adversarial review passed after fixes in
d3ff2f8:CI observation: the first run on
d3ff2f8passed all rename/golden/migration checks but failedTestEvaluateSubject_ShortDeadlineDuringClaimNeverLeaksLeaseonce. The lease implementation and test body are unchanged by P1. Focused reproduction passed 20 repetitions on this branch and 100 on base050ebad; this does not establish the intermittent failure's cause. The failed job passed on rerun without source/test changes; all four final CI checks are green (run 37169875026). The intermittent lease-cleanup failure remains an unresolved follow-up investigation. P1s, tenant profiles, the pack engine, vendor adapters, and hosted deployment remain separate slices.