test(comms): pin roster presence states, nil-source default, visibility clip (RIG-3537) - #1137
Merged
trunk-io[bot] merged 1 commit intoSep 12, 2026
Conversation
…ty clip (RIG-3537) The roster presence join was asserted by one test covering a single non-default enum plus the OFFLINE default. Three cases close that. The presence-state case asserts per-agent (handle -> enum) across WORKING, IDLE, WAITING and the absent-from-map OFFLINE default in one read. Per-agent is the point: a set or count assertion still passes when the join maps one agent's enum onto another's entry, which is the bug this catches. WAITING is the ask-pending state and the one most likely to regress silently. The nil-source case pins the hub-less contract documented in presence_source.go — GetRoster guards on a nil presence source and re-applies the OFFLINE default, so a caller with no hub wired reads OFFLINE for every agent rather than panicking. The clipping case covers a member structurally present in the vantage's tree but invisible to the caller: it must be dropped entirely, not returned blanked. It is canary-ordered, so an unrelated empty roster cannot pass it. Mutation-verified, each against production code: - rotating the presence map by one agent fails the per-agent case - removing the `c.presence != nil` guard fails the nil-source case - disabling the visibility skip fails the clipping case Co-authored-by: Matt Wilkinson <matt@rigel.build>
This was referenced Sep 12, 2026
rigel-mintaka
added this pull request to stack #1124
September 12, 2026 02:19
rigel-mintaka
marked this pull request as ready for review
September 12, 2026 02:20
|
Compass engineering docs preview: https://compass-comms-rig3537-roster.compass-eng-docs.pages.dev Deployed from |
mattwilkinsonn
approved these changes
Sep 12, 2026
|
😎 Stack merged successfully - details. |
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:
mainThe roster presence join was asserted by one test covering a single non-default
enum plus the OFFLINE default. Three cases close that.
The presence-state case asserts per-agent (handle -> enum) across WORKING, IDLE,
WAITING and the absent-from-map OFFLINE default in one read. Per-agent is the
point: a set or count assertion still passes when the join maps one agent's enum
onto another's entry, which is the bug this catches. WAITING is the ask-pending
state and the one most likely to regress silently.
The nil-source case pins the hub-less contract documented in presence_source.go —
GetRoster guards on a nil presence source and re-applies the OFFLINE default, so
a caller with no hub wired reads OFFLINE for every agent rather than panicking.
The clipping case covers a member structurally present in the vantage's tree but
invisible to the caller: it must be dropped entirely, not returned blanked. It is
canary-ordered, so an unrelated empty roster cannot pass it.
Mutation-verified, each against production code:
c.presence != nilguard fails the nil-source caseCo-authored-by: Matt Wilkinson matt@rigel.build