feat(store): watermark persistence + enabled-repo enumeration (RIG-2883 T4) - #705
Open
rigel-mintaka wants to merge 2 commits into
Open
feat(store): watermark persistence + enabled-repo enumeration (RIG-2883 T4)#705rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
…83 T4) The board webhook lane's durable state, additive on the pre-live `0001_init.sql`. - `forge_repo_subscriptions` gains `swept_updated_at` (the per-repo updated-at watermark; NULL = never swept) and `list_etag` (the conditional-GET etag for the repo LIST walk), plus `LoadForgeRepoWatermark`/`StoreForgeRepoWatermark` (advance-after-sink; unknown coordinate reads zero/empty, store on a missing row is `ErrNotFound`), `ListEnabledForgeRepos` (ascending cross-coordinate enumeration for the reconciler), and `IsEnabledForgeRepo` (the point membership check the webhook arm gates on). - `issues` gains `forge_updated_at TIMESTAMPTZ`, INERT this slice — the OQ-6(a) recency-guard column. T4a threads its write path and makes the upsert conditional; the bare column is a no-op until then. The `forge_list_cursors` table and its store methods (`ForgeListCursor`/`UpsertForgeListCursorPage`/`PruneForgeListCursorPages`) stay: they retire atomically with their `serve.go` poll-driver consumer in T5, so this slice never breaks the tree build. pgtest covers the watermark round-trip, coordinate isolation, enabled-repo enumeration + point membership, and that the edited migration applies on a fresh database with the three new columns present. Spec-impact: none. Refs RIG-2883 Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Compass engineering docs preview: https://compass-forge-rig-2883-t4-st.compass-eng-docs.pages.dev Deployed from |
…cks (RIG-2883 T4) ListEnabledForgeRepos / IsEnabledForgeRepo key on repo alone, matching the frozen repo-keyed ingest seam, while the watermark methods are coordinate-keyed (provider, host, repo). Unambiguous in a github.com-only deployment; documents the latent cross-coordinate ambiguity so a future multi-host enablement threads (provider, host) through the seam first. Refs RIG-2883 Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
marked this pull request as ready for review
August 28, 2026 05:41
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.
This PR is part of a stack containing 2 PRs:
mainThe board webhook lane's durable state, additive on the pre-live
0001_init.sql.forge_repo_subscriptionsgainsswept_updated_at(the per-repo updated-at watermark; NULL = never swept) andlist_etag(the conditional-GET etag for the repo LIST walk), plusLoadForgeRepoWatermark/StoreForgeRepoWatermark(advance-after-sink; unknown coordinate reads zero/empty, store on a missing row isErrNotFound),ListEnabledForgeRepos(ascending cross-coordinate enumeration for the reconciler), andIsEnabledForgeRepo(the point membership check the webhook arm gates on).issuesgainsforge_updated_at TIMESTAMPTZ, INERT this slice — the OQ-6(a) recency-guard column. T4a threads its write path and makes the upsert conditional; the bare column is a no-op until then.The
forge_list_cursorstable and its store methods (ForgeListCursor/UpsertForgeListCursorPage/PruneForgeListCursorPages) stay: they retire atomically with theirserve.gopoll-driver consumer in T5, so this slice never breaks the tree build. pgtest covers the watermark round-trip, coordinate isolation, enabled-repo enumeration + point membership, and that the edited migration applies on a fresh database with the three new columns present.Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson matt@rigel.build