Skip to content

refactor(harness-ops): simplify audit_skill_visibility.py part 1 of 2 - #14831

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14519-42681119219-1
Nov 9, 2026
Merged

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14519

Summary

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

Simplified functions that start in the first half (lines 1-1940) of audit_skill_visibility.py without changing behavior. A new _read_frontmatter helper replaces three copies of the read-or-mark-malformed pattern, and a new _scope_version helper replaces three scope/version dict literals in resolve_installed. _settings_layer now reuses _stub_layer through a dict merge, which keeps the key order. resolve_windows builds each env row once and returns from one place instead of four, and _window_label is now a dict lookup. Net: 59 lines added, 91 removed.

Not verified

  • test_audit_skill_visibility.py and audit_skill_visibility.test.sh not run directly: the lane's Bash runs no interpreter, so the suites are left to the PR's CI
  • ruff and mypy not run directly (no interpreter in this lane); the review subagent checked the changed lines against the repo's ruff.toml selection and default mypy
  • ci-status green is a PR CI check, left to the PR's CI
  • tidy pass 5 (ai-slop): the detector script is not one of the lane's allowed wrappers, so only the rubric read ran on the changelog fragment (no findings)

Fix

  • plugins/harness-ops/skills/audit-skill-visibility/scripts/audit_skill_visibility.py: adds the _read_frontmatter and _scope_version helpers; _settings_layer delegates to _stub_layer; resolve_windows builds each env row with one if/elif chain and has one return; _window_label is a dict lookup.…
  • .changes/harness-ops/work-resolve-issue-issue-14519-42681119219-1-52a7021b.md: patch fragment with '### Changed' and 'Internal simplification, no behavior change.'

Verification

The runner ran each check from the base copy against 14a9461:

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

The run reports:

  • check-changelog-fragments: all 12 fragments valid (run before and after tidy)
  • check-changed-skills: audit-skill-visibility PASS, 0 errors (3 existing size warnings on SKILL.md, which this change does not touch)
  • check-affected: 13 passed, 6 skipped over 2 changed files (run before and after tidy)
  • fresh-context review subagent: compared every hunk with the pre-change code at c8d1fa0 and found no behavior difference (return values, dict key order, env-row order, effect and basis strings), no new ruff (repo ruff.toml selects E4/E7/E9/F) or mypy findings, and no tests that rely on…
  • git-read diff --numstat HEAD: 59 added, 91 removed, in the one listed file
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42681119219

Left out: the items under Not verified.

Related

#14519

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

Security review: PR #14831 (head 14a9461)

No security issues found.

I read every hunk in both changed files:

  • .changes/harness-ops/work-resolve-issue-issue-14519-42681119219-1-52a7021b.md: a patch-bump changelog fragment. It holds prose only and no instructions or directives.

  • plugins/harness-ops/skills/audit-skill-visibility/scripts/audit_skill_visibility.py: a refactor of a local, read-only audit script. It adds two helpers:

    • _read_frontmatter replaces three copies of read-or-mark-malformed with the same parsers as before.
    • _scope_version builds the scope/version dicts in resolve_installed.

    Three other functions are restructured:

    • _settings_layer now reuses _stub_layer through a dict merge. settings gets overwritten in place, so the key order stays the same.
    • resolve_windows builds each env row once and returns from one place. The effect and basis strings and the row order are the same as before.
    • _window_label is now a dict lookup.

    No new file, network, subprocess, env or path inputs are added, and no existing ones are widened. Untrusted data reaches the same parsers as before.

Other checks:

  • Trusted paths: neither changed file matches a listed glob.
  • Trust controls: no control is touched or widened.
  • Instruction surfaces: no standing instruction is deleted, narrowed or softened.
  • Plugin manifests: none are changed.
  • Embedded text in the PR context: none found that tries to direct this review.
  • Prior findings: none. This is the first review of this pull request, not a blocking-only one.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 14a946152b5d44bd3eed0e89d9b2e44ce56ce154: 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 and found no behavior difference from base.

What I checked against base

  • _read_frontmatter is defined at line 502, after parse_frontmatter (line 362) and parse_command_frontmatter (line 413), so the default argument resolves correctly. It still returns {"_malformed": True} when a file can't be read, as before. No test monkeypatches parse_frontmatter, so binding it as a default argument at definition time changes nothing.
  • _scope_version builds the same scope/version dicts, with the same defaults.
  • _settings_layer: _stub_layer puts "settings": None in fourth position. | {"settings": settings} overwrites that key where it sits, so key order (scope, path, status, settings, note) and values are unchanged.
  • resolve_windows:
    • In the unset branches, the old code wrote "value": None and the new code writes "value": max_tokens / disable_1m. Both are None there, so the output is the same.
    • The env rows keep their order and their effect strings.
    • The pin branch still adds " (not applied: --context-window pinned)" before the return.
    • Basis precedence is unchanged: pin, then MAX_CONTEXT_TOKENS, then DISABLE_1M, then the band.
  • _window_label: the dict lookup's eager f"{window:,}" default is safe for ints, and the output is the same.

Closing issue #14519 acceptance criteria

  • Behavior unchanged: met, by the reading above. No test covers _settings_layer key order or _window_label directly. The existing suites cover behavior end to end.
  • Diff limited to the listed file plus a fragment: met.
  • Size: met, about 150 changed lines across 1 hand-edited file.
  • Fragment: met. It has bump: patch, ### Changed, and "Internal simplification, no behavior change."
  • Only functions starting in range 1 of 2: met. The last changed function, _window_label, starts around line 1738, inside lines 1-1940.
  • ci-status green: CI hasn't reported yet, so I couldn't check it.

Not verified by me: I had no shell, so I didn't run the test suites, ruff or mypy. The PR body's verification results are the author's claims and I haven't confirmed them.

Neither changed file matches a trusted path. Neither file is a plugin manifest, so the manifest checks didn't apply. No embedded instructions were found in the PR context.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 14a9461

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-14831-14a946152b5d44bd3eed0e89d9b2e44ce56ce154, 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 failed status checks Nov 9, 2026
@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 2341ade Nov 9, 2026
63 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14519-42681119219-1 branch November 9, 2026 21:04
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_skill_visibility.py harness-ops plugin code (part 1 of 2)

0 participants