Skip to content

A runtime may serve a workspace without its broken agents (--leave-out-broken-agents) - #44

Merged
jithinAB merged 1 commit into
masterfrom
pact-kernel/one-agent-refused
Nov 16, 2026
Merged

jithinAB merged 1 commit into
masterfrom
pact-kernel/one-agent-refused

Conversation

@jithinAB

Copy link
Copy Markdown
Contributor

Why

A runtime that serves a PACT tree edited while it runs (Bud Meta Harness publishes every agent of a watched tree and keeps serving them) lost every agent of a workspace the moment one agent was edited badly: pact discover printed skipping <root>: N problem(s) and pact show exited 1. Agents nobody had touched went out of service with the broken one. This was found live (BMH tier 8 t8-pact-hot-edit: one agent's steps-at-most: set below the floor withdrew its sibling too).

What changes

  • pact show and pact discover take --leave-out-broken-agents. With it, when every error of a workspace lies in some agents' own folders (agents/<key>/…), the workspace is validated again without those agents and served if it then loads (exit 0). Each left-out agent is named on stderr (loader/agent-left-out) with its own errors shown as warnings, and discover adds "left-out": [{ "id": "pact:<key>", "problems": N }] to the workspace's inventory, so a runtime can keep serving the version it last had of them.
  • An error anywhere else, or one the reduced workspace still has (a teammate naming a left-out agent), keeps the whole workspace refused, as before.
  • Opt-in, default unchanged. pact show's exit code is how PACT Core: a language the checker reads, a workspace that changes while it runs, and a sealed plan #39's session door (session._checked) and compile_plan decide a document loads; neither may lose an agent quietly, so isolation is asked for, never implied. (The first version of this change made it the default; rebasing onto PACT Core: a language the checker reads, a workspace that changes while it runs, and a sealed plan #39 showed that would let a proposal that breaks one agent through the door with that agent silently dropped.)
  • pact check <root> still refuses the tree. pact check <agent> for a clean agent beside broken siblings now says loader/other-agents-left-out (a runtime that leaves them out runs this agent) instead of loader/the-workspace-around-it-is-broken.
  • Docs: site-docs/reference/cli.md (show, discover), USAGE, CHANGELOG; headline test counts.

Tests

  • crates/pact-cli/tests/one_broken_agent_leaves_its_workspace_served.rs: with the flag, the broken agent is left out and its sibling is served by discover and show; without it, discover skips and show exits 1; pact check refuses the tree and pact check agents/clerk says loader/other-agents-left-out; a teammate naming the broken agent keeps the workspace refused even with the flag.
  • Gate (scripts/test-all.sh steps) on this head: cargo build, wasm build, cargo test, clippy (both targets, -D warnings), TypeScript tsc --noEmit, and the Python adapter suite (3560 passed, 31 skipped) all pass.

Purpose (PACT for BMH)

  • Declarative, edited online: an online edit to one agent no longer takes the rest of its workspace out of service; the document stays the source of truth and check still tells the author.
  • Portable: the behaviour is the checker's, so every runtime that passes the flag gets the same served view and the same left-out list.
  • Trade-off: none for existing callers (opt-in).

🤖 Generated with Claude Code

pact show and pact discover take --leave-out-broken-agents: when every error of
a workspace lies in some agents' own folders, the workspace is validated again
without those agents and served if it then loads, each left-out agent named
(loader/agent-left-out, and a left-out list in discover's inventory). Without
the flag nothing changes, since a session's door and a sealed plan read pact
show's exit code. pact check still refuses the tree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jithinAB
jithinAB marked this pull request as ready for review November 16, 2026 19:44
@jithinAB
jithinAB merged commit 1562341 into master Nov 16, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant