Skip to content

refactor(harness-ops): simplify the second half of audit_performance.py - #15128

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14516-42842095996-1
Nov 10, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14516-42842095996-1

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14516

Summary

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

Simplified the functions that start in range 2 of 2 of audit_performance.py (line 1276 onward) without changing what they do. project_fan_out groups its per-tool-call handlers by event once, instead of rescanning every handler for every (event, tool, file kind) row. It also builds its row identity in one local helper and computes command_key once per settings handler. hook_inventory routes its four read_json calls through one local read() that records errors. A new private _configured_env helper replaces the settings-env-then-process-env lookup that concurrency_ceilings and shell_resolution each repeated. concurrency_ceilings' two mutually exclusive finding branches become one if/elif. Output dicts, key order, list order, errors, flags and public names are unchanged; _configured_env is private and not in all.

Not verified

  • The Python test suite (test_audit_performance.py, audit_performance.test.sh) was not run: this lane cannot run an interpreter, so it is left to the PR's CI.
  • Lint and format of the Python file (ruff, black) were not run here for the same reason; left to the PR's CI.
  • ci-status green is a PR check, left to the PR's CI.
  • Tidy passes 4 and 5 (docs-hygiene and ai-slop on markdown) were skipped: the only markdown line is the fragment text the issue's acceptance criteria require word for word. Tidy passes 1 to 3 found nothing further.

Fix

  • plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py: project_fan_out groups gated handlers by event, shares a hook_row helper with the duplicate-row pass, flattens the extension-gate condition and hoists command_key; hook_inventory uses a local read() for read_json plus error…
  • .changes/harness-ops/work-resolve-issue-issue-14516-42842095996-1-66735b99.md: patch fragment, ### Changed, 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against c39c9ba:

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

The run reports:

  • check-changelog-fragments: all 10 fragments under .changes/ valid (run before and after tidy)
  • check-changed-skills: audit-performance PASS, 0 errors, 3 warnings about SKILL.md size that this change did not touch (run before and after tidy)
  • check-affected: 13 passed, 6 skipped over 2 changed files (run before tidy, after tidy, and after the review nit fix)
  • fresh-context review subagent: compared old and new code for each changed function (ordering, duplicate entry objects, non-dict and non-int inputs, exceptions, annotations) and found no behavior difference; its one nit (unannotated env parameter) was applied
  • scope: every changed hunk sits in a function that starts at or after line 1276 of the 2550-line file (range 2 of 2); the only other change is the changelog fragment
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42842095996

Left out: the items under Not verified.

Related

#14516

Merge-Risk: max=LOW demote=false head=c39c9ba5dd33b99e3e06600aadcc60c953075420 rubric=8.3.5 rater=claude-opus-5-5 checker=claude-opus-5-5

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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15128

I found no security issues.

I read every hunk of both changed files. Neither one matches a trusted-path glob, and neither touches a trust control, a merge hold, a plugin manifest or an instruction surface.

  • plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py is a behaviour-preserving refactor of a local, read-only audit script:
    • project_fan_out now groups handlers by event and uses a hook_row helper.
    • The duplicate-row pass now iterates entries instead of gated. It picks the same id()-matched entries in the same relative order, because gated was an ordered subsequence of entries.
    • hook_inventory sends its four read_json calls through one local read() that still records each error.
    • A new private _configured_env helper replaces lookup code that was repeated twice. It keeps the same precedence: settings env first, then the process environment.
    • In concurrency_ceilings, two branches that could never both run are merged into one if/elif.
    • It adds no new input sources, subprocess or shell calls, path construction from untrusted data, network I/O, or handling of secrets.
  • .changes/harness-ops/...md is a changelog fragment with no executable content.

The PR context contains no embedded directives aimed at this lane.

This is the first review of this pull request, so it is not blocking only. I made no subagent or verifier calls because there were no candidate findings.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk of both changed files, audit_performance.py and the changelog fragment, and compared each against the base code in the head file.

Behavior equivalence (checked by reading, not by running):

  • project_fan_out:
    • Grouping by event: gated_by_event keeps the handlers in their entries order inside each event. sorted(gated_by_event) gives the same event set as the old sorted({... for e in gated}). The old inner event filter is now implied by the grouping.
    • Extension gate: the merged condition is logically the same as the old nested if.
    • command_key: it is computed once per handler, which is safe because it is a pure read.
    • Duplicate rows: the pass now runs over entries instead of gated. This is equivalent. duplicate_ids only ever holds ids of gated entries, gated was a subsequence of entries in the same order, and the same object always lands on the same side of the gate.
    • hook_row: it reproduces the old row dict, including the or "unknown" fallback and key order.
  • hook_inventory: the local read() adds errors in the same order as before. No later code uses the removed error local.
  • _configured_env: settings env first, then process env, with the same source strings, for both concurrency_ceilings and shell_resolution.
  • concurrency_ceilings: the two old branches could never both run, so making them one if/elif keeps the order of findings. above_documented_default is still set only when there is a value and a documented default, in the same key position, and still None when the value is not an integer.

Closing issue #14516 acceptance criteria:

  • Behavior unchanged: met as read above. Existing tests in test_audit_performance.py cover:
    • hook_inventory
    • the duplicate-settings-handler reason
    • above_documented_default
    • "set but undocumented upstream"
    • the "engine process environment" source
  • Only the listed file plus a fragment changed: met.
  • Size limit: met. About 60 changed lines in one file.
  • Fragment: met. bump: patch, ### Changed, and the exact line "Internal simplification, no behavior change."
  • Only functions in range 2 of 2 changed: met. Every changed hunk is in a function that starts after line 1702, which is past the stated split at line 1276.
  • ci-status green: not checked here. The PR body says CI will verify it, and I can't run tests.

The PR body's verification results (fragment and skill checks, check-affected) are the author's claims; I did not verify them. No embedded instructions in the PR context. No .claude/rules or manifest changes apply. This is the first review of this PR (no earlier heads), so it is not blocking-only.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for c39c9ba

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-15128-c39c9ba5dd33b99e3e06600aadcc60c953075420, expires on 2026-12-10.

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 10, 2026
Merged via the queue into main with commit 7c75fff Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14516-42842095996-1 branch November 10, 2026 16:31
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 86%; mutation score 86%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py 6 1 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py:2071 SBR productive input-gap

The run's summary has the full report.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 7c75fffec4110892faf196aba770b1a2faf45765; 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 audit_performance.py harness-ops plugin code (part 2 of 2)

0 participants