Skip to content

feat(stovepipe): add the ValidationFact entity and its create-only queue-scoped store - #552

Merged
roychying merged 2 commits into
mainfrom
chenghan.ying/stovepipe-validation-fact-store
Aug 7, 2026
Merged

feat(stovepipe): add the ValidationFact entity and its create-only queue-scoped store#552
roychying merged 2 commits into
mainfrom
chenghan.ying/stovepipe-validation-fact-store

Conversation

@roychying

Copy link
Copy Markdown
Contributor

Why?

record currently derives greenness straight from request.State and writes nothing durable beyond the queue's last-green bookmark. The record RFC (#394) calls for an immutable ValidationFact per validated commit — "how broken was this scope at this URI?" — with every decision after the fact is written reading the fact rather than the request.

This PR adds the entity, the store contract, and the MySQL implementation.

What?

  • entity.ValidationFact — identity (queue, uri, project); carries Degree, RequestID, CreatedAt. Plus DegreeGreen/DegreeBroken constants and IsGreen(), so the float comparison lives in one place instead of Degree == 0 at call sites.
  • ValidationFactStoreCreate (returns ErrAlreadyExists) and Get (returns ErrNotFound). No Update: facts are create-only and first-writer-wins, so the first fact for an identity is the permanent answer.
  • MySQL impl + validation_fact.sql, wired into the queue-scoped Storage aggregate.

Test Plan

Issue

…eue-scoped store

Facts record how broken a scope was at a commit, keyed by (queue, uri,
project) and immutable once written. Nothing writes them yet; the record
controller adopts them next.
@roychying
roychying requested review from a team, behinddwalls and sbalabanov as code owners August 7, 2026 21:55
Comment thread stovepipe/entity/validation_fact.go
@roychying
roychying added this pull request to the merge queue Aug 7, 2026
Merged via the queue into main with commit 9a1cafa Aug 7, 2026
15 checks passed
@roychying
roychying deployed to stack-rebase August 7, 2026 22:22 — with GitHub Actions Active
@behinddwalls
behinddwalls deleted the chenghan.ying/stovepipe-validation-fact-store branch August 7, 2026 22:22
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.

2 participants