Skip to content

refactor(lib): simplify suppression-scan.py and transcript_reader.py - #14799

Merged
melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-14341-42646645318-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 3 commits into
mainfrom
work-resolve-issue/issue-14341-42646645318-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14341

Summary

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

Simplified lib/suppression-scan.py and lib/transcript_reader.py without changing what they print, return or accept, then regenerated their shared copies with scripts/sync-shared-copies.sh. In suppression-scan.py: the string-closer regex is compiled once per string instead of once per loop pass, the per-call code-marker dict is now the module constant CODE_MARKERS (also used by scan_text's kind check), the list of markers found anywhere in a comment is built once per line, not once per segment, the duplicate PRAGMA match uses a walrus, duplicate _quotes branches are merged into the fallthrough, and the diff-hunk parser drops an isdigit guard its [0-9]+ regex already makes unreachable. In transcript_reader.py, a _str helper replaces six repeated isinstance(..., str) ternaries, and permission_denials becomes a list comprehension. lib/telemetry-body-gate.sh and lib/test-tmp.mjs were reviewed and left unchanged: test-tmp.mjs is already 16 lines with nothing to remove, and the gate's redundant-looking checks are defense in depth on a security boundary.

Not verified

  • Python unit tests for suppression-scan.py and transcript_reader.py (code-metrics, toolchain, session-flow, performance suites) were not run: this lane cannot run an interpreter, so they are left to the PR's CI
  • tidy not run: every source edit is under lib/, a listed shared path, so the change is not eligible for tidy
  • ci-status green is a PR CI check, left to the PR's CI
  • lib/telemetry-body-gate.sh and lib/test-tmp.mjs left unchanged after review (no simplification found that keeps the same behavior and security checks)

Fix

  • lib/suppression-scan.py: merged duplicate _quotes branches; _no_escape as a tuple-membership test; _close_string compiles its regex once; module CODE_MARKERS dict replaces the per-call dict and the kind tuple in scan_text; walrus for the PRAGMA match; the anywhere-marker list is built once per…
  • lib/transcript_reader.py: new _str helper used in permission_event and permission_denials; permission_denials is a list comprehension
  • plugins/code-metrics/skills/audit-suppressions/scripts/suppression-scan.py: regenerated shared copy
  • plugins/toolchain/skills/ratchet/scripts/suppression-scan.py: regenerated shared copy
  • plugins/session-flow/scripts/transcript_reader.py: regenerated shared copy
  • plugins/performance/lib/transcript_reader.py: regenerated shared copy
  • .changes/code-metrics/work-resolve-issue-issue-14341-42646645318-1-70115f6b.md: bump none fragment
  • .changes/toolchain/work-resolve-issue-issue-14341-42646645318-1-d42701e7.md: bump none fragment
  • .changes/session-flow/work-resolve-issue-issue-14341-42646645318-1-9f87242a.md: bump none fragment
  • .changes/performance/work-resolve-issue-issue-14341-42646645318-1-9952f214.md: bump none fragment

Verification

The runner ran each check from the base copy against 535f07a:

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

The run reports:

  • sync-shared-copies: regenerated the 4 copies, exit status 0 (run again after the last edit, exit status 0)
  • check-changelog-fragments: all 9 fragments under .changes/ are valid
  • check-changed-skills: audit-suppressions and ratchet PASS, 0 errors (only pre-existing size warnings)
  • check-affected: 13 passed, 6 skipped, over 10 changed files
  • fresh-context review subagent over the full lib diff: no behavior change found in any of the 10 edits; its one clarity note (a misleading variable name in _close_string) was fixed by restoring the original expression inside re.compile
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42646645318

Left out: the items under Not verified.

Related

#14341

Merge-Risk: max=MEDIUM demote=false head=ccd8da928bfa8bd3f959dd6152ff6f1d08fc9119 rubric=8.2.0 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review needs no new review of ccd8da928bfa8bd3f959dd6152ff6f1d08fc9119: no file of this pull request changed since the review of 020c0dd.

Security review: PR #14799 (incremental, head 020c0dd)

I found no security issues. This was an incremental review covering everything since 535f07ae, and the review was blocking only (CRITICAL and IMPORTANT only), because this lane already reviewed an earlier head.

What changed

The push edits only the four changelog fragments under .changes/:

  • code-metrics
  • performance
  • session-flow
  • toolchain

In each one, the front matter goes from bump: none to bump: patch, and the one-line prose is rewritten as a ### Changed bullet about the synced shared suppression-scan.py or transcript_reader.py copy.

Security relevance

  • None of the four paths matches a trusted-path glob.
  • No code, workflow, plugin manifest, trust control, merge hold, token scope, kill switch or standing instruction is touched.
  • The patch bump only means the four plugins get a version bump on release. It installs no new code: the code in those copies was already reviewed at 535f07ae and found unchanged in behavior.

Prior findings

The lane's earlier review at 535f07ae reported 0 findings, so nothing carries over.

PR context

The description contains no embedded text telling the lane to pass the PR, skip a check, drop a finding or post somewhere else.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

claude-review needs no new review of ccd8da928bfa8bd3f959dd6152ff6f1d08fc9119: no file of this pull request changed since the review of 020c0dd.

Code review (incremental, blocking only): no findings.

This lane already reviewed an earlier head, so this pass reports blocking findings only.

I read every hunk of the 4 files in the incremental scope. They are the changelog fragments for code-metrics, performance, session-flow and toolchain. The push made the same change in each one:

  • The front matter goes from bump: none to bump: patch.
  • The one-line prose body becomes a ### Changed section with one bullet.

The code-metrics and toolchain fragments name the suppression-scan.py sync. The performance and session-flow fragments name the transcript_reader.py sync. Each bullet matches the shared copy that plugin carries in this PR.

The new layout matches the other fragments in the repository, for example .changes/source-control/perf-pr-merge-call-cuts-5c1a9e03.md. A patch bump is a valid level for these plugins: each one ships a changed script, even though the script behaves the same, and a patch is the smallest release that carries it to users.

Closing issue #14341: "The diff edits only the listed files … and changelog fragments" is still met, because this push touched only changelog fragments. I didn't re-check the other criteria: the code under them didn't change, and the earlier review covered them.

No plugin manifests changed. No settled threads or prior inline findings apply. Nothing in the PR context reads as an instruction to the lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 020c0dd6faf500811d99ce2ec09d34f43934cbe2, the head its arming checks judged.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Verification evidence for ccd8da9

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14799-ccd8da928bfa8bd3f959dd6152ff6f1d08fc9119, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Nov 9, 2026
@kyle-sexton
kyle-sexton disabled auto-merge November 9, 2026 22:00
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head ccd8da928bfa8bd3f959dd6152ff6f1d08fc9119, the head its arming checks judged.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 090e18b Nov 10, 2026
61 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14341-42646645318-1 branch November 10, 2026 03:06
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 090e18b7c9064a0736d64773b1e388bba598c9a7; later checks count it verified from this comment.

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.

Simplify the suppression-scan.py, telemetry-body-gate.sh, test-tmp.mjs and 1 more shared lib sources

1 participant