Skip to content

fix(sweep): Fill the tracking issue findings table from all-findings - #559

Open
tlq5l wants to merge 6 commits into
getsentry:mainfrom
tlq5l:fix/sweep-issue-findings-table
Open

tlq5l wants to merge 6 commits into
getsentry:mainfrom
tlq5l:fix/sweep-issue-findings-table

Conversation

@tlq5l

@tlq5l tlq5l commented Nov 4, 2026 •

Copy link
Copy Markdown

Fixes #227

build_issue_body() in skills/warden-sweep/scripts/create_issue.py read severity, skill, file, line and title from verified.jsonl. Phase 2 appends only verdict data there (findingId, verdict, confidence; see references/verify-prompt.md), so every row of the tracking issue rendered as | info | | `` | |.

The function now looks up each verified entry by findingId in all_findings and renders {**full_record, **verified_entry}: keys in the verified row override the matching all-findings entry. A verified entry with a match now shows its severity, skill, file, line and title. The line comes from the nested location.startLine that extract_findings.py writes (skills/warden-sweep/scripts/extract_findings.py:93-96); a top-level startLine is used first when present. A verified entry with no match still gets a row, with blank details. This implements issue #227's option 1.

generate_report.py also reads severity from verified.jsonl (lines 60, 127 and 206); I left it alone to keep this diff to the issue.

Added create_issue_test.py: end-to-end tests that run the real extract_findings.py on a warden log, then create_issue.py with a stub gh. CI runs them through pnpm test:sweep-scripts.

Added create_issue_breaks_test.py: end-to-end cases for malformed rows (non-object location, unhashable finding id and others); build_issue_body() now treats a non-object location as missing and skips non-string finding ids instead of crashing.

Callers checked: skills/warden-sweep/scripts/create_issue.py, skills/warden-sweep/scripts/create_issue_test.py, skills/warden-sweep/scripts/create_issue_breaks_test.py

Real run (agent-run) at d78271f, clean setup (empty HOME, no git config): pnpm test:sweep-scripts, exit 0. Last output line: OK. Record: .git/live-run-d78271f.txt (local clone).

AI disclosure: Agent-written and agent-checked; the maintainer's CI will run the suite; the author takes responsibility.

tlq5l added 3 commits November 4, 2026 12:23
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Agent: claude
create_issue.py read startLine at the top level, but extract_findings.py
nests it under location, so every verified row lost its line number. The
regression test now runs create_issue.py end to end on extractor output,
and CI runs it.

Agent: claude
@vercel

vercel Bot commented Nov 4, 2026

Copy link
Copy Markdown

@tlq5l is attempting to deploy a commit to the Sentry Team on Vercel.

A member of the Team first needs to authorize it.

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. The verify prompt only returns findingId/verdict/confidence/reasoning, so joining back to all-findings.jsonl by findingId is the right place to fix this, and reading location.startLine matches what extract_findings.py actually writes. I ran the new tests locally: they pass on this branch, and the main test fails against the old create_issue.py, so the regression is covered end to end through the real extractor.

Fine with leaving generate_report.py out of this one. organize.py's security index reads skill/severity/file/title straight off verified.jsonl too, so it's probably worth a follow-up alongside that.

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good to me. Joining on findingId against all-findings.jsonl fixes #227 where the problem starts. The verify prompt only returns verdict fields, so the script can't rely on verified.jsonl for display data. Reading location.startLine also lines up with how extract_findings.py normalizes records.

The end-to-end test runs the real extractor output through create_issue.py, so it catches this break. I ran it locally: it fails against main and passes on this branch.

@tlq5l

tlq5l commented Nov 4, 2026

Copy link
Copy Markdown
Author

The organize.py follow-up the review pointed at is up as #560: same findingId join, end-to-end tests through the real extractor.

tlq5l added 3 commits November 7, 2026 12:34
verified.jsonl only holds verdict data, so the tracking issue's
findings table rendered empty severity, skill, file and title cells.
Join each verified entry to its finding in all-findings.jsonl by
findingId before rendering.

Adds an end-to-end test that runs create_issue.py on a sweep directory
with a fake gh and checks the rendered row.

Agent: claude
The verified-findings join pulls title, file and skill from
all-findings.jsonl into the issue table. Those values are scanned from
code, so:

- escape pipes and flatten newlines in table cells, so a title or skill
  cannot add cells or forge a row
- treat a non-object location as missing instead of crashing
- ignore non-string findingIds instead of crashing on unhashable values
- fail before posting when one findingId maps to two different findings,
  rather than letting file order pick the row
- null or empty display fields in verified.jsonl no longer override the
  finding's values

Each case has an end-to-end regression test that failed before this fix.

Agent: claude
… values

build_issue_body read startLine from a location that may be a string or
list, and keyed findings by findingId without checking the type, so one
malformed finding crashed the tracking issue. Treat a non-object location
as missing and skip non-string findingIds, as join_finding_details does.

Move the end-to-end tests to create_issue_breaks_test.py so the sweep
test command (*_test.py) runs them.

Agent: claude

This branch has not been deployed

No deployments
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.

warden-sweep: create_issue.py renders empty findings table because verified.jsonl lacks full finding data

1 participant