Skip to content

fix(swarm): harden inline Python confinement and align skills with agy 1.5.9 - #5

Merged
caelaxie merged 9 commits into
mainfrom
fix/agy-1.5.9-python-guard-and-skills
Nov 15, 2026
Merged

caelaxie merged 9 commits into
mainfrom
fix/agy-1.5.9-python-guard-and-skills

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

Why

Verify and align agy-pstack-next with the agy 1.5.9 native swarm runtime across hook confinement, plugin metadata, role capsules, and skills. Read-only ro-* workers hit false PreToolUse denials on multi-argument inline Python str.replace calls, while .replace and .rename checks missed destination escapes, unbound Path and subclass calls, format-string interpolations, reflection dispatch, and wrapped module receivers.

What changed

  • hooks/guard.mjs and hooks/guard.test.mjs. Allow multi-argument str.replace on non-Path and non-module receivers in checkInlinePythonFs, validate destination arguments on Path.rename and Path.replace, normalize comments, line continuations, and parenthesized member chains, tokenize nested f and t format-string interpolations in scanPythonTokensRange, propagate Path subclasses and aliased os, posix, and shutil imports to fixed point in collectPythonSymbolBindings, block reflection (getattr, vars, __dict__, methodcaller), and block container, conditional, boolean, lambda, and function-return wrapped Path or filesystem module escapes.
  • .antigravity-plugin/plugin.json, roles/*.md, and skills/**. Remove unsupported license and keywords fields from .antigravity-plugin/plugin.json, align skills/pstack/SKILL.md, skills/pstack/topologies/hillclimb.md, roles/coordinator.md, roles/poteto-agent.md, and roles/research.md with agy 1.5.9 swarm (title, tasks, n, builtin skill name swarm, and comma-separated model pool rules), check .system_generated/swarm/view.json and highest-numbered live narrator-N entries first in skills/ketchup/SKILL.md, and add /agy-pstack-next:<skill> trigger syntax across all 13 skills/*/SKILL.md descriptions.

Scope

  • Covers hooks/guard.mjs, hooks/guard.test.mjs, .antigravity-plugin/plugin.json, roles/*.md, and skills/** (19 files).
  • Leaves operator ~/.gemini/config/hooks.json and ~/.gemini/config/rules/pstack-models.md outside the repository until /agy-pstack-next:setup-pstack is run on each host.

Tradeoffs

Tokenizes inline Python expressions, format-string spans, and symbol bindings to fixed point instead of adding a regex exemption for .replace(, because naive .replace( exemptions allow unbound Path.replace(Path('/tmp/src'), '/outside/dst') and f"{Path.replace(...)}" path escapes.

Blast Radius

Affects PreToolUse inline Python command checks in hooks/guard.mjs across ro-*, impl-*, adv-*, and sicko-* swarm workers plus prompt and manifest metadata. Unmanaged non-swarm sessions and plain /swarm sessions remain unaffected.

Verification

  • node --test hooks/guard.test.mjs passed 29/29 tests across 10 suites, and 52 adversarial and legitimate inline Python probes passed 208/208 evaluations across all 4 worker roles with 0 mismatches.
  • agy plugin validate --strict --json exited 0 with 0 findings (13 skills, 1 hook).
  • npm --prefix skills/statechart/scripts test exited 0 (267 passed, 0 failed, 67 TLC-jar tests skipped).

@caelaxie
caelaxie merged commit ffeff29 into main Nov 15, 2026
1 check passed
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.

1 participant