Problem
On Claude Code 2.1.286, plugins/claude-ops/skills/inventory/scripts/inventory.py reads the built-in Explore and Plan agents' disallowed tools as partial: the list is short. Those agents' definitions spread a shared list (...pY). The spread resolver reads the nearest pY binding, and on 2.1.286 that is an unrelated pY=p(...) call, so the shared entries, including the Artifact tools, are dropped.
The inventory already reports the field as partial, so this is not a wrong value. But anything that reads those lists sees fewer restrictions than the agents actually have.
Found while fixing #5700 (PR #5704). The behavior was the same before that change.
Fix
Resolve the spread with the module and scope rule that field and name resolution already use (_scoped_constant, #5619 and #5704), so ...pY reads the binding in the agent definition's own scope. If that binding can't be determined, keep partial.
Acceptance
- On 2.1.286, Explore and Plan list the shared disallowed tools, and the field is no longer
partial.
- 2.1.285 output is unchanged, unless the same field was partial there too.
- Synthetic-fixture test: a spread whose nearest same-name binding sits in another scope.
Related: #5640 (move to a real JavaScript parser).
Problem
On Claude Code 2.1.286,
plugins/claude-ops/skills/inventory/scripts/inventory.pyreads the built-in Explore and Plan agents' disallowed tools aspartial: the list is short. Those agents' definitions spread a shared list (...pY). The spread resolver reads the nearestpYbinding, and on 2.1.286 that is an unrelatedpY=p(...)call, so the shared entries, including the Artifact tools, are dropped.The inventory already reports the field as
partial, so this is not a wrong value. But anything that reads those lists sees fewer restrictions than the agents actually have.Found while fixing #5700 (PR #5704). The behavior was the same before that change.
Fix
Resolve the spread with the module and scope rule that field and name resolution already use (
_scoped_constant, #5619 and #5704), so...pYreads the binding in the agent definition's own scope. If that binding can't be determined, keeppartial.Acceptance
partial.Related: #5640 (move to a real JavaScript parser).