Prepare a direct worker worktree

the repo option /absolute/repository selects the source Git repository.

Prepare a direct worker worktree

Prompt-first procedure: Describe the outcome you want in your agent conversation. The agent should select and load the appropriate AIWG assets, explain material changes, request any needed approval, and report verification evidence. Exact commands and flags appear only in the CLI reference.

First time using AIWG? Begin with Install, Connect, and Verify.

From the control workspace, run:

Use AIWG to complete this documented outcome: From the control workspace, run
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

`the repo option /absolute/repository` selects the source Git repository. It defaults to Git's toplevel for the current directory, including when invoked from a subdirectory. `the from option /absolute/control` selects only the settings and policy source; it defaults to the current directory and never selects the repository. Preparation requires the control workspace's local `aiwg.config` with worker dispatch enabled and its `models.json` policy. The base must resolve to a local commit in the source repository; preparation refuses with a non-zero exit and names that repository when it cannot resolve the base. It does not fetch. The branch must be new and the destination must not already exist.

For a control workspace containing a member repository with its own `.git` and history, run from inside the member:

Use AIWG to complete this documented outcome: For a control workspace containing a member repository with its own .git and history, run from inside the member
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

This creates a member-repository worktree with the control's worker settings. From another directory, add `the repo option /absolute/control/repos/member` explicitly. A base present only in the control repository is refused.

This extends `ralph-external`; it creates no Mission, scheduler or new command family. Preparation projects the control's `parallelism` settings and model policy, keeps the base's unrelated project settings, assigns a distinct effect signing account and project scope, initializes the existing delivery keyring, adds runtime excludes, and finishes with `doctor the probe-workers option the qualify option the yes option the json option` in the new tree. Qualification uses the existing bounded CLI probes and approvals; it makes no paid model calls. The command authorizes recording those local approvals.

The control's effect-key provider type and service are preserved. A file provider gets a new private key in the worktree's Git metadata; its control key is never copied. The default provider uses the existing OS credential store with a distinct account. The control's artifact-root pointer is never copied. Bases containing an artifact-root pointer, or an active `AIWG_ARTIFACTS_PATH` override, block preparation to prevent accidentally sharing a ledger.

Concurrent preparations in the same repository serialize internally using the existing owner-lock mechanism in the source repository's Git common directory, including key setup and qualification. A bounded wait reports `blocked` if another preparation holds the lock too long. Proven dead owners can be reclaimed; live or unverifiable owners remain protected.

A successful command prints one `ready` line naming the source repository and resolved base commit, for example `ready "/absolute/writer-a" repo "/absolute/control/repos/member" base <full-commit-sha>`. The preparation receipt in Git metadata records both as `repo` and `base`. Resolve from the prepared tree:

Use AIWG to complete this documented outcome: A successful command prints one ready line naming the source repository and resolved base commit, for example ready "/absolute/writer-a" repo "/absolute/control/repos/member" base <full-commit-sha. The preparation receipt in Git metadata re
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Use your configured group and role. Eligibility still depends on the policy, installed CLI, model observations and available host capacity. No worker launches as part of preparation. The one-launch-per-tree rule continues to apply.

Tracked projections use `skip-worktree`; untracked projections and runtime outputs use Git's `info/exclude`. `git add -A` does not stage them. Git metadata stores a content receipt. Repeating the same preparation reports `ready ... unchanged`; changed source settings, projected content, branch/base or index protection report `blocked` with drift and preserve the files. Preparation never refreshes an edited projection automatically. Failed qualification retains the tree for diagnosis; retrying unchanged inputs resumes preparation.

To remove a prepared tree, run from its control workspace:

Use AIWG to complete this documented outcome: To remove a prepared tree, run from its control workspace
Have it inspect the current state, explain the plan, ask before material
changes, and report the result with verification evidence.

Removal uses the source repository recorded in the receipt, including when invoked from the control repository with a different history. Use `the from option /absolute/control` when removing from another directory. An optional the repo option must match the recorded repository. Removal refuses modified projections and dirty tracked or untracked work. It compares `aiwg.config` structurally, ignoring JSON formatting and object-key order and allowing only nonempty string replacements at `installed.<existing bundle>.version` and `installed.<existing bundle>.installedAt`. AIWG refreshes these stamps when deploying worker context at launch. Added or deleted fields/records, type changes, and every other setting (including installation source, deployment counts, parallelism and effect-key settings) still block removal. `models.json` has no installation stamps and remains byte-for-byte protected.

Refusals identify each drifting JSON Pointer, for example `aiwg.config#/parallelism/clis/codex/extraWritableRoots`, without printing values. Missing files, malformed JSON and byte-only `models.json` changes identify the file's root (`#`) and still block removal. The same comparison protects preparation reruns; accepted installation stamps are left untouched.

After these checks pass, removal revokes only that workspace's approvals, deletes its effect-key account and removes the worktree and receipt. Repeating removal of an absent tree succeeds. The branch remains available for review; there is no force-removal option. Unmanaged paths are never adopted or deleted.

For dispatch configuration and limits, see `$AIWG_ROOT/docs/getting-started/worker-dispatch.md`.