Skip to content

Audit panic paths, split config domains, and align release metadata#37

Open
EvalOpsBot wants to merge 8 commits intomainfrom
cursor/codebase-health-audit-5da4
Open

Audit panic paths, split config domains, and align release metadata#37
EvalOpsBot wants to merge 8 commits intomainfrom
cursor/codebase-health-audit-5da4

Conversation

@EvalOpsBot
Copy link
Contributor

@EvalOpsBot EvalOpsBot commented Mar 13, 2026

Summary

  • harden the highest-risk production parser panic paths by removing capture-group unwrap/expect usage in LLM response, diff, secret scanning, and verification parsing
  • reorganize Config into flattened Vault, GitHub, Agent, and Verification domain structs while migrating a slice of the command tree to idiomatic mod.rs modules
  • align release metadata with 0.5.26, add a release workflow guard for tag/version drift, and pin the Rust toolchain so the current dependency graph is reproducible
  • merge the latest main changes, resolve conflicts in the eval/config/verification pipeline, and preserve the diff parser fix for zero-count hunks

Testing

  • cargo test

Slack Thread

Open in Web Open in Cursor 

cursoragent and others added 6 commits March 13, 2026 21:02
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
Co-authored-by: EvalOpsBot <EvalOpsBot@users.noreply.github.com>
@haasonsaas
Copy link
Collaborator

@cursor review and resolve merge conflicts

@cursor
Copy link

cursor bot commented Mar 13, 2026

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@haasonsaas
Copy link
Collaborator

@cursor review and resolve merge conflicts

@haasonsaas haasonsaas marked this pull request as ready for review March 13, 2026 21:52
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Filter in parse_optional_capture rejects valid zero line counts
    • Removed the zero-value filter so hunk headers preserve valid 0 line counts, and added regression assertions for new and deleted file hunks.

fn parse_optional_capture(captures: &regex::Captures<'_>, group: usize) -> Option<usize> {
captures
.get(group)
.and_then(|value| value.as_str().parse::<usize>().ok())
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The parse_optional_capture function incorrectly converts 0 to 1 for line counts in diff hunk headers, breaking parsing for new files, deleted files, and pure insertion/deletion hunks.
Severity: CRITICAL

Suggested Fix

Remove the .filter(|value| *value > 0) call within the parse_optional_capture function. This will allow the parser to correctly handle 0 as a valid line count in diff hunk headers, which is necessary for new files, deleted files, and pure insertion/deletion hunks.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/core/diff_parser.rs#L478

Potential issue: In `diff_parser.rs`, the `parse_optional_capture` function uses
`.filter(|value| *value > 0)` followed by `.unwrap_or(1)`. This incorrectly converts a
line count of `0` in a diff hunk header to `1`. This affects hunks for new files,
deleted files, and pure insertions/deletions. The hunk termination logic `consumed_old
>= old_lines && consumed_new >= new_lines` then fails because one of the conditions
(e.g., `consumed_old >= 1` for a new file) can never be met. This causes the parser to
read past the end of the hunk, corrupting the parsed diff output.

Did we get this right? 👍 / 👎 to inform future reviews.

@haasonsaas
Copy link
Collaborator

@cursor resolve the merge conflictss and address all feedback

@cursor
Copy link

cursor bot commented Mar 13, 2026

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Filter in parse_optional_capture rejects valid zero line counts
    • Removed the zero-value filter so hunk headers preserve valid 0 line counts, and added regression assertions for new and deleted file hunks.

Create PR

Open in Web Open in Cursor 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants