Skip to content

I4002 — Worktree.create is a typed writing capability

Declare worktree.create as a capability with a repository_mutation effect over the git calls integration/drain.rs already makes, so a worker creates a canonical worktree through the registry rather than a shell (Mission Control B5).

READY wave 0 · p1 · implementation profile · parallel safe

Part of a-session-proceeds-through-the-mesh — A session proceeds through the mesh: it finds the work, claims it once, runs it watched and stops when the intent is met.

Ready. Every dependency is done, so majordomus plan start I4002 will be accepted.

Objective

Declare worktree.create as a capability with a repository_mutation effect over the git calls integration/drain.rs already makes, so a worker creates a canonical worktree through the registry rather than a shell (Mission Control B5).

Why

Creating the worktree is a shell step of the CLI; a loop that proceeds unasked cannot do it as a declared, refusable, audited act.

Current state

Not built: this issue is planned by the milestone a-session-proceeds-through-the-mesh and nothing of it exists.

Desired state

The acceptance criteria below hold and case 4002 proves them.

Scope

  • apps/majordomus-cli/src/capability/builtin
  • apps/majordomus-cli/src/integration/drain.rs
  • docs/WORKTREES.md
  • test/cases/4002_worktree_create_is_a_typed_writing_capability.sh
  • .ai/repo/project/issues/I4002.yaml

Dependencies

None. This issue is a root of the graph.

What waits on this

Acceptance criteria

  • worktree.create plans and applies the canonical <repository>-wt/<branch> path and refuses a misplaced or existing one with a reason
  • It reuses the git calls of integration/drain.rs and adds no second implementation
  • Its declaration projects to the command, the MCP tool and the skill from one definition

Validation

  • env -u MAJORDOMUS_SHARE -u MAJORDOMUS_HTTP_HOST -u MJ_ROOT bash test/run.sh 4002_worktree_create_is_a_typed_writing_capability

Evidence required

  • case_4002_worktree_create_is_a_typed_writing_capability

Evidence

None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.

Timeline

started
—
verified
—
completed
—

Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.

Canonical record: .ai/repo/project/issues/I4002.yaml. Read it back with majordomus plan show I4002.

Searches the titles and descriptions of every page this site publishes.