Skip to content

fix(swarm): resolve agy 1.5.9 compatibility bugs, guard escapes, and swarm-capacity gaps - #3

Merged
caelaxie merged 2 commits into
mainfrom
fix/agy-1.5.9-swarm-bugs
Nov 14, 2026
Merged

caelaxie merged 2 commits into
mainfrom
fix/agy-1.5.9-swarm-bugs

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

Why

Make agy-pstack-next fully compatible with agy 1.5.9 native swarm while keeping every workflow swarm-centered and preserving full worker autonomy. Live agy 1.5.9 audits uncovered shell-variable false denials on control-cli, evolve hook-isolation collisions when global hooks.json is active, sharded *-verifier misclassification, shell and temp-script confinement escapes in hooks/guard.mjs, missing [done] completion prefixes in role capsules, and brittle optional dependencies in statechart tests.

What changed

  • hooks/guard.mjs and hooks/guard.test.mjs. Track scoped per-segment shell environments across subshells, pipelines, short-circuits, and loops in collectInvocations and resolveShellTargetPath, delegate staged trial packs via PSTACK_PLUGIN_ROOT and PSTACK_CACHE_DIR, strip numeric suffixes on *-verifier groups in classifyWorkerMember, detect forkStep markers and swarm.json anchors, and enforce role confinement across git, archive, download, find, preload flags, and /tmp scripts while preserving dynamic codemod or fuzzer loops, /tmp Playwright and PTY harnesses, and cross-worktree git fetch imports.
  • roles/*.md, skills/**, and docs/guide/07-overnight.md. Require @<target> [done] completion prefixes and unified PASS, PASS+NOTES, ISSUES, and BLOCKED verdicts across capsules and topologies, document PSTACK_PLUGIN_ROOT and PSTACK_CACHE_DIR staging in skills/pstack/topologies/evolve.md, default RUN_ID to $$ in verify-gen and statechart, honor always_on <user_rules> without disk reads, and pass verbatim open_board lines on mid-flight coordinator replies while keeping native swarm tools (swarm, post_message, read_board, swarm_wait, schedule, and manage_task) unrestricted across all roles.
  • skills/statechart/scripts/test/{differential,render}.test.ts. Resolve fast-check dynamically inside property tests and check cached render packages with os.tmpdir() fallback and clean offline skip before running npm install.

Scope

  • Covers hooks/guard.mjs, hooks/guard.test.mjs, all four roles/*.md capsules, pstack topologies, sibling SKILL.md guides, docs/guide/07-overnight.md, and statechart test hygiene.
  • Leaves host ~/.gemini/config/* files untouched in user home directories until operators pull and sync the updated plugin.

Blast Radius

Affects SessionStart, PreInvocation, and PreToolUse hook decisions in hooks/guard.mjs plus prompt instructions injected into managed swarm coordinators and workers. Non-swarm conversations remain unmanaged and pass through untouched.

Verification

  • agy plugin validate --strict --json . exited 0 with 0 findings (13 skills, 1 hook), 269/269 relative markdown links resolved across 92 .md files, and roles/*.md passed zero-colon and zero-dash checks.
  • node --test hooks/guard.test.mjs passed 21/21 suites (9 top-level groups) with 0 host plugin_data mutations, plus 239/239 independent sandbox probes across all confinement, shell-variable, forkStep, evolve delegation, and swarm-capacity paths.
  • node --test skills/statechart/scripts/test/*.test.ts exited 0 across all 10 files (334 tests, 0 failures), including standalone differential.test.ts without fast-check and offline unwritable-cache render.test.ts.

…echart tests

Align role capsules, pstack topologies, sibling skills, guide docs, and statechart test suites with the agy 1.5.9 native swarm audit while preserving full swarm worker autonomy.

- Require @<target> [done] completion prefixes across poteto-agent, research, comment-sicko, and topologies so the Swarm UI marks parked workers done, and standardize gate verdicts on PASS, PASS+NOTES, ISSUES, and BLOCKED.

- Document staging neutral /tmp/<pack-id> plugin trees with PSTACK_PLUGIN_ROOT and PSTACK_CACHE_DIR in evolve trials, default RUN_ID to $$ in verify-gen and statechart scratch paths, honor active <user_rules> in interrogate and crucible without disk reads, and pass verbatim open_board lines on mid-flight coordinator replies.

- Load fast-check dynamically in differential.test.ts and resolve cached render packages before npm install with os.tmpdir() fallback and clean offline skip in render.test.ts.

Verified with node --test hooks/guard.test.mjs (15/15 passed), node --test skills/statechart/scripts/test/*.test.ts (10 files, 334 tests, 0 failures), agy plugin validate --strict --json . (0 findings), and 269/269 relative markdown links.
…n detection

Resolve the shell-variable, evolve-isolation, verifier-sharding, and confinement findings from the agy 1.5.9 swarm audit without restricting worker swarm autonomy or codemod capacity.

- Track active segment environments across shell redirects, expand HOME, defaulted shell variables, and safe runtime tokens in resolveShellTargetPath, and anchor canonicalTempRoots strictly to outer host env.
- Delegate hook runs through PSTACK_PLUGIN_ROOT and isolate deduplication state via PSTACK_CACHE_DIR for evolve trials, strip numeric suffixes on *-verifier worker groups, and detect forkStep memory markers plus swarm.json anchors.
- Confine mutating git, download, archive, find, and temp-script calls across ro-*, author, adversary, and sicko-* roles while preserving dynamic in-worktree codemod and fuzzer loops, /tmp harness expressions, and cross-worktree donor fetches.

@caelaxie caelaxie left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bar pass on 8a12063.

layout stays the sanctioned v2 tree (top-level skills/, .antigravity-plugin/, hooks, roles). no cursor-team-kit mention, no .cursor/skills. control-cli and control-ui still load. hook and skill edits stay on the 1.5.9 audit (shell vars, evolve staging, numbered *-verifier, confinement, @target [done], open_board, statechart test hygiene). dropping swarm-tool coordinator promotion is tested: spontaneous swarm roots stay unmanaged.

ci run 8 is green on this head with agy 1.5.9: validate, agy plugin install ., list shows 13 skills including control-cli and control-ui plus hook pstack-swarm-guard, guard tests 21/21, statechart 334 tests 0 fail. no issue to link.

squash-merging.

@caelaxie
caelaxie merged commit f31a86a into main Nov 14, 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