[Wails] M5: Consumer drift warning (snapshot + banner)#142
[Wails] M5: Consumer drift warning (snapshot + banner)#142josh-padnick wants to merge 1 commit intofeat/wails-rewritefrom
Conversation
Reviewers on consumer-mode opens now see a non-blocking banner when files under the gruntbook tree change after they opened it — protects them from executing scripts that drifted from the reviewed state. Adds core/watcher primitives (Walk + Classify) hash-compared against a baseline snapshot taken at StartWatch time. WatcherService now walks the tree, adds every subdirectory to fsnotify, and emits a classified drift event on every debounced change. ResetSnapshot re-baselines after the user clicks Reload. Author Mode unchanged — auto-reload still wins and the banner stays hidden. Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
core/watcher/with OS-freeWalk+Classifyprimitives so the snapshot/diff logic is testable with fake filesystems and portable into hosted mode later.WatcherService.StartWatchnow takes a baseline snapshot (sha256-hashed, output-path-aware) and recursively registers every subdirectory with fsnotify. Debounced changes emit a classifiedwatch:<watchID>:driftevent alongside the existing:change.WatcherService.ResetSnapshotre-baselines after Reload so subsequent edits are measured against the just-reloaded state.useWatchModenow returns{ resetSnapshot }and acceptsonDrift. NewDriftBannercomponent (expand/collapse changed-file list, Reload, Dismiss).RunbookViewrenders it in consumer mode only; Author Mode continues to auto-reload and suppresses the banner.Test plan
go test ./core/watcher/... ./services/... ./core/...— passes (snapshot Walk skips.git/node_modules/output path, Classify is deterministically sorted, architecture test still blocks OS imports fromcore/).cd web && npx tsc -b— clean.cd web && npx vitest run— 229 tests pass.task desktop:dev, open a gruntbook, edit a script outside the app → banner appears; Reload re-baselines (banner stays gone for content-identical writes); Dismiss hides; next change re-opens with cumulative delta.--watch(author mode) → auto-reload still fires and banner never renders.🤖 Generated with Claude Code