Skip to content

fix(check-plan): validate Swarm UI plan.json and Pstack v2 dependencies - #10

Merged
caelaxie merged 1 commit into
mainfrom
fix/check-plan-json
Nov 16, 2026
Merged

caelaxie merged 1 commit into
mainfrom
fix/check-plan-json

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

Why

skills/pstack/scripts/check-plan.mjs rejected Swarm UI plan.json files as invalid Markdown and checked stale v1 playbooks/ and ~/.gemini/config/plugins/pstack/ markers in multi-phase plan.md files. This change updates the validator and its test suite to enforce the swarm_pane JSON schema and Pstack v2 multi-PR dependency rules deterministically.

What changed

  • JSON mode in check-plan.mjs. Added checkJsonPlan to validate goal, tasks, and threads exact keys, word-count bounds, reserved and whitespace-free worker names, and one-to-one worker coverage across 1 to 6 threads.
  • Pstack v2 Markdown checks in check-plan.mjs. Updated required markers to topologies/ and ~/.gemini/config/plugins/agy-pstack-next/, and added validatePrDependencies to reject unknown PR references, self-dependencies, None. mixed with PR references, and dependency cycles.
  • Behavioral tests in check-plan.test.mjs. Expanded test coverage to 16 tests spanning valid plan.json examples, schema rejections, v2 marker enforcement, PR dependency DAGs and cycles, unreadable inputs, and decision-log.sh.

Scope

  • Included changes in skills/pstack/scripts/check-plan.mjs and skills/pstack/scripts/check-plan.test.mjs.
  • Left active skills, docs, hooks, and golden statechart corpus files untouched because zero stale references exist outside the test fixtures.

Blast Radius

Callers invoking check-plan.mjs on legacy v1 plan.md plans using playbooks/ or ~/.gemini/config/plugins/pstack/ will now fail validation until migrated to Pstack v2 paths. Valid Pstack v2 plan.md files and Swarm UI plan.json files require no changes.

Verification

  • node --test skills/pstack/scripts/check-plan.test.mjs passed 16 of 16 tests.
  • node --test hooks/guard.test.mjs passed 20 of 20 tests.
  • node --test skills/pstack/scripts/watch-pr.test.mjs passed 56 of 56 tests.
  • agy plugin validate --strict --json . passed with 0 findings across 14 skills and 1 hook.

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