Skip to content

feat(relay): artifact conversations for task comments - #9569

Draft
morgmart wants to merge 11 commits into
morganm/filed-auto-archivefrom
morganm/task-conversations
Draft

morgmart wants to merge 11 commits into
morganm/filed-auto-archivefrom
morganm/task-conversations

Conversation

@morgmart

@morgmart morgmart commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What this does

Stacked on #9565. A NIP-AR artifact, such as a task, can now have a conversation: a channel for its comments that belongs to the task, not to whoever opened it. This is the relay part of task comments (slice 2).

  • Address. The conversation's channel ID comes from the task's d alone: the first 16 bytes of SHA-256("nip-ar-conversation\0" || UTF-8(d)), as a UUIDv8. Every client computes the same one, and it doesn't change when the task moves. NOSTR.md has the exact bytes and a fixture. Version-8 channel IDs are reserved, so an ordinary kind:9007 can't take one.
  • Opening. kind:9007 with ["h", <derived>] and ["artifact", <d>]. Anyone who may post in the task's home may send it; it needs messages:write, not channels:write. The relay creates a private channel of the new type artifact, filed under the home, with no member rows, so nobody owns it. Opening one that exists is accepted and writes nothing.
  • Access comes from the home. Comments are ordinary kind:9 events, and who reads and posts comes from the home through channel parents (feat(relay): read a private channel through its parent #9551, feat(relay): per-channel project access (parent_access) #9564). A view-only home's people read but don't post. Comments close to new posts while the home is archived.
  • Only comments. A conversation accepts only what comments need: kind:9 messages, 40003 edits, 7 reactions, 5 deletions, 9005 removals and the 9007 that opens it. Everything else is refused with "an artifact's conversation only holds comments", including people and settings events, a canvas and any kind added later. The home's direct owners and admins delete comments with 9005, and authors delete their own.
  • Archived parents. By the project rule, an archived parent still grants access and doesn't archive its children. Comments follow the task's own home, the same way posting in a channel does. NOSTR.md states this as a decision.
  • Moves. A task move refiles its conversation in the same transaction. The old home's readers lose it at once, and their live subscriptions close.
  • Delete and restore. Deleting a task closes its conversation to everyone (parent_access = none, and it has no rows), and opening one is refused. Restoring reopens it.
  • Depth. A home must be a live stream or forum with at most one parent, so a conversation is at most the third level. Opening for a task in a grandchild, or moving a task with comments into one, is refused with a clear reason. A conversation can't hold artifacts.
  • Hidden. artifact isn't a legacy channel type, so conversations stay out of reads that name no channel, by the existing NIP-CL rule. kind:39000 marks them hidden.
  • Auto-archiving chats. A conversation doesn't make a chat a project, so an unfiled auto-archiving chat can hold task comments.
  • Task sync now includes artifacts in auto-archiving channels (the exclusion dates from feat(relay): add incremental artifact reads #8523). A TTL change still resets progress.
  • NIP-11 advertises buzz-artifact-conversations. Migration 0095 adds the enum value (renumbered after main took 0089–0092).

Testing

  • New Postgres tests (artifact_conversation_postgres_tests.rs), all through real ingest, REQ and COUNT:
    • a home reader opens and comments, with no rows made; the outsider is refused; re-opening is accepted; a wrong h is refused; comments are hidden from implicit reads
    • a view-only home reads but can't comment or open
    • deleting closes comments to everyone, evicts a live subscription, refuses opening; restoring reopens
    • a move refiles the conversation, evicts the old reader live, admits the new home's reader; moving into or opening in a grandchild is refused
    • people and settings events, a canvas, a pin and a forum post are refused; an ordinary 9007 can't squat a derived address or the type; an artifact can't live in a conversation
    • two first comments at the same moment share one conversation and make no member rows
    • a forged address, and claiming a task's address before the task exists, are refused
    • filing a channel whose tasks have comments into a project is refused at the depth limit and allowed above it
    • conversations stay out of channel lists and search
    • the home's owner moderates; a member can't delete someone else's comment but can delete their own
    • an auto-archiving chat holds task comments, keeps its TTL, and closes them when archived
  • The TTL sync test now asserts inclusion: sync_includes_auto_archiving_channels_and_resets_on_ttl_changes.
  • Derivation fixture checked in Rust and independently in Python.
  • Mutation checks, each of which turned a test red: the derivation check, the home write check, delete closing, move refiling, eviction after a move, the depth check, refused kinds, the ordinary-9007 guard, no artifacts in a conversation, moderation by the home, conversations not making a project, the archived-home check, sync including TTL channels, and accepting every kind in a conversation.
  • Postgres lane for buzz-db and buzz-relay: 1441/1445. Four were timing failures under load. Three passed on a serial rerun. The fourth, hanging_redis_peer_times_out_before_the_health_listener_binds, fails the same way on the base branch at 310ae91d8. After formatting, the 133 artifact, conversation, parent and migration tests passed at cb7830d63.
  • After merging main and adding the follow-ups, the full Postgres lane for buzz-db and buzz-relay passed, 1455/1455, on the top of the stack, and clippy is clean.
  • Unit tests for buzz-core, buzz-db, buzz-relay and buzz-test-client: 2471/2471. Clippy with -D warnings is clean.

Follow-ups and known limits

  • Project admins moderating inside a project's channels and comments (the cap on inherited roles) is a slice 1 gap and stays a follow-up.
  • Channel-scoped tokens can't open or post in a conversation, because its address isn't in the token's channel list.
  • Search doesn't cover comments yet.
  • Ephemeral kinds such as typing indicators still reach a conversation through the existing ephemeral gate.
  • Push and live mentions for readers through a parent (slice 3) apply here too.

🤖 Generated with Claude Code

A NIP-AR artifact can now have a conversation: a private `artifact`
channel at a UUIDv8 address derived from its `d`, filed under the
artifact's home with no member rows. Anyone who may post in the home
opens it with kind:9007 and an `artifact` tag; access comes only through
the home. Moves refile it in the same transaction, delete closes it and
restore reopens it. People and settings events are refused in it, and
the home's owners and admins moderate comments.

Incremental artifact sync now includes channels with a TTL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
morgmart and others added 3 commits November 16, 2026 09:37
…gaps

A task conversation now accepts only the kinds comments need (messages,
edits, deletes, reactions and the open itself) and refuses everything
else, so a canvas or any future setting stays out without a refuse list.
Adds tests for two first comments at once, a forged or early-claimed
address, filing a channel with comments at the depth limit, and keeping
conversations out of lists and search. NOSTR.md records that an archived
parent still grants comment access, as a decision.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  feat(auth): tolerate client clocks up to 120 s off (#9485)
  docs: name the required stop as a relay build, not a release (#9577)
  buzz-db: drop the created_at floor, community write-fence and migration-only NIP-RS triggers (contract) (#8326)
  Keep community deletion working across a new tenant table's migration (#9304)
  docs: design Android push notifications (#9555)
  feat(push-gateway): accept deliveries on a platform-neutral route (#9557)
  fix(mobile): read a Solo chat through its newest message on open (#9515)
  fix(mobile): keep the Solo header's agent portrait while its roster reloads (#9512)
  perf(mobile): pulse the Solo working dots at 12 fps on a shared clock (#9554)
  test(mobile): match the resumeSince override in the search journey (#9546)
  mobile: show account communities in the switcher and sync saved destinations (#9262)
  perf(mobile): stop replaying stored read state on every resume (#9090)
  perf(mobile): save the open-channel directory and catch it up (#9513)
  fix(mobile): sign out from Settings in every build, keeping keys on the device (#9421)
  fix(mobile): wrap inline Markdown links with their sentence (#9462)
  feat(mobile): message the Bestie from Siri and Shortcuts (#9517)
  fix(mobile): slide a closing chat away instead of cutting to the list (#9511)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>

# Conflicts:
#	crates/buzz-db/src/runtime/migration.rs
…ions

* morganm/filed-auto-archive:
  Refuse opening a private channel that has other members (#9307)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  feat(deletion): clean up media for users and owned agents (#9365)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  update feedback community invite link (#9588)
  fix(mobile): name the failing step in sign-in errors (#9263)
  fix(mobile): order same-second messages by millisecond offsets (#9541)
  fix(acp): saturate observer frame size estimates (#9494)
  feat(mobile): accept mentions with Tab and send with Enter on hardware keyboards (#8733)
  Fix remote Huddle ending cleanup (#9376)
  fix(mobile): host Duo long-press menus in native sheets (#9536)
  fix(mobile): keep the relay session across auth reloads (#9543)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  [buzz] Classify HTTP event request metrics by event type (#9561)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  feat(workflow): implement send_dm action (#9402)
  perf(mobile): stop following presence for people no longer shown (#9480)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  feat(relay): grow DMs in place, identified by their people (#9125)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  buzz-db: check workflow references in app code before FK retirement (#9399)
  fix(relay): enforce channel owner precedence (#9592)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>
…ions

* morganm/filed-auto-archive:
  buzz-db: check membership, agent-owner and channel references in app code (#9404)
  buzz-db: enforce five single-table guards in app writers (phase 1) (#8320)
  docs(mobile): add REVIEWING.md with mobile review principles (#9298)

Signed-off-by: morgmart <98432065+morgmart@users.noreply.github.com>

This branch has not been deployed

No deployments
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