Skip to content

feat(issue-import-from-scan): attach a scan's candidate patches to new trackers - #1896

Merged
potiuk merged 2 commits into
apache:mainfrom
potiuk:scan-import-attach-patches
Oct 29, 2026
Merged

potiuk merged 2 commits into
apache:mainfrom
potiuk:scan-import-attach-patches

Conversation

@potiuk

@potiuk potiuk commented Oct 29, 2026

Copy link
Copy Markdown
Member

Some scans ship candidate fixes alongside their findings, for example the patches/<n>.patch files in a decrypted findings archive. Until now security-issue-import-from-scan linked only each finding's write-up. Whoever picked up a new tracker had to go back into the archive to find the patches.

This change puts them on the tracker:

  • attach_archive lists each finding's candidate patches in numeric order as patches ([] when none). It only lists them, never runs anything.
  • A new render-patch-comment command writes the tracker comment. It starts with a short warning that the patches are untested and private, then has one collapsed <details> block per candidate. Each block is titled by the patch's own header line and fenced as diff, with a fence longer than any backtick run inside the patch. @ tokens in the titles are wrapped in backticks so they notify nobody.
  • Comment bodies stay under GitHub's 65,536-character limit by splitting across several comments. A single patch too large for one comment is refused rather than cut.
  • Step F posts the comment after the operator confirms. The patches are quoted only, never applied or run. Their headers explain the vulnerability, so the comment stays on the private tracker and is never copied into a public PR.
  • The scan-format contract gains an optional patches field.

Tests cover ordering, folded rendering, fence escaping, splitting, the oversize error, and the refusal when no archive was linked.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NyQq9UPScpux59zQR38WWD

…w trackers

When a scan ships candidate patches, import-from-scan now puts them on
each tracker it creates, so whoever picks up the fix starts from them
instead of digging through the decrypted archive.

- attach_archive lists each finding's patches/<n>.patch files, in
  numeric order, as `patches` (`[]` when none).
- New `render-patch-comment` command writes the tracker comment: a short
  untested-and-private warning, then one collapsed <details> block per
  candidate, titled by the patch's own header line and fenced as diff
  with a fence longer than any backtick run inside it. @-tokens in the
  titles are code-wrapped so they notify nobody. Bodies stay under
  GitHub's comment limit by splitting across several comments; a single
  patch too large for one comment is refused rather than cut. Each body
  starts with the `scan-patches` skill-comment marker, so sync's
  pre-flight reads it as skill-authored, not as human activity.
- Step F posts the comment after the operator confirms; the patches are
  quoted only, never applied or run, and never copied into a public PR.
- The scan-format contract gains the optional `patches` field.

Generated-by: Claude Opus 5
Claude-Session: https://claude.ai/code/session_01NyQq9UPScpux59zQR38WWD
@github-actions github-actions Bot added family:security security-* skills family:tools tools/* family:docs Docs, MISSION.md, READMEs capability:intake Import external signal + sync tracker state contract:scan-format Tool capability: security-scanner report parsing substrate:analytics Tool substrate: read-only metrics / dashboards / renderers labels Oct 29, 2026
…the patch comment

The scan's target and commit come from the disclosure email. A value
holding a backtick would close the code span and let the email inject
Markdown or an @-mention into the tracker comment, so a value that is
not a plain ref is left out of the intro.

Generated-by: Claude Opus 5
Claude-Session: https://claude.ai/code/session_01NyQq9UPScpux59zQR38WWD
@potiuk
potiuk enabled auto-merge (squash) October 29, 2026 09:24
@potiuk
potiuk merged commit 634ab08 into apache:main Oct 29, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capability:intake Import external signal + sync tracker state contract:scan-format Tool capability: security-scanner report parsing family:docs Docs, MISSION.md, READMEs family:security security-* skills family:tools tools/* substrate:analytics Tool substrate: read-only metrics / dashboards / renderers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant