feat: guard .aem store + select-all in Review changes - #33
Merged
Conversation
The `.aem` folder holds the pristine server copies the app diffs and
reverts against; an accidental edit (often by an AI assistant tidying
files) silently corrupts change detection. Discourage that cheaply:
- Mark pristine originals read-only (0o444) after every legitimate write
(download, push round-trip, post-push mtime touch), clearing the bit
right before the app's own rewrites/deletes so sync never gets blocked.
- Drop a README ("DO NOT EDIT") and a catch-all `.gitignore` into each
`.aem` dir whenever the manifest is written.
- Unlock the tree before "delete local content" so read-only originals
don't trip `fs.rm` (notably on Windows).
All chmod is best-effort — a failure can never abort a sync. New pure
module `aem-guard.js` with unit tests; the `content` CLI inherits the
behavior via the shared da-sync functions.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The review rail had no one-click way to (un)check every file. Replace the static "Changes" heading with a tri-state master checkbox: empty when nothing is checked, indeterminate when some are, ticked when all are. Toggling it checks or clears every reviewable file, and it stays in sync with per-row checkboxes, Space-to-toggle, and Cmd+A. It disables while there is nothing to review or a push/revert is running. The header inset is now symmetric so the master checkbox lines up with the per-row checkboxes below it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
🎉 This PR is included in version 1.16.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small, independent improvements (one commit each).
1. Guard the
.aempristine store against accidental edits.aem/holds the pristine server copies the app diffs and reverts against. An accidental edit (often an AI assistant "tidying" files) silently corrupts change detection. Cheap deterrents — not a security boundary:0o444) after every legitimate write (download, push round-trip, post-push mtime touch). The write bit is cleared right before the app's own rewrites/deletes so sync is never blocked..gitignoreare dropped into each.aemdir whenever the manifest is written.fs.rm(notably on Windows).All
chmodis best-effort — a failure can never abort a sync. New pure modulesrc/main/aem-guard.jswith unit tests; thecontentCLI inherits the behavior through the sharedda-syncfunctions.2. Select/deselect-all checkbox in Review changes
The review rail had no one-click way to (un)check every file. The static "Changes" heading is replaced with a tri-state master checkbox: empty when nothing is checked, indeterminate when some are, ticked when all are. It toggles every reviewable file and stays in sync with per-row checkboxes, Space-to-toggle, and Cmd+A; it disables when there's nothing to review or a push/revert is running. The header inset is now symmetric so the checkbox lines up with the per-row checkboxes.
Testing
npm run lintclean.npm test— 343 passing (6 new tests intest/aem-guard.test.js).🤖 Generated with Claude Code