feat(comms): publish message_posted on the event fabric (RIG-3107) - #1333
Open
rigel-mintaka wants to merge 4 commits into
Open
rigel-mintaka wants to merge 4 commits into
rigel-mintaka wants to merge 4 commits into
Conversation
Adds the publish side of the delivery cutover in `docs/designs/infra/runtime/compass-managed-delivery-cutover/design.md` (Plan, T1).
- `NewComms` takes a `fabric.EventFabric`. A nil fabric keeps `message_posted` on the bus only. Every call site passes `nil` until server assembly constructs the fabric.
- After the bus publish, `publishMessagePosted` publishes `EventRef{tenant, message_posted, row id}` on `CommsSubject(tenant, message_posted)`. The tenant comes from `Store.EffectiveTenant`, the exported set-or-bootstrap resolver the hub already uses. The record names it `ResolveTenant`; this reuses the existing export instead of adding a second one.
- The auth registry guard now names the internal compass.v1 service files (runner, agent gateway, guest control) as ungated. Linking the fabric into comms put them in the auth test binary, and they are never mounted behind AdminGate.
- A publish failure after commit is logged and counted on `compass.delivery.fabric_publish_failures`, never returned to the poster.
Tests (pgtest, fake fabric): a genuine post publishes exactly one ref after the row commits; an idempotent retry publishes nothing; a publish failure still succeeds and increments the counter; `RespondToAsk` publishes the answer message.
Spec-impact: none. Refs RIG-3107
Co-authored-by: Matt Wilkinson <matt@rigel.build>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
Compass engineering docs preview: https://compass-managed-rig-3107-fab-a0of.compass-eng-docs.pages.dev Deployed from Changed pages: |
…3107) Review of the T1 publish found a lost-trigger window: - The publish ran on the request ctx. A client hanging up after commit canceled it, and an idempotent retry never republishes, so the post waited for the floor sweep. It now runs on a WithoutCancel ctx bounded by a 5s timeout. - New tests pin a non-bootstrap request tenant to its subject, and pin the publish surviving a cancel mid-ack. The fake keeps its row-read error instead of folding it into a bool. - The design record's T1 interface named Store.ResolveTenant; it now names Store.EffectiveTenant, which landed with the same semantics. Spec-impact: none. Refs RIG-3107 Co-authored-by: Matt Wilkinson <matt@rigel.build>
The cancellation test proved the publish is detached from the request, but removing the 5s timeout left it green. The fake now records the publish deadline, and the test fails when none is set. Spec-impact: none. Refs RIG-3107 Co-authored-by: Matt Wilkinson <matt@rigel.build>
The deadline check caught a missing or longer timeout but passed a shorter one. It now measures from Publish entry and fails on a 2s or 10s bound. Spec-impact: none. Refs RIG-3107 Co-authored-by: Matt Wilkinson <matt@rigel.build>
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:
mainAdds the publish side of the delivery cutover in
docs/designs/infra/runtime/compass-managed-delivery-cutover/design.md(Plan, T1).NewCommstakes afabric.EventFabric. A nil fabric keepsmessage_postedon the bus only. Every call site passesniluntil server assembly constructs the fabric.publishMessagePostedpublishesEventRef{tenant, message_posted, row id}onCommsSubject(tenant, message_posted). The tenant comes fromStore.EffectiveTenant, the exported set-or-bootstrap resolver the hub already uses. The record names itResolveTenant; this reuses the existing export instead of adding a second one.compass.delivery.fabric_publish_failures, never returned to the poster.Tests (pgtest, fake fabric): a genuine post publishes exactly one ref after the row commits; an idempotent retry publishes nothing; a publish failure still succeeds and increments the counter;
RespondToAskpublishes the answer message.Spec-impact: none. Refs RIG-3107
Co-authored-by: Matt Wilkinson matt@rigel.build
Enqueue
Do not enqueue this PR alone. Production passes a nil fabric until T3 wires it, so T1 on its own publishes nothing. T2+T5 and T3 will stack on this branch; enqueue at the stack tip (T3) once it exists.