Skip to content

fix: section-12 drift checks work under the copy-deploy model#192

Merged
mlorentedev merged 2 commits into
mainfrom
fix/section-12-drift-checks-copy-deploy
May 31, 2026
Merged

fix: section-12 drift checks work under the copy-deploy model#192
mlorentedev merged 2 commits into
mainfrom
fix/section-12-drift-checks-copy-deploy

Conversation

@mlorentedev
Copy link
Copy Markdown
Owner

Fixes the two section-12 "Repo <-> Deploy-Dir Drift" healthcheck FAILs from setup-linux. Both were exposed by the copy-deploy model (ADR-012 made ~/.dotfiles a plain non-git copy).

FAIL 1 - harness/skill drift

compile-harness.sh --check required a git repo (git rev-parse), but the healthcheck runs it from the non-git ~/.dotfiles -> [ERROR] not in a git repo -> false-fail.
Fix: resolve the root from the script's own location (CWD- and deploy-model-independent) - works in a checkout, a linked worktree, and the non-git copy alike. Removed the vestigial cd "$DOTFILES_DIR". --check/--deploy/--refresh now fail loudly on a missing manifest (was a silent pass).

FAIL 2 - deployed skill is a symlink (~/.claude/skills/find-skills)

A REAL issue, correctly caught: find-skills was a dangling symlink (-> a removed 3-Feb ~/.agents leftover). Resolved by removing the broken symlink (runtime). The check stays strict - all deployed skill paths must be hard copies (BUG-100); now reports every offender with an ours/foreign fix hint. (An attempt to scope the check to "our" skills was reverted - it would have hidden the real dangling symlink, contradicting the all-hard-copies invariant.)

Verification

  • bats tests/compile-harness-rootresolve.bats: --check works from a non-git copy + fails gracefully without a manifest.
  • skills-pipeline.bats + claude-settings-template.bats green; shellcheck + bash -n clean.

FAIL 1 (harness/skill drift): compile-harness.sh required a git repo (git rev-parse), but the healthcheck runs --check from the non-git deploy copy ~/.dotfiles (ADR-012) -> '[ERROR] not in a git repo' false-fail. Now resolve the repo/deploy root from the script's own location (CWD- and deploy-model-independent); removed the vestigial 'cd DOTFILES_DIR'; --check/--deploy/--refresh now fail loudly on a missing manifest. FAIL 2 (deployed skill is a symlink): the check correctly caught a real dangling find-skills symlink (-> a removed ~/.agents leftover); kept the check strict (all deployed skills must be hard copies, BUG-100), report all offenders with an ours/foreign fix hint. Regression test: compile-harness --check from a non-git copy.
…tion

The copy-deploy fix switched compile-harness.sh from git-toplevel (CWD-based)
to SCRIPT_DIR-based root resolution, so the real script under test resolved to
the live repo instead of each test's throwaway fixture — 26 pipeline tests then
ran --refresh/--deploy against the wrong tree and failed.

Add a HARNESS_REPO_ROOT override (same explicit-override idiom as VAULT_PATH):
the fixture tests export it in setup() to pin the root; production keeps the
SCRIPT_DIR default untouched. Realign the symlink-free guard grep to the
current healthcheck message wording.
@mlorentedev mlorentedev merged commit ca293be into main May 31, 2026
6 checks passed
@mlorentedev mlorentedev deleted the fix/section-12-drift-checks-copy-deploy branch May 31, 2026 18:37
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