test(comms): direct coverage for resolve.go's handle-resolution contracts (RIG-3536) - #1030
Open
rigel-mintaka wants to merge 1 commit into
Conversation
|
Compass engineering docs preview: https://compass-comms-rig3536-resolv.compass-eng-docs.pages.dev Deployed from |
rigel-mintaka
force-pushed
the
compass-comms/rig3536-resolve-coverage
branch
from
September 8, 2026 21:52
cfdc94f to
419468b
Compare
rigel-mintaka
marked this pull request as ready for review
September 8, 2026 22:22
rigel-mintaka
force-pushed
the
compass-comms/rig3536-resolve-coverage
branch
from
September 9, 2026 04:56
419468b to
0e2d950
Compare
…acts (RIG-3536) T8 of the RIG-3473 record. resolve.go had no dedicated test file: its contracts were pinned only where other files happened to cross them. The load-bearing case is the vantage-probe closure. resolveVisibleAgentHandle maps a real-but-invisible agent to the SAME NOT_FOUND an unknown handle gets, and that INDISTINGUISHABILITY is the security property -- a distinguishable miss is an existence oracle. So the test asserts it as an equivalence: each submitted spelling is substituted out and the two messages must be byte-identical, the resolved id must not appear, and both must map to CodeNotFound. A paired positive stops a resolver that returns NOT_FOUND for everything from satisfying it, and a fixture guard fails loudly if the invisible agent ever becomes visible, so the assertion cannot go vacuous. The deliberate ASYMMETRY is pinned in the same test: resolveAgentHandle is owner-namespaced but NOT viewer-scoped, so it still resolves that agent. Both halves in one place, because the pair is the contract. Also: submitted-order preservation (ids that do not sort with their handles, so a map-iteration bug yields a wrong permutation rather than an accidental pass); the same bare handle under two owners resolving differently per caller; an unknown owner qualifier naming the SUBMITTED handle; notFoundHandle passing a non-not-found error through by IDENTITY; and empty input short-circuiting before any store call (driven against a nil store, so it can only pass if the guard fires). Batch atomicity is NOT re-proven here. resolveHandles delegates it to store.AccountsByHandles, already covered by TestAccountsByHandlesAtomicMissNamesAll -- so this tier asserts only the pass-through: the sentinel survives, no partial result rides along, and the message equals the store's own verbatim. Test-only; resolve.go is unmodified. Mutation-verified: leaking the resolved id into the visible-miss, ignoring the visibility result, and always re-keying in notFoundHandle each fail with a message naming the defect. gofmt/vet/vet -tags pgtest clean; -race pgtest run ok against a live Postgres, with the new tests confirmed RUN rather than skipped. Ledger-impact: none Refs RIG-3536 Co-authored-by: Matt Wilkinson <matt@rigel.build>
mattwilkinsonn
approved these changes
Sep 10, 2026
|
Stacked PR 1042 was cancelled: a user cancelled it. |
rigel-mintaka
force-pushed
the
compass-comms/rig3536-resolve-coverage
branch
from
September 10, 2026 02:26
0e2d950 to
003ceb5
Compare
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 3 PRs:
mainT8 of the RIG-3473 record. resolve.go had no dedicated test file: its contracts
were pinned only where other files happened to cross them.
The load-bearing case is the vantage-probe closure. resolveVisibleAgentHandle
maps a real-but-invisible agent to the SAME NOT_FOUND an unknown handle gets, and
that INDISTINGUISHABILITY is the security property -- a distinguishable miss is
an existence oracle. So the test asserts it as an equivalence: each submitted
spelling is substituted out and the two messages must be byte-identical, the
resolved id must not appear, and both must map to CodeNotFound. A paired positive
stops a resolver that returns NOT_FOUND for everything from satisfying it, and a
fixture guard fails loudly if the invisible agent ever becomes visible, so the
assertion cannot go vacuous.
The deliberate ASYMMETRY is pinned in the same test: resolveAgentHandle is
owner-namespaced but NOT viewer-scoped, so it still resolves that agent. Both
halves in one place, because the pair is the contract.
Also: submitted-order preservation (ids that do not sort with their handles, so a
map-iteration bug yields a wrong permutation rather than an accidental pass); the
same bare handle under two owners resolving differently per caller; an unknown
owner qualifier naming the SUBMITTED handle; notFoundHandle passing a
non-not-found error through by IDENTITY; and empty input short-circuiting before
any store call (driven against a nil store, so it can only pass if the guard
fires).
Batch atomicity is NOT re-proven here. resolveHandles delegates it to
store.AccountsByHandles, already covered by TestAccountsByHandlesAtomicMissNamesAll
-- so this tier asserts only the pass-through: the sentinel survives, no partial
result rides along, and the message equals the store's own verbatim.
Test-only; resolve.go is unmodified. Mutation-verified: leaking the resolved id
into the visible-miss, ignoring the visibility result, and always re-keying in
notFoundHandle each fail with a message naming the defect. gofmt/vet/vet -tags
pgtest clean; -race pgtest run ok against a live Postgres, with the new tests
confirmed RUN rather than skipped.
Ledger-impact: none
Refs RIG-3536
Co-authored-by: Matt Wilkinson matt@rigel.build