Skip to content

docs(agent): design comms file sharing (RIG-2669) - #2153

Closed
rigel-mintaka wants to merge 5 commits into
mainfrom
compass-comms/rig-2669-file-sharing-design
Closed

rigel-mintaka wants to merge 5 commits into
mainfrom
compass-comms/rig-2669-file-sharing-design

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Design record for RIG-2669: file sharing on the comms surface. Agents and the operator can attach a file to a channel, topic or DM message, and anyone who can read that message can read the file. Agents get attach and read tools; the operator downloads from the UI and the CLI.

Record: docs/designs/agent/compass-comms-file-sharing/design.md. Ledger rows: DL-480 to DL-485, all Active (proposed, pending Matt, 2026-10-11).

Decisions (proposed)

Decision
D1 storage Bytes go through the existing Server ObjectStore under blobs/<sha256>, as session blobs do (DL-426). A new tenant-RLS comms_attachments table indexes them.
D2 wire UploadAttachment / GetAttachment RPCs on CommsService; new MessageBlock arm 4. Upload first, then a post binds the attachment to one message. Agent call arms 16 and 17.
D3 read access A file is readable exactly where its message block was delivered: IsTopicChannelMember, the probe that already gates MessagePosted. The uploader can also read it until it is posted. Every refusal is NotFound.
D4 cap and retention 15 MiB per file (the 16 MiB message limit less 1 MiB). At most 8 unposted uploads per uploader in 24 h. An attachment lives as long as its message; GC is deferred.
D5 agent tools comms_attach_file and comms_read_file.
D6 operator UI attachment chip with download (always application/octet-stream); compass message attach / get.
T0 Directory-backed ObjectStore (--object-dir, default <StateDir>/objects) so local stacks have storage (OQ-1).

Open questions for Matt

OQ-1 (load-bearing: a directory-backed object store for local stacks, recommended) is with Matt in RIG-5148. OQ-2 to OQ-4 are deferrals: retention and GC as one follow-up, no UI upload, no files over 15 MiB. The Plan builds each recommendation and lists the delta for the other options.

Review

An adversarial design critic and three review-correctness rounds; every finding is folded in. Review at head 4a65014d: 0 high, 0 medium, 0 low, 0 nit (see the PR comment).

Spec-impact: none
Ledger-impact: DL-480..485 added (proposed)

Refs RIG-2669

Co-authored-by: Matt Wilkinson matt@rigel.build

Attachments on the comms surface: bytes through the Server ObjectStore
under blobs/<sha256>, a comms_attachments index table, upload-then-bind
onto a new attachment block, read access equal to the message read
check, a size cap, agent attach/read tools, and UI/CLI download.
Rows DL-480..485, proposed pending Matt.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@trunk-io

trunk-io Bot commented Oct 11, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

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

@linear-code

linear-code Bot commented Oct 11, 2026

Copy link
Copy Markdown

RIG-2669

@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

rigel-mintaka and others added 4 commits October 11, 2026 08:04
Fill-insert-bind order for idempotent replays, unbound-upload bound, read
via the topic-participant probe, directory ObjectStore as T0, socket read
cap, content-type and filename hardening, Go-side native save, fenced
agent marker, ordering against the cost gate and stale-post check.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
Embedded-mode bridge target for native save, a launcher table with the
devenv object dir, a size-scaled body deadline for uploads, fill and bind
inside AppendMessage, and the caption block layout.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…IG-2669)

Add stack.Config.NoObjectStore and a WithoutObjectStore fixture option so
the existing no-store resume test and the T7 no-store leg still run; give
RelaySessionBlob the same size-scaled deadline; share the runner read cap.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
…ame (RIG-2669)

Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Review at head 4a65014d: high 0, medium 0, low 0, nit 0. Scope: the full record plus DL-480..485. Passes: adversarial design critic (3 high, 8 medium, 4 low, 1 nit, all folded, plus 3 forks decided as Alternatives or OQ-1), then review-correctness over three rounds (3/3/1 medium, all fixed; one finding withdrawn as wrong). Lenses: correctness against main, the Plan's interfaces and tests, security (authz via the topic-participant probe, octet-stream downloads, filename rules, read caps, body deadlines), proto numbers vs #2120/#2136/#2078/#2139, hygiene. rumdl clean; design-ledger gate OK. OQ-1 (local object store) is with Matt in RIG-5148 and must be ruled before merge.

@rigel-mintaka

Copy link
Copy Markdown
Contributor Author

Moved to RigelBuild/docs#25 under Matt's directive that design records live in the docs repo, not code repos. Review continues there.

@rigel-mintaka
rigel-mintaka deleted the compass-comms/rig-2669-file-sharing-design branch October 15, 2026 16:47
rigel-mintaka added a commit to RigelBuild/docs that referenced this pull request Oct 18, 2026
Moved from RigelBuild/compass#2153 under the design-records-to-docs-repo directive.

Co-authored-by: Matt Wilkinson <matt@rigel.build>
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.

1 participant