feat(stovepipe): record the validation fact and decide greenness from it - #555
Merged
Merged
Conversation
Every succeeded or failed request now writes an immutable whole-repository fact before the bookmark moves, and the advance is gated on the stored fact rather than the request state, so a redelivery cannot reach a different verdict than the original.
…the interval The previous wording claimed intermediate values describe partial breakage without saying for what, which read as though a whole-repository build could be partly green. Addresses review feedback on #552.
roychying
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
August 10, 2026 17:22
mnoah1
approved these changes
Aug 10, 2026
roychying
had a problem deploying
to
stack-rebase
August 11, 2026 17:25 — with
GitHub Actions
Failure
behinddwalls
deleted the
chenghan.ying/stovepipe-record-validation-fact
branch
August 11, 2026 22:40
mnoah1
added a commit
that referenced
this pull request
Aug 13, 2026
…mework The record stage landed in #555 while this doc still read as a proposal, so the RFC described a design rather than the code. Re-frames it as-built and corrects the contract details that drifted: ValidationFact carries no Queue field (the queue is the store binding and the leading PK column), Get takes (uri, project), the Record payload carries queue_name beside the request id, degrees are the named DegreeGreen/DegreeBroken constants, LastGreenRequestID is shipped rather than proposed, and the bookmark's CAS conflict is absorbed by the retry loop rather than returned. Adds the two algorithm steps the doc omitted (deserialize, per-queue storage resolution) and the ordering rationale for advancing the bookmark only after the fact is durable. Replaces the inline Hooks design with integration against hook-framework.md, which supersedes it: a HookEvent published to a per-domain hook topic and dispatched to a pluggable extension, not a Notify() call out of the stage. Records where the publish belongs, the event shape, and the decision that `type` names the scope (validation.repository.recorded) rather than the outcome, since scope is the axis consumers cannot route on later. Documents that record_dlq has no consumer even though dead-lettering is enabled on the subscription, so rejected messages accumulate unread.
mnoah1
added a commit
that referenced
this pull request
Aug 13, 2026
…mework The record stage landed in #555 while this doc still read as a proposal, so the RFC described a design rather than the code. Re-frames it as-built and corrects the contract details that drifted: ValidationFact carries no Queue field (the queue is the store binding and the leading PK column), Get takes (uri, project), the Record payload carries queue_name beside the request id, degrees are the named DegreeGreen/DegreeBroken constants, LastGreenRequestID is shipped rather than proposed, and the bookmark's CAS conflict is absorbed by the retry loop rather than returned. Adds the two algorithm steps the doc omitted (deserialize, per-queue storage resolution) and the ordering rationale for advancing the bookmark only after the fact is durable. Replaces the inline Hooks design with integration against hook-framework.md, which supersedes it: a HookEvent published to a per-domain hook topic and dispatched to a pluggable extension, not a Notify() call out of the stage. Records where the publish belongs, the event shape, and the decision that `type` names the scope (validation.repository.recorded) rather than the outcome, since scope is the axis consumers cannot route on later. Documents that record_dlq has no consumer even though dead-lettering is enabled on the subscription, so rejected messages accumulate unread.
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.
Why?
recordcurrently derives greenness straight fromrequest.Stateand writes nothing durable except the queue's last-green bookmark. This PR switchs to read the fact from the fact storeWhat?
Restructured
record's greenness track:succeeded0, then advance if the stored fact is greenfailed1, no advancecancelledfailedsuperseded/ otherThe new
recordFactreturns the fact that is actually stored, which is not always the one just built. OnErrAlreadyExistsit loads the winner: sameRequestIDmeans this delivery's own prior write (a redelivery after the fact landed but before the bookmark moved), so it adopts it and continues; a differentRequestIDis an invariant violation — two requests can't validate one URI given ingest's(queue, uri)dedup — and is non-retryable.Ordering is fact first, bookmark second. The fact is the durable record; the bookmark is a derived cache that self-heals, since
CompareRequestIDonly moves forward. The reverse order could leave a bookmark with no fact behind it.Now it only handles the whole repo greenness. Project-scope greenness should come in the
analyzestep.Test Plan
Issue