Skip to content

refactor(harness-ops): simplify inventory compare_reports and docs_crosscheck - #15323

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

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

Conversation

@melodic-automation-lanes

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

Copy link
Copy Markdown
Contributor

Closes #14557

Summary

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

Simplified the two inventory scripts without changing behavior. compare_reports.py now walks lists with zip_longest, folds the list and string cases of _unresolved into one check, and reads JSON through a shared _read_json helper. docs_crosscheck.py adds a _give_up helper for its six early-return failure paths and a _count helper for both status tallies, computes classify's docs-alias test once instead of three times, and skips building alias sets that were then thrown away. Every public and test-referenced name (compare, main, bash, ROW_MAX, subprocess, fetch_text, parse*, classify, build*) is unchanged.

Not verified

  • test_compare_reports.py and test_inventory.py were not run: this lane allows no interpreter; left to the PR's CI
  • ci-status green (acceptance criterion) is a PR CI check, left to the PR's CI
  • Python lint (ruff/black) not run here: no linter wrapper in this lane; left to the PR's CI
  • tidy passes 4 and 5 (docs-hygiene and ai-slop on the changelog fragment) skipped: the fragment body is fixed verbatim by the issue's acceptance criteria; passes 1-3 ran and found nothing further

Fix

  • plugins/harness-ops/skills/inventory/scripts/compare_reports.py: zip_longest list walk, single-path _unresolved, shared _read_json for the allow file and both reports
  • plugins/harness-ops/skills/inventory/scripts/docs_crosscheck.py: _give_up and _count helpers, dict comprehension for tool names, simpler kind/body parse, docs_alias computed once in classify, alias-disagreement sets built only when a docs row exists
  • .changes/harness-ops/work-resolve-issue-issue-14557-42995326352-1-a53b1a1e.md: patch fragment, ### Changed, "Internal simplification, no behavior change."

Verification

The runner ran each check from the base copy against 31011a0:

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

The run reports:

  • check-changelog-fragments: all 11 fragments valid (run before and after tidy)
  • check-changed-skills: inventory PASS, 0 errors, 2 warnings that were already there (SKILL.md size), run before and after tidy
  • check-affected: 13 passed, 6 skipped, 0 failed over 3 changed files (run before and after tidy)
  • fresh-context subagent review of the whole diff for behavior equivalence: no reachable behavior difference found; it confirmed row is never an empty dict, statuses are always within STATUSES/TOOL_STATUSES, and key order of returned blocks is unchanged
  • grep of callers: inventory.py imports only compare and build_crosscheck; tests reference compare, main, _bash, _ROW_MAX, subprocess, fetch_text, parse_commands_table, parse_tools_table, parse_changelog, classify, build_crosscheck, build_tools_crosscheck, COMMANDS_URL, all kept
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42995326352

Left out: the items under Not verified.

Related

#14557

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

Security review: PR #15323, no findings

I read every hunk of all 3 changed files. I found no security issues.

  • compare_reports.py: a behavior-preserving refactor. The list walk now uses zip_longest, _unresolved is folded into one check, and JSON is read through a shared _read_json helper. The file paths still come from the caller's own argparse arguments, so no new input reaches open and nothing new is parsed. The (OSError, ValueError) error handling is unchanged.
  • docs_crosscheck.py: also a refactor. It adds a _give_up helper for the early returns and a _count helper for the status tallies. classify now computes its docs-alias test once, and alias sets are built only when a docs row exists. No new network calls, subprocess calls, file paths or code execution were added. The script's output is an advisory report.
  • .changes/harness-ops/...md: a changelog fragment with no executable content.

Scope checks:

  • No changed file matches a trusted-path glob.
  • No trust control is touched: the trusted-trigger check, the lane token, the kill switch, the broker and the merge holds are all outside this diff.
  • No standing instruction is deleted or softened.
  • No plugin manifest is changed.
  • No GitHub Actions workflow is changed.

Embedded text: the PR context file has no directives aimed at the review lane.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

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

No findings. I read every hunk of all 3 changed files. I checked by reading the code, not by running anything.

Behavior equivalence (closing issue #14557, criterion "Behavior is unchanged")

compare_reports.py:

  • _unresolved: the string case now goes through the same any(...) check as a single-item list. It returns the same results as before.
  • zip_longest(..., fillvalue=_MISSING): this branch only runs when both values are lists, and _MISSING is a private sentinel that never appears in report data. Indexes and the pointers they produce are unchanged.
  • _read_json: files are read in the same order (before, after, allow) and raise the same OSError/ValueError, so the except path and the exit code are unchanged.

docs_crosscheck.py:

  • _give_up: every block it updates is created with a status key already set (docs_crosscheck.py#L237-L242, #L536-L548). Setting status after sources.commands.error therefore leaves the JSON key order unchanged.
  • _count(names_block, STATUSES) replaces counts[status] += 1. The old code would raise KeyError on a status outside STATUSES; the new one would skip it. That can't happen here: every status classify assigns (L472-L487) is in STATUSES. Every count key still appears, starting at 0, in the same order.
  • In classify:
    • row is None or row["is_alias"] and docs_alias = row["is_alias"] if row else ... match the old expressions because a row from parse_commands_table is never an empty dict.
    • Gating documented_aliases on reg and row only skips building a set that was thrown away when row was falsy.
  • The kind/body parse in parse_commands_table gives the same result.

Other acceptance criteria

  • Only the two listed files and one changelog fragment are edited, and the PR is well under 400 lines.
  • The fragment .changes/harness-ops/...a53b1a1e.md is bump: patch with ### Changed and the line "Internal simplification, no behavior change.", as the issue asks.
  • "ci-status is green" and the test runs (test_compare_reports.py, test_inventory.py) are left to CI. The author did not run them, and I could not confirm them.
  • Every gap above has a test that could catch it, according to the author's caller grep. That claim is the author's and I did not verify it.

No plugin manifest changed, so there are no manifest lines. The PR context contains no embedded instructions aimed at this lane.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

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

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 31011a0

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-15323-31011a073d9b0ad5e8035df839ea30a6af48d825, 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 e67131d Nov 11, 2026
64 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14557-42995326352-1 branch November 11, 2026 11:02
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit e67131d5a8efa30eedc8275a62968b34d8d6f01f; 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 inventory harness-ops plugin code

0 participants