Skip to content

fix(harness-ops): read method gates, repeated loads, duplicate commands and classic_hooks spreads - #10056

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-9941-40208858127-1
Oct 25, 2026
Merged

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

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9941

Summary

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

Before this change, the inventory's built-in plugin lane reported wrong values in four places where it should have reported partial ones. A method isAvailable gate now reads as gated with unresolved gate_flags. A plugin the loader requires at several call sites combines them: any unguarded site makes it unconditional, and differing guards leave load partial. A command name registered twice with different records keeps both and leaves commands partial. A hooks object holding a spread or a key the reader cannot see names classic_hooks in partial.

Not verified

  • Neither the pytest selection (4 new tests) nor scripts/run-test-file.sh on test_inventory.py and test_inventory_under_parser.py was executed. Nor was parser_reader.py --install. This lane refuses interpreters and scripts other than its named wrappers, and check-affected skips steps that run checked-
  • The pinned ruff lint (.claude/rules/ruff-pin.md) was not run on the two touched Python files, because this lane allows no such command. Changed lines were checked by hand against the 88-character limit. Left to the PR's CI.
  • ci-status green on the PR head: left to the PR's CI.
  • Known edge, unchanged: a setter-only part (set k(v){}) matches the plain-part pattern but _object_fields does not record it, so _object_keys and _merged_fields read such an object as fully read without that key. _merged_fields already behaved this way before this change.

Fix

  • plugins/harness-ops/skills/inventory/scripts/inventory.py: _merged_fields reads own keys with methods=True and _merged_string resolves a method entry with methods=True. _builtin_plugin_loader collects every call site per plugin and combines them through the new _combined_load. _plugin_commands keeps
  • plugins/harness-ops/skills/inventory/scripts/test_inventory.py: TestBuiltinPlugins gains test_a_method_gate_is_gated_and_partial, test_a_plugin_loaded_twice_combines_its_conditions (guarded then unguarded is unconditional; two different guards is partial), test_a_command_registered_twice_is_not_coll
  • plugins/harness-ops/skills/inventory/reference/extraction.md: the loader paragraph says how several call sites combine. The partial table covers a method gate, sites guarded differently, a name registered twice, and a spread or unseen key in classic_hooks.
  • .changes/harness-ops/fix-9941-builtin-plugin-lane-reads-5c2e9a71.md: new patch fragment under Fixed. It was written by hand because new-changelog-fragment refuses a detached HEAD.

Verification

The runner ran each check from the base copy against 900cf5a:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • .lane/checks/bin/check-changelog-fragments: all 5 fragments under .changes/ are valid (ran after the last edit)
  • .lane/checks/bin/check-affected: 10 passed and 6 skipped over 4 changed files (ran after the last edit). The skips were steps that run code from the checked tree, plus typos, which is not installed.
  • fresh-context review subagent over the whole diff (read-only): it traced each of the 4 new tests by hand and found all pass, found no change to existing TestBuiltinPlugins results, and found no line over 88 characters. It reported an A,B,B duplicate not being deduped (fixed) and extraction.md drift
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40208858127

Left out: the items under Not verified.

Related

#9941

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

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 900cf5a3060f82765e30380249a8efa7c95dc399: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

I read the full diff in .claude-lane/pr.diff and the PR context.

  • Scope: The change only touches the harness-ops inventory reader. It is the built-in plugin lane in inventory.py, its tests, extraction.md and a changelog fragment.
  • Trusted paths: No changed file matches the trusted-path globs.
  • Manifests: No plugin.json or marketplace.json changed, so there are no manifest lines to report.
  • Instruction surface: No standing instruction, hook allowlist or guardrail is deleted or softened. The extraction.md edits only document the new partial-result rules.
  • Code paths: The new code does static string and regex analysis of a binary's source text. It adds no shell execution, no network access, no file writes outside what was already there, and no handling of tokens or secrets. _combined_load, _object_keys and the _plugin_commands change only alter how results are combined and when partial is set.
  • Direction of the change: Every edit moves the inventory from reporting a definite value to reporting partial or unresolved when it cannot read one. That leaves reported values the same or less certain than before. The inventory output reads as a report, not as a gate.
  • PR context: I found no embedded instructions aimed at the review lane.

I did not run the code or the tests. The PR itself says the new tests and the pinned lint were not executed.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 900cf5a3060f82765e30380249a8efa7c95dc399: 0 finding(s), 0 as inline comments.

No findings. I read the full diff and the PR context, and traced the changed code in inventory.py against its callers. I did not run the tests or lint. The PR says it didn't either, so treat the four new tests as unverified until CI reports.

What I checked:

  • Method gate: _merged_fields now reads own keys with methods=True. isAvailable(){...} is therefore a present key with form "method". Downstream, gated is True. gate_flags is None because _gate_flags only runs for the "value" form, so gate_flags lands in partial. _merged_string forwards methods= to resolve_field, which accepts it. Other method-form fields (skills, mcpServers, defaultEnabled) already degrade to partial or unresolved, so I found no regression.
  • Loader call sites: _combined_load is correct for every case: any [] site makes the load unconditional. Otherwise a None site or differing guards leave load and load_guards as None. Identical guards stay conditional. A single unreadable site keeps the old result (None/None).
  • Duplicate commands: _plugin_commands skips an identical record. A second, different record under the same name is kept, and complete goes false.
  • classic_hooks: _object_keys uses _split_top, which drops empty parts. hooks:{} and a trailing comma therefore don't spuriously mark it partial. A spread, or a shorthand, quoted or computed key, does.
  • Docs and changelog: the extraction.md partial-table rows match the code. The patch fragment under Fixed matches the change size.
  • Closing issue fix(harness-ops): read method gates, repeated loads, duplicate commands and classic_hooks spreads in the built-in plugins lane #9941: the four listed fixes and the fragment are all present, each with the named test. I could not confirm the "Done when" run results, since they are CI items.

Known edge: the author notes that a setter-only part (set k(v){}) reads as fully read. This predates the change and is minor, so I did not count it.

Spend: the change adds no billed resources, so there is no cost hold. The PR touches no trusted-path file, so the extra security scrutiny did not apply.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 900cf5a3060f82765e30380249a8efa7c95dc399.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit 7e3d99f Oct 25, 2026
39 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-9941-40208858127-1 branch October 25, 2026 18:17
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.

fix(harness-ops): read method gates, repeated loads, duplicate commands and classic_hooks spreads in the built-in plugins lane

0 participants