Skip to content

feat(ingest): advance a suppressed subscriber's delivery cursor when caught up (RIG-3326) - #1185

Merged
trunk-io[bot] merged 2 commits into
compass-forge/rig-3326-t1-suppression-seamfrom
compass-forge/rig-3326-t2-cursor-advance
Sep 12, 2026
Merged

feat(ingest): advance a suppressed subscriber's delivery cursor when caught up (RIG-3326)#1185
trunk-io[bot] merged 2 commits into
compass-forge/rig-3326-t1-suppression-seamfrom
compass-forge/rig-3326-t2-cursor-advance

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. feat(ingest): self-origin notification suppression seam and predicate (RIG-3326) #1177
  3. "feat(ingest): advance a suppressed subscriber's delivery cursor when caught up (RIG-3326)" (this PR)

A suppressed notification is never acked, so delivered_revision stays
behind the cursor revision and the reconcile sweep re-delivers the
self-notification as a synthetic UPDATE on every sweep. The suppress
path therefore advances the cursor itself - a narrow amendment to the
rule that the router never advances delivered_revision, since a
suppressed dispatch has no agent to ack it.

The advance is conditional on the subscriber being caught up. Advancing
unconditionally would erase the gap left by a real event that was
dispatched but never delivered, and the agent would never learn of it -
losing work-relevant signal, which is strictly worse than a redundant
wake. Caught-up means delivered_revision equals the cursor revision as
it stood BEFORE this event's upsert, with an empty string for a
coordinate never observed, matching a fresh subscriber's default.

A separate compare-and-set in SQL guards the write, so a concurrent
route cannot erase a gap it did not observe. A lost CAS or a store
fault is logged and swallowed: the sweep then synthesizes one UPDATE,
which degrades open, never closed.

Container-scope subscribers never advance. Their cursor lives on the
number=0 row and the sweep compares it against the container cursor's
revision, so writing an artifact revision there would poison the row
and synthesize an UPDATE every sweep forever.

The ack arm's existing unguarded query is untouched: an ack must land
regardless of the stored value, so the CAS is a sibling query.

Co-authored-by: Matt Wilkinson matt@rigel.build

…caught up (RIG-3326)

A suppressed notification is never acked, so delivered_revision stays
behind the cursor revision and the reconcile sweep re-delivers the
self-notification as a synthetic UPDATE on every sweep. The suppress
path therefore advances the cursor itself - a narrow amendment to the
rule that the router never advances delivered_revision, since a
suppressed dispatch has no agent to ack it.

The advance is conditional on the subscriber being caught up. Advancing
unconditionally would erase the gap left by a real event that was
dispatched but never delivered, and the agent would never learn of it -
losing work-relevant signal, which is strictly worse than a redundant
wake. Caught-up means delivered_revision equals the cursor revision as
it stood BEFORE this event's upsert, with an empty string for a
coordinate never observed, matching a fresh subscriber's default.

A separate compare-and-set in SQL guards the write, so a concurrent
route cannot erase a gap it did not observe. A lost CAS or a store
fault is logged and swallowed: the sweep then synthesizes one UPDATE,
which degrades open, never closed.

Container-scope subscribers never advance. Their cursor lives on the
number=0 row and the sweep compares it against the container cursor's
revision, so writing an artifact revision there would poison the row
and synthesize an UPDATE every sweep forever.

The ack arm's existing unguarded query is untouched: an ack must land
regardless of the stored value, so the CAS is a sibling query.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Sep 12, 2026

Copy link
Copy Markdown

RIG-3326

@rigel-mintaka
rigel-mintaka added this pull request to stack #1186 September 12, 2026 22:20
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 12, 2026 22:20
@github-actions

github-actions Bot commented Sep 12, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-3326-t2-cu.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-3326-t2-cursor-advance at 7750efb.

Both suppress-advance warn logs carried only the subscription and
account, so a failure could not be tied to the artifact it happened on
without cross-referencing the subscription row. The sibling
dispatch-failed log already carries repo and number; match it.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Sep 12, 2026

Copy link
Copy Markdown

😎 Stack merged successfully - details.

@trunk-io
trunk-io Bot merged commit bff25ca into main Sep 12, 2026
15 checks passed
@trunk-io
trunk-io Bot deleted the compass-forge/rig-3326-t2-cursor-advance branch September 12, 2026 23:51
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