Skip to content

feat(rooms): read and browse a room's records through this wallet's own agent - #222

Merged
stormer78 merged 1 commit into
mainfrom
feat/rooms-read-browse-client
Sep 10, 2026
Merged

feat(rooms): read and browse a room's records through this wallet's own agent#222
stormer78 merged 1 commit into
mainfrom
feat/rooms-read-browse-client

Conversation

@stormer78

Copy link
Copy Markdown
Contributor

rooms/records/* is served by the room's host, and this console cannot address one. carrierParams passes {type, payload} and the offscreen document supplies its own agent as the recipient, so a service naming a host is silently dropped and the call lands somewhere that does not serve it.

That narrowing is deliberate — the offscreen document mints and signs rather than counter-signing a document composed in a page — so the answer is the one roomsKeysBackfill already took: ask the agent to do it. roomsKeysRead and roomsKeysBrowse (tt#426, @openvtc/trust-tasks 0.18.3) are that ask.

The agent verifies; this renders

The check is deliberately not re-implemented here. The epoch key never leaves the agent, so it is the only party that can open a record — and the only party on the member's side that remembers what this host said last time. verification is its account of both, and a second verifier here would be a second thing to keep in step.

verification is a verdict, never a failure, and the doc comments say so where a caller will read them. An adverse value still returns the record: a member's own agent refusing because the host misbehaved would punish them for somebody else's act, and lock them out of the room holding the records that would show what happened. The consequence belongs on the write path. A surface that treats an adverse verdict as an error has inverted the design.

Two things documented at the call site because they are easy to get wrong:

  • limit is the page size to ask the host for, never a cap on the result. The agent follows the cursor and reports complete.
  • verification.count is narrow. It means something only when complete is true and neither prefix nor sinceVersion was set. Anything else is notComparable, which will be the common answer and is not a fault.

Resyncing the task surface exposed a break this library already had

Not part of the plan, and worth flagging rather than folding in quietly.

vta-sdk cut rooms/keys/present and rooms/owner/issue-authority over to 0.2 (VTI#1365) and nothing here followed. Both calls named versions the agent no longer serves — and present is the load-bearing one, since every host task takes a presentation and nothing else produces one. The rooms panes' host calls were broken against current VTI and nothing said so, because the task-surface snapshot was stale enough not to notice.

Cut over here. issue-authority/0.2 is shape-identical (validUntil became REQUIRED, which this always sent). present/0.2 removed audience and nonce, and neither was doing what its name suggested:

  • audience at the task layer names the document's destination — the agent being asked — not the host the presentation is later shown to.
  • A room presentation needs no nonce: a host binds it to whoever signed the envelope, not to a challenge it issued.

The payload is additionalProperties: false, so a caller still sending either is refused. The test that asserted nonce was sent now asserts it is not — the same test doing the same job against the shape that exists.

Checks

  • npm run build — clean
  • npm test1,188 tests, 0 failures across all four workspaces
  • Task-surface census resynced against vta-sdk 0.34.1; expected moved 201 → 204 with the reason recorded inline

Depends on VTI serving the two tasks (in flight) — this is the client half, and nothing calls it yet.

…wn agent

`rooms/records/*` is served by the room's **host**, and this console cannot
address one: `carrierParams` passes `{type, payload}` and the offscreen document
supplies its own agent as the recipient, so a `service` naming a host is dropped
and the call lands somewhere that does not serve it. That narrowing is
deliberate — the offscreen document mints and signs rather than counter-signing
a document composed in a page — so the answer is the one `roomsKeysBackfill`
already took: ask the agent to do it.

`roomsKeysRead` and `roomsKeysBrowse` (dtgwg-trust-tasks-tf#426,
`@openvtc/trust-tasks` 0.18.3) are that ask.

**The agent verifies; this renders.** The check is deliberately not
re-implemented here. The epoch key never leaves the agent, so it is the only
party that can open a record, and the only party on the member's side that
remembers what this host said last time — `verification` is its account of both
and a second verifier here would be a second thing to keep in step.

**`verification` is a verdict, never a failure**, and the doc comments say so
where a caller will read them. An adverse value still returns the record: a
member's own agent refusing because the *host* misbehaved would punish them for
somebody else's act and lock them out of the room holding the records that would
show what happened. A surface that treats it as an error has inverted the
design.

`limit` is documented as the page size to ask the host for, never a cap: the
agent follows the cursor and reports `complete`, and `verification.count` means
something only on a complete unfiltered listing.

**Resyncing the task surface exposed a break this library already had.**
`vta-sdk` cut `rooms/keys/present` and `rooms/owner/issue-authority` over to
`0.2` (VTI#1365) and nothing here followed, so both calls named versions the
agent no longer serves — and `present` is the load-bearing one, since every host
task takes a presentation and nothing else produces one. Cut over here, with
`validUntil` unchanged and the two members `present/0.2` removed now absent:
`audience` at the task layer names the document's *destination*, which is the
agent being asked rather than the host it is later shown to, and a room
presentation needs no `nonce` because a host binds it to whoever signed the
envelope.

The test that asserted `nonce` was sent now asserts it is **not**, which is the
same test doing the same job against the shape that exists.

`npm run build` clean; 1,188 tests, 0 failures.

Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
@stormer78
stormer78 force-pushed the feat/rooms-read-browse-client branch from ef86c8d to 0a12347 Compare September 10, 2026 12:59
@stormer78
stormer78 merged commit cd305d3 into main Sep 10, 2026
3 checks passed
@stormer78
stormer78 deleted the feat/rooms-read-browse-client branch September 10, 2026 13:03
@affinidi-appsecurity-bot

Copy link
Copy Markdown

🛡️ AI Agentic Security Code Review

🔎 A manual security review is recommended before merging. Please contact the Security team for specifics and remediation guidance.

ℹ️ Detailed findings are not published on public repositories; the Security team holds the complete report.

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