-
Notifications
You must be signed in to change notification settings - Fork 0
fix(review): neutralise log markers, flag command substitution #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f012bb3
fix(review): neutralise Actions log markers in untrusted text
zfarrell fd8df04
feat(review): flag command substitution in the tool usage artifact
zfarrell e217f90
fix(review): neutralise the ##[ marker form anywhere in a line
zfarrell 0fc192c
fix(review): sanitise before the byte caps, not after
zfarrell 251a000
fix(review): cap the PR description so it cannot evict the diff
zfarrell aa6553a
fix(review): remove a live log marker from the prompt document
zfarrell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: moving the pass here makes every per-block cap non-authoritative, and the PR body has no cap of its own — so the diff can now be evicted where it used to survive. (not blocking)
The step output is bounded again, which was the point, and the threads half is fully fixed because its only cap is the one that now runs last. But
cap_file "$CTX"at line 542 is the sole cap downstream of the substitutions, and the blocks are appended in order, so an amplifying early block no longer just inflates the output — it consumes the budget the later blocks were going to use.The PR body at line 340 is the reachable one, and it is the block your own new test already sizes: 65,536 characters is ~21,800
::lines, 28 bytes out each, ~610 KB against a 200 KB cap. The header above it is ~150 bytes, sohead -c 200000cuts ~1/3 of the way into the body and## Commits,## Changed files,## CI checks, the failing-job excerpt, the since-diff and## Full diffare all gone. Before this commit the same body was ~64 KB at cap time, so every one of those blocks made it in and the cost was output size instead.That reading is testable, and I think it is why tests/context-step-test.sh:655-661 asserts only boundedness where the three sibling budget tests (613, 632, 676) each also assert
^## Full diff. Adding the same line there should fail today:The other pre-cap blocks turn out to be fine, for what it is worth — the log excerpts are line-bounded (
LOG_WINDOW120 + 20 summary lines, so ~4 KB even all-::), andDIFF_MAX/SINCE_MAXcap out around 145 KB combined. The body is the only uncapped one.Two shapes of fix. Narrow: give the description its own block cap on the sanitised bytes, like the log excerpts get.
General: sanitise each untrusted value at the point it enters
$CTXrather than in one pass at the end, which restores the invariant the per-block caps were written under and lets this whole-file pass go away.PR_TITLEis untrusted on the same footing and is a single line, so it costs nothing either way.Degradation, not a wrong review — the truncation notice survives the cut and the prompt handles absent blocks by fetching. But README.md:53-56 now says the per-block caps keep the file "far below" the total, and with the substitutions downstream of them that is no longer what the code does.