Skip to content

feat(agent-spec): add typed Resource bindings - #86

Merged
schickling merged 4 commits into
mainfrom
schickling-assistant/2026-07-30-resource-bindings
Jul 30, 2026
Merged

feat(agent-spec): add typed Resource bindings#86
schickling merged 4 commits into
mainfrom
schickling-assistant/2026-07-30-resource-bindings

Conversation

@schickling-assistant

@schickling-assistant schickling-assistant commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Why

Agent declarations need a portable way to name the external resources an agent depends on without copying payloads or making st2 own downstream schemas, access, readiness, or lifecycle policy.

What

Add a direct named Resource envelope to Agent Spec:

resource "work" _tag="github-issue" uri="github-issue://example/project/123"

The public agent-spec model preserves bindings in deterministic name order across KDL, TOML, and JSON. Names are unique, _tag stays opaque to st2, and uri is validated as RFC 3986 absolute syntax while its exact bytes remain unnormalized. Public serde uses the same strict invariants and rejects unknown policy fields.

st2 agents --json [--enrich] exposes each declaration's ordered resources descriptors for language-neutral inspection, including unknown downstream tags.

VRS requirements R20-R21 define the portable envelope and its observable, nondisruptive runtime boundary; the implementation spec traces directly to them.

Rationale

The envelope intentionally contains only the agent-local semantic name, concrete type discriminator, and URI identity. Unsupported policy properties fail closed so callers cannot mistake ignored fields for enforcement. Resource bindings are excluded from task launch targets; a resource-only edit adopts a healthy live task without replacement or relaunch.

This does not project folder-eval resources or define resolution, readiness, access, lifecycle, or mutation semantics.

Validation

  • cargo test -p agent-spec --no-fail-fast
  • cargo test --lib agents::tests --no-fail-fast
  • cargo test --test status_agents --no-fail-fast
  • cargo test --test reconcile resource_only_changes_do_not_replace_or_relaunch_a_live_task --no-fail-fast
  • cargo test --test validate resource --no-fail-fast
  • cargo test --test invariants --no-fail-fast
  • cargo check --workspace --all-targets
  • git diff --check origin/main...HEAD

Related to compoundingtech/evals#41. Runtime resolution and renderer boundaries remain tracked in #60 and #61.

Define a minimal named Resource envelope with exact URI identity, opaque type tags, strict uniqueness and shape validation, and no runtime lifecycle semantics.

agent-session-id: dev3.dotfiles-cos-misc-st2-resource-design
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.local/state/agent-session-recovery/2026-07-29-pty-st2-cutover/runtime-profile/profile-without-null-opencode.json
agent-skills-manifest: /nix/store/kx5j47nghj1yps2v693ryb6wnf1c2xhb-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@16a22c6
Validate exact RFC 3986 syntax without normalization, keep public serde on the same strict schema, and expose declared descriptors through the stable agents JSON roster.

agent-session-id: dev3.dotfiles-cos-misc-st2-resource-design
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.local/state/agent-session-recovery/2026-07-29-pty-st2-cutover/runtime-profile/profile-without-null-opencode.json
agent-skills-manifest: /nix/store/kx5j47nghj1yps2v693ryb6wnf1c2xhb-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@16a22c6
@schickling-assistant
schickling-assistant force-pushed the schickling-assistant/2026-07-30-resource-bindings branch from bde2cf3 to 93daa77 Compare July 30, 2026 13:13
@schickling-assistant
schickling-assistant marked this pull request as ready for review July 30, 2026 13:18
@schickling
schickling requested a review from myobie July 30, 2026 13:21
@schickling

Copy link
Copy Markdown
Contributor

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 93daa77a46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

agent-session-id: dev3.dotfiles-cos-misc-st2-resource-design
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.local/state/agent-session-recovery/2026-07-29-pty-st2-cutover/runtime-profile/profile-without-null-opencode.json
agent-skills-manifest: /nix/store/kx5j47nghj1yps2v693ryb6wnf1c2xhb-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@16a22c6
agent-session-id: dev3.dotfiles-cos-misc-st2-resource-design
agent-tool: Codex
agent-tool-version: 0.145.0
agent-model: gpt-5.6-sol
agent-runtime-profile: /home/schickling/.local/state/agent-session-recovery/2026-07-29-pty-st2-cutover/runtime-profile/profile-without-null-opencode.json
agent-skills-manifest: /nix/store/kx5j47nghj1yps2v693ryb6wnf1c2xhb-agent-skills-corpus/share/agent-skills/manifest.json
tooling-profile: dotfiles@16a22c6
@schickling
schickling merged commit ce2c106 into main Jul 30, 2026
1 check passed
@schickling schickling added area:agent-spec Agent Spec format, parsing, and the agent-spec crate · Set: manual area:resource Typed Resource bindings and linked records · Set: manual origin:agent Filed or primarily produced by an AI agent · Set: manual type:feature New user-visible or system capability · Set: manual labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:agent-spec Agent Spec format, parsing, and the agent-spec crate · Set: manual area:resource Typed Resource bindings and linked records · Set: manual origin:agent Filed or primarily produced by an AI agent · Set: manual type:feature New user-visible or system capability · Set: manual

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants