Skip to content

fix(upstream-apply-changelog): skip handoffs whose drift key is already open on an earlier release's issue - #17869

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-17856-44884035799-1
Nov 21, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-17856-44884035799-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #17856

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The changelog lane deduped handoffs only by their release-scoped key inside that release's own issue, so a native-drift row such as native-drift:inventory-broken:unknown:inventory was filed again every release. fileReleaseHandoffs now reads each handoff body's Drift key: <key> line (trimmed exact match, as in the changelog skill's native-drift.md "Dedupe by key"), searches for an open issue holding that exact line, and skips the handoff when one exists, logging <handoff key>: drift key <key> is already open in #N; not filed again. Design choices: only issues the lanes App opened count, the same trust rule the release-marker lookup already uses (anyone can type a marker), so a drift handoff filed by hand through /harness-ops:changelog under a person's account does not suppress the lane's filing. Only drift keys matching [A-Za-z0-9_.:/-]{1,200} are searched, which keeps the quoted search phrase safe and short; any other key files as before. Each distinct drift key costs one search call per run.

Not verified

  • node --test for upstream-apply-changelog.test.mjs was not run directly: the lane runs no interpreter; check-affected's output does not list which suites it ran, so the suite is left to the PR's CI
  • tidy skipped: the change sits under .github/, a listed shared path
  • comment-hygiene and size-check, within check-affected, could not run here (network fetch denied; audit-size.sh absent from the lane checkout); left to the PR's CI

Fix

  • .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs: adds driftKeyOf, openDriftIssue and withoutOpenDrift; fileReleaseHandoffs filters out handoffs whose drift key is on an open lanes App issue before its existing release-issue logic, and returns a distinct message when every…
  • .github/scripts/upstream-apply-changelog/upstream-apply-changelog.test.mjs: adds a stateful fake tracker and four tests: two releases with one drift key end with one open issue holding it and the second run logs #100; a release whose only drift handoff is open files nothing (a stopped one files its…

Verification

The runner ran each check from the base copy against 65a0264:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-affected: 10 passed, 10 skipped over 2 changed files (comment-hygiene and size-check skipped: their fetch or script was unavailable in the lane)
  • check-changelog-fragments: all 6 fragments valid (the change is under .github/scripts, not a plugin, so no fragment is owed)
  • check-changed-skills: no changed skills
  • fresh-context review subagent: traced the four new tests and the existing fileReleaseHandoffs tests by hand against the code and found them passing; its one finding (a drift key near 256 characters could exceed GitHub's search-length limit and fail publish) was fixed by capping the searched key at…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/44884035799

Left out: the items under Not verified.

Related

#17856

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 65a0264e2da08f556494170272cfbff3752e2dbe: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17869

No security issues found.

What changed: fileReleaseHandoffs in .github/scripts/upstream-apply-changelog/upstream-apply-changelog.mjs now drops any handoff whose Drift key: line already appears on an open issue. It finds that issue with one search call per distinct drift key, before the existing release-issue logic runs. The test file adds a fake tracker and four tests. Neither file is on the trusted-path list.

Trust boundaries checked:

  • Suppression by forgery. A handoff counts as already filed only when the issue was opened by the lanes App. The code checks the returned item's user.login === LANES_APP_LOGIN itself (L70) and does not rely on the author:app/... search qualifier. It also requires state === "open" and the exact trimmed line. An outsider's issue or comment holding the same Drift key: line cannot suppress a filing. This matches the trust rule the release-marker lookup already uses (L142).
  • Search-query injection. Only keys that match ^[A-Za-z0-9_.:@/-]{1,200}$ are put into the quoted search phrase (L36). That pattern allows no quotes or whitespace, so a key cannot close the phrase or add search qualifiers. The query is also encodeURIComponent-encoded. A key of any other shape is not searched and is filed as before. The PR text gives the character class without @, but the code allows @; that has no security effect.
  • Failure modes. A missed search match or search lag only means a duplicate issue gets filed. A search error fails the publish, as the existing release lookup already does. Neither path widens a token, exposes a secret, admits an actor or sends untrusted text into a lane with credentials.

No trust control, merge hold, kill switch, token scope or plugin manifest is touched. No instruction surface is deleted or weakened.

Spend: one extra GitHub search API call per distinct drift key on each changelog run. This draws on the existing API rate budget, not billing.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 65a0264e2da08f556494170272cfbff3752e2dbe: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Code review: PR #17869, deduping changelog handoffs by drift key

No blocking or advisory findings. I read both changed files' full diff, plus the unchanged parts of upstream-apply-changelog.mjs that the new code calls or is called from: fileReleaseHandoffs, renderItems and publish.

What changed. Before a release issue is filed or appended to, fileReleaseHandoffs now drops any handoff whose Drift key: line already sits on an open issue opened by the lanes App. The match is an exact trimmed line, the same rule native_drift.py has-key and native-drift.md "Dedupe by key" use. Each distinct key is searched once per run, and the DRIFT_KEY pattern keeps the quoted search phrase safe and short. Including @ in the pattern is correct: it matches the p:s@agent keys the skill names. The PR body's version of the pattern leaves @ out, but that is only the description.

Paths I traced by hand (not executed):

  • Re-running a release whose own issue already holds the drift row. The handoff is dropped before the missing check, and the PATCH title count (have.size + missing.length) stays correct.
  • Stopped plan where every handoff is dropped. It still files a stop-line issue titled 0 handoffs.
  • No drift handoffs. The search is skipped, so the existing issueApi tests see the same calls as before.
  • Search query length. It stays under GitHub's 256-character limit, since qualifiers don't count and the phrase is at most 211 characters.

Closing issue #17856, Done when:

  • "A release run whose handoff carries a Drift key: line already present on an open issue does not file that handoff again, and its log names the open issue." Met, at upstream-apply-changelog.mjs#L74-L85. Tests that would catch a regression: "two releases producing the same drift key…" (checks the #100 log line) and "a release whose only handoff's drift key is open files nothing…".
  • "A test in which two releases produce the same drift key ends with one open issue holding it." Met by the first new test, which asserts exactly one open issue holds the key.

Not verified: I didn't run node --test (this lane has no shell). The author also says the suite wasn't run in their lane and was left to CI. The test results above are my hand trace, not a run.

Other checks:

  • No .claude/rules/ glob matches either changed file, and neither file is a plugin manifest.
  • The PR context contains no embedded directives.
  • Security is left to the separate security lane. Example: whether a handoff body from the plan could carry a forged Drift key: line that suppresses a real handoff.
  • Nothing here can cause a charge, so there is no hold.

Loosened checks would be marked: fail (no wrapper verdict or pattern lines supplied, so the default applies); patterns: 0. The diff loosens no check. The prompt had no loosened_check_decision_record: line, so the citation requirement was not checked.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 15d81b1 Nov 21, 2026
49 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-17856-44884035799-1 branch November 21, 2026 09:13
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.

upstream-apply-changelog: dedupe handoffs by drift key across releases

1 participant