Skip to content

Standardize discovery indexes for provider lookup and writeback context #157

Description

@kjgbot

Problem

Agents need stable lookup context for connected integrations even when historical provider records are not mounted. The immediate Slack case is channel writeback: an agent cannot write to a channel unless it can discover channel ids/names, but mounting /slack/channels/.../messages for history should remain optional.

Cloud PR AgentWorkforce/cloud#1931 adds a Slack-specific stopgap by materializing:

  • /discovery/slack/channels/_index.json
  • /discovery/slack/users/_index.json

and by triggering fetch-users + fetch-channels on Slack connection without requiring fetch-channel-history.

We should make this a provider-wide Relayfile adapter contract instead of an ad hoc Cloud-only Slack behavior.

Proposed contract

Every connected integration should expose a small /discovery/<provider>/... tree that is mounted independently of historical data sync. In addition to schemas/examples/action docs, discovery should include lookup indexes for provider entities agents need to reference when writing back.

Examples:

  • Slack: /discovery/slack/channels/_index.json, /discovery/slack/users/_index.json
  • GitHub: repo/org lookup indexes for PR/issue/review writeback
  • Linear: teams, projects, states, users/assignees where supported
  • Notion: databases/pages and any writable parent targets
  • Jira/Confluence/GitLab/etc.: project/space/repo/resource lookup indexes needed by writeback schemas

Index rows should be compact, stable, and agent-friendly: ids, display names/titles, canonical read paths, writable resource/action paths, and any provider-specific fields required to disambiguate targets.

Acceptance criteria

  • Define an adapter-level convention for discovery lookup indexes, including naming, row shape guidance, and where each provider documents its indexes in LAYOUT.md / .adapter.md.
  • Update adapter resources/discovery docs so providers advertise lookup indexes alongside writeback schemas and examples.
  • Add tests that fail when a provider has writable resources but no documented lookup/index surface for required target ids.
  • Add or document the Cloud/materializer responsibility: generated/static adapter discovery assets come from relayfile-adapters; dynamic _index.json contents are produced from provider sync records and should be materialized even when historical mounts are disabled.
  • Ensure this does not require mounting historical record trees. Discovery syncs for lookup entities should be independently triggerable on connect.

Notes

This likely spans two layers:

  • relayfile-adapters: owns the public contract, provider docs, resource metadata, schemas/examples, and tests for what discovery should expose.
  • cloud: consumes that contract, runs provider discovery syncs, and writes dynamic _index.json files into Relayfile workspaces.

Slack can be the reference implementation from Cloud #1931, but the long-term design should be generic enough that Pear/agents can rely on /discovery/<provider>/... for writeback context across all integrations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions