feat: single shared presence topic, topic post patterns, dynamic tool descriptions#7
Merged
Merged
Conversation
… descriptions Presence rework and topic-config extensions, all within bridge-core (no seam change, no plugin changes, conformance suites untouched): - Presence now announces on ONE shared topic (presence.topic, default parley-presence) instead of a derived <topic>-parley-presence stream per allowlisted topic. The record is v2 and carries the emitter's subscribed topics, so parley_list_users still reports liveness per topic while a human mutes a single topic on real chat backends. - Heartbeat default 30s -> 10min; ttl_ms is optional and defaults to 3x the heartbeat via a Zod transform. - Chat/reactive-only instances set presence.enabled: false (wired into the remote-chat example configs). - post_topics: full-match regex patterns that extend post/fetch ONLY; subscribe, catch-up, presence, and list_users-default still use the explicit topics list. The Allowlist grows a two-dimensional check plus a reserved guard so no pattern can target the presence topic and spoof the roster. - Tool descriptions interpolate the configured topics/patterns at registration, and the topic param carries a JSON-Schema enum when no pattern widens the set, so an agent discovers what it may post to with no extra call. Note: the presence wire format is v1->v2; old and new bridges are mutually invisible in parley_list_users (accepted pre-1.0). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Guestbook testimony; not load-bearing. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What & why
Reworks presence and extends topic config, all inside
bridge-core— no seam change, no plugin changes, and the shared conformance suite is untouched. Addresses five requests: presence noise (N muted topics), an over-frequent heartbeat, chat instances emitting heartbeats they can't use, no way for an agent to discover postable topics, and no way to post to ad-hoc topics.Changes
hello/heartbeat/goodbyenow post to one shared topic (presence.topic, defaultparley-presence) instead of a derived<topic>-parley-presencestream per allowlisted topic. The record isv2and carries the emitter's subscribedtopics[], soparley_list_usersstill reports liveness per topic while a human mutes one topic.parley_list_usersdoes a single fetch and filters each entry by its advertised topics.heartbeat_ms30 000 → 600 000 (10 min).ttl_msis now optional and defaults to 3× the heartbeat via a Zod.transform.presence.enabled: falseset in all fiveremote-chat.yamlexamples and the self-host config.topicparam gets a JSON-Schemaenumwhen no pattern widens the set. No new tool.post_topicsregex patterns. Full-match-anchored regexes that grant post + fetch on matching topics; subscribe/catch-up/presence/list_users-default still use only the explicittopicslist. TheAllowlistgrew a two-dimensional check plus a reserved guard so no pattern (even.*) can target the presence topic and spoof the roster. Config.superRefinerejects uncompilable patterns and atopicsentry colliding withpresence.topic.Wiring is centralized in one
allowlistFor(cfg)helper shared by both composition roots.Testing
tsc -bclean.parley-presencestream with their advertised topics; scoping by a pattern-allowed topic works;post_topicsad-hoc post + fetch succeeds; posting/fetching the reserved presence topic is refused even under.*; tool descriptions show the interpolated topics and the enum on/off behavior.Notes / risks
v1→v2): old (per-topic) and new (single-topic) bridges are mutually invisible inparley_list_users. Accepted pre-1.0; old derived streams age out via backend retention. Titledfeat:(notfeat!:) per the repo's pre-1.0 rule.presence.topicconsistent across a deployment or the roster splits (documented in DESIGN §7).ConfigSchemais now aZodEffects; verified no consumer uses.shape/.extend.docs/journal/(testimony, not load-bearing).🤖 Generated with Claude Code