Skip to content

pm contracts omits the new workspace command group, so agents cannot discover snapshot/restore machine-readably #805

Closed

Description

@unbraind

Verified on @unbrained/pm-cli 2026.7.29 (clean pm init workspace, no packages installed).

What happens

2026.7.29 adds two agent-facing command surfaces: pm eval and pm workspace snapshot. Only one of them reaches the machine-readable contract surface.

$ pm contracts --json | node -e 'const c=JSON.parse(require("fs").readFileSync(0,"utf8"));
const n=c.command_summaries.map(x=>x.name);
console.log("total:",n.length,"| eval:",n.includes("eval"),"| workspace:",n.includes("workspace"));'
total: 54 | eval: true | workspace: false

pm --help lists workspace ("Manage portable workspace-level SDK primitives") and pm workspace snapshot --help works, but command_summaries has no workspace entry, and commands is empty unless --selected is passed.

Why it matters

pm contracts is the documented capability-discovery path for agents — it is how an agent decides what it is allowed to call without spending tokens on --help sweeps. An agent that enumerates contracts to plan its work concludes that snapshot/restore does not exist, which is exactly the wrong conclusion for the feature whose stated purpose (GH-787) is "cheap reproducible evaluation episodes" for agents.

The asymmetry also makes the omission hard to notice: eval shipping in the same release is present, so a spot check on the release notes looks fine.

Expected

workspace (and its snapshot subcommand actions: create/inspect/list/restore/delete) appears in pm contracts command_summaries like every other command group, so capability discovery matches the actual CLI surface.

Suggestion

If the contract generator enumerates a static command registry, workspace is presumably registered through a different path than the top-level commands (it has no options of its own, only a subcommand dispatcher — same shape as item, which is listed). A regression test asserting command_summaries covers every name in the top-level program would fail closed on the next such addition.

Activity

  1. coderabbitai commented on Jul 29, 2026

    @coderabbitai
    🔗 Related PRs

    #456 - Expose SDK runtime action client [merged]
    #483 - Add agent list windows and contracts summary [merged]
    #491 - Harden init target safety and package install verification [merged]
    #753 - feat(sdk): universal context, concurrency, and discovery primitives [merged]
    #777 - Unify SDK runtime contracts, MCP profiles, resources, and atomic extensions [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  2. unbraind commented on Jul 29, 2026

    @unbraind
    OwnerAuthor

    Tracked by pm-1jrdri and now active in the broad SDK/CLI context-contract delivery.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions