fix: sanitize staged files before GitHub upload - #170
Open
mimosapudical wants to merge 2 commits into
Open
Conversation
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
Closes #153.
Dependency
Depends on #169.
The first commit in this branch (
90d67f5) is already under review in #169.The new change introduced by this PR is
6fe92e0.Once #169 is merged, I will rebase this branch onto the updated
mainso this PR contains only the #153 change.Why
Previously, sanitization only covered selected files under
logs/beforegit add.Secrets written to other artifacts could therefore enter the Git index.
Also, sanitizing only the working-tree file after staging is insufficient because the Git index may still retain the original secret-containing blob.
The new boundary is:
agent artifacts
→ git staging
→ staged-file sanitization
→ re-stage sanitized files
→ staged-content verification
→ commit
→ push
Testing
python -m pytest -q tests/test_security.py— 13 passedpython -m py_compile src/core/security.py src/core/github_manager.py tests/test_security.py— passedFull
tests/: 178 passed, 3 unrelated existing Windows path assertion failures.