open-pstack 0.0.0-stage → 0.9.149
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/LICENSE-cursor-team-kit +21 -0
- package/LICENSE-thermos +21 -0
- package/NOTICE-skills.md +13 -0
- package/NOTICE.md +62 -0
- package/bin/open-pstack.mjs +4 -0
- package/lib/bundle.mjs +42 -0
- package/lib/cli.mjs +211 -0
- package/lib/detect.mjs +28 -0
- package/lib/harnesses.mjs +136 -0
- package/lib/steps.mjs +93 -0
- package/package.json +30 -4
- package/plugin/.antigravity-plugin/plugin.json +8 -0
- package/plugin/.claude-plugin/icon.png +0 -0
- package/plugin/.claude-plugin/plugin.json +31 -0
- package/plugin/.codex-plugin/plugin.json +52 -0
- package/plugin/.github/plugin/plugin.json +15 -0
- package/plugin/.grok-plugin/plugin.json +9 -0
- package/plugin/.muse-plugin/plugin.json +381 -0
- package/plugin/LICENSE +22 -0
- package/plugin/README.md +27 -0
- package/plugin/agents/comment-sicko.md +34 -0
- package/plugin/agents/poteto-agent.md +8 -0
- package/plugin/agents/thermo-nuclear-code-quality-review-subagent.md +23 -0
- package/plugin/agents/thermo-nuclear-review-subagent.md +28 -0
- package/plugin/assets/pstack-icon.png +0 -0
- package/plugin/assets/pstack-icon.prompt.txt +8 -0
- package/plugin/grok/skills/pstack-routing/SKILL.md +8 -0
- package/plugin/hooks/agy-context.awk +9 -0
- package/plugin/hooks/codex-hooks.json +17 -0
- package/plugin/hooks/copilot-context.awk +44 -0
- package/plugin/hooks/copilot-hooks.json +29 -0
- package/plugin/hooks/hooks.json +16 -0
- package/plugin/hooks/json.awk +164 -0
- package/plugin/hooks/kimi-instructions.md +17 -0
- package/plugin/hooks/muse-context.awk +31 -0
- package/plugin/hooks/pre-tool-use.awk +152 -0
- package/plugin/hooks/pre-tool-use.sh +16 -0
- package/plugin/hooks/script-contracts.awk +53 -0
- package/plugin/hooks/session-start-agy.md +17 -0
- package/plugin/hooks/session-start-context.md +15 -0
- package/plugin/hooks/session-start-copilot-setup.md +1 -0
- package/plugin/hooks/session-start-copilot-sheet.md +1 -0
- package/plugin/hooks/session-start-copilot.md +3 -0
- package/plugin/hooks/session-start-minimax.md +17 -0
- package/plugin/hooks/session-start-muse-sheet.md +1 -0
- package/plugin/hooks/session-start-muse.md +17 -0
- package/plugin/hooks/session-start-opencode.md +17 -0
- package/plugin/hooks/session-start.ps1 +169 -0
- package/plugin/hooks/session-start.sh +107 -0
- package/plugin/hooks.json +10 -0
- package/plugin/models.json +60 -0
- package/plugin/omp/index.mjs +34 -0
- package/plugin/opencode/index.js +49 -0
- package/plugin/package.json +8 -0
- package/plugin/pi/agent-files.ts +117 -0
- package/plugin/pi/agent-text.ts +99 -0
- package/plugin/pi/agent-tools.ts +148 -0
- package/plugin/pi/agents.ts +510 -0
- package/plugin/pi/ask.ts +87 -0
- package/plugin/pi/child.ts +313 -0
- package/plugin/pi/config.ts +208 -0
- package/plugin/pi/hc-child.ts +210 -0
- package/plugin/pi/index.ts +45 -0
- package/plugin/pi/one-shot.ts +90 -0
- package/plugin/pi/path-skills.ts +54 -0
- package/plugin/pi/prompt.ts +39 -0
- package/plugin/pi/schedule.ts +254 -0
- package/plugin/pi/slash.ts +106 -0
- package/plugin/pi/sleep-wait.ts +76 -0
- package/plugin/pi/worktree.ts +87 -0
- package/plugin/skills/architect/SKILL.md +20 -0
- package/plugin/skills/arena/SKILL.md +66 -0
- package/plugin/skills/automate-me/SKILL.md +111 -0
- package/plugin/skills/babysit/SKILL.md +68 -0
- package/plugin/skills/benchmark-checklist/SKILL.md +38 -0
- package/plugin/skills/blast-radius/SKILL.md +49 -0
- package/plugin/skills/bro/SKILL.md +6 -0
- package/plugin/skills/correct/SKILL.md +31 -0
- package/plugin/skills/create-formal-verification-skill/SKILL.md +50 -0
- package/plugin/skills/create-verification-skill/SKILL.md +51 -0
- package/plugin/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/plugin/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/plugin/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/plugin/skills/deslop/SKILL.md +24 -0
- package/plugin/skills/figure-it-out/SKILL.md +51 -0
- package/plugin/skills/fix-ci/SKILL.md +29 -0
- package/plugin/skills/fix-merge-conflicts/SKILL.md +32 -0
- package/plugin/skills/get-pr-comments/SKILL.md +23 -0
- package/plugin/skills/how/SKILL.md +28 -0
- package/plugin/skills/in-your-own-words/SKILL.md +6 -0
- package/plugin/skills/interrogate/SKILL.md +48 -0
- package/plugin/skills/ketchup/SKILL.md +42 -0
- package/plugin/skills/ketchup-video/SKILL.md +28 -0
- package/plugin/skills/maintain-formal-verification-skill/SKILL.md +65 -0
- package/plugin/skills/maintain-verification-skill/SKILL.md +46 -0
- package/plugin/skills/make-pr-easy-to-review/SKILL.md +59 -0
- package/plugin/skills/no-comments/SKILL.md +45 -0
- package/plugin/skills/poteto-help/SKILL.md +148 -0
- package/plugin/skills/poteto-help/references/prompting.md +51 -0
- package/plugin/skills/poteto-help/references/recipes.md +51 -0
- package/plugin/skills/poteto-mode/SKILL.md +132 -0
- package/plugin/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/plugin/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/plugin/skills/poteto-mode/playbooks/autopilot-full.md +31 -0
- package/plugin/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/plugin/skills/poteto-mode/playbooks/babysit.md +10 -0
- package/plugin/skills/poteto-mode/playbooks/bug-fix.md +32 -0
- package/plugin/skills/poteto-mode/playbooks/eval.md +25 -0
- package/plugin/skills/poteto-mode/playbooks/feature.md +21 -0
- package/plugin/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/plugin/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/plugin/skills/poteto-mode/playbooks/multi-phase-plan.md +13 -0
- package/plugin/skills/poteto-mode/playbooks/opening-a-pr.md +9 -0
- package/plugin/skills/poteto-mode/playbooks/pause-safely.md +11 -0
- package/plugin/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/plugin/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/plugin/skills/poteto-mode/playbooks/refactoring.md +18 -0
- package/plugin/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/plugin/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/plugin/skills/poteto-mode/playbooks/shipping.md +16 -0
- package/plugin/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/plugin/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/plugin/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/plugin/skills/poteto-mode/references/agents/comment-sicko.md +34 -0
- package/plugin/skills/poteto-mode/references/agy-tools.md +100 -0
- package/plugin/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/plugin/skills/poteto-mode/references/cloud-session-pr-reads.md +29 -0
- package/plugin/skills/poteto-mode/references/codex-tools.md +110 -0
- package/plugin/skills/poteto-mode/references/copilot-tools.md +144 -0
- package/plugin/skills/poteto-mode/references/dsh-tools.md +51 -0
- package/plugin/skills/poteto-mode/references/grok.md +50 -0
- package/plugin/skills/poteto-mode/references/kimi-tools.md +40 -0
- package/plugin/skills/poteto-mode/references/licenses/LICENSE +22 -0
- package/plugin/skills/poteto-mode/references/licenses/LICENSE-cursor-team-kit +21 -0
- package/plugin/skills/poteto-mode/references/licenses/LICENSE-thermos +21 -0
- package/plugin/skills/poteto-mode/references/licenses/NOTICE.md +13 -0
- package/plugin/skills/poteto-mode/references/merge-safety.md +43 -0
- package/plugin/skills/poteto-mode/references/minimax-tools.md +93 -0
- package/plugin/skills/poteto-mode/references/muse-tools.md +105 -0
- package/plugin/skills/poteto-mode/references/omp-tools.md +45 -0
- package/plugin/skills/poteto-mode/references/opencode-tools.md +30 -0
- package/plugin/skills/poteto-mode/references/pi-tools.md +120 -0
- package/plugin/skills/poteto-mode/references/resume-storage.md +20 -0
- package/plugin/skills/poteto-mode/scripts/.prettierignore +19 -0
- package/plugin/skills/poteto-mode/scripts/.prettierrc.json +3 -0
- package/plugin/skills/poteto-mode/scripts/bootstrap.ts +71 -0
- package/plugin/skills/poteto-mode/scripts/bun.lock +67 -0
- package/plugin/skills/poteto-mode/scripts/check-playbooks.mjs +165 -0
- package/plugin/skills/poteto-mode/scripts/codex-session-effort.mjs +94 -0
- package/plugin/skills/poteto-mode/scripts/package.json +16 -0
- package/plugin/skills/poteto-mode/scripts/resume.mjs +139 -0
- package/plugin/skills/poteto-mode/scripts/tsconfig.json +14 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/check-suites.ts +203 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cli.port.test.ts +88 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cli.test.ts +383 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/cli.ts +283 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/deadline.ts +20 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +163 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/fresh-install.test.ts +35 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.port.test.ts +1119 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.test.ts +506 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/github.ts +979 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/head-checks.ts +37 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/integrity.test.ts +887 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/landing.ts +92 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/live-merge-safety.mjs +142 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/policy.port.test.ts +945 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/policy.test.ts +492 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/policy.ts +966 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/query-error.ts +36 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/render.ts +211 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/ship-pr +6 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/shipping-cli.test.ts +159 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/shipping-cli.ts +65 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/shipping.test-helper.ts +48 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/shipping.test.ts +360 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/shipping.ts +235 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/transport.test.ts +588 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/types.compile.ts +109 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/types.ts +502 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/workflow-runs.ts +217 -0
- package/plugin/skills/poteto-mode/scripts/watch-pr/wrapper.test.ts +20 -0
- package/plugin/skills/poteto-mode/scripts/worktree-audit.mjs +492 -0
- package/plugin/skills/poteto-mode/worker.md +11 -0
- package/plugin/skills/principle-attack-the-premise/SKILL.md +15 -0
- package/plugin/skills/principle-boundary-discipline/SKILL.md +11 -0
- package/plugin/skills/principle-build-the-lever/SKILL.md +15 -0
- package/plugin/skills/principle-encode-lessons-in-structure/SKILL.md +11 -0
- package/plugin/skills/principle-exhaust-the-design-space/SKILL.md +9 -0
- package/plugin/skills/principle-experience-first/SKILL.md +19 -0
- package/plugin/skills/principle-explain-the-number/SKILL.md +14 -0
- package/plugin/skills/principle-fix-root-causes/SKILL.md +14 -0
- package/plugin/skills/principle-foundational-thinking/SKILL.md +13 -0
- package/plugin/skills/principle-guard-the-context-window/SKILL.md +12 -0
- package/plugin/skills/principle-laziness-protocol/SKILL.md +10 -0
- package/plugin/skills/principle-make-operations-idempotent/SKILL.md +15 -0
- package/plugin/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +14 -0
- package/plugin/skills/principle-minimize-reader-load/SKILL.md +15 -0
- package/plugin/skills/principle-model-the-domain/SKILL.md +15 -0
- package/plugin/skills/principle-never-block-on-the-human/SKILL.md +15 -0
- package/plugin/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/plugin/skills/principle-prove-it-works/SKILL.md +17 -0
- package/plugin/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/plugin/skills/principle-separate-before-serializing-shared-state/SKILL.md +11 -0
- package/plugin/skills/principle-sequence-verifiable-units/SKILL.md +13 -0
- package/plugin/skills/principle-subtract-before-you-add/SKILL.md +18 -0
- package/plugin/skills/principle-test-behavior-not-implementation/SKILL.md +16 -0
- package/plugin/skills/principle-type-system-discipline/SKILL.md +15 -0
- package/plugin/skills/recall/SKILL.md +43 -0
- package/plugin/skills/reflect/SKILL.md +33 -0
- package/plugin/skills/reflect/scripts/claude-project-dir.mjs +121 -0
- package/plugin/skills/reflect/scripts/find-transcript.mjs +218 -0
- package/plugin/skills/setup-pstack/SKILL.md +104 -0
- package/plugin/skills/setup-pstack/copilot.md +88 -0
- package/plugin/skills/setup-pstack/references/runtimes.md +77 -0
- package/plugin/skills/setup-pstack/scripts/check-sheet.awk +10 -0
- package/plugin/skills/setup-pstack/scripts/check-sheet.sh +20 -0
- package/plugin/skills/setup-pstack/scripts/read-sheet.sh +24 -0
- package/plugin/skills/setup-pstack/scripts/sheet.awk +152 -0
- package/plugin/skills/sharpen/SKILL.md +15 -0
- package/plugin/skills/show-me-your-work/SKILL.md +89 -0
- package/plugin/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/plugin/skills/show-me-your-work/scripts/log.sh +58 -0
- package/plugin/skills/statechart/SKILL.md +81 -0
- package/plugin/skills/statechart/references/render.md +93 -0
- package/plugin/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugin/skills/statechart/scripts/backends/mermaid.ts +249 -0
- package/plugin/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugin/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugin/skills/statechart/scripts/bun.lock +17 -0
- package/plugin/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugin/skills/statechart/scripts/frontends/dot.ts +77 -0
- package/plugin/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugin/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugin/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugin/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugin/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugin/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugin/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugin/skills/statechart/scripts/ir.ts +547 -0
- package/plugin/skills/statechart/scripts/janitor.ts +13 -0
- package/plugin/skills/statechart/scripts/kill.ts +15 -0
- package/plugin/skills/statechart/scripts/package.json +11 -0
- package/plugin/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugin/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugin/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugin/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugin/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugin/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugin/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugin/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugin/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugin/skills/statechart/scripts/run.ts +545 -0
- package/plugin/skills/statechart/scripts/statechart +29 -0
- package/plugin/skills/statechart/scripts/statechart.ts +166 -0
- package/plugin/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugin/skills/statechart/scripts/test/chart.test.ts +1253 -0
- package/plugin/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugin/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugin/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugin/skills/statechart/scripts/test/child-env.test.ts +15 -0
- package/plugin/skills/statechart/scripts/test/cli.test.ts +1353 -0
- package/plugin/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugin/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/chart.mmd +28 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugin/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugin/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugin/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugin/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugin/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugin/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugin/skills/statechart/scripts/test/corpus.test.ts +453 -0
- package/plugin/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugin/skills/statechart/scripts/test/drawn.ts +20 -0
- package/plugin/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugin/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugin/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugin/skills/statechart/scripts/test/java.ts +63 -0
- package/plugin/skills/statechart/scripts/test/labels.ts +648 -0
- package/plugin/skills/statechart/scripts/test/messages.test.ts +226 -0
- package/plugin/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugin/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugin/skills/statechart/scripts/test/render.test.ts +145 -0
- package/plugin/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugin/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugin/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugin/skills/statechart/scripts/worker.ts +35 -0
- package/plugin/skills/swarm/SKILL.md +58 -0
- package/plugin/skills/tdd/SKILL.md +41 -0
- package/plugin/skills/teach/SKILL.md +28 -0
- package/plugin/skills/technical-writing/SKILL.md +69 -0
- package/plugin/skills/thermo-nuclear-code-quality-review/SKILL.md +201 -0
- package/plugin/skills/thermo-nuclear-review/SKILL.md +50 -0
- package/plugin/skills/thermos/SKILL.md +40 -0
- package/plugin/skills/typescript-best-practices/SKILL.md +32 -0
- package/plugin/skills/typescript-best-practices/references/patterns.md +328 -0
- package/plugin/skills/unslop/SKILL.md +39 -0
- package/plugin/skills/what-did-i-get-done/SKILL.md +31 -0
- package/plugin/skills/why/SKILL.md +16 -0
- package/README.md +0 -3
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { Type } from "typebox";
|
|
3
|
+
|
|
4
|
+
import type { OneShot } from "./one-shot.ts";
|
|
5
|
+
import { expandSlash } from "./slash.ts";
|
|
6
|
+
|
|
7
|
+
const MIN_DELAY_S = 60;
|
|
8
|
+
const MAX_DELAY_S = 3600;
|
|
9
|
+
// setInterval treats a delay above 2^31-1 ms as 1 ms.
|
|
10
|
+
const MAX_LOOP_S = 24 * 86400;
|
|
11
|
+
const IDLE_RETRY_MS = 1000;
|
|
12
|
+
// Text the agent chose (a schedule_wakeup prompt, and what a loop it re-arms sends) goes in as a custom
|
|
13
|
+
// message, not a user message. The permission classifier reads user-role messages as what the user asked
|
|
14
|
+
// for, so a user message here would let the agent write its own permission.
|
|
15
|
+
const AGENT_PROMPT_TYPE = "pstack-wakeup";
|
|
16
|
+
const LOOP_COMMAND = /^\/loop(?:\s+([\s\S]*))?$/;
|
|
17
|
+
type Send = (prompt: string) => void;
|
|
18
|
+
|
|
19
|
+
const errorText = (e: unknown) => (e instanceof Error ? e.message : String(e));
|
|
20
|
+
|
|
21
|
+
const wakeupParams = Type.Object({
|
|
22
|
+
delaySeconds: Type.Optional(Type.Number({ description: `Seconds until the wakeup (${MIN_DELAY_S}-${MAX_DELAY_S})` })),
|
|
23
|
+
prompt: Type.Optional(Type.String({ description: "The prompt to run when the wakeup fires" })),
|
|
24
|
+
reason: Type.Optional(Type.String({ description: "Why this delay, in one short sentence" })),
|
|
25
|
+
noop: Type.Optional(Type.Boolean({ description: "Mark this wakeup as a routine check; it is scheduled all the same" })),
|
|
26
|
+
stop: Type.Optional(Type.Boolean({ description: "Cancel the pending wakeup; no other field is needed" })),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// One pending wakeup, one fixed-interval loop, and one live self-paced loop per
|
|
30
|
+
// session. A due wakeup or loop tick runs the delivery its caller chose, at
|
|
31
|
+
// once when the agent is idle.
|
|
32
|
+
export class Scheduler {
|
|
33
|
+
private wakeup?: NodeJS.Timeout;
|
|
34
|
+
private loop?: NodeJS.Timeout;
|
|
35
|
+
// A self-paced loop has no timer of its own while its iteration runs, so
|
|
36
|
+
// this is what /loop stop finds then.
|
|
37
|
+
private selfPaced = false;
|
|
38
|
+
// Set by a /loop command that ends or replaces the loop while a run is in
|
|
39
|
+
// flight, until that run settles. A schedule_wakeup call names no loop, so
|
|
40
|
+
// nothing tells that run's re-arm of the old loop from any other wakeup. It
|
|
41
|
+
// is refused them all, or the loop the user just ended would come back.
|
|
42
|
+
sealed = false;
|
|
43
|
+
// A run is in flight: set by agent_start, cleared by agent_settled. Not
|
|
44
|
+
// ctx.isIdle(), which is also false during a manual compaction.
|
|
45
|
+
running = false;
|
|
46
|
+
|
|
47
|
+
scheduleWakeup(seconds: number, deliver: () => void, ctx: ExtensionContext): void {
|
|
48
|
+
this.cancelWakeup();
|
|
49
|
+
const due = () => {
|
|
50
|
+
// Pi rejects prompts during manual compaction. Keep the wakeup pending
|
|
51
|
+
// until idle, including while a run or compaction is still finishing.
|
|
52
|
+
if (!ctx.isIdle()) {
|
|
53
|
+
this.wakeup = setTimeout(due, IDLE_RETRY_MS).unref();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
this.wakeup = undefined;
|
|
57
|
+
deliver();
|
|
58
|
+
};
|
|
59
|
+
this.wakeup = setTimeout(due, seconds * 1000);
|
|
60
|
+
this.wakeup.unref();
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
cancelWakeup(): boolean {
|
|
64
|
+
const had = this.wakeup !== undefined;
|
|
65
|
+
clearTimeout(this.wakeup);
|
|
66
|
+
this.wakeup = undefined;
|
|
67
|
+
return had;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
startLoop(seconds: number, tick: () => void, ctx: ExtensionContext): void {
|
|
71
|
+
// A tick that lands mid-run is dropped, so a slow iteration cannot pile up a backlog.
|
|
72
|
+
this.loop = setInterval(() => ctx.isIdle() && tick(), seconds * 1000);
|
|
73
|
+
this.loop.unref();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
private stopLoop(): boolean {
|
|
77
|
+
const had = this.loop !== undefined;
|
|
78
|
+
clearInterval(this.loop);
|
|
79
|
+
this.loop = undefined;
|
|
80
|
+
return had;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
startSelfPaced(): void {
|
|
84
|
+
this.selfPaced = true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Ends the loop and the pending wakeup. midRun says a run is in flight,
|
|
88
|
+
// which seals the wakeup slot against it.
|
|
89
|
+
stopAll(midRun = false): boolean {
|
|
90
|
+
const wakeup = this.cancelWakeup();
|
|
91
|
+
const selfPaced = this.selfPaced;
|
|
92
|
+
this.selfPaced = false;
|
|
93
|
+
if (midRun) this.sealed = true;
|
|
94
|
+
return this.stopLoop() || wakeup || selfPaced;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function clampDelay(seconds: number): number {
|
|
99
|
+
return Math.min(MAX_DELAY_S, Math.max(MIN_DELAY_S, Math.round(seconds)));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const UNIT_SECONDS: Record<string, number> = { s: 1, m: 60, h: 3600, d: 86400 };
|
|
103
|
+
|
|
104
|
+
type LoopCommand =
|
|
105
|
+
| { kind: "stop" }
|
|
106
|
+
| { kind: "usage"; reason?: string }
|
|
107
|
+
| { kind: "fixed"; seconds: number; prompt: string }
|
|
108
|
+
| { kind: "dynamic"; prompt: string };
|
|
109
|
+
|
|
110
|
+
function parseLoop(args: string): LoopCommand {
|
|
111
|
+
const text = args.trim();
|
|
112
|
+
if (!text) return { kind: "usage" };
|
|
113
|
+
if (text === "stop") return { kind: "stop" };
|
|
114
|
+
const m = /^(\d+)([smhd])(?:\s+([\s\S]+))?$/.exec(text);
|
|
115
|
+
if (m) {
|
|
116
|
+
const seconds = Number(m[1]) * UNIT_SECONDS[m[2]];
|
|
117
|
+
if (!m[3]) return { kind: "usage" };
|
|
118
|
+
if (seconds > MAX_LOOP_S) return { kind: "usage", reason: "Intervals over 24 days are not supported." };
|
|
119
|
+
return { kind: "fixed", seconds, prompt: m[3].trim() };
|
|
120
|
+
}
|
|
121
|
+
return { kind: "dynamic", prompt: text };
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function dynamicPrompt(prompt: string): string {
|
|
125
|
+
return (
|
|
126
|
+
`${prompt}\n\n` +
|
|
127
|
+
`[/loop, self-paced] When this iteration is done, call schedule_wakeup with prompt "/loop ${prompt}" ` +
|
|
128
|
+
`and a delay that fits what you are waiting for (${MIN_DELAY_S} to ${MAX_DELAY_S} seconds) to run it again. ` +
|
|
129
|
+
`Skip the call to end the loop.`
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// model-only exposure keeps the tool declared under codemode.mode "only".
|
|
134
|
+
export function registerSchedule(pi: ExtensionAPI, scheduler: Scheduler, oneShot: OneShot): void {
|
|
135
|
+
// The prompt's author picks the role: the user's /loop sends user messages, and text the agent chose
|
|
136
|
+
// goes in as a custom message, which the permission classifier does not read as the user's ask. Pi
|
|
137
|
+
// expands slash text only in a user message, so the agent's is expanded before it is sent.
|
|
138
|
+
const sendAsUser: Send = (prompt) => pi.sendUserMessage(prompt, { deliverAs: "followUp", expandPromptTemplates: true });
|
|
139
|
+
const sendAsAgent =
|
|
140
|
+
(ctx: ExtensionContext): Send =>
|
|
141
|
+
(prompt) => {
|
|
142
|
+
let content = prompt;
|
|
143
|
+
try {
|
|
144
|
+
content = expandSlash(pi.getCommands(), prompt);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
ctx.ui.notify(`A wakeup's command could not be expanded and was sent as written: ${errorText(e)}`, "error");
|
|
147
|
+
}
|
|
148
|
+
pi.sendMessage({ customType: AGENT_PROMPT_TYPE, content, display: true }, { triggerTurn: true, deliverAs: "followUp" });
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
pi.registerTool({
|
|
152
|
+
name: "schedule_wakeup",
|
|
153
|
+
label: "Schedule wakeup",
|
|
154
|
+
exposure: "model-only",
|
|
155
|
+
description: `Schedule this session to be re-invoked with a prompt after delaySeconds (clamped to ${MIN_DELAY_S}-${MAX_DELAY_S}), once the session is idle. One wakeup is pending at a time: a new call replaces it, and stop: true cancels it. Used by /loop's self-paced mode.`,
|
|
156
|
+
parameters: wakeupParams,
|
|
157
|
+
async execute(_id, params, _signal, _onUpdate, ctx) {
|
|
158
|
+
if (params.stop) {
|
|
159
|
+
// What is pending in a sealed slot is a loop start the user asked for, not this run's.
|
|
160
|
+
const had = !scheduler.sealed && scheduler.cancelWakeup();
|
|
161
|
+
const text = had ? "Pending wakeup cancelled." : "No wakeup was pending.";
|
|
162
|
+
return { content: [{ type: "text", text }], details: { cancelled: had } };
|
|
163
|
+
}
|
|
164
|
+
if (params.delaySeconds === undefined || !params.prompt) {
|
|
165
|
+
throw new Error("schedule_wakeup needs delaySeconds and prompt unless stop is true.");
|
|
166
|
+
}
|
|
167
|
+
if (scheduler.sealed) {
|
|
168
|
+
ctx.ui.notify("A wakeup this run asked for was not scheduled: /loop ended or replaced the loop while it ran.", "warning");
|
|
169
|
+
return {
|
|
170
|
+
content: [{ type: "text", text: "Not scheduled: the user ended or replaced the loop with a /loop command during this run. Do not schedule another wakeup in this run." }],
|
|
171
|
+
details: { refused: true },
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (oneShot.exits(ctx)) {
|
|
175
|
+
throw new Error(`schedule_wakeup cannot fire in a ${ctx.mode} run: pi exits when this run ends. Finish the work in this run instead.`);
|
|
176
|
+
}
|
|
177
|
+
const seconds = clampDelay(params.delaySeconds);
|
|
178
|
+
// A custom message runs no command, so the agent's "/loop ..." re-arm runs the loop here.
|
|
179
|
+
const prompt = params.prompt;
|
|
180
|
+
const send = sendAsAgent(ctx);
|
|
181
|
+
const loop = LOOP_COMMAND.exec(prompt);
|
|
182
|
+
const deliver = loop
|
|
183
|
+
? () => void runLoop(loop[1] ?? "", ctx, send).catch((e) => ctx.ui.notify(`/loop from a wakeup failed: ${errorText(e)}`, "error"))
|
|
184
|
+
: () => send(prompt);
|
|
185
|
+
scheduler.scheduleWakeup(seconds, deliver, ctx);
|
|
186
|
+
const fireAt = new Date(Date.now() + seconds * 1000).toISOString();
|
|
187
|
+
const clamped = seconds !== params.delaySeconds ? ` (clamped from ${params.delaySeconds})` : "";
|
|
188
|
+
return {
|
|
189
|
+
content: [{ type: "text", text: `Wakeup scheduled in ${seconds}s${clamped}, at ${fireAt}. It replaces any earlier pending wakeup.` }],
|
|
190
|
+
details: { delaySeconds: seconds, fireAt, noop: params.noop === true },
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
pi.on("agent_start", () => {
|
|
196
|
+
scheduler.running = true;
|
|
197
|
+
});
|
|
198
|
+
pi.on("agent_settled", () => {
|
|
199
|
+
scheduler.running = false;
|
|
200
|
+
scheduler.sealed = false;
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
async function runLoop(args: string, ctx: ExtensionContext, send: Send): Promise<void> {
|
|
204
|
+
const cmd = parseLoop(args);
|
|
205
|
+
// Also true during a manual compaction, which no run is behind: the first
|
|
206
|
+
// prompt then waits for idle, but only a run in flight seals the slot.
|
|
207
|
+
const midRun = !ctx.isIdle();
|
|
208
|
+
// sendUserMessage only starts the run, and a one-shot run disposes the
|
|
209
|
+
// session as soon as the command returns, so there the command waits it out.
|
|
210
|
+
const fire = async (prompt: string) => {
|
|
211
|
+
// The slot is sealed against the run in flight, so the loop's first
|
|
212
|
+
// prompt takes the slot and runs once that run has settled. Its own
|
|
213
|
+
// re-arm then comes from a later run and is not refused.
|
|
214
|
+
if (midRun) {
|
|
215
|
+
scheduler.scheduleWakeup(0, () => send(prompt), ctx);
|
|
216
|
+
ctx.ui.notify("The loop starts once the session is idle.", "info");
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (!oneShot.exits(ctx)) {
|
|
220
|
+
send(prompt);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
await oneShot.assertStartsRun(prompt, ctx);
|
|
224
|
+
const settled = oneShot.untilSettled();
|
|
225
|
+
send(prompt);
|
|
226
|
+
await settled;
|
|
227
|
+
};
|
|
228
|
+
switch (cmd.kind) {
|
|
229
|
+
case "usage":
|
|
230
|
+
ctx.ui.notify(`${cmd.reason ? `${cmd.reason} ` : ""}Usage: /loop [interval like 5m or 1h] <prompt>, or /loop stop`, "info");
|
|
231
|
+
return;
|
|
232
|
+
case "stop":
|
|
233
|
+
ctx.ui.notify(scheduler.stopAll(scheduler.running) ? "Loop stopped." : "No loop was running.", "info");
|
|
234
|
+
return;
|
|
235
|
+
case "fixed": {
|
|
236
|
+
const seconds = Math.max(MIN_DELAY_S, cmd.seconds);
|
|
237
|
+
scheduler.stopAll(scheduler.running);
|
|
238
|
+
scheduler.startLoop(seconds, () => send(cmd.prompt), ctx);
|
|
239
|
+
ctx.ui.notify(`Looping every ${seconds}s. /loop stop ends it.`, "info");
|
|
240
|
+
await fire(cmd.prompt);
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
case "dynamic":
|
|
244
|
+
scheduler.stopAll(scheduler.running);
|
|
245
|
+
scheduler.startSelfPaced();
|
|
246
|
+
await fire(dynamicPrompt(cmd.prompt));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
pi.registerCommand("loop", {
|
|
251
|
+
description: "Run a prompt on an interval (/loop 5m <prompt>), self-paced (/loop <prompt>), or stop (/loop stop)",
|
|
252
|
+
handler: (args, ctx) => runLoop(args, ctx, sendAsUser),
|
|
253
|
+
});
|
|
254
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { SlashCommandInfo } from "@earendil-works/pi-coding-agent";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
|
|
4
|
+
// Pi expands "/skill:name args" and "/template args" only inside sendUserMessage, and its package exports
|
|
5
|
+
// none of the code that does it. This is that code from pi 1.5.1 (AgentSession._expandSkillCommand,
|
|
6
|
+
// dist/core/prompt-templates.js, and dist/utils/frontmatter.js), reading the files pi.getCommands() names,
|
|
7
|
+
// for text the extension sends as a custom message. tests/pi/slash.test.mjs checks it against the installed pi.
|
|
8
|
+
|
|
9
|
+
export function stripFrontmatter(content: string): string {
|
|
10
|
+
const normalized = content.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
11
|
+
if (!normalized.startsWith("---")) return normalized;
|
|
12
|
+
const endIndex = normalized.indexOf("\n---", 3);
|
|
13
|
+
return endIndex === -1 ? normalized : normalized.slice(endIndex + 4).trim();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Splits on whitespace outside quotes. A quote opens only at the start of an argument, so an apostrophe inside a
|
|
17
|
+
// word is text, and ends at the next quote of the same kind. Inside it, a backslash before that kind of quote
|
|
18
|
+
// keeps the quote as text. A quote that never closes is text too, and "" is an argument.
|
|
19
|
+
export function parseCommandArgs(argsString: string): string[] {
|
|
20
|
+
const args: string[] = [];
|
|
21
|
+
let current = "";
|
|
22
|
+
let hasToken = false;
|
|
23
|
+
let inQuote: string | null = null;
|
|
24
|
+
let quoteStart = 0;
|
|
25
|
+
for (let i = 0; i < argsString.length; i++) {
|
|
26
|
+
const char = argsString.charAt(i);
|
|
27
|
+
if (inQuote) {
|
|
28
|
+
if (char === "\\" && argsString.charAt(i + 1) === inQuote) {
|
|
29
|
+
current += inQuote;
|
|
30
|
+
i++;
|
|
31
|
+
} else if (char === inQuote) inQuote = null;
|
|
32
|
+
else current += char;
|
|
33
|
+
} else if ((char === '"' || char === "'") && !hasToken) {
|
|
34
|
+
inQuote = char;
|
|
35
|
+
quoteStart = i;
|
|
36
|
+
hasToken = true;
|
|
37
|
+
} else if (/\s/.test(char)) {
|
|
38
|
+
if (hasToken) {
|
|
39
|
+
args.push(current);
|
|
40
|
+
current = "";
|
|
41
|
+
hasToken = false;
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
current += char;
|
|
45
|
+
hasToken = true;
|
|
46
|
+
}
|
|
47
|
+
// The quote never closed: restart after it with the quote character as the argument's first character.
|
|
48
|
+
if (inQuote && i === argsString.length - 1) {
|
|
49
|
+
current = inQuote;
|
|
50
|
+
inQuote = null;
|
|
51
|
+
i = quoteStart;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (hasToken) args.push(current);
|
|
55
|
+
return args;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// $1, $@, $ARGUMENTS, ${N:-default}, ${@:-default}, ${@:N} and ${@:N:L}. A value is not substituted again.
|
|
59
|
+
export function substituteArgs(content: string, args: string[]): string {
|
|
60
|
+
const allArgs = args.join(" ");
|
|
61
|
+
return content.replace(
|
|
62
|
+
/\$\{(\d+|ARGUMENTS|@):-([^}]*)\}|\$\{@:(\d+)(?::(\d+))?\}|\$(ARGUMENTS|@|\d+)/g,
|
|
63
|
+
(_match, defaultTarget, defaultValue, sliceStart, sliceLength, simple) => {
|
|
64
|
+
if (defaultTarget) {
|
|
65
|
+
const value = defaultTarget === "@" || defaultTarget === "ARGUMENTS" ? allArgs : args[parseInt(defaultTarget, 10) - 1];
|
|
66
|
+
return value ? value : defaultValue;
|
|
67
|
+
}
|
|
68
|
+
if (sliceStart) {
|
|
69
|
+
const start = Math.max(0, parseInt(sliceStart, 10) - 1);
|
|
70
|
+
return (sliceLength ? args.slice(start, start + parseInt(sliceLength, 10)) : args.slice(start)).join(" ");
|
|
71
|
+
}
|
|
72
|
+
if (simple === "ARGUMENTS" || simple === "@") return allArgs;
|
|
73
|
+
return args[parseInt(simple, 10) - 1] ?? "";
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function expandSkillCommand(commands: readonly SlashCommandInfo[], text: string): string {
|
|
79
|
+
if (!text.startsWith("/skill:")) return text;
|
|
80
|
+
const spaceIndex = text.indexOf(" ");
|
|
81
|
+
const name = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
|
|
82
|
+
const args = spaceIndex === -1 ? "" : text.slice(spaceIndex + 1).trim();
|
|
83
|
+
const skill = commands.find((c) => c.source === "skill" && c.name === name);
|
|
84
|
+
if (!skill) return text;
|
|
85
|
+
const { path, baseDir } = skill.sourceInfo;
|
|
86
|
+
const body = stripFrontmatter(readFileSync(path, "utf8")).trim();
|
|
87
|
+
const block = `<skill name="${name.slice("skill:".length)}" location="${path}">\nReferences are relative to ${baseDir}.\n\n${body}\n</skill>`;
|
|
88
|
+
return args ? `${block}\n\n${args}` : block;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function expandPromptTemplate(commands: readonly SlashCommandInfo[], text: string): string {
|
|
92
|
+
const match = /^\/([^\s]+)(?:\s+([\s\S]*))?$/.exec(text);
|
|
93
|
+
const template = match && commands.find((c) => c.source === "prompt" && c.name === match[1]);
|
|
94
|
+
if (!template) return text;
|
|
95
|
+
return substituteArgs(stripFrontmatter(readFileSync(template.sourceInfo.path, "utf8")), parseCommandArgs(match[2] ?? ""));
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// The text a user message with this text would carry. A name pi has no skill or template for stays as written,
|
|
99
|
+
// and so does an extension command: pi runs one only from a user message, and the agent must not run one as the
|
|
100
|
+
// user. Throws when a command's file cannot be read, where pi reports the error and sends the text as written.
|
|
101
|
+
export function expandSlash(commands: readonly SlashCommandInfo[], text: string): string {
|
|
102
|
+
const spaceIndex = text.indexOf(" ");
|
|
103
|
+
const name = spaceIndex === -1 ? text.slice(1) : text.slice(1, spaceIndex);
|
|
104
|
+
if (text.startsWith("/") && commands.some((c) => c.source === "extension" && c.name === name)) return text;
|
|
105
|
+
return expandPromptTemplate(commands, expandSkillCommand(commands, text));
|
|
106
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// Whether a bash command line waits on a foreground `sleep`, the way a model
|
|
2
|
+
// polls for a background agent it should leave alone.
|
|
3
|
+
//
|
|
4
|
+
// A token rule, not a shell parser. After heredoc bodies, quoted strings, and
|
|
5
|
+
// comments are removed, the word `sleep` followed by a literal duration of
|
|
6
|
+
// MIN_WAIT_S or more blocks, anywhere in the line, unless that sleep itself is
|
|
7
|
+
// directly backgrounded (`sleep 30 &`, never `&&` or `&>`). It errs toward
|
|
8
|
+
// blocking: a wrongly blocked command costs one rephrased turn, a missed poll
|
|
9
|
+
// loop costs minutes. Known misses: a sleep inside a quoted script such as
|
|
10
|
+
// `bash -c 'sleep 30'`, a quoted duration (`sleep "30"`), a variable duration
|
|
11
|
+
// (`sleep $N`), and a poll loop of sleeps under two seconds. Known over-blocks:
|
|
12
|
+
// a sleep inside a backgrounded group (`(sleep 30; echo done) &`), a
|
|
13
|
+
// backgrounded sleep with a redirection before the `&`, and
|
|
14
|
+
// `timeout 5 sleep 30`. tests/pi/sleep-wait.test.mjs lists each, so changing
|
|
15
|
+
// one is a visible decision.
|
|
16
|
+
const MIN_WAIT_S = 2;
|
|
17
|
+
const SLEEP_UNITS: Record<string, number> = { "": 1, s: 1, m: 60, h: 3600, d: 86400 };
|
|
18
|
+
|
|
19
|
+
// Seconds a literal sleep argument asks for (30, 2.5, 1m, 1m30s, infinity);
|
|
20
|
+
// 0 when it is not a literal.
|
|
21
|
+
function sleepSeconds(arg: string): number {
|
|
22
|
+
if (/^inf(inity)?$/.test(arg)) return Infinity;
|
|
23
|
+
const parts = arg.match(/\d*\.?\d+[smhd]?/g);
|
|
24
|
+
if (!parts || parts.join("") !== arg) return 0;
|
|
25
|
+
return parts.reduce((sum, part) => {
|
|
26
|
+
const unit = /[smhd]$/.exec(part)?.[0] ?? "";
|
|
27
|
+
return sum + Number(part.slice(0, part.length - unit.length)) * SLEEP_UNITS[unit];
|
|
28
|
+
}, 0);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// One line with its quoted strings replaced by "" and a comment cut off, in a
|
|
32
|
+
// single left-to-right pass. An unterminated quote drops the rest of the line.
|
|
33
|
+
function stripQuotesAndComment(line: string): string {
|
|
34
|
+
let out = "";
|
|
35
|
+
let quote: string | undefined;
|
|
36
|
+
for (let i = 0; i < line.length; i++) {
|
|
37
|
+
const c = line[i];
|
|
38
|
+
if (quote) {
|
|
39
|
+
if (c === "\\" && quote === '"') i++;
|
|
40
|
+
else if (c === quote) {
|
|
41
|
+
quote = undefined;
|
|
42
|
+
out += '""';
|
|
43
|
+
}
|
|
44
|
+
} else if (c === "\\") {
|
|
45
|
+
out += c + (line[i + 1] ?? "");
|
|
46
|
+
i++;
|
|
47
|
+
} else if (c === '"' || c === "'") quote = c;
|
|
48
|
+
else if (c === "#" && (i === 0 || /\s/.test(line[i - 1]))) break;
|
|
49
|
+
else out += c;
|
|
50
|
+
}
|
|
51
|
+
return out;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// The command text the shell would run: heredoc bodies, quoted strings, and
|
|
55
|
+
// comments removed, one pass over the lines so the cost stays linear. The
|
|
56
|
+
// line that opens a heredoc is kept, since commands can follow the `<<`.
|
|
57
|
+
function shellText(command: string): string {
|
|
58
|
+
const kept: string[] = [];
|
|
59
|
+
let terminator: string | undefined;
|
|
60
|
+
for (const line of command.split("\n")) {
|
|
61
|
+
if (terminator !== undefined) {
|
|
62
|
+
if (line.trim() === terminator) terminator = undefined;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
kept.push(stripQuotesAndComment(line));
|
|
66
|
+
terminator = /<<-?\s*(["']?)(\w+)\1/.exec(line)?.[2];
|
|
67
|
+
}
|
|
68
|
+
return kept.join("\n");
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function isForegroundWait(command: string): boolean {
|
|
72
|
+
for (const m of shellText(command).matchAll(/\bsleep\s+([^\s;|&()<>]+)\s*(&(?![&>]))?/g)) {
|
|
73
|
+
if (m[2] === undefined && sleepSeconds(m[1]) >= MIN_WAIT_S) return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { existsSync, lstatSync, readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { type Static, Type } from "typebox";
|
|
6
|
+
|
|
7
|
+
export const worktreeSchema = Type.Object({ repo: Type.String(), path: Type.String(), branch: Type.String(), base: Type.String(), owner: Type.Optional(Type.String()) });
|
|
8
|
+
export type Worktree = Static<typeof worktreeSchema>;
|
|
9
|
+
|
|
10
|
+
// The error message ends up in an agent's final text, so it stays short. The
|
|
11
|
+
// buffer is sized for a long reflog, which the default 1 MB is not.
|
|
12
|
+
function git(cwd: string, args: string[], input?: string): string {
|
|
13
|
+
const r = spawnSync("git", args, { cwd, encoding: "utf8", input, maxBuffer: 256 * 1024 * 1024 });
|
|
14
|
+
if (r.status !== 0) throw new Error(`git ${args.join(" ").slice(0, 200)} failed: ${(r.stderr || r.error?.message || "").trim().slice(0, 1000)}`);
|
|
15
|
+
return r.stdout.trim();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function planWorktree(cwd: string, agentId: string): Worktree {
|
|
19
|
+
const repo = git(cwd, ["rev-parse", "--show-toplevel"]);
|
|
20
|
+
return {
|
|
21
|
+
repo,
|
|
22
|
+
owner: randomUUID(),
|
|
23
|
+
path: join(repo, ".claude", "worktrees", `agent-${agentId}`),
|
|
24
|
+
branch: `worktree-agent-${agentId}`,
|
|
25
|
+
base: git(repo, ["rev-parse", "HEAD"]),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// An existing path can be a leftover directory, a replacement repository, or
|
|
30
|
+
// a link to another checkout. None is permission to run an isolated writer there.
|
|
31
|
+
function assertWorktree(wt: Worktree, created = false): void {
|
|
32
|
+
const invalid = () => new Error(`not the expected linked worktree: ${wt.path.slice(0, 200)}`);
|
|
33
|
+
if (!lstatSync(wt.path).isDirectory()) throw invalid();
|
|
34
|
+
const root = realpathSync(wt.path);
|
|
35
|
+
if (root === realpathSync(wt.repo) || root !== realpathSync(git(wt.path, ["rev-parse", "--show-toplevel"]))) throw invalid();
|
|
36
|
+
const commonDir = (cwd: string) => realpathSync(git(cwd, ["rev-parse", "--path-format=absolute", "--git-common-dir"]));
|
|
37
|
+
if (commonDir(wt.path) !== commonDir(wt.repo)) throw invalid();
|
|
38
|
+
const registered = git(wt.repo, ["worktree", "list", "--porcelain", "-z"]).split("\0").some((field) => {
|
|
39
|
+
if (!field.startsWith("worktree ")) return false;
|
|
40
|
+
try {
|
|
41
|
+
return realpathSync(field.slice("worktree ".length)) === root;
|
|
42
|
+
} catch {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (!registered) throw invalid();
|
|
47
|
+
|
|
48
|
+
// The private Git directory stays with the registered worktree across moves and is deleted on removal.
|
|
49
|
+
const marker = join(git(wt.path, ["rev-parse", "--absolute-git-dir"]), "pstack-owner");
|
|
50
|
+
if (wt.owner) {
|
|
51
|
+
if (created) writeFileSync(marker, wt.owner, { flag: "wx", mode: 0o600 });
|
|
52
|
+
else if (!existsSync(marker) || readFileSync(marker, "utf8") !== wt.owner) throw invalid();
|
|
53
|
+
} else if (git(wt.path, ["branch", "--show-current"]) !== wt.branch) {
|
|
54
|
+
// Older session records have no owner marker. Only their recorded branch identifies a retained checkout.
|
|
55
|
+
throw invalid();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Creates the worktree on first use and re-creates it for a resume after a
|
|
60
|
+
// clean finish removed it. A retained path is checked before any child starts.
|
|
61
|
+
export function ensureWorktree(wt: Worktree): void {
|
|
62
|
+
const created = !existsSync(wt.path);
|
|
63
|
+
if (created) {
|
|
64
|
+
const branchExists = git(wt.repo, ["branch", "--list", wt.branch]) !== "";
|
|
65
|
+
git(wt.repo, branchExists ? ["worktree", "add", wt.path, wt.branch] : ["worktree", "add", wt.path, "-b", wt.branch, wt.base]);
|
|
66
|
+
}
|
|
67
|
+
assertWorktree(wt, created);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// True when the agent left anything behind and the worktree stays. Ignored
|
|
71
|
+
// files count: a build the agent produced is its output too, and a fresh
|
|
72
|
+
// checkout has none. Commits are counted from the branch and from every
|
|
73
|
+
// commit HEAD's reflog visited, since an agent can commit on a detached HEAD
|
|
74
|
+
// and move away, which leaves the commit reachable only from the reflog.
|
|
75
|
+
export function settleWorktree(wt: Worktree): boolean {
|
|
76
|
+
if (!existsSync(wt.path)) return false;
|
|
77
|
+
assertWorktree(wt);
|
|
78
|
+
// A display preference must not hide output from automatic cleanup.
|
|
79
|
+
const dirty = git(wt.path, ["status", "--porcelain", "--untracked-files=normal", "--ignored"]) !== "";
|
|
80
|
+
// The reflog goes in on stdin: a long one would overflow an argument list.
|
|
81
|
+
const visited = git(wt.path, ["log", "-g", "--format=%H", "HEAD"]);
|
|
82
|
+
const ahead = git(wt.path, ["rev-list", "--count", "--stdin"], `${visited}\nrefs/heads/${wt.branch}\n^${wt.base}\n`) !== "0";
|
|
83
|
+
if (dirty || ahead) return true;
|
|
84
|
+
git(wt.repo, ["worktree", "remove", wt.path]);
|
|
85
|
+
git(wt.repo, ["branch", "-D", wt.branch]);
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: architect
|
|
3
|
+
description: "Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Architect
|
|
7
|
+
|
|
8
|
+
On Codex, read the [platform mapping](../poteto-mode/references/codex-tools.md), including its per-skill notes, before following this skill.
|
|
9
|
+
|
|
10
|
+
On GitHub Copilot, read the [platform mapping](../poteto-mode/references/copilot-tools.md), including its per-skill notes, before following this skill.
|
|
11
|
+
|
|
12
|
+
On Muse, read the [platform mapping](../poteto-mode/references/muse-tools.md), including its per-skill notes, before following this skill.
|
|
13
|
+
|
|
14
|
+
On Antigravity, read the [platform mapping](../poteto-mode/references/agy-tools.md), including its per-skill notes, before following this skill.
|
|
15
|
+
|
|
16
|
+
Before writing code, trace every system the change touches, then sketch two different shapes for it (types, signatures, module boundaries) and pick the one where each piece of state has one owner, each task has one way to do it, and callers need to know least. Redesign instead of patching if workarounds repeat.
|
|
17
|
+
|
|
18
|
+
For a large or contested design, run the **arena** skill instead of sketching alone.
|
|
19
|
+
|
|
20
|
+
Before closing each implementation unit or handing its contract to the next worker, compare accepted deviations with the saved sketch and rationale. Once the owner or review process accepts a change, update the affected parts of the sketch and record who accepted it. Keep unaccepted changes and unresolved disagreements visible, and never edit the sketch merely to justify what was implemented.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arena
|
|
3
|
+
description: "Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arena
|
|
7
|
+
|
|
8
|
+
On Codex, read the [platform mapping](../poteto-mode/references/codex-tools.md), including its per-skill notes, before following this skill.
|
|
9
|
+
|
|
10
|
+
On GitHub Copilot, read the [platform mapping](../poteto-mode/references/copilot-tools.md), including its per-skill notes, before following this skill.
|
|
11
|
+
|
|
12
|
+
On Muse, read the [platform mapping](../poteto-mode/references/muse-tools.md), including its per-skill notes, before following this skill.
|
|
13
|
+
|
|
14
|
+
On Antigravity, read the [platform mapping](../poteto-mode/references/agy-tools.md), including its per-skill notes, before following this skill.
|
|
15
|
+
|
|
16
|
+
Open a todolist with one entry per phase (Frame, Fan out, Cross-judge, Pick, Graft, Verify) before launching anything.
|
|
17
|
+
|
|
18
|
+
## Phase A: Frame
|
|
19
|
+
|
|
20
|
+
Every candidate gets the same prompt, so the prompt is the contract.
|
|
21
|
+
|
|
22
|
+
1. State the artifact each candidate is producing.
|
|
23
|
+
2. Derive the rubric, 3-6 concrete gradeable criteria for what success looks like on *this* task. It is the picker's tool in Phase D. Candidates only see the task.
|
|
24
|
+
3. Pick the runners from the `arena runners` line in `pstack-models.md`, or from [Models](#models) when the sheet has no such line. An `auto` or `inherit-parent` entry is the parent model, so omit `model` and spawn `general-purpose`. If the `Agent` tool rejects a slug, use the nearest valid slug of the same family or drop the seat, keep at least two runners, and say so. Families go by model name, such as Opus, Fable, or Sonnet. Spawn more for multiple design directions, and repeat one model when the work is generation-bound, not judgment-sensitive. Pick each subagent's reasoning level per the Subagents section of the **poteto-mode** skill.
|
|
25
|
+
4. Give each candidate its own output location (a git worktree where possible, otherwise `/tmp/arena-<slug>/candidate-<n>/`), per the **separate-before-serializing-shared-state** principle skill.
|
|
26
|
+
|
|
27
|
+
## Phase B: Fan out
|
|
28
|
+
|
|
29
|
+
Spawn all N subagents in one message with `run_in_background: true`, each with the task, the path to the shared grounding, its own output path, and instructions to produce the artifact and a short rationale naming the alternatives it considered and what it rejected.
|
|
30
|
+
|
|
31
|
+
If a candidate produces no output, proceed with N-1 and note the dropout.
|
|
32
|
+
|
|
33
|
+
## Phase C: Cross-judge
|
|
34
|
+
|
|
35
|
+
After all Phase B candidates complete, spawn one readonly judge from the `arena cross-judge pool` line in `pstack-models.md`, or from [Models](#models) when the sheet has no such line. The judge is never from the parent's family, as Phase A step 3 defines families, so use the first entry from another family. An `auto` or `inherit-parent` entry is the parent model. If you do not know the parent's model, use the first real slug and say that the family check did not run. If the `Agent` tool rejects a slug, use the nearest valid slug of the same family, then the next such entry, or skip the judge, and say so. While you read in Phase D, the judge scores each candidate, by path label, on each rubric criterion and recommends a base.
|
|
36
|
+
|
|
37
|
+
## Phase D: Pick a base
|
|
38
|
+
|
|
39
|
+
Read every candidate end to end before picking. Score each against the rubric criterion by criterion, not on holistic feel, and compare with the cross-judge when Phase C ran one. Agreement on the base confirms the pick. Disagreement means one of you is biased or the rubric was ambiguous. Read both rationales before deciding.
|
|
40
|
+
|
|
41
|
+
Pick the base a future maintainer can extend most easily without breaking invariants. When two feel tied, prefer the cleaner boundary or smaller API, per the Laziness Protocol.
|
|
42
|
+
|
|
43
|
+
## Phase E: Graft
|
|
44
|
+
|
|
45
|
+
Walk each losing candidate once more for what is worth porting into the base, usually one or two things per candidate, not most of it. Fold each graft in by hand, per the **redesign-from-first-principles** principle skill, so the result stays coherent under one mental model. Don't paste mechanically.
|
|
46
|
+
|
|
47
|
+
If the candidates converge on one shape, that is strong agreement. Note it and ship the consensus shape. No graft is needed. If they wildly diverge, Phase A was under-specified. Reframe and re-run rather than averaging the divergence.
|
|
48
|
+
|
|
49
|
+
## Phase F: Verify
|
|
50
|
+
|
|
51
|
+
Verify the synthesized artifact like any other output, per the **prove-it-works** principle skill. If verification finds a problem the arena missed, either Phase A was wrong (re-frame and re-run) or a candidate caught it and you missed the graft (go back to Phase E). Don't paper over it.
|
|
52
|
+
|
|
53
|
+
## Outputs
|
|
54
|
+
|
|
55
|
+
One synthesized artifact, with a short synthesis note alongside naming the base and why, the cross-judge's verdict or that Phase C skipped the judge, each graft with its source candidate, what was rejected and why, any convergence or dropouts, and the verification result.
|
|
56
|
+
|
|
57
|
+
## Models
|
|
58
|
+
|
|
59
|
+
Role defaults, stamped from `plugins/pstack/models.json` (edit there, rerun `tools/generate.mjs`). A matching role line in the `pstack-models.md` override sheet overrides each at runtime; `/setup-pstack` writes it and lists its path per runtime.
|
|
60
|
+
|
|
61
|
+
- arena runners: `opus`, `fable`, `sonnet`, `haiku`
|
|
62
|
+
- arena cross-judge pool: `opus`, `fable`, `sonnet`, `haiku`
|
|
63
|
+
|
|
64
|
+
## Reasoning effort
|
|
65
|
+
|
|
66
|
+
A role value in the override sheet may name a reasoning effort after its model, as in `opus @xhigh`. Levels on Claude Code: `low`, `medium`, `high`, `xhigh`, `max`. Which ones apply depends on the model. A value without `@` takes the sheet's `default effort` line, a level or `session`, and `session` when the sheet has no such line. On Claude Code, `session` sets no effort. On other runtimes, follow the platform mapping for `session`. Strip the suffix before reading the model: `inherit-parent` or `auto` still omits `model` at every level, and a model name is passed as `model`. Pass the level as the dispatch's effort field and keep the `subagent_type` you would otherwise use. That is `effort` on the Claude Code `Agent` call and `reasoning_effort` on Codex's `spawn_agent`. On Muse it is `effort` on a Workflow child; a `subagent_spawn` dispatch keeps the session's effort.
|