Skip to content

v0.3.0: unattended worktree identities and environment generation

Choose a tag to compare

@EdoMon93 EdoMon93 released this 02 Oct 10:38
· 13 commits to main since this release

This release adds caller-supplied worktree identities and private environment-file generation to detached unattended creation.

Contract

mkwt create \
  --repo /srv/repos/project \
  --path /srv/workspaces/run-123/reviewer \
  --commit FULL_COMMIT_SHA \
  --detach \
  --config /etc/orchestrator/project-mkwt.conf \
  --worktree-id 5f38b9a814f348dfab1a39945fd574d0 \
  --non-interactive --json

Example declarative external configuration, using literal newlines for multiple assignments:

SYMLINKS=""
POST_CREATE_HOOK=""
OPEN_IN_VSCODE="never"
WORKTREE_ENV_FILE=".env.worktree"
WORKTREE_ENV='WORKTREE_ID={id}
TEST_ENV_NUMBER={n}'

{id} uses the exact validated caller ID or an automatically allocated decimal identity. {n} remains an independently allocated numeric slot. IDs contain 1–128 ASCII characters, start with a letter or digit, and otherwise allow letters, digits, underscore, dot, and hyphen. They remain reserved in Git's worktree registration until removal or explicit pruning, independent of environment filenames or file deletion.

The caller must hold one exclusive repository lock for the whole operation. Every caller using the same Git common directory, including human workflows and direct Git worktree mutations, must participate in that lock. Unsynchronized allocation is unsupported. mkwt adds no locking-tool runtime dependency.

Environment files are fresh and private with mode 0600; new parent directories use mode 0700. Unattended creation never copies a main-checkout env file. Unsafe paths, symlink parents, and existing destinations are refused. Generation failures preserve discoverable registrations and report truthful partial-failure and ownership metadata. Inspect and explicitly remove surviving worktrees before retrying.

JSON schema version remains 1, with additive worktree_id and worktree_env_path fields. Empty-config behavior and the human copy-and-append workflow remain supported. Unattended symlinks and post-create hooks remain disabled. Bash 4.4+ and Git 2.48+ are required for automation.

Orchestrator remains responsible for dependencies, database creation and migrations, startup, host-wide ports, isolation verification, and database cleanup.

Install and verify

git clone --branch v0.3.0 --depth 1 https://github.com/EdoMon93/mkwt.git mkwt-v0.3.0
cd mkwt-v0.3.0
MKWT_INSTALL_DIR="$PWD/release-bin" ./setup.sh
./release-bin/mkwt --version --json

The attached standalone mkwt executable embeds the source revision and does not require a source checkout to report it. The existing v0.2.0 tag and release remain unchanged.

Validation: 40 integration tests and four human-workflow checks passed locally and in GitHub Actions. Coverage includes explicit/automatic identities, numeric templates, multiline literal configuration, caller-locked concurrent allocations and duplicate detection, identities across filename changes/moves/missing worktrees, private permissions, unsafe paths and existing files, and checkout/environment failures. Copilot reviewed the final PR head before merge.