Skip to content

Unify declared Resource bindings and linked records around one typed Resource reference #122

Description

@schickling-assistant

Problem

st2 now has two durable ways for an agent to point at a Resource:

  • Agent Spec bindings carry an agent-local name plus an open _tag and exact Resource URI; and
  • st2 resource add|ls|read|remove stores agent-owned link records with a URL, relation, title, tags, and body.

These represent different relationship lifecycles around the same underlying concept, but they use different descriptor schemas and read surfaces. #62 clarifies the current distinction and explicitly leaves unification as a separate question.

Open question

Could both surfaces share one typed Resource reference while retaining distinct tagged edge semantics?

ResourceRef = { _tag, uri }

AgentResourceEdge =
  | Binding { name, resource: ResourceRef }
  | Link { id, relation, resource: ResourceRef, title?, tags, body? }

A binding remains publisher/CAS-controlled Agent Spec state. A link remains agent-owned append/remove state for outputs, references, and other observed relationships. Both edges use the same Resource type and URI identity.

Constraints

  • Do not turn linked outputs into repeated Agent Spec rewrites.
  • Preserve the different mutation authorities and lifecycles of bindings and links.
  • Do not introduce a Resource registry or generic external-resource mutation authority.
  • Keep unknown Resource types and URI schemes open.
  • Resource-edge changes must remain non-disruptive to healthy running tasks.
  • Define an explicit migration for existing url link records if the wire format changes.

Questions to resolve

  • Should st2 resource ls return both edge variants, or expose separate declared and linked projections?
  • Should resource add require both _tag and uri, or derive a default tag from the URI scheme?
  • Does relation remain open text or become a small tagged core with extensions?
  • How should consumers deduplicate several edges that reference the same Resource URI?

Non-goals

  • Generic Resource resolution.
  • Mutating the external object named by a Resource URI.
  • Making possession of a URI grant authority.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agent-specAgent Spec format, parsing, and the agent-spec crate · Set: manualarea:resourceTyped Resource bindings and linked records · Set: manualorigin:agentFiled or primarily produced by an AI agent · Set: manualstate:needs-researchNeeds research / investigation before scope or approach is clear · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions