Skip to content

fix(install): keep checkout on uninstall, keep kit.toml mode - #1260

Merged
tieubao merged 5 commits into
masterfrom
l312-install
Dec 2, 2026
Merged

tieubao merged 5 commits into
masterfrom
l312-install

Conversation

@tieubao

@tieubao tieubao commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

What

Three installer bugs and two copy trims in install.sh.

  1. An in-place --uninstall (the kit checkout is the install) deleted the checkout's own hooks and kit.toml. The guard now compares the folders by inode (-ef), which also holds for a case-variant path on macOS.
  2. --force-both after plugin-compat exited 1 on empty globs under set -euo pipefail. The summary now uses glob loops.
  3. kit.toml dropped to mode 0600 on every render. The render now keeps the existing mode (fallback 0644).
  4. An out-of-place install no longer copies lib//tests and lib//*/tests; no installed tool reads them.
  5. Only the playbooks that agents and commands reference (and the playbooks those link to) are copied: 10 kept, 11 dropped.

Demo

In-place uninstall with a case-variant path: 41 checkout files deleted before, none after.

Proof

docs/verification/l312-install-fixes.md

  • Verdict: works: the three bugs are fixed and an out-of-place install still has every file its tools read.
  • Proof: tests/test-install-fixes.sh 31/31 on bash 3.2 and 5, red on the old install.sh; installer, adopt and clean-room suites green; a fresh review ran sandboxed installs (in place, symlinked, case variant, out of place round trip) and both of its blockers were fixed and tested.
  • Risk: a user doc pointing at a dropped playbook would now point at a missing file in an out-of-place install; undo with a revert.
  • Needs Han: nothing.

Bookkeeping

no-board-row: leftover audit slice tracked on the devkit leftovers item

Fix three installer bugs and add two out-of-place copy trims:
- Skip deleting checkout files under dwarves-kit/ during in-place --uninstall (direct clone or symlinked checkout).
- Replace ls-1 pipelines in the install summary with glob loops so --force-both after compat install exits 0 under pipefail.
- Preserve existing kit.toml permissions (or source mode on fresh install) before moving mktemp output into place.
- Exclude lib/*/tests and lib/*/*/tests when copying lib/ out of place.
- Copy only the 9 referenced docs/impl-playbook files into out-of-place installs.
Resolve review blockers B1 and B2:
- Compare KIT_DIR and CLAUDE_DIR/dwarves-kit by inode (-ef) in --uninstall so case-variant paths on macOS APFS stay protected.
- Add red-team-engagement.md (linked from threat-modeling.md) to KIT_IMPL_PLAYBOOKS and widen tests/test-install-fixes.sh to follow playbook-to-playbook links transitively.
- Add a case-variant in-place uninstall regression test (skipped on case-sensitive filesystems) and refresh docs/reference/FEATURES.md.
# Conflicts:
#	docs/reference/FEATURES.md
@tieubao tieubao changed the title fix(install): keep the checkout on in-place uninstall, keep kit.toml mode, trim the copy fix(install): keep checkout on uninstall, keep kit.toml mode Dec 2, 2026
@tieubao
tieubao merged commit cd42b65 into master Dec 2, 2026
10 of 11 checks passed
@tieubao
tieubao deleted the l312-install branch December 2, 2026 10:07
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