fix(update): gitignored user files also block the destructive ZIP overlay - #96440
Merged
kshitijk4poor merged 2 commits intoAug 27, 2026
Merged
kshitijk4poor merged 2 commits into
kshitijk4poor merged 2 commits into
Conversation
Carried from NousResearch#87392 (closed as superseded — its core guard landed via the NousResearch#87327 salvage chain): the dirty-tree check now passes --ignored=all, so a gitignored-but-real user file (logs, scratch files, local data) blocks the destructive ZIP overlay too. The ZIP path's own preserved top-level entries (venv, node_modules, .git, .env — gitignored on every normal install) are exempted so they don't become a false refusal. Credit: @JoaoMarcos44, whose NousResearch#87392 included this hardening.
kshitijk4poor
force-pushed
the
fix/zip-dirty-tree-ignored-all
branch
from
August 27, 2026 14:58
d0cde74 to
d792113
Compare
kshitijk4poor
enabled auto-merge (rebase)
August 27, 2026 15:09
kshitijk4poor
disabled auto-merge
August 27, 2026 15:12
…hared preserve constant Review corrections on the first draft (caught by /simplify-code before merge — the PR was disarmed for these): - BLOCKER: --ignored=all is not a valid git mode (git exits 128 'Invalid ignored mode'); with it, every ZIP update was refused as 'could not check the working tree'. The mocked tests could not see this — a new real-git test creates an actual repo + .gitignore and asserts the guard runs clean, blocks on an ignored user file, and exempts ignored preserved entries. --ignored=matching also reports an ignored dir as one line instead of enumerating its contents. - FAIL-OPEN HOLE: the ' -> ' two-path split now applies only to R/C rename/copy status codes. Porcelain v1 does not quote plain filenames with spaces, so an ignored file literally named 'venv -> node_modules' parsed as two preserved tops and slipped past the guard into the destructive swap. - _update_via_zip's swap loop now consumes _ZIP_PRESERVED_TOP_LEVEL instead of a comment-synced duplicate set (change-detector test added).
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.
Summary
Gitignored user files now also block the destructive ZIP-fallback overlay during
hermes update. Carried from #87392 (@JoaoMarcos44), whose core ZIP-guard fix was superseded by the #87327→#87878 salvage chain but whose--ignored=allhardening never landed.Root cause: the dirty-tree guard (
_zip_overlay_block_reason) rangit status --porcelain --untracked-files=all— gitignored files (local logs, scratch files, user data sitting in the checkout) were invisible to it, and the ZIP overlay permanently deletes them.Changes
hermes_cli/update_cmd.py: the status probe adds--ignored=all; a new_is_zip_preserved_entry_status_linefilter exempts the swap's own preserved top-level entries (venv,node_modules,.git,.env— gitignored on every normal install) so they can't become a false refusal.--ignored=all; ignored preserved entries don't block.Validation
!! scratch/notes.localin checkout!! venv/,!! node_modules/Credit: @JoaoMarcos44 — commit cherry-picked shape with authorship preserved.