Skip to content

test(comms): direct coverage for resolve.go's handle-resolution contracts (RIG-3536) - #1030

Open
rigel-mintaka wants to merge 1 commit into
compass-comms/rig3528-e2e-fixture-plumbingfrom
compass-comms/rig3536-resolve-coverage
Open

test(comms): direct coverage for resolve.go's handle-resolution contracts (RIG-3536)#1030
rigel-mintaka wants to merge 1 commit into
compass-comms/rig3528-e2e-fixture-plumbingfrom
compass-comms/rig3536-resolve-coverage

Conversation

@rigel-mintaka

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

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 3 PRs:

  1. main
  2. test(e2e): marker-routed multi-turn scripts + observer-scoped fixture clients (RIG-3528) #1029
  3. "test(comms): direct coverage for resolve.go's handle-resolution contracts (RIG-3536)" (this PR)
  4. test(e2e): multi-tenant comms visibility transport proof (RIG-3531) #1042

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

@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

RIG-3536

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-comms-rig3536-resolv.compass-eng-docs.pages.dev

Deployed from compass-comms/rig3536-resolve-coverage at 003ceb5.

@rigel-mintaka
rigel-mintaka force-pushed the compass-comms/rig3536-resolve-coverage branch from cfdc94f to 419468b Compare September 8, 2026 21:52
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review September 8, 2026 22:22
@rigel-mintaka
rigel-mintaka force-pushed the compass-comms/rig3536-resolve-coverage branch from 419468b to 0e2d950 Compare September 9, 2026 04:56
…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>
@trunk-io

trunk-io Bot commented Sep 10, 2026

Copy link
Copy Markdown

Stacked PR 1042 was cancelled: a user cancelled it.

@rigel-mintaka
rigel-mintaka force-pushed the compass-comms/rig3536-resolve-coverage branch from 0e2d950 to 003ceb5 Compare September 10, 2026 02:26
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