Skip to content

fix(generate): chmod on ActionUnchanged + close Plan 12 test gaps (Plan 13)#22

Merged
LastStep merged 1 commit into
mainfrom
plan-13-actionunchanged-followups
Apr 17, 2026
Merged

fix(generate): chmod on ActionUnchanged + close Plan 12 test gaps (Plan 13)#22
LastStep merged 1 commit into
mainfrom
plan-13-actionunchanged-followups

Conversation

@LastStep

Copy link
Copy Markdown
Owner

Summary

  • writeFileChmod now re-applies its declared perm when the inner writeFile returns ActionUnchanged. Previously, a sensor script whose exec bit had been stripped externally would stay non-executable across bonsai update runs once Plan 12's content-equality short-circuit took effect.
  • TestWriteResultSummary now asserts the unchanged count (previously discarded via _).
  • New TestWorkspaceClaudeMDUnchangedShortCircuit covers the short-circuit at internal/generate/generate.go:829-833 — second call asserts ActionUnchanged and verifies mtime is unchanged (file was back-dated first to make rewrites detectable on coarse-mtime filesystems).
  • New TestWriteFileChmodRestoresPermOnUnchanged regression test: create at 0755 → strip to 0644 externally → re-run with identical content → assert ActionUnchanged + mode restored to 0755.

Plan: station/Playbook/Plans/Active/13-actionunchanged-followups.md. Follow-up to Plan 12 (PR #20).

Test plan

  • `go build ./...`
  • `go vet ./...`
  • `go test ./...` — all pass
  • `gofmt -s -l cmd/ internal/ main.go` — empty
  • Manual: in a dogfooded workspace, `chmod -x station/agent/Sensors/status-bar.sh && bonsai update` — expect "Up to date" panel AND exec bit restored
  • Manual: two consecutive `bonsai update` runs on a clean workspace — second shows "Up to date" with no mtime churn

🤖 Generated with Claude Code

… gaps

- writeFileChmod now re-applies perm when inner writeFile returns
  ActionUnchanged; previously a sensor script that had its exec bit
  stripped externally would stay non-executable across bonsai update
  runs once Plan 12's content-equality short-circuit took effect.
- TestWriteResultSummary now covers the unchanged count.
- New TestWorkspaceClaudeMDUnchangedShortCircuit covers the
  WorkspaceClaudeMD short-circuit at generate.go:829-833.
- New TestWriteFileChmodRestoresPermOnUnchanged regression test.

Plan 13. Follow-up to Plan 12 (PR #20).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@LastStep LastStep merged commit 86e7adf into main Apr 17, 2026
2 checks passed
@LastStep LastStep deleted the plan-13-actionunchanged-followups branch April 17, 2026 08:43
LastStep added a commit that referenced this pull request Apr 17, 2026
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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