Skip to content

refactor(harness-ops): simplify audit_performance.py part 1 of 2 - #14844

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14515

Summary

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

Simplified functions that start in the first half of audit_performance.py (lines 1-1284 when this part started), with no behavior change. cli_version now times its probe with the existing timed() helper. The FILETIME setup in process_times is collapsed into a list. attribute_orphans has a flatter verdict branch, where dead and recycled share one orphan path and the unused parent lookup is gone, and its census row update uses min/max. Smaller changes: a redundant reassignment in tree_census is dropped, and a formatter-wrapped constant and an over-long string line are reflowed. Every output string, dict key order and exception path is the same as before.

Not verified

  • Ran no Python test suite here (the lane runs no interpreter); test_audit_performance.py and audit_performance.test.sh are left to the PR's CI
  • process_times (Windows ctypes path) cannot run on this Linux runner; its change was checked by reading the code and the subagent review only
  • Tidy-diff ran passes 1-3 (no edits needed) and skipped markdown passes 4-5, because the issue fixes the fragment body word for word
  • ruff lint not run locally (no interpreter or tool command allowed here); left to the PR's CI
  • ci-status green is a PR check, left to the PR's CI

Fix

  • plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py: cli_version reuses timed(); tree_census drops a redundant size = 0; _windows_object_type_table moves the size comment above a plain assignment; process_times builds and passes its four FILETIMEs as one list;…
  • .changes/harness-ops/work-resolve-issue-issue-14515-42681223965-1-5d9f9c25.md: new patch fragment with ### Changed and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 155aea7:

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

The run reports:

  • check-changelog-fragments: all 10 fragments valid (run before and after tidy)
  • check-changed-skills: audit-performance PASS, 0 errors, 3 warnings that were already there (description and body length, not touched by this change)
  • check-affected: 13 passed, 6 skipped over 2 changed files (run before and after tidy)
  • fresh-context subagent review of the whole diff: no behavior change found. It checked timed() semantics, that _parent_state returns only dead/unknown/recycled/live, dict key order, min/max on ties and NaN, the reflowed string's concatenation, and unused names
  • grep of test_audit_performance.py: no test mocks perf_counter, GetProcessTimes or the edited internals; attribute_orphans tests assert on the outputs this change keeps the same
  • edited functions all start before line 1284 (range 1 of 2 of the 2568-line file); read_proc_text (line 1289) and later are untouched
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42681223965

Left out: the items under Not verified.

Related

#14515

Merge-Risk: max=MEDIUM demote=false head=155aea7a427a829ceb41fd3fa04d541ae24b15eb 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 reviewed 155aea7a427a829ceb41fd3fa04d541ae24b15eb: read 2 of 2 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #14844 (head 155aea7)

No security issues found.

I read every hunk of both changed files:

  • plugins/harness-ops/skills/audit-performance/scripts/audit_performance.py is refactored inside a read-only diagnostic script, with no new security-relevant surface:
    • cli_version now calls the existing timed() helper (L374-377). The subprocess call still runs as an argv list, [exe, "--version"], with no shell and with the same timeout. No new input reaches it.
    • In tree_census, size is already set to 0 at the top of each loop pass (L546), so dropping the second size = 0 in the except branch changes nothing.
    • In process_times, building the four FILETIME values as a list is the same ctypes call with the same buffers. The 1 << 20 buffer size in _windows_object_type_table is unchanged.
    • The attribute_orphans verdict branch is flatter. _parent_state (L1022-1033) returns only dead, unknown, recycled or live, and live is returned only when by_pid[ppid] exists, so the direct index by_pid[record["ppid"]] cannot raise. The census row update now uses min/max.
    • One string line is reflowed. The engine still only reports and never kills processes.
  • .changes/harness-ops/...5d9f9c25.md is a new changelog fragment holding only prose.

The diff changes no trust control, merge hold, workflow, token scope, plugin manifest or standing instruction. The PR context has no embedded instructions aimed at this lane. This is the lane's first review of this PR (blocking only: no), and there are no prior findings to restate.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

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

Code review: PR #14844 (refactor(harness-ops): simplify audit_performance.py part 1 of 2)

No findings. I read every hunk of both changed files (the changelog fragment and audit_performance.py). I checked each edit against the head file to confirm it doesn't change behavior.

  • cli_version: timed() (L374-377) returns (result, round(perf_counter delta, 3)), which is the same as the inline timing it replaces. TimeoutExpired still reaches the existing except.
  • tree_census: size = 0 is already set at the top of each loop pass (L546), and nothing changes it before the try. Writing pass there instead is equivalent.
  • process_times: the four FILETIMEs are now passed by reference in the same order (created, exited, kernel, user), so the result unpacks the same way. I could not run the Windows ctypes path, so this is checked by reading only.
  • attribute_orphans:
    • _parent_state (L1022-1033) only ever returns dead, unknown, recycled or live.
    • It returns live only when by_pid has the parent, so by_pid[record["ppid"]] cannot raise KeyError.
    • The dead and recycled cases share one branch now, and the dict keys come out in the same order as before. The reason key is still added only for recycled.
    • Switching the census row to min/max gives the same values.
  • Reflowed string: it joins to exactly the same text as before.
  • Closing issue Simplify the audit_performance.py harness-ops plugin code (part 1 of 2) #14515 criteria:
    • Only the listed file and one changelog fragment are edited, and the PR is well under 400 lines.
    • The fragment's body matches the required wording, with bump: patch.
    • Every edited function starts before about line 1284, inside range 1.
    • Existing tests in test_audit_performance.py assert on the recycled/parent_name outputs of attribute_orphans.
    • ci-status being green is left to CI. I did not run it. The author's verification claims are also unverified by me.

Spend: none beyond this review run.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 155aea7

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-14844-155aea7a427a829ceb41fd3fa04d541ae24b15eb, 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
Merged via the queue into main with commit 69bb273 Nov 10, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14515-42681223965-1 branch November 10, 2026 00:04
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit 69bb273839a1d09253056cdcb43b73efef846012; 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 1 of 2)

0 participants