Skip to content

fix(watcher): absorb MM rows + S-64 DoD wrap#99

Merged
tieubao merged 1 commit into
mainfrom
fix/watcher-deploy-wrap
May 12, 2026
Merged

fix(watcher): absorb MM rows + S-64 DoD wrap#99
tieubao merged 1 commit into
mainfrom
fix/watcher-deploy-wrap

Conversation

@tieubao
Copy link
Copy Markdown
Member

@tieubao tieubao commented May 12, 2026

Summary

  • Bug fix: original dotfiles-watcher-tick regex ^ M only caught destination-only-modified rows in chezmoi status. Real-world MM rows (both source and destination flagged) were silently ignored, so the live edit during the Mac mini deploy never fired the absorb. Widened to ^.M so any "destination modified" row absorbs.
  • New test: case 3.5 absorb_MM_status against a fake chezmoi status emitting MM .tool-versions. Full suite now 10/10 on Mac mini.
  • DoD wrap: S-64 frontmatter flipped to status: done, DoD checklist ticked, new "Known issues" section documents two operational quirks surfaced during deploy. docs/tasks.md row moved from "Next up" to "Completed (post v0.1.0)". docs/sync-log.md gets a hostname-tagged entry for the Mac mini deploy.
  • Drift swept: home/dot_gitignore .claude/worktrees/ lines re-added during the deploy session (pre-existing drift, not new content).

Test plan

  • bash tests/dotfiles-watch.sh — 10/10 pass (was 9/9, +1 new MM case).
  • End-to-end demo on Mac mini: appended a comment to ~/.tool-versions, watcher tick wrote TICK start + + .tool-versions + TICK done (passes=3) to ~/Library/Logs/dotfiles-watcher.log; git diff home/dot_tool-versions showed the line absorbed; sed-revert fired another tick that returned source to HEAD.
  • Both LaunchAgents loaded: com.truonghan.dotfiles-watcher (state=idle), com.truonghan.dotfiles-watcher-fswatch (state=running, pid 5578).

Known issues documented in spec

  • .claude/settings.json is MM because a modify_ script renders it; chezmoi re-add succeeds but doesn't change source, so each tick logs an absorb attempt that's a no-op. DRIFT_LOOP_MAX=3 caps the loop.
  • launchctl print reports runs = N outpacing the log line count when a manual tick is holding the mkdir lock during a launchd-triggered firing. The lock collapses bursts correctly; the only observable effect is the runs counter.

🤖 Generated with Claude Code

Original `dotfiles-watcher-tick` matched drift with `awk '/^ M /'`
(destination-only modified). On the Mac mini, the live edit produced
`MM .tool-versions` in `chezmoi status` because chezmoi flagged both
sides as changed, and the watcher exited silently. Widened the regex
to `awk '/^.M /'` so any "destination modified" row — ` M `, `MM `,
or `AM ` — absorbs. Added test case 3.5 (`absorb_MM_status`) to the
spec test matrix; full suite is 10/10 on Mac mini.

Other wrap-up items shipped in the same commit:

- S-64 frontmatter flipped to `status: done`; DoD checklist ticked
  with the Mac mini end-to-end demo result.
- New "Known issues" section in the spec for the two operational
  quirks surfaced during deploy: `.claude/settings.json` MM that
  never clears (`modify_` script overrides re-add) and the
  launchd-runs-vs-log-lines mismatch when manual ticks hold the
  mkdir lock during a launchd-triggered firing.
- `docs/tasks.md`: S-64 moved from "Next up" to "Completed
  (post v0.1.0)" with the full deploy-time context.
- `docs/sync-log.md`: hostname-tagged entry for the Mac mini deploy,
  noting the regex fix and the artifacts absorbed.
- `home/dot_gitignore`: `.claude/worktrees/` lines re-added (live
  drift absorbed by `chezmoi re-add` during the deploy session;
  not introduced by this commit).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tieubao tieubao merged commit 31e92a9 into main May 12, 2026
@tieubao tieubao deleted the fix/watcher-deploy-wrap branch May 12, 2026 08:57
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