feat(forge): notify router + snapshot apply (RIG-2732) - #676
Open
rigel-mintaka wants to merge 2 commits into
Open
feat(forge): notify router + snapshot apply (RIG-2732)#676rigel-mintaka wants to merge 2 commits into
rigel-mintaka wants to merge 2 commits into
Conversation
This was referenced Aug 27, 2026
Open
|
Compass engineering docs preview: https://compass-forge-rig-2732-t4-ro.compass-eng-docs.pages.dev Deployed from |
T4: the `ForgeEvent` hot path — `NotifyRouter.Route` + pure `ApplyEvent`/`SnapshotRevision`. - `notify_router.go`: package-local structural seams (`NotifyStore`, `NotifyDispatcher`, `ChecksRoller`) + `NotifyRouter`. `Route` runs the frozen algorithm (design.md:841-872): load prior snapshot -> resolve CHECKS roll-up before apply -> `ApplyEvent` -> upsert cursor BEFORE notify -> resolve subs (OPENED=container/project-matched, per-artifact=exact coordinate) -> dispatch a `ForgeNotification` carrying revision. Never advances `delivered_revision` (W3, ack-driven). - `notify_detect.go`: `ArtifactSnapshot` canonical form + pure `ApplyEvent` + `SnapshotRevision` (sha256 of canonical JSON, sorted checks, map-keyed comments) — the cross-producer meeting-point contract shared with T5. - Red-first unit tests with fakes for both seams, incl. the meeting-point invariant. Reconciled seams (single-admissible readings, not open forks): `NotifyStore` gained `LoadArtifactCursor` (the frozen 3-method block omits the point read the algorithm's step 1 needs); `ChecksRoller` returns a placeholder `ChecksResult` in this commit, collapsed into the real `forge.ConditionalResult[forge.Checks]` by T5 stacked above; UPDATE/REVIEW are snapshot-neutral and labels are excluded from the digest (the `ForgeEvent` currency carries no title/body/labels, so the canonicalization invariant holds trivially). Refs RIG-2732 Co-authored-by: Matt Wilkinson <matt@rigel.build>
…-2732) Review fixes for the notify router slice (PR #676): - Extend `Route`'s coordinate guard to reject `ev.Number == 0`, not just zero provider/kind. The frozen Global Constraint makes a zero number a caller bug for every event kind (ForgeEvent.Number is always set; on OPENED it is the new artifact's number), so a zero-number event must be `ErrInvalidArgument`, never a bogus number-0 cursor write. OPENED is unaffected (it carries the new artifact's number). - Add router error-path tests: a `LoadArtifactCursor` error aborts before upsert/dispatch; a `ChecksRoller` error on a CHECKS event aborts before apply; an `UpsertArtifactCursor` error surfaces and dispatches nothing (proving upsert-before-notify ordering under failure). These fakes exposed the error fields but no test set them. Refs RIG-2732 Co-authored-by: Matt Wilkinson <matt@rigel.build>
rigel-mintaka
force-pushed
the
compass-forge/rig-2732-t2-ingress
branch
from
August 27, 2026 08:51
e8f7a9f to
4e56465
Compare
rigel-mintaka
force-pushed
the
compass-forge/rig-2732-t4-router
branch
from
August 27, 2026 08:52
0732b93 to
5ac4f40
Compare
rigel-mintaka
marked this pull request as ready for review
August 27, 2026 09:05
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 4 PRs:
mainT4: the
ForgeEventhot path —NotifyRouter.Route+ pureApplyEvent/SnapshotRevision.notify_router.go: package-local structural seams (NotifyStore,NotifyDispatcher,ChecksRoller) +NotifyRouter.Routeruns the frozen algorithm (design.md:841-872): load prior snapshot -> resolve CHECKS roll-up before apply ->ApplyEvent-> upsert cursor BEFORE notify -> resolve subs (OPENED=container/project-matched, per-artifact=exact coordinate) -> dispatch aForgeNotificationcarrying revision. Never advancesdelivered_revision(W3, ack-driven).notify_detect.go:ArtifactSnapshotcanonical form + pureApplyEvent+SnapshotRevision(sha256 of canonical JSON, sorted checks, map-keyed comments) — the cross-producer meeting-point contract shared with T5.Reconciled seams (single-admissible readings, not open forks):
NotifyStoregainedLoadArtifactCursor(the frozen 3-method block omits the point read the algorithm's step 1 needs);ChecksRollerreturns a placeholderChecksResultin this commit, collapsed into the realforge.ConditionalResult[forge.Checks]by T5 stacked above; UPDATE/REVIEW are snapshot-neutral and labels are excluded from the digest (theForgeEventcurrency carries no title/body/labels, so the canonicalization invariant holds trivially).Refs RIG-2732
Co-authored-by: Matt Wilkinson matt@rigel.build