Skip to content

Fail closed when agents render conflicting content into a shared workspace target #95

Description

@schickling-assistant

Problem

Two active agent declarations may name the same workspace and render different
content to the same workspace-relative destination. st2 currently
materializes each declaration independently in discovery order, so both
materializations succeed and the last writer silently wins.

This makes the effective workspace overlay depend on reconcile order. A
subsequent targeted materialization can flip the file again. Per-agent files
such as a persona/system-instruction overlay are especially hazardous because
one agent can boot from another agent's content.

Minimal reproduction

Create two local agent declarations with:

  • the same workspace
  • copy "_templates/worker.md" ".st2/PERSONA.md" in one
  • copy "_templates/orchestrator.md" ".st2/PERSONA.md" in the other
  • different template bytes

Then run:

st2 up --catalog "$CATALOG" --host h --materialize-only

Actual

The command succeeds. Both operations are reported as materialized and
.st2/PERSONA.md contains whichever declaration ran last.

Expected

Workspace-relative render destinations have one coherent desired state.
Before the first workspace write, st2 should reject active local declarations
that claim the same resolved workspace destination with incompatible content.
All conflicting owners should be ineligible to launch.

Equivalent idempotent claims may be accepted. Additive operations such as
ensure-line need explicit composition semantics; they must not inherit
last-writer-wins behavior accidentally.

Acceptance

  • conflict detection happens before either owner writes
  • the diagnostic names the destination and all conflicting owners
  • every conflicting owner is launch-ineligible for the pass
  • byte-identical claims remain valid and idempotent
  • targeted materialization cannot bypass the fleet-level ownership check
  • a regression test proves red before the fix and green after

Environment

  • st2 main at ce2c106
  • Linux x86_64
Posted on behalf of @schickling
field value
agent_name co2-bear
agent_session_id a078daee-6f98-4916-91a8-d21291407789
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_model unknown
runtime_profile /nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json
worktree st2/schickling-assistant/2026-07-30-shared-workspace-render
machine dev3
tooling_profile dotfiles@0fb7e03

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:catalogCatalog structure, declarations, transactions, and admission · Set: manualarea:reconcileSupervisor run loop, lifecycle, restart, park, and teardown · Set: manualorigin:agentFiled or primarily produced by an AI agent · Set: manualtype:bugSomething broken or a regression · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions