Skip to content

feat(server): supersede cached verdicts when record metadata changes - #2431

Merged
tkircsi merged 3 commits into
mainfrom
feat/verdict-invalidation
Oct 29, 2026
Merged

tkircsi merged 3 commits into
mainfrom
feat/verdict-invalidation

Conversation

@tkircsi

@tkircsi tkircsi commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Part of #2343. Does not close it: the "and only those" criterion needs scoping by fact group, which follows in a second PR.

A verdict is reached on the metadata as it stood, and nothing marked it stale when that metadata moved. A scan completing or a signature failing left the old verdict being served as current. Now the write that changes the metadata supersedes the record's verdicts in the same transaction, so the record is withheld until it has been evaluated again rather than served on evidence that moved.

Both read paths already key off EvaluatedPolicyStatuses, so the new superseded status needs no query changes: the gate stops serving the record because it requires a verdict in that set, and the reconciler re-selects it because it selects records without one.

Only effective changes count. The reconciler re-reports the same scan result and re-asserts the same claim on every pass, and invalidating on each would leave the verdict table never settling. The comparison covers exactly the fields server/policy/meta.go projects, excluding the timestamps: those record when the node last looked rather than what it concluded, and GetRecordsNeedingScan bounds on scan_reports.updated_at to schedule rescans, so they cannot be frozen instead.

Six writers, two of which were not in the issue's list of five: UpdateSignatureVerification, which marks a signer failed once it stops appearing in a verification run, and DeleteIdentityClaim, where a fact changes by a row disappearing rather than changing.

Docs: a new "When a Record's Metadata Changes" section, sibling to the existing explanation of what a policy edit does to verdicts.

@tkircsi
tkircsi requested a review from a team as a code owner October 28, 2026 15:01
@tkircsi tkircsi self-assigned this Oct 28, 2026
@tkircsi tkircsi added kind/feature Categorizes issue or PR as related to a new feature. area/dir/server labels Oct 28, 2026
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Oct 28, 2026
@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

@tkircsi
tkircsi added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 0395891 Oct 29, 2026
37 checks passed
@tkircsi
tkircsi deleted the feat/verdict-invalidation branch October 29, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dir/server kind/feature Categorizes issue or PR as related to a new feature. size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants