Skip to content

refactor(harness-ops): simplify overlap.py subcommands and detect helpers (part 2 of 2) - #15334

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14514-42997894323-1
Nov 11, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14514

Summary

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

Simplified the functions that start in the second half of overlap.py (from line 1216 of the 2430-line file; the first function in range is _body_has_native_step at line 1322) without changing behavior. The four subcommands' repeated print-each-problem-then-return-1 loops now go through one private helper, _failed. cmd_detect drops the key_of alias in favor of pair_key, reads each lane's state once in the per-lane integrity report, shares one native_text helper between fingerprints() and dismissal_state(), shares one lane_broken predicate between its two broken-lane lists, and reads the seeded native name once. The two body_has* checks use any(), and main() dispatches through a dict keyed by subcommand. Choice and basis: only functions starting in range 2 changed, per the issue; _failed is a new private helper placed in range 2 just above build_native_index, and no public or test-referenced name changed (checked by grepping test_overlap.py).

Not verified

  • test_overlap.py was not run: this lane cannot run a Python interpreter, so the unit suite is left to the PR's CI
  • ruff/mypy lint of overlap.py was not run (no interpreter or linter wrapper in this lane). The review subagent checked line lengths and type narrowing by reading the code; CI runs the linters
  • check-affected skipped the validate-plugins native-overlap registry check (it runs code from the checked tree) and typos (not installed); left to the PR's CI
  • tidy pass 5 (ai-slop:audit fix) ran only its judgment rubric on the changelog fragment and found nothing. The deterministic detect.sh layer and the digest guard did not run because the lane's Bash allowlist does not cover them
  • Not committed: the lane instructions say to leave every change uncommitted in the working tree for the runner to turn into a patch

Fix

  • plugins/harness-ops/skills/audit-native-overlap/scripts/overlap.py: range-2 simplifications: new private _failed helper replaces five print-each-problem loops in cmd_detect, cmd_generate, cmd_self_check and cmd_dismiss; cmd_detect gets the lane_broken and native_text nested helpers, pair_key…
  • .changes/harness-ops/work-resolve-issue-issue-14514-42997894323-1-4c795324.md: patch fragment created with new-changelog-fragment, body '### Changed' and '- Internal simplification, no behavior change.'

Verification

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

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

The run reports:

  • check-changelog-fragments (run before and after tidy): all 11 changelog fragments under .changes/ valid
  • check-changed-skills (run before and after tidy): audit-native-overlap PASS, 0 errors, 4 warnings, all pre-existing (description length, body size, a stale fresh-eyes-exempt directive) and in SKILL.md, which this change did not touch
  • check-affected (run before and after tidy): 13 passed, 6 skipped over 2 changed files
  • fresh-context review subagent over git-read diff HEAD: no behavior change or defect found; it checked main() dispatch equivalence under argparse required=True, _failed truthiness and output order, walrus scope in the report_integrity comprehension, local-name shadowing in cmd_detect, the key_of…
  • grep of test_overlap.py for overlap.* references: tests use build_native_index, _lane_payloads, plugin_component_payload and lane_of, all unchanged
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42997894323

Left out: the items under Not verified.

Related

#14514

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

Code review: no findings

I read every change in both files: overlap.py and the new changelog fragment. I checked each simplification against the code at head, c492270a.

Behavior checks (done by reading the code; no Python was run):

  • _failed helper (overlap.py#L1399): it calls _fail for each problem in the original order, then returns whether the list was non-empty. At all five call sites the result matches the old code:
    • same exit 1
    • in cmd_self_check, the same SELF-CHECK broken line after the errors.
  • main() dispatch dict (L2401-L2407): subparsers is set with required=True (L2270), and the four keys match the parser names exactly (self-check at L2328). So the old "anything else goes to self-check" fallback could never be reached, and the KeyError path can't be reached either. The dict is built inside main(), so a test that monkeypatches the module's cmd_* names still takes effect.
  • Walrus in the report_integrity["lanes"] comprehension (L1889-L1902): the if filter runs before the value expression, so state is always bound and non-None when it's read. state leaks into cmd_detect's scope, but no other code in the function uses that name.
  • native_text nested helper: the old local of the same name existed only inside fingerprints and dismissal_state. The module-level dismissal_drift parameter called native_text has its own separate scope.
  • Seeded-loop name local: native_block and discovered_candidate define their own name, and the later existing loop reassigns it before using it. No closure picks up the new binding.
  • Other changes: replacing key_of with pair_key, the lane_broken predicate, and the two any() rewrites are all exact equivalents.

Against #14514's acceptance criteria:

  • Only overlap.py and one changelog fragment are edited, well under 400 lines.
  • The fragment has bump: patch, a ### Changed heading and the required line.
  • All edited functions start after line 1215, the midpoint of the 2430-line base file.
  • No flag, exported name or printed message changed.
  • "ci-status is green" and "behavior unchanged" depend on the PR's CI. The PR body says test_overlap.py, ruff and mypy were not run by the lane (the author's own claim; I didn't verify it), so those criteria rest on CI.

No manifest changes, no trusted-path files, and no hold class applies. I found no embedded instructions in the PR context.

@github-actions

Copy link
Copy Markdown
Contributor

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

Security review: PR #15334

No security issues found.

I read every hunk of both changed files:

  • .changes/harness-ops/work-resolve-issue-issue-14514-42997894323-1-4c795324.md is a new changelog fragment. It holds a bump: patch header and one sentence of text.

  • plugins/harness-ops/skills/audit-native-overlap/scripts/overlap.py is refactored without changing what it does:

    • The repeated print-then-return-1 loops now go through a new _failed helper.
    • New local helpers lane_broken and native_text are shared within cmd_detect.
    • The key_of alias is replaced by pair_key.
    • Two loops become any().
    • The per-lane integrity report reads each lane's state once, using := inside a dict comprehension.
    • main() now picks the subcommand from a dict.

    None of these changes adds input handling, a subprocess or shell call, a new file path, network access, or any handling of tokens or secrets. The file writes it already made (store_path.write_text) are unchanged.

No changed file matches a trusted-path glob. No trust control, merge hold, kill switch, token request, plugin manifest or standing instruction is touched, so the trust-control, manifest and instruction-surface checks have nothing to apply to. The pull request context has no embedded instructions aimed at this lane.

critical-findings: 0

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for c492270

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-15334-c492270a847ea5a6fcf8a242156b64de09428405, expires on 2026-12-11.

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 11, 2026
Merged via the queue into main with commit 6b92304 Nov 11, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14514-42997894323-1 branch November 11, 2026 11:04
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

0 participants