-
Notifications
You must be signed in to change notification settings - Fork 1
Pipeline Design 191
Seth Ford edited this page Mar 1, 2026
·
1 revision
ADR written to .claude/plan.md. Here's a summary:
Design: Self-healing smoke test for daemon worktree creation
Decision: Extract the real setup_dirs() from sw-daemon.sh at test time via sed + eval, run it in an isolated subshell with controlled env vars ($HOME, $DAEMON_DIR, cwd), and assert two behaviors:
-
.claude/worktrees/directory gets created when absent -
.gitignoregains the entry when missing
Key choices:
- Real function extraction (not copy-paste) — catches actual regressions
- Subshell isolation — no side effects on test env or real filesystem
- Single test function — both assertions exercise one function call
- Inline assertions — more readable than generic helpers for 2 checks
Alternatives rejected:
- Source full daemon script —
setup_dirs()runs at parse time, creates real dirs - Copy-paste function into test — goes stale silently, defeats the purpose
- New test file — one function doesn't justify ~100 lines of boilerplate +
package.jsonregistration
Risk areas: sed extraction pattern fragility (mitigated by loud failure on empty extraction), eval safety (mitigated by $TEMP_DIR sandbox)
Single file change: scripts/sw-daemon-test.sh — add function + register in tests=() array.