Repository navigation
Description
What's broken
For a PROBABLE-DUP report, security-issue-triage names the tracker to keep but puts the newly triaged tracker first in the deduplicate command.
Both the proposal and recap emit this order.
Copying either command and approving the resulting merge can close the tracker triage selected to keep.
The merge confirmation still identifies the tracker it will close and requires approval.
Which layer
The proposal renderer and recap renderer emit <new> <kept>.
The deduplicate selector assigns keep, drop = issues, following the kept-first input contract.
How to reproduce
From a checkout of 3fd660b0b1316f475044c05dae17c5b86a12165e, run this synthetic example.
It renders the proposal and recap and passes their commands to the local selector.
uv run --frozen --project tools/security-management python - <<'PY'
# SPDX-License-Identifier: Apache-2.0
import re
from security_management.issue_triage.proposal import render as proposal
from security_management.issue_triage.recap import render as recap
from security_management.issue_deduplicate.gate import selector
tracker = "example/tracker"
p = proposal({
"tracker": tracker, "number": 250, "class": "PROBABLE-DUP",
"kept_tracker": 212, "severity": "my read is Low, team-scoring expected",
"roster": ["alice"], "viewer": "bob", "handles": ["alice"],
"summary": "Synthetic duplicate of the earlier report.",
"question": "agree this is a duplicate", "scratch": "/tmp/m060",
})
assert p["ok"], p
command = re.search(r"next: `([^`]+)`", p["text"])[1]
print(next(line for line in p["text"].splitlines() if "Kept tracker:" in line))
r = recap({"tracker": tracker, "posted": [{
"number": 250, "class": "PROBABLE-DUP", "kept": 212,
"comment_url": "https://github.com/example/tracker/issues/250#issuecomment-1",
}]})
for source, invocation in (("proposal", command), ("recap", r["next_steps"][0])):
result = selector({"tracker": tracker, "invocation": invocation})
print(source, invocation, "=>", result["keep"], result["drop"])
PYExpected vs actual
Both renderers should emit 212 250, which the selector resolves to keep=212, drop=250.
Actual output:
Kept tracker: [example/tracker#212](https://github.com/example/tracker/issues/212); next: `security-issue-deduplicate 250 212`.
proposal security-issue-deduplicate 250 212 => 250 212
recap /security-issue-deduplicate 250 212 => 250 212
Surface area (optional)
The affected surfaces are the triage proposal, the triage recap, and the packaged copies of both renderers.
Environment (optional)
Reproduced at 3fd660b0b1316f475044c05dae17c5b86a12165e with Python 3.12 on Linux.
All tracker data and handles in the example are synthetic.
Prepared with assistance from Codex.
Activity