fix(disk-hygiene): scan transcript head for guard-launch failures - #2478
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 2m 18s —— View job Security Review
This PR changes IMPORTANT — Head-region scan reintroduces the unbounded-cost problem this detector was explicitly designed to avoid The module docstring (lines 47–58) is explicit that this detector must stay head_limit = size - _MAX_TAIL_BYTES
head_raw = handle.read(head_limit) # reads the ENTIRE file minus 2MBCritically, per main()#L273-L290 and _run()#L252-L270, the once-per-session marker is written only when a guard failure is actually found. In the normal/expected case — no guard failures — the marker never gets written, so this full-head read repeats on every single There's a secondary consequence: Confidence: High — verified directly in the code; the marker-only-on-found gating is unconditional and not test-covered for the repeated-scan/no-failure path. Suggested fix: cap the head scan too (e.g., only scan back some bounded multiple of SUGGESTION — Boundary record between head and tail is silently dropped The JSONL record that straddles the head/tail split point is discarded from both sides: the trailing partial line is trimmed off Confidence: Medium — the mechanics are verified in code; likelihood of a real guard failure landing exactly on this byte boundary is low. No other security issues (injection, auth, secrets handling, or GitHub Actions risk) found in this PR's changes — |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2b8e5c050e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
15a8bd4 to
49bd721
Compare
|
Claude finished @kyle-sexton's task in 1m 32s —— View job Security Review
This PR changes IMPORTANT — Head-region scan reintroduces the unbounded per- guard_launch_monitor.py#L179-L194 The module docstring (lines 47-58) states this detector must stay head_limit = size - _MAX_TAIL_BYTES
head_raw = handle.read(head_limit) # reads the entire transcript minus 2MBThe once-per-session marker is written only on the path where a failure is found (main()#L281-L286, gated by There's a compounding failure mode: Confidence: High — verified directly in the code; the marker-only-on-found gating is unconditional, and the repeated full-head-read path has no bound or offset persistence. Suggested fix: cap the head scan too (e.g., only scan back some bounded multiple of SUGGESTION — Boundary record between head and tail is silently dropped guard_launch_monitor.py#L165-L194 The JSONL record straddling the head/tail split point is discarded from both sides: the trailing partial line is trimmed off Confidence: Medium — mechanics verified in code; likelihood of a real guard failure landing exactly on this byte boundary is low. No other security issues found. This PR does not touch any GitHub Actions workflow files, so no |
49bd721 to
f2cebb7
Compare
|
Claude finished @kyle-sexton's task in 2m 20s —— View job Security Review
This PR changes IMPORTANT — Head-region scan reintroduces the unbounded per- guard_launch_monitor.py#L179-L194 The module docstring (L47-L58) states the read must stay head_limit = size - _MAX_TAIL_BYTES
head_raw = handle.read(head_limit) # reads the entire transcript minus 2 MBThe once-per-session marker is written only when a failure is actually found ( Compounding this: Confidence: High — verified directly against current HEAD; the marker-only-on-found gating is unconditional and the repeated full-head-read path has no bound or persisted offset. Also independently flagged by Codex (P1 comment) and prior automated passes on this PR. Suggested fix: cap the head scan too (e.g., only scan back a bounded multiple of SUGGESTION — JSONL record straddling the head/tail split point is silently dropped guard_launch_monitor.py#L179-L194 Tracing the byte ranges precisely: Confidence: Medium — mechanics verified by tracing exact byte offsets in the current code; likelihood of a real guard failure landing exactly on this boundary is low. No other security issues found. This PR does not touch any GitHub Actions workflow files, so no |
|
Claude finished @kyle-sexton's task in 5m 23s —— View job Code Review
This lane covers correctness, design, error handling, tests, and documentation; security/performance findings (already reported on this PR by the security lane) are intentionally left to it. One Important finding, posted inline on
Otherwise: the Verification note: I did not have working shell access to run |
|
Claude has reviewed this PR 4 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
bd08b79 to
db7018b
Compare
|
Claude finished @cursor[bot]'s task in 2m 31s —— View job Security Review
Reviewed all four changed files at HEAD I independently re-verified the core logic in IMPORTANT — IMPORTANT — Both findings were already surfaced by Codex and by earlier review passes on this PR; confirming they remain unresolved at the current head. |
|
Last security-reviewed head: |
|
Claude finished @cursor[bot]'s task in 4m 2s —— View job Code Review
This lane covers correctness, design, error handling, tests, and documentation. Per One Important finding, posted inline on
This is the same bug already identified and inline-commented by a prior automated pass on this PR (on an earlier HEAD); it remains present, unaddressed, on the current HEAD ( Otherwise: the Verification note: I did not have working shell access to execute |
|
Claude finished @kyle-sexton's task in 53s —— View job Security Review
Skip gate: this head already has a security review that still applies.
— empty output. The merge pulled in unrelated changes to other plugins ( Per the skill's skip gate (
Neither finding has code changed since it was reported, so I have not re-posted duplicate inline comments. |
|
Claude finished @cursor[bot]'s task in 1m 30s —— View job Security Review
Skip gate: this head already has a security review that still applies.
— empty output. The only changes since then are unrelated docs/changelog updates merged in from Per the security-review skill's skip gate, no new review is needed. For reference, the previously-reported findings on
Neither finding has had code changed since it was reported, so no duplicate inline comments were posted. |
|
Claude finished @cursor[bot]'s task in 3m 35s —— View job Code Review (
|
Fixes #1514 Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
3fd79e4 to
6406da1
Compare
|
Claude finished @cursor[bot]'s task in 53s —— View job Security Review
Skip gate: this head already has a security review that still applies.
— empty output. The only changes since then are unrelated content merged in from Per the security-review skill's skip gate (item 3: "this head already has a successful security review that still applies"), no new review is needed. For reference, the previously-reported findings on
Neither finding has had code changed since it was reported, so no duplicate inline comments were posted. |
|
Claude finished @cursor[bot]'s task in 1m 36s —— View job Code Review (
|
Fixes #1514
Test plan
python3 -m pytest plugins/disk-hygiene/skills/clean/scripts/test_guard_launch_monitor.py -k head_region_failureRelated
N/A