pstack-claude-mirror 0.0.0-stage → 0.9.133
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/.claude-plugin/marketplace.json +16 -0
- package/CHANGES.md +1110 -0
- package/LICENSE +22 -0
- package/LICENSE-cursor-team-kit +21 -0
- package/LICENSE-mirror +27 -0
- package/LICENSE-thermos +21 -0
- package/NOTICE-skills.md +13 -0
- package/NOTICE.md +62 -0
- package/README.md +84 -2
- package/UPSTREAM-README.md +243 -0
- package/bin/pstack-claude.mjs +183 -0
- package/docs/reference.md +247 -0
- package/package.json +88 -4
- package/plugins/pstack/.antigravity-plugin/plugin.json +8 -0
- package/plugins/pstack/.claude-plugin/icon.png +0 -0
- package/plugins/pstack/.claude-plugin/plugin.json +31 -0
- package/plugins/pstack/.codex-plugin/plugin.json +52 -0
- package/plugins/pstack/.github/plugin/plugin.json +15 -0
- package/plugins/pstack/.grok-plugin/plugin.json +9 -0
- package/plugins/pstack/.muse-plugin/plugin.json +381 -0
- package/plugins/pstack/README.md +27 -0
- package/plugins/pstack/agents/comment-sicko.md +34 -0
- package/plugins/pstack/agents/poteto-agent.md +8 -0
- package/plugins/pstack/agents/thermo-nuclear-code-quality-review-subagent.md +23 -0
- package/plugins/pstack/agents/thermo-nuclear-review-subagent.md +28 -0
- package/plugins/pstack/assets/pstack-icon.png +0 -0
- package/plugins/pstack/assets/pstack-icon.prompt.txt +8 -0
- package/plugins/pstack/grok/skills/pstack-routing/SKILL.md +8 -0
- package/plugins/pstack/hooks/agy-context.awk +9 -0
- package/plugins/pstack/hooks/codex-hooks.json +17 -0
- package/plugins/pstack/hooks/copilot-context.awk +44 -0
- package/plugins/pstack/hooks/copilot-hooks.json +27 -0
- package/plugins/pstack/hooks/hooks.json +16 -0
- package/plugins/pstack/hooks/json.awk +164 -0
- package/plugins/pstack/hooks/kimi-instructions.md +17 -0
- package/plugins/pstack/hooks/muse-context.awk +31 -0
- package/plugins/pstack/hooks/pre-tool-use.awk +152 -0
- package/plugins/pstack/hooks/pre-tool-use.sh +16 -0
- package/plugins/pstack/hooks/script-contracts.awk +55 -0
- package/plugins/pstack/hooks/session-start-agy.md +17 -0
- package/plugins/pstack/hooks/session-start-context.md +15 -0
- package/plugins/pstack/hooks/session-start-copilot-setup.md +1 -0
- package/plugins/pstack/hooks/session-start-copilot-sheet.md +1 -0
- package/plugins/pstack/hooks/session-start-copilot.md +3 -0
- package/plugins/pstack/hooks/session-start-minimax.md +17 -0
- package/plugins/pstack/hooks/session-start-muse-sheet.md +1 -0
- package/plugins/pstack/hooks/session-start-muse.md +17 -0
- package/plugins/pstack/hooks/session-start-opencode.md +17 -0
- package/plugins/pstack/hooks/session-start.ps1 +105 -0
- package/plugins/pstack/hooks/session-start.sh +95 -0
- package/plugins/pstack/hooks.json +10 -0
- package/plugins/pstack/models.json +67 -0
- package/plugins/pstack/omp/index.mjs +34 -0
- package/plugins/pstack/opencode/index.js +49 -0
- package/plugins/pstack/package.json +8 -0
- package/plugins/pstack/pi/agent-files.ts +117 -0
- package/plugins/pstack/pi/agent-text.ts +99 -0
- package/plugins/pstack/pi/agent-tools.ts +148 -0
- package/plugins/pstack/pi/agents.ts +486 -0
- package/plugins/pstack/pi/ask.ts +87 -0
- package/plugins/pstack/pi/child.ts +310 -0
- package/plugins/pstack/pi/config.ts +178 -0
- package/plugins/pstack/pi/index.ts +44 -0
- package/plugins/pstack/pi/one-shot.ts +90 -0
- package/plugins/pstack/pi/path-skills.ts +54 -0
- package/plugins/pstack/pi/prompt.ts +39 -0
- package/plugins/pstack/pi/schedule.ts +254 -0
- package/plugins/pstack/pi/slash.ts +92 -0
- package/plugins/pstack/pi/sleep-wait.ts +76 -0
- package/plugins/pstack/pi/worktree.ts +74 -0
- package/plugins/pstack/skills/architect/SKILL.md +100 -0
- package/plugins/pstack/skills/architect/references/design-red-flags.md +57 -0
- package/plugins/pstack/skills/architect/references/rationale-template.md +39 -0
- package/plugins/pstack/skills/architect/references/runner-prompt.md +20 -0
- package/plugins/pstack/skills/arena/SKILL.md +66 -0
- package/plugins/pstack/skills/automate-me/SKILL.md +111 -0
- package/plugins/pstack/skills/babysit/SKILL.md +68 -0
- package/plugins/pstack/skills/benchmark-checklist/SKILL.md +38 -0
- package/plugins/pstack/skills/blast-radius/SKILL.md +49 -0
- package/plugins/pstack/skills/bro/SKILL.md +6 -0
- package/plugins/pstack/skills/correct/SKILL.md +31 -0
- package/plugins/pstack/skills/create-formal-verification-skill/SKILL.md +50 -0
- package/plugins/pstack/skills/create-verification-skill/SKILL.md +51 -0
- package/plugins/pstack/skills/create-verification-skill/references/feature-map-example/README.md +47 -0
- package/plugins/pstack/skills/create-verification-skill/references/feature-map-example/create-note.md +39 -0
- package/plugins/pstack/skills/create-verification-skill/references/feature-map-example/search.md +45 -0
- package/plugins/pstack/skills/deslop/SKILL.md +24 -0
- package/plugins/pstack/skills/figure-it-out/SKILL.md +51 -0
- package/plugins/pstack/skills/fix-ci/SKILL.md +29 -0
- package/plugins/pstack/skills/fix-merge-conflicts/SKILL.md +32 -0
- package/plugins/pstack/skills/get-pr-comments/SKILL.md +23 -0
- package/plugins/pstack/skills/how/SKILL.md +54 -0
- package/plugins/pstack/skills/how/references/explainer-prompt.md +55 -0
- package/plugins/pstack/skills/how/references/explorer-prompt.md +35 -0
- package/plugins/pstack/skills/in-your-own-words/SKILL.md +6 -0
- package/plugins/pstack/skills/interrogate/SKILL.md +48 -0
- package/plugins/pstack/skills/ketchup/SKILL.md +42 -0
- package/plugins/pstack/skills/ketchup-video/SKILL.md +28 -0
- package/plugins/pstack/skills/maintain-formal-verification-skill/SKILL.md +65 -0
- package/plugins/pstack/skills/maintain-verification-skill/SKILL.md +46 -0
- package/plugins/pstack/skills/make-pr-easy-to-review/SKILL.md +59 -0
- package/plugins/pstack/skills/no-comments/SKILL.md +45 -0
- package/plugins/pstack/skills/poteto-help/SKILL.md +149 -0
- package/plugins/pstack/skills/poteto-help/references/prompting.md +51 -0
- package/plugins/pstack/skills/poteto-help/references/recipes.md +51 -0
- package/plugins/pstack/skills/poteto-mode/SKILL.md +174 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/authoring-a-skill.md +12 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/autonomous-run.md +13 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/autopilot-full.md +31 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/autopilot-stack.md +8 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/babysit.md +23 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/bug-fix.md +15 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/eval.md +25 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/feature.md +21 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/hillclimb.md +21 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/investigation.md +14 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/multi-phase-plan.md +158 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/opening-a-pr.md +34 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/orchestrate.md +27 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/pause-safely.md +11 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/perf-issue.md +25 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/prototype.md +14 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/refactoring.md +18 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/runtime-forensics.md +11 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/session-pickup.md +11 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/shipping.md +16 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/trace-forensics.md +14 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/visual-parity.md +11 -0
- package/plugins/pstack/skills/poteto-mode/playbooks/worktree-cleanup.md +12 -0
- package/plugins/pstack/skills/poteto-mode/references/agents/comment-sicko.md +34 -0
- package/plugins/pstack/skills/poteto-mode/references/agy-tools.md +99 -0
- package/plugins/pstack/skills/poteto-mode/references/bugbot-triage.md +142 -0
- package/plugins/pstack/skills/poteto-mode/references/codex-tools.md +109 -0
- package/plugins/pstack/skills/poteto-mode/references/copilot-tools.md +143 -0
- package/plugins/pstack/skills/poteto-mode/references/grok.md +50 -0
- package/plugins/pstack/skills/poteto-mode/references/kimi-tools.md +40 -0
- package/plugins/pstack/skills/poteto-mode/references/licenses/LICENSE +22 -0
- package/plugins/pstack/skills/poteto-mode/references/licenses/LICENSE-cursor-team-kit +21 -0
- package/plugins/pstack/skills/poteto-mode/references/licenses/LICENSE-thermos +21 -0
- package/plugins/pstack/skills/poteto-mode/references/licenses/NOTICE.md +13 -0
- package/plugins/pstack/skills/poteto-mode/references/merge-safety.md +43 -0
- package/plugins/pstack/skills/poteto-mode/references/minimax-tools.md +93 -0
- package/plugins/pstack/skills/poteto-mode/references/muse-tools.md +105 -0
- package/plugins/pstack/skills/poteto-mode/references/omp-tools.md +39 -0
- package/plugins/pstack/skills/poteto-mode/references/opencode-tools.md +29 -0
- package/plugins/pstack/skills/poteto-mode/references/pi-tools.md +117 -0
- package/plugins/pstack/skills/poteto-mode/references/resume-storage.md +20 -0
- package/plugins/pstack/skills/poteto-mode/scripts/.prettierignore +23 -0
- package/plugins/pstack/skills/poteto-mode/scripts/.prettierrc.json +3 -0
- package/plugins/pstack/skills/poteto-mode/scripts/bootstrap.ts +71 -0
- package/plugins/pstack/skills/poteto-mode/scripts/bun.lock +67 -0
- package/plugins/pstack/skills/poteto-mode/scripts/check-plan.mjs +214 -0
- package/plugins/pstack/skills/poteto-mode/scripts/check-plan.test.ts +115 -0
- package/plugins/pstack/skills/poteto-mode/scripts/check-playbooks.mjs +71 -0
- package/plugins/pstack/skills/poteto-mode/scripts/codex-session-effort.mjs +66 -0
- package/plugins/pstack/skills/poteto-mode/scripts/package.json +16 -0
- package/plugins/pstack/skills/poteto-mode/scripts/resume.mjs +139 -0
- package/plugins/pstack/skills/poteto-mode/scripts/tsconfig.json +14 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/cli.test.ts +383 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/cli.ts +266 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/deadline.ts +20 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/fakes.test-helper.ts +157 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/fresh-install.test.ts +35 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/github.test.ts +902 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/github.ts +922 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/integrity.test.ts +887 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/landing.ts +92 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/live-merge-safety.mjs +142 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/policy.test.ts +1151 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/policy.ts +956 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/render.ts +200 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/ship-pr +6 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/shipping-cli.test.ts +159 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/shipping-cli.ts +65 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/shipping.test-helper.ts +48 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/shipping.test.ts +360 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/shipping.ts +235 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/transport.test.ts +211 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/tsconfig.json +13 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/types.compile.ts +108 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/types.ts +474 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/watch-pr +6 -0
- package/plugins/pstack/skills/poteto-mode/scripts/watch-pr/wrapper.test.ts +20 -0
- package/plugins/pstack/skills/poteto-mode/scripts/worktree-audit.mjs +434 -0
- package/plugins/pstack/skills/principle-attack-the-premise/SKILL.md +21 -0
- package/plugins/pstack/skills/principle-boundary-discipline/SKILL.md +34 -0
- package/plugins/pstack/skills/principle-build-the-lever/SKILL.md +24 -0
- package/plugins/pstack/skills/principle-encode-lessons-in-structure/SKILL.md +11 -0
- package/plugins/pstack/skills/principle-exhaust-the-design-space/SKILL.md +9 -0
- package/plugins/pstack/skills/principle-experience-first/SKILL.md +19 -0
- package/plugins/pstack/skills/principle-explain-the-number/SKILL.md +18 -0
- package/plugins/pstack/skills/principle-fix-root-causes/SKILL.md +21 -0
- package/plugins/pstack/skills/principle-foundational-thinking/SKILL.md +21 -0
- package/plugins/pstack/skills/principle-guard-the-context-window/SKILL.md +12 -0
- package/plugins/pstack/skills/principle-laziness-protocol/SKILL.md +10 -0
- package/plugins/pstack/skills/principle-make-operations-idempotent/SKILL.md +22 -0
- package/plugins/pstack/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +14 -0
- package/plugins/pstack/skills/principle-minimize-reader-load/SKILL.md +18 -0
- package/plugins/pstack/skills/principle-model-the-domain/SKILL.md +24 -0
- package/plugins/pstack/skills/principle-never-block-on-the-human/SKILL.md +15 -0
- package/plugins/pstack/skills/principle-outcome-oriented-execution/SKILL.md +21 -0
- package/plugins/pstack/skills/principle-prove-it-works/SKILL.md +27 -0
- package/plugins/pstack/skills/principle-redesign-from-first-principles/SKILL.md +16 -0
- package/plugins/pstack/skills/principle-separate-before-serializing-shared-state/SKILL.md +16 -0
- package/plugins/pstack/skills/principle-sequence-verifiable-units/SKILL.md +17 -0
- package/plugins/pstack/skills/principle-subtract-before-you-add/SKILL.md +18 -0
- package/plugins/pstack/skills/principle-test-behavior-not-implementation/SKILL.md +20 -0
- package/plugins/pstack/skills/principle-type-system-discipline/SKILL.md +13 -0
- package/plugins/pstack/skills/recall/SKILL.md +43 -0
- package/plugins/pstack/skills/reflect/SKILL.md +89 -0
- package/plugins/pstack/skills/reflect/references/divergent-reviewer.md +38 -0
- package/plugins/pstack/skills/reflect/references/judgment-reviewer.md +37 -0
- package/plugins/pstack/skills/reflect/references/synthesizer.md +56 -0
- package/plugins/pstack/skills/reflect/references/tooling-reviewer.md +48 -0
- package/plugins/pstack/skills/reflect/scripts/claude-project-dir.mjs +121 -0
- package/plugins/pstack/skills/reflect/scripts/find-transcript.mjs +218 -0
- package/plugins/pstack/skills/setup-pstack/SKILL.md +109 -0
- package/plugins/pstack/skills/setup-pstack/copilot.md +88 -0
- package/plugins/pstack/skills/setup-pstack/references/runtimes.md +75 -0
- package/plugins/pstack/skills/setup-pstack/scripts/check-sheet.awk +10 -0
- package/plugins/pstack/skills/setup-pstack/scripts/check-sheet.sh +20 -0
- package/plugins/pstack/skills/setup-pstack/scripts/read-sheet.sh +24 -0
- package/plugins/pstack/skills/setup-pstack/scripts/sheet.awk +160 -0
- package/plugins/pstack/skills/sharpen/SKILL.md +15 -0
- package/plugins/pstack/skills/show-me-your-work/SKILL.md +89 -0
- package/plugins/pstack/skills/show-me-your-work/references/decision-log-template.tsv +1 -0
- package/plugins/pstack/skills/show-me-your-work/scripts/log.sh +58 -0
- package/plugins/pstack/skills/statechart/SKILL.md +81 -0
- package/plugins/pstack/skills/statechart/references/render.md +93 -0
- package/plugins/pstack/skills/statechart/scripts/backends/cfg.ts +33 -0
- package/plugins/pstack/skills/statechart/scripts/backends/mermaid.ts +201 -0
- package/plugins/pstack/skills/statechart/scripts/backends/plain-text.ts +72 -0
- package/plugins/pstack/skills/statechart/scripts/backends/report.ts +177 -0
- package/plugins/pstack/skills/statechart/scripts/bun.lock +17 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/config.ts +276 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/dot.ts +74 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/marks.ts +93 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/messages.ts +52 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/spec.ts +114 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/trace.ts +24 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/value.ts +166 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/verdict.ts +40 -0
- package/plugins/pstack/skills/statechart/scripts/frontends/view.ts +119 -0
- package/plugins/pstack/skills/statechart/scripts/ir.ts +547 -0
- package/plugins/pstack/skills/statechart/scripts/janitor.ts +12 -0
- package/plugins/pstack/skills/statechart/scripts/package.json +11 -0
- package/plugins/pstack/skills/statechart/scripts/passes/annotate.ts +128 -0
- package/plugins/pstack/skills/statechart/scripts/passes/label.ts +269 -0
- package/plugins/pstack/skills/statechart/scripts/passes/lift.ts +85 -0
- package/plugins/pstack/skills/statechart/scripts/passes/loop-check.ts +68 -0
- package/plugins/pstack/skills/statechart/scripts/passes/paths.ts +60 -0
- package/plugins/pstack/skills/statechart/scripts/passes/reach.ts +135 -0
- package/plugins/pstack/skills/statechart/scripts/passes/region-check.ts +97 -0
- package/plugins/pstack/skills/statechart/scripts/passes/regions.ts +295 -0
- package/plugins/pstack/skills/statechart/scripts/pipeline.ts +76 -0
- package/plugins/pstack/skills/statechart/scripts/run.ts +526 -0
- package/plugins/pstack/skills/statechart/scripts/statechart +29 -0
- package/plugins/pstack/skills/statechart/scripts/statechart.ts +171 -0
- package/plugins/pstack/skills/statechart/scripts/test/ConfigOracle.java +63 -0
- package/plugins/pstack/skills/statechart/scripts/test/chart.test.ts +1210 -0
- package/plugins/pstack/skills/statechart/scripts/test/charts/Braces.mmd +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/charts/Escapes.mmd +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/charts/Phases.mmd +29 -0
- package/plugins/pstack/skills/statechart/scripts/test/child-env.test.ts +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/cli.test.ts +1323 -0
- package/plugins/pstack/skills/statechart/scripts/test/config-fuzz.test.ts +263 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/Counter.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/Counter.tla +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/chart.mmd +9 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/graph.dot +16 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/report.md +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Counter/verdict-1.out +49 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/ChartRun.out +60 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/CounterAction.tla +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/chart.mmd +26 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/graph.dot +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/report.md +20 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/verdict-2.out +82 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterAction/verdict-3.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/CounterDeadlock.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/chart.mmd +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/graph.dot +16 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/report.md +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterDeadlock/verdict-2.out +77 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/ChartRun.out +69 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/CounterFan.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/chart.mmd +85 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/graph.dot +70 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/report.md +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/verdict-1.out +67 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterFan/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/ChartRun.out +85 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.cfg +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/CounterGuard.tla +13 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/chart.mmd +5 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/graph.dot +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/report.md +31 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/verdict-1.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterGuard/verdict-2.out +77 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/ChartRun.out +55 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/CounterInitPast.tla +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/chart.mmd +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/graph.dot +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/report.md +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-1.out +33 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPast/verdict-2.out +54 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/ChartRun.out +54 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/CounterInitPastHolds.tla +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/chart.mmd +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/graph.dot +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/report.md +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInitPastHolds/verdict-1.out +46 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/CounterInstance.tla +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/CounterSteps.tla +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/chart.mmd +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/graph.dot +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/report.md +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/sany.out +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterInstance/verdict-1.out +78 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/CounterJump.tla +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/chart.mmd +26 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/graph.dot +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/report.md +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/verdict-1.out +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterJump/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/CounterLoop.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/chart.mmd +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/graph.dot +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/report.md +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterLoop/verdict-1.out +76 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/CounterOrder.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/chart.mmd +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/graph.dot +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/report.md +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterOrder/verdict-2.out +67 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/ChartRun.out +62 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.cfg +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/CounterRules.tla +24 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/Moves.tla +5 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/chart.mmd +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/graph.dot +10 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/report.md +23 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/sany.out +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-1.out +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-2.out +66 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-3.out +74 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterRules/verdict-4.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/ChartRun.out +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/CounterStart.tla +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/chart.mmd +18 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/graph.dot +13 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/report.md +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/verdict-1.out +33 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStart/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/CounterStop.tla +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/chart.mmd +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/graph.dot +13 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/report.md +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterStop/verdict-1.out +49 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/ChartRun.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/CounterTie.tla +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/chart.mmd +30 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/graph.dot +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/report.md +27 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-2.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-3.out +87 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTie/verdict-4.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/ChartRun.out +60 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/CounterTieInGraph.tla +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/chart.mmd +23 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/graph.dot +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/report.md +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterTieInGraph/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/ChartRun.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/CounterView.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/CounterView.tla +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/chart.mmd +23 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/graph.dot +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/report.md +27 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-2.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-3.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-3.out +87 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/verdict-4.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/CounterView/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/DieHard.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/DieHard.tla +38 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/chart.mmd +92 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/graph.dot +126 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/report.md +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/verdict-1.out +91 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/DieHard/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/ChartRun.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.cfg +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/FirstRule.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/chart.mmd +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/graph.dot +16 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/report.md +25 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-2.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-3.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/FirstRule/verdict-4.out +77 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/HiddenClock.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/chart.mmd +13 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/graph.dot +12 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/report.md +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/HiddenClock/verdict-1.out +72 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/Login.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/Login.tla +62 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/chart.mmd +27 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/graph.dot +40 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/report.md +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/verdict-1.out +47 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Login/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/LoginGuarded.tla +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/chart.mmd +28 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/graph.dot +37 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/report.md +8 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/verdict-1.out +47 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginGuarded/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/ChartRun.out +60 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/LoginParallel.tla +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/chart.mmd +44 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/graph.dot +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/report.md +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/verdict-1.out +83 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/LoginParallel/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/ChartRun.out +60 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/MediaPlayer.tla +103 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/chart.mmd +43 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/graph.dot +93 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/report.md +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-1.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/verdict-2.out +72 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayer/view.mjs +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/MediaPlayerFixed.tla +100 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/chart.mmd +31 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/graph.dot +85 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/report.md +9 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/verdict-1.out +47 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerFixed/view.mjs +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayer.tla +103 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/MediaPlayerProps.tla +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/chart.mmd +42 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/graph.dot +93 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/report.md +19 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-1.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-2.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-3.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-4.out +66 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-5.out +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/verdict-6.out +49 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/MediaPlayerProps/view.mjs +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.cfg +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/PickWorker.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/chart.mmd +5 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/graph.dot +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/report.md +7 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/sany.out +5 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/PickWorker/verdict-1.out +70 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/ChartRun.out +61 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/Shadow.cfg +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/Shadow.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/ShadowLib.tla +6 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/ShadowSub.tla +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/chart.mmd +9 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/graph.dot +16 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/report.md +8 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/sany.out +4 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/Shadow/verdict-1.out +65 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/ChartRun.out +59 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/SpacedNames.tla +9 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/chart.mmd +23 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/graph.dot +17 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/report.md +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/verdict-1.out +65 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/SpacedNames/verdict-2.out +75 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/ChartRun.out +69 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/TwoPhase.tla +75 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/chart.mmd +60 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/graph.dot +297 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/report.md +20 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/verdict-1.out +95 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/verdict-2.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhase/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/ChartRun.out +57 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.cfg +3 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/TwoPhaseFixed.tla +75 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/chart.mmd +37 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/graph.dot +223 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/report.md +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/sany.out +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/verdict-1.out +47 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TwoPhaseFixed/view.mjs +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/ChartRun.out +75 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.cfg +5 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/TypeGuard.tla +11 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/chart.mmd +18 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/graph.dot +14 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/report.md +29 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/verdict-1.out +64 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/TypeGuard/verdict-2.out +75 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/ChartRun.out +58 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/UserNoDeadlock.tla +8 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/chart.mmd +22 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/graph.dot +16 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/report.md +15 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-1.out +56 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.exit +1 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus/UserNoDeadlock/verdict-2.out +77 -0
- package/plugins/pstack/skills/statechart/scripts/test/corpus.test.ts +415 -0
- package/plugins/pstack/skills/statechart/scripts/test/differential.test.ts +565 -0
- package/plugins/pstack/skills/statechart/scripts/test/grid/Grid.cfg +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/grid/Grid.tla +9 -0
- package/plugins/pstack/skills/statechart/scripts/test/grid/sany.out +2 -0
- package/plugins/pstack/skills/statechart/scripts/test/java.ts +63 -0
- package/plugins/pstack/skills/statechart/scripts/test/labels.ts +643 -0
- package/plugins/pstack/skills/statechart/scripts/test/messages.test.ts +227 -0
- package/plugins/pstack/skills/statechart/scripts/test/pipeline.test.ts +270 -0
- package/plugins/pstack/skills/statechart/scripts/test/plain-tlc.test.ts +255 -0
- package/plugins/pstack/skills/statechart/scripts/test/render.test.ts +81 -0
- package/plugins/pstack/skills/statechart/scripts/test/tlc-out.test.ts +90 -0
- package/plugins/pstack/skills/statechart/scripts/test/tlc.ts +158 -0
- package/plugins/pstack/skills/statechart/scripts/tsconfig.json +11 -0
- package/plugins/pstack/skills/statechart/scripts/worker.ts +35 -0
- package/plugins/pstack/skills/swarm/SKILL.md +58 -0
- package/plugins/pstack/skills/tdd/SKILL.md +41 -0
- package/plugins/pstack/skills/teach/SKILL.md +28 -0
- package/plugins/pstack/skills/technical-writing/SKILL.md +105 -0
- package/plugins/pstack/skills/thermo-nuclear-code-quality-review/SKILL.md +201 -0
- package/plugins/pstack/skills/thermo-nuclear-review/SKILL.md +50 -0
- package/plugins/pstack/skills/thermos/SKILL.md +40 -0
- package/plugins/pstack/skills/typescript-best-practices/SKILL.md +32 -0
- package/plugins/pstack/skills/typescript-best-practices/references/patterns.md +328 -0
- package/plugins/pstack/skills/unslop/SKILL.md +61 -0
- package/plugins/pstack/skills/what-did-i-get-done/SKILL.md +31 -0
- package/plugins/pstack/skills/why/SKILL.md +116 -0
- package/plugins/pstack/skills/why/references/epistemics.md +79 -0
- package/plugins/pstack/skills/why/references/investigator-prompt.md +86 -0
- package/plugins/pstack/skills/why/references/source-playbook.md +17 -0
- package/plugins/pstack/skills/why/references/sources/code-archaeology.md +51 -0
- package/plugins/pstack/skills/why/references/sources/databricks.md +70 -0
- package/plugins/pstack/skills/why/references/sources/datadog.md +97 -0
- package/plugins/pstack/skills/why/references/sources/incident-postmortem.md +5 -0
- package/plugins/pstack/skills/why/references/sources/linear.md +48 -0
- package/plugins/pstack/skills/why/references/sources/notion.md +55 -0
- package/plugins/pstack/skills/why/references/sources/sentry.md +66 -0
- package/plugins/pstack/skills/why/references/sources/slack.md +17 -0
- package/plugins/pstack/skills/why/references/synthesizer-prompt.md +130 -0
- package/tools/forks.json +398 -0
- package/tools/substitutions.json +646 -0
- package/tools/upstream.json +53 -0
|
@@ -0,0 +1,1151 @@
|
|
|
1
|
+
import { describe, expect, it } from "bun:test";
|
|
2
|
+
import { WatchDeadline } from "./deadline.ts";
|
|
3
|
+
import { WatcherQueryError } from "./github.ts";
|
|
4
|
+
import {
|
|
5
|
+
applyQueueSnapshot,
|
|
6
|
+
assessGitHubMerge,
|
|
7
|
+
classifyPr,
|
|
8
|
+
createQueueState,
|
|
9
|
+
evaluateQueue,
|
|
10
|
+
noChecksConfirmer,
|
|
11
|
+
planQueue,
|
|
12
|
+
queryBackoffSeconds,
|
|
13
|
+
readSnapshot,
|
|
14
|
+
runQueued,
|
|
15
|
+
runSimple,
|
|
16
|
+
selectTierMajorStackDecision,
|
|
17
|
+
} from "./policy.ts";
|
|
18
|
+
import {
|
|
19
|
+
fakeReader,
|
|
20
|
+
failedCheck,
|
|
21
|
+
passingCheck,
|
|
22
|
+
pendingCheck,
|
|
23
|
+
} from "./fakes.test-helper.ts";
|
|
24
|
+
import type {
|
|
25
|
+
GitHubReader,
|
|
26
|
+
NonEmpty,
|
|
27
|
+
PollingOptions,
|
|
28
|
+
PrContext,
|
|
29
|
+
ProgressVerdict,
|
|
30
|
+
PullRequestFacts,
|
|
31
|
+
RollupState,
|
|
32
|
+
} from "./types.ts";
|
|
33
|
+
import { parsePrNumber } from "./types.ts";
|
|
34
|
+
|
|
35
|
+
const context = (number: number): PrContext => ({
|
|
36
|
+
owner: "owner",
|
|
37
|
+
repo: "repo",
|
|
38
|
+
number: parsePrNumber(number),
|
|
39
|
+
});
|
|
40
|
+
const options = {
|
|
41
|
+
interval: 10,
|
|
42
|
+
sweepInterval: 300,
|
|
43
|
+
timeout: 0,
|
|
44
|
+
maxQueryErrors: 5,
|
|
45
|
+
allowDraft: false,
|
|
46
|
+
} satisfies PollingOptions;
|
|
47
|
+
|
|
48
|
+
describe("readiness truth table", () => {
|
|
49
|
+
it("covers every specified row and every UNKNOWN rollup value", () => {
|
|
50
|
+
const cases: readonly [
|
|
51
|
+
PullRequestFacts["mergeStateStatus"],
|
|
52
|
+
RollupState,
|
|
53
|
+
"allowed" | "refused",
|
|
54
|
+
][] = [
|
|
55
|
+
["BLOCKED", "FAILURE", "refused"],
|
|
56
|
+
["BLOCKED", "ERROR", "refused"],
|
|
57
|
+
["BLOCKED", "PENDING", "allowed"],
|
|
58
|
+
["UNSTABLE", "FAILURE", "allowed"],
|
|
59
|
+
["UNKNOWN", "ERROR", "allowed"],
|
|
60
|
+
["UNKNOWN", "EXPECTED", "allowed"],
|
|
61
|
+
["UNKNOWN", "FAILURE", "allowed"],
|
|
62
|
+
["UNKNOWN", "PENDING", "allowed"],
|
|
63
|
+
["UNKNOWN", "SUCCESS", "allowed"],
|
|
64
|
+
["UNKNOWN", null, "allowed"],
|
|
65
|
+
["CLEAN", "SUCCESS", "allowed"],
|
|
66
|
+
];
|
|
67
|
+
for (const [mergeStateStatus, headRollupState, expected] of cases) {
|
|
68
|
+
expect(
|
|
69
|
+
assessGitHubMerge({ mergeStateStatus, headRollupState }).kind,
|
|
70
|
+
).toBe(expected);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("turns a clean visible list plus GitHub refusal into an explicit CI blocker", async () => {
|
|
75
|
+
const reader = fakeReader({
|
|
76
|
+
facts: { mergeStateStatus: "BLOCKED" },
|
|
77
|
+
fastPath: { kind: "checks", checks: [passingCheck()] },
|
|
78
|
+
commitRollups: [{ oid: "head", state: "FAILURE" }],
|
|
79
|
+
});
|
|
80
|
+
const snapshot = await readSnapshot({
|
|
81
|
+
reader,
|
|
82
|
+
context: context(1),
|
|
83
|
+
pendingHistory: "include",
|
|
84
|
+
allowDraft: false,
|
|
85
|
+
});
|
|
86
|
+
expect(snapshot.kind).toBe("open");
|
|
87
|
+
if (snapshot.kind !== "open") throw new Error("expected open snapshot");
|
|
88
|
+
expect(snapshot.ci.kind).toBe("ci-github-rejected");
|
|
89
|
+
expect(classifyPr(snapshot)).toMatchObject({
|
|
90
|
+
kind: "blocker",
|
|
91
|
+
blocker: { kind: "failing-checks" },
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
describe("snapshot query planning", () => {
|
|
97
|
+
it("does not query commit rollups while queued checks are pending", async () => {
|
|
98
|
+
const reader = fakeReader({
|
|
99
|
+
fastPath: { kind: "checks", checks: [pendingCheck()] },
|
|
100
|
+
});
|
|
101
|
+
const snapshot = await readSnapshot({
|
|
102
|
+
reader,
|
|
103
|
+
context: context(2),
|
|
104
|
+
pendingHistory: "omit",
|
|
105
|
+
allowDraft: false,
|
|
106
|
+
});
|
|
107
|
+
expect(snapshot.kind).toBe("open");
|
|
108
|
+
if (snapshot.kind !== "open") throw new Error("expected open snapshot");
|
|
109
|
+
expect(snapshot.ci.kind).toBe("ci-pending");
|
|
110
|
+
expect(reader.calls).toEqual([
|
|
111
|
+
"pullRequest",
|
|
112
|
+
"reviewThreadPage:null",
|
|
113
|
+
"checksFastPath",
|
|
114
|
+
"pullRequest",
|
|
115
|
+
]);
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
it("queries rollups for settled and failed lists", async () => {
|
|
119
|
+
const settled = fakeReader();
|
|
120
|
+
await readSnapshot({
|
|
121
|
+
reader: settled,
|
|
122
|
+
context: context(3),
|
|
123
|
+
pendingHistory: "omit",
|
|
124
|
+
allowDraft: false,
|
|
125
|
+
});
|
|
126
|
+
expect(settled.calls).toContain("commitRollups");
|
|
127
|
+
|
|
128
|
+
const failed = fakeReader({
|
|
129
|
+
fastPath: { kind: "checks", checks: [failedCheck()] },
|
|
130
|
+
});
|
|
131
|
+
await readSnapshot({
|
|
132
|
+
reader: failed,
|
|
133
|
+
context: context(4),
|
|
134
|
+
pendingHistory: "omit",
|
|
135
|
+
allowDraft: false,
|
|
136
|
+
});
|
|
137
|
+
expect(failed.calls).toContain("commitRollups");
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it("short-circuits merged rows before threads and checks", async () => {
|
|
141
|
+
const reader = fakeReader({
|
|
142
|
+
facts: { state: "MERGED", mergedAt: "2026-07-26T00:00:00Z" },
|
|
143
|
+
});
|
|
144
|
+
expect(
|
|
145
|
+
(
|
|
146
|
+
await readSnapshot({
|
|
147
|
+
reader,
|
|
148
|
+
context: context(5),
|
|
149
|
+
pendingHistory: "include",
|
|
150
|
+
allowDraft: false,
|
|
151
|
+
})
|
|
152
|
+
).kind,
|
|
153
|
+
).toBe("merged");
|
|
154
|
+
expect(reader.calls).toEqual(["pullRequest"]);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it("scans stacks tier-major so an upstack conflict outranks frontier CI", async () => {
|
|
159
|
+
const frontier = await readSnapshot({
|
|
160
|
+
reader: fakeReader({
|
|
161
|
+
fastPath: { kind: "checks", checks: [failedCheck()] },
|
|
162
|
+
commitRollups: [{ oid: "head", state: "FAILURE" }],
|
|
163
|
+
}),
|
|
164
|
+
context: context(10),
|
|
165
|
+
pendingHistory: "omit",
|
|
166
|
+
allowDraft: false,
|
|
167
|
+
});
|
|
168
|
+
const upstack = await readSnapshot({
|
|
169
|
+
reader: fakeReader({ facts: { mergeable: "CONFLICTING" } }),
|
|
170
|
+
context: context(11),
|
|
171
|
+
pendingHistory: "omit",
|
|
172
|
+
allowDraft: false,
|
|
173
|
+
});
|
|
174
|
+
const decision = selectTierMajorStackDecision([frontier, upstack]);
|
|
175
|
+
expect(decision).toMatchObject({
|
|
176
|
+
kind: "blocker",
|
|
177
|
+
blocker: { kind: "merge-conflicts", pr: { number: 11 } },
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it("attributes a stack wait to the PR whose checks are pending, not the bottom", async () => {
|
|
182
|
+
const readyBottom = await readSnapshot({
|
|
183
|
+
reader: fakeReader(),
|
|
184
|
+
context: context(20),
|
|
185
|
+
pendingHistory: "omit",
|
|
186
|
+
allowDraft: false,
|
|
187
|
+
});
|
|
188
|
+
const pendingUpstack = await readSnapshot({
|
|
189
|
+
reader: fakeReader({
|
|
190
|
+
fastPath: { kind: "checks", checks: [pendingCheck("upstack-build")] },
|
|
191
|
+
}),
|
|
192
|
+
context: context(21),
|
|
193
|
+
pendingHistory: "omit",
|
|
194
|
+
allowDraft: false,
|
|
195
|
+
});
|
|
196
|
+
const decision = selectTierMajorStackDecision([readyBottom, pendingUpstack]);
|
|
197
|
+
expect(decision).toMatchObject({
|
|
198
|
+
kind: "waiting",
|
|
199
|
+
frontier: { number: 21 },
|
|
200
|
+
reason: { kind: "pending-checks", pending: [{ name: "upstack-build" }] },
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
it("waits on a draft while checks are pending, then reports the draft gate", async () => {
|
|
205
|
+
const pending = await readSnapshot({
|
|
206
|
+
reader: fakeReader({
|
|
207
|
+
facts: { isDraft: true },
|
|
208
|
+
fastPath: { kind: "checks", checks: [pendingCheck()] },
|
|
209
|
+
}),
|
|
210
|
+
context: context(12),
|
|
211
|
+
pendingHistory: "omit",
|
|
212
|
+
allowDraft: false,
|
|
213
|
+
});
|
|
214
|
+
expect(classifyPr(pending).kind).toBe("waiting");
|
|
215
|
+
|
|
216
|
+
const settled = await readSnapshot({
|
|
217
|
+
reader: fakeReader({ facts: { isDraft: true } }),
|
|
218
|
+
context: context(12),
|
|
219
|
+
pendingHistory: "omit",
|
|
220
|
+
allowDraft: false,
|
|
221
|
+
});
|
|
222
|
+
expect(classifyPr(settled)).toMatchObject({
|
|
223
|
+
kind: "blocker",
|
|
224
|
+
blocker: { kind: "merge-gate", reason: "draft-pr" },
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
describe("queued-stack cadence", () => {
|
|
229
|
+
async function openSnapshot(pr: PrContext) {
|
|
230
|
+
return readSnapshot({
|
|
231
|
+
reader: fakeReader(),
|
|
232
|
+
context: pr,
|
|
233
|
+
pendingHistory: "omit",
|
|
234
|
+
allowDraft: false,
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
it("drops a sweep head only after its snapshot succeeds", async () => {
|
|
239
|
+
const queue = [
|
|
240
|
+
context(20),
|
|
241
|
+
context(21),
|
|
242
|
+
context(22),
|
|
243
|
+
] satisfies NonEmpty<PrContext>;
|
|
244
|
+
let state = createQueueState(queue, 0);
|
|
245
|
+
const first = await openSnapshot(queue[0]);
|
|
246
|
+
state = applyQueueSnapshot(state, first, 0, options).state;
|
|
247
|
+
expect(state.work).toMatchObject({
|
|
248
|
+
kind: "whole-stack-sweep",
|
|
249
|
+
remaining: [{ number: 21 }, { number: 22 }],
|
|
250
|
+
});
|
|
251
|
+
const second = await openSnapshot(queue[1]);
|
|
252
|
+
state = applyQueueSnapshot(state, second, 60, options).state;
|
|
253
|
+
expect(state.work).toMatchObject({
|
|
254
|
+
kind: "whole-stack-sweep",
|
|
255
|
+
remaining: [{ number: 22 }],
|
|
256
|
+
});
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it("resumes the sweep at the PR whose read failed", async () => {
|
|
260
|
+
const middle = context(21);
|
|
261
|
+
const base = fakeReader();
|
|
262
|
+
let failNext = true;
|
|
263
|
+
const timeline: string[] = [];
|
|
264
|
+
const reader = {
|
|
265
|
+
...base,
|
|
266
|
+
async pullRequest(pr: PrContext) {
|
|
267
|
+
if (pr.number === middle.number && failNext) {
|
|
268
|
+
failNext = false;
|
|
269
|
+
timeline.push(`fail:${pr.number}`);
|
|
270
|
+
throw new WatcherQueryError({
|
|
271
|
+
kind: "command-exit",
|
|
272
|
+
retryable: true,
|
|
273
|
+
detail: "rate limited",
|
|
274
|
+
code: 1,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
timeline.push(`read:${pr.number}`);
|
|
278
|
+
return base.pullRequest(pr);
|
|
279
|
+
},
|
|
280
|
+
} satisfies GitHubReader;
|
|
281
|
+
let now = 0;
|
|
282
|
+
let sleeps = 0;
|
|
283
|
+
const running = runQueued({
|
|
284
|
+
dependencies: {
|
|
285
|
+
reader,
|
|
286
|
+
deadline: new WatchDeadline(options.timeout, () => now),
|
|
287
|
+
clock: {
|
|
288
|
+
now: () => now,
|
|
289
|
+
observedAt: () => "2026-07-26T00:00:00.000Z",
|
|
290
|
+
async sleep(seconds) {
|
|
291
|
+
timeline.push("sleep");
|
|
292
|
+
now += seconds;
|
|
293
|
+
sleeps += 1;
|
|
294
|
+
if (sleeps === 2) throw new Error("stop after resume proof");
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
emit(verdict) {
|
|
298
|
+
timeline.push(`emit:${verdict.kind}`);
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
contexts: [context(20), middle, context(22)],
|
|
302
|
+
options,
|
|
303
|
+
});
|
|
304
|
+
await expect(running).rejects.toThrow("stop after resume proof");
|
|
305
|
+
expect(timeline).toEqual([
|
|
306
|
+
"emit:QUEUE",
|
|
307
|
+
"read:20",
|
|
308
|
+
"read:20",
|
|
309
|
+
"fail:21",
|
|
310
|
+
"emit:RETRY",
|
|
311
|
+
"sleep",
|
|
312
|
+
"read:21",
|
|
313
|
+
"read:21",
|
|
314
|
+
"read:22",
|
|
315
|
+
"read:22",
|
|
316
|
+
"emit:STATUS",
|
|
317
|
+
"emit:WAITING",
|
|
318
|
+
"sleep",
|
|
319
|
+
]);
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("emits a completed sweep only after its final successful snapshot", async () => {
|
|
323
|
+
const queue = [context(30), context(31)] satisfies NonEmpty<PrContext>;
|
|
324
|
+
let state = createQueueState(queue, 0);
|
|
325
|
+
const first = applyQueueSnapshot(
|
|
326
|
+
state,
|
|
327
|
+
await openSnapshot(queue[0]),
|
|
328
|
+
0,
|
|
329
|
+
options,
|
|
330
|
+
);
|
|
331
|
+
expect(first.completedSweepRows).toBeNull();
|
|
332
|
+
state = first.state;
|
|
333
|
+
const second = applyQueueSnapshot(
|
|
334
|
+
state,
|
|
335
|
+
await openSnapshot(queue[1]),
|
|
336
|
+
5,
|
|
337
|
+
options,
|
|
338
|
+
);
|
|
339
|
+
expect(
|
|
340
|
+
second.completedSweepRows?.map((row) => Number(row.context.number)),
|
|
341
|
+
).toEqual([30, 31]);
|
|
342
|
+
expect(second.state.nextSweepAt).toBe(305);
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
it("ADVANCE continues directly to the new frontier without sleeping", async () => {
|
|
346
|
+
const one = context(40);
|
|
347
|
+
const two = context(41);
|
|
348
|
+
const base = fakeReader();
|
|
349
|
+
const reads = new Map<number, number>();
|
|
350
|
+
const timeline: string[] = [];
|
|
351
|
+
const reader = {
|
|
352
|
+
...base,
|
|
353
|
+
async pullRequest(pr: PrContext) {
|
|
354
|
+
timeline.push(`read:${pr.number}`);
|
|
355
|
+
const facts = await base.pullRequest(pr);
|
|
356
|
+
const count = (reads.get(pr.number) ?? 0) + 1;
|
|
357
|
+
reads.set(pr.number, count);
|
|
358
|
+
return pr.number === one.number && count > 2
|
|
359
|
+
? {
|
|
360
|
+
...facts,
|
|
361
|
+
state: "MERGED" as const,
|
|
362
|
+
mergedAt: "2026-07-26T00:00:00Z",
|
|
363
|
+
}
|
|
364
|
+
: facts;
|
|
365
|
+
},
|
|
366
|
+
} satisfies GitHubReader;
|
|
367
|
+
let now = 0;
|
|
368
|
+
let sleeps = 0;
|
|
369
|
+
const emitted: ProgressVerdict[] = [];
|
|
370
|
+
const running = runQueued({
|
|
371
|
+
dependencies: {
|
|
372
|
+
reader,
|
|
373
|
+
deadline: new WatchDeadline(options.timeout, () => now),
|
|
374
|
+
clock: {
|
|
375
|
+
now: () => now,
|
|
376
|
+
observedAt: () => "2026-07-26T00:00:00.000Z",
|
|
377
|
+
async sleep(seconds) {
|
|
378
|
+
timeline.push("sleep");
|
|
379
|
+
now += seconds;
|
|
380
|
+
sleeps += 1;
|
|
381
|
+
if (sleeps === 2) throw new Error("stop after advance proof");
|
|
382
|
+
},
|
|
383
|
+
},
|
|
384
|
+
emit(verdict) {
|
|
385
|
+
emitted.push(verdict);
|
|
386
|
+
timeline.push(`emit:${verdict.kind}`);
|
|
387
|
+
},
|
|
388
|
+
},
|
|
389
|
+
contexts: [one, two],
|
|
390
|
+
options,
|
|
391
|
+
});
|
|
392
|
+
await expect(running).rejects.toThrow("stop after advance proof");
|
|
393
|
+
expect(emitted.some((event) => event.kind === "ADVANCE")).toBe(true);
|
|
394
|
+
const firstSleep = timeline.indexOf("sleep");
|
|
395
|
+
expect(timeline.slice(firstSleep, firstSleep + 6)).toEqual([
|
|
396
|
+
"sleep",
|
|
397
|
+
"read:40",
|
|
398
|
+
"emit:ADVANCE",
|
|
399
|
+
"read:41",
|
|
400
|
+
"read:41",
|
|
401
|
+
"emit:WAITING",
|
|
402
|
+
]);
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
it("deduplicates identical waits and schedules the next due sweep", async () => {
|
|
406
|
+
const queue = [context(50)] satisfies NonEmpty<PrContext>;
|
|
407
|
+
let state = createQueueState(queue, 0);
|
|
408
|
+
state = applyQueueSnapshot(
|
|
409
|
+
state,
|
|
410
|
+
await openSnapshot(queue[0]),
|
|
411
|
+
0,
|
|
412
|
+
options,
|
|
413
|
+
).state;
|
|
414
|
+
const first = evaluateQueue(state, options);
|
|
415
|
+
expect(first.kind).toBe("waiting");
|
|
416
|
+
if (first.kind !== "waiting") throw new Error("expected waiting");
|
|
417
|
+
expect(first.emit).toBe(true);
|
|
418
|
+
const second = evaluateQueue(first.state, options);
|
|
419
|
+
expect(second.kind).toBe("waiting");
|
|
420
|
+
if (second.kind !== "waiting") throw new Error("expected waiting");
|
|
421
|
+
expect(second.emit).toBe(false);
|
|
422
|
+
expect(planQueue(second.state, 300).work?.kind).toBe("whole-stack-sweep");
|
|
423
|
+
});
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
it("uses the specified retry floor and cap", () => {
|
|
427
|
+
expect(queryBackoffSeconds(1, 1)).toBe(60);
|
|
428
|
+
expect(queryBackoffSeconds(1, 2)).toBe(120);
|
|
429
|
+
expect(queryBackoffSeconds(60, 4)).toBe(300);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
describe("review gate", () => {
|
|
433
|
+
it("blocks on a required review instead of reporting a blocked PR ready", async () => {
|
|
434
|
+
const snapshot = await readSnapshot({
|
|
435
|
+
reader: fakeReader({
|
|
436
|
+
facts: { reviewDecision: "REVIEW_REQUIRED", mergeStateStatus: "BLOCKED" },
|
|
437
|
+
}),
|
|
438
|
+
context: context(23),
|
|
439
|
+
pendingHistory: "omit",
|
|
440
|
+
allowDraft: false,
|
|
441
|
+
});
|
|
442
|
+
expect(classifyPr(snapshot)).toEqual({
|
|
443
|
+
kind: "blocker",
|
|
444
|
+
blocker: { kind: "merge-gate", pr: context(23), reason: "review-required" },
|
|
445
|
+
});
|
|
446
|
+
expect(
|
|
447
|
+
selectTierMajorStackDecision([snapshot] as NonEmpty<typeof snapshot>),
|
|
448
|
+
).toMatchObject({
|
|
449
|
+
kind: "blocker",
|
|
450
|
+
blocker: { kind: "merge-gate", reason: "review-required" },
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
|
|
454
|
+
it("blocks when branch protection holds an approved PR with clean CI", async () => {
|
|
455
|
+
const snapshot = await readSnapshot({
|
|
456
|
+
reader: fakeReader({ facts: { mergeStateStatus: "BLOCKED" } }),
|
|
457
|
+
context: context(24),
|
|
458
|
+
pendingHistory: "omit",
|
|
459
|
+
allowDraft: false,
|
|
460
|
+
});
|
|
461
|
+
expect(classifyPr(snapshot)).toMatchObject({
|
|
462
|
+
kind: "blocker",
|
|
463
|
+
blocker: { kind: "merge-gate", reason: "merge-blocked" },
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
it("waits for pending checks before reporting the review gate", async () => {
|
|
468
|
+
const snapshot = await readSnapshot({
|
|
469
|
+
reader: fakeReader({
|
|
470
|
+
facts: { reviewDecision: "REVIEW_REQUIRED", mergeStateStatus: "BLOCKED" },
|
|
471
|
+
fastPath: { kind: "checks", checks: [pendingCheck()] },
|
|
472
|
+
}),
|
|
473
|
+
context: context(26),
|
|
474
|
+
pendingHistory: "omit",
|
|
475
|
+
allowDraft: false,
|
|
476
|
+
});
|
|
477
|
+
expect(classifyPr(snapshot)).toMatchObject({ kind: "waiting" });
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
it("still reports changes requested as a merge-gate blocker", async () => {
|
|
481
|
+
const snapshot = await readSnapshot({
|
|
482
|
+
reader: fakeReader({
|
|
483
|
+
facts: { reviewDecision: "CHANGES_REQUESTED", mergeStateStatus: "BLOCKED" },
|
|
484
|
+
}),
|
|
485
|
+
context: context(25),
|
|
486
|
+
pendingHistory: "omit",
|
|
487
|
+
allowDraft: false,
|
|
488
|
+
});
|
|
489
|
+
expect(classifyPr(snapshot)).toMatchObject({
|
|
490
|
+
kind: "blocker",
|
|
491
|
+
blocker: { kind: "merge-gate", reason: "changes-requested" },
|
|
492
|
+
});
|
|
493
|
+
});
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
describe("facts that change while the snapshot is read", () => {
|
|
497
|
+
const read = (options: Parameters<typeof fakeReader>[0]) =>
|
|
498
|
+
readSnapshot({
|
|
499
|
+
reader: fakeReader(options),
|
|
500
|
+
context: context(29),
|
|
501
|
+
pendingHistory: "include",
|
|
502
|
+
allowDraft: false,
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
it("retries instead of reporting a merge gate the checks read has already cleared", async () => {
|
|
506
|
+
await expect(
|
|
507
|
+
read({
|
|
508
|
+
facts: { mergeStateStatus: "BLOCKED" },
|
|
509
|
+
factsOnReread: { mergeStateStatus: "CLEAN" },
|
|
510
|
+
}),
|
|
511
|
+
).rejects.toMatchObject({
|
|
512
|
+
failure: { kind: "snapshot-changed", retryable: true },
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
it("retries instead of reporting ready when a review lands after the facts read", async () => {
|
|
517
|
+
for (const factsOnReread of [
|
|
518
|
+
{ reviewDecision: "CHANGES_REQUESTED" },
|
|
519
|
+
{ mergeable: "CONFLICTING" },
|
|
520
|
+
{ mergeable: "UNKNOWN" },
|
|
521
|
+
{ isDraft: true },
|
|
522
|
+
] as const)
|
|
523
|
+
await expect(read({ factsOnReread })).rejects.toMatchObject({
|
|
524
|
+
failure: { kind: "snapshot-changed", retryable: true },
|
|
525
|
+
});
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
it("retries when the PR closes, merges, or renames its head branch between the two reads", async () => {
|
|
529
|
+
for (const factsOnReread of [
|
|
530
|
+
{ state: "CLOSED" },
|
|
531
|
+
{ mergedAt: "2026-07-26T00:00:00Z" },
|
|
532
|
+
{ headRefName: "renamed" },
|
|
533
|
+
] as const)
|
|
534
|
+
await expect(read({ factsOnReread })).rejects.toMatchObject({
|
|
535
|
+
failure: { kind: "snapshot-changed", retryable: true },
|
|
536
|
+
});
|
|
537
|
+
});
|
|
538
|
+
|
|
539
|
+
it("keeps an unknown first read when GitHub computes mergeability before the re-read", async () => {
|
|
540
|
+
const unknown = {
|
|
541
|
+
mergeable: "UNKNOWN",
|
|
542
|
+
mergeStateStatus: "UNKNOWN",
|
|
543
|
+
} as const;
|
|
544
|
+
expect(
|
|
545
|
+
await read({
|
|
546
|
+
facts: unknown,
|
|
547
|
+
factsOnReread: { mergeable: "MERGEABLE", mergeStateStatus: "CLEAN" },
|
|
548
|
+
}),
|
|
549
|
+
).toMatchObject({ kind: "open", facts: unknown });
|
|
550
|
+
await expect(
|
|
551
|
+
read({
|
|
552
|
+
facts: unknown,
|
|
553
|
+
factsOnReread: { reviewDecision: "CHANGES_REQUESTED" },
|
|
554
|
+
}),
|
|
555
|
+
).rejects.toMatchObject({ failure: { kind: "snapshot-changed" } });
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
const ticking = (onSleep = () => {}) => {
|
|
560
|
+
let now = 0;
|
|
561
|
+
return {
|
|
562
|
+
now: () => now,
|
|
563
|
+
async sleep(seconds: number) {
|
|
564
|
+
now += seconds;
|
|
565
|
+
// A wait that never ends would spin on this clock without yielding to
|
|
566
|
+
// the test runner's own timeout.
|
|
567
|
+
if (now > 3600) throw new Error("no verdict within an hour of polling");
|
|
568
|
+
onSleep();
|
|
569
|
+
},
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
const dependencies = (
|
|
573
|
+
reader: GitHubReader,
|
|
574
|
+
clock: { now: () => number; sleep: (seconds: number) => Promise<void> },
|
|
575
|
+
emitted: ProgressVerdict[],
|
|
576
|
+
timeout = 0,
|
|
577
|
+
) => ({
|
|
578
|
+
reader,
|
|
579
|
+
emit: (verdict: ProgressVerdict) => {
|
|
580
|
+
emitted.push(verdict);
|
|
581
|
+
},
|
|
582
|
+
clock: { ...clock, observedAt: () => "2026-07-26T00:00:00.000Z" },
|
|
583
|
+
deadline: new WatchDeadline(timeout, clock.now),
|
|
584
|
+
});
|
|
585
|
+
const kinds = (emitted: readonly ProgressVerdict[]) =>
|
|
586
|
+
emitted.map((verdict) =>
|
|
587
|
+
verdict.kind === "WAITING"
|
|
588
|
+
? `${verdict.kind}:${verdict.reason.kind}`
|
|
589
|
+
: verdict.kind,
|
|
590
|
+
);
|
|
591
|
+
|
|
592
|
+
describe("mergeability", () => {
|
|
593
|
+
const unknown = {
|
|
594
|
+
mergeable: "UNKNOWN",
|
|
595
|
+
mergeStateStatus: "UNKNOWN",
|
|
596
|
+
} as const;
|
|
597
|
+
const read = (options: Parameters<typeof fakeReader>[0]) =>
|
|
598
|
+
readSnapshot({
|
|
599
|
+
reader: fakeReader(options),
|
|
600
|
+
context: context(27),
|
|
601
|
+
pendingHistory: "include",
|
|
602
|
+
allowDraft: false,
|
|
603
|
+
});
|
|
604
|
+
// One query error ends the run, so a wait that spent the budget would exit 7.
|
|
605
|
+
const watch = async (
|
|
606
|
+
reader: GitHubReader,
|
|
607
|
+
polling: Partial<PollingOptions> = {},
|
|
608
|
+
statusOnly = false,
|
|
609
|
+
) => {
|
|
610
|
+
const clock = ticking();
|
|
611
|
+
const emitted: ProgressVerdict[] = [];
|
|
612
|
+
const verdict = await runSimple({
|
|
613
|
+
dependencies: dependencies(reader, clock, emitted, polling.timeout),
|
|
614
|
+
contexts: [context(27)],
|
|
615
|
+
mode: "single",
|
|
616
|
+
statusOnly,
|
|
617
|
+
options: { ...options, maxQueryErrors: 1, ...polling },
|
|
618
|
+
});
|
|
619
|
+
return { verdict, emitted: kinds(emitted), elapsed: clock.now() };
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
it("waits while GitHub has not computed mergeability instead of reporting ready", async () => {
|
|
623
|
+
for (const facts of [
|
|
624
|
+
{ mergeable: "UNKNOWN" },
|
|
625
|
+
{ mergeStateStatus: "UNKNOWN" },
|
|
626
|
+
] as const) {
|
|
627
|
+
const snapshot = await read({ facts });
|
|
628
|
+
const waiting = {
|
|
629
|
+
kind: "waiting",
|
|
630
|
+
frontier: context(27),
|
|
631
|
+
reason: { kind: "mergeability-unknown" },
|
|
632
|
+
} as const;
|
|
633
|
+
expect(classifyPr(snapshot)).toEqual(waiting);
|
|
634
|
+
expect(selectTierMajorStackDecision([snapshot])).toEqual(waiting);
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
it("re-polls at the interval after an unknown first read, without spending the query-error budget", async () => {
|
|
639
|
+
const { verdict, emitted, elapsed } = await watch(
|
|
640
|
+
fakeReader({
|
|
641
|
+
facts: unknown,
|
|
642
|
+
factsOnReread: { mergeable: "MERGEABLE", mergeStateStatus: "CLEAN" },
|
|
643
|
+
}),
|
|
644
|
+
);
|
|
645
|
+
expect(emitted).toEqual(["WAITING:mergeability-unknown"]);
|
|
646
|
+
expect(elapsed).toBe(options.interval);
|
|
647
|
+
expect(verdict).toMatchObject({ kind: "READY", exitCode: 0 });
|
|
648
|
+
});
|
|
649
|
+
|
|
650
|
+
it("times out at the caller's deadline when GitHub never computes it", async () => {
|
|
651
|
+
const { verdict, emitted, elapsed } = await watch(
|
|
652
|
+
fakeReader({ facts: unknown }),
|
|
653
|
+
{ timeout: 25 },
|
|
654
|
+
);
|
|
655
|
+
expect(emitted).toEqual([
|
|
656
|
+
"WAITING:mergeability-unknown",
|
|
657
|
+
"WAITING:mergeability-unknown",
|
|
658
|
+
"WAITING:mergeability-unknown",
|
|
659
|
+
]);
|
|
660
|
+
expect(elapsed).toBe(25);
|
|
661
|
+
expect(verdict).toMatchObject({
|
|
662
|
+
kind: "TIMEOUT",
|
|
663
|
+
exitCode: 5,
|
|
664
|
+
reason: { kind: "mergeability-unknown" },
|
|
665
|
+
});
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
it("reports an unknown row on a status-only pass and exits 0 without waiting", async () => {
|
|
669
|
+
const { verdict, emitted, elapsed } = await watch(
|
|
670
|
+
fakeReader({ facts: unknown }),
|
|
671
|
+
{},
|
|
672
|
+
true,
|
|
673
|
+
);
|
|
674
|
+
expect(emitted).toEqual([]);
|
|
675
|
+
expect(elapsed).toBe(0);
|
|
676
|
+
expect(verdict).toMatchObject({
|
|
677
|
+
kind: "STATUS",
|
|
678
|
+
exitCode: 0,
|
|
679
|
+
rows: [{ kind: "open", facts: unknown, ci: { kind: "ci-clean" } }],
|
|
680
|
+
});
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
it("still stops at once on a blocker that does not depend on mergeability", async () => {
|
|
684
|
+
const thread = {
|
|
685
|
+
id: "thread",
|
|
686
|
+
firstComment: null,
|
|
687
|
+
isBugbot: false,
|
|
688
|
+
bugbotReviewPasses: 0,
|
|
689
|
+
};
|
|
690
|
+
const cases = [
|
|
691
|
+
[{ threads: [thread] }, { kind: "review-threads" }],
|
|
692
|
+
[
|
|
693
|
+
{
|
|
694
|
+
fastPath: { kind: "checks", checks: [failedCheck()] },
|
|
695
|
+
commitRollups: [{ oid: "head", state: "FAILURE" }],
|
|
696
|
+
},
|
|
697
|
+
{ kind: "failing-checks" },
|
|
698
|
+
],
|
|
699
|
+
[
|
|
700
|
+
{ facts: { ...unknown, reviewDecision: "CHANGES_REQUESTED" } },
|
|
701
|
+
{ kind: "merge-gate", reason: "changes-requested" },
|
|
702
|
+
],
|
|
703
|
+
] as const;
|
|
704
|
+
for (const [overrides, blocker] of cases)
|
|
705
|
+
expect(
|
|
706
|
+
classifyPr(await read({ facts: unknown, ...overrides })),
|
|
707
|
+
).toMatchObject({ kind: "blocker", blocker });
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
it("defers a required review, and names pending checks first, while mergeability is unknown", async () => {
|
|
711
|
+
expect(
|
|
712
|
+
classifyPr(
|
|
713
|
+
await read({ facts: { ...unknown, reviewDecision: "REVIEW_REQUIRED" } }),
|
|
714
|
+
),
|
|
715
|
+
).toMatchObject({
|
|
716
|
+
kind: "waiting",
|
|
717
|
+
reason: { kind: "mergeability-unknown" },
|
|
718
|
+
});
|
|
719
|
+
expect(
|
|
720
|
+
classifyPr(
|
|
721
|
+
await read({
|
|
722
|
+
facts: unknown,
|
|
723
|
+
fastPath: { kind: "checks", checks: [pendingCheck()] },
|
|
724
|
+
}),
|
|
725
|
+
),
|
|
726
|
+
).toMatchObject({ kind: "waiting", reason: { kind: "pending-checks" } });
|
|
727
|
+
});
|
|
728
|
+
|
|
729
|
+
it("does not report a queued frontier blocker-free while its mergeability is unknown", async () => {
|
|
730
|
+
let sleeps = 0;
|
|
731
|
+
const emitted: ProgressVerdict[] = [];
|
|
732
|
+
const running = runQueued({
|
|
733
|
+
dependencies: dependencies(
|
|
734
|
+
fakeReader({ facts: unknown }),
|
|
735
|
+
ticking(() => {
|
|
736
|
+
if (++sleeps === 2) throw new Error("stop after two polls");
|
|
737
|
+
}),
|
|
738
|
+
emitted,
|
|
739
|
+
),
|
|
740
|
+
contexts: [context(27)],
|
|
741
|
+
options,
|
|
742
|
+
});
|
|
743
|
+
await expect(running).rejects.toThrow("stop after two polls");
|
|
744
|
+
expect(kinds(emitted)).toEqual([
|
|
745
|
+
"QUEUE",
|
|
746
|
+
"STATUS",
|
|
747
|
+
"WAITING:mergeability-unknown",
|
|
748
|
+
]);
|
|
749
|
+
});
|
|
750
|
+
|
|
751
|
+
it("gates a branch that is behind its base instead of reporting it ready", async () => {
|
|
752
|
+
const snapshot = await readSnapshot({
|
|
753
|
+
reader: fakeReader({ facts: { mergeStateStatus: "BEHIND" } }),
|
|
754
|
+
context: context(28),
|
|
755
|
+
pendingHistory: "include",
|
|
756
|
+
allowDraft: false,
|
|
757
|
+
});
|
|
758
|
+
expect(classifyPr(snapshot)).toEqual({
|
|
759
|
+
kind: "blocker",
|
|
760
|
+
blocker: { kind: "merge-gate", pr: context(28), reason: "behind-base" },
|
|
761
|
+
});
|
|
762
|
+
});
|
|
763
|
+
|
|
764
|
+
it("stops at once on a branch behind its base, without waiting for checks that are pending or unreported", async () => {
|
|
765
|
+
for (const checks of [
|
|
766
|
+
{ fastPath: { kind: "checks", checks: [pendingCheck()] } },
|
|
767
|
+
{
|
|
768
|
+
fastPath: { kind: "none-reported" },
|
|
769
|
+
rollupPages: [{ kind: "no-rollup" }],
|
|
770
|
+
commitRollups: [{ oid: "head", state: null }],
|
|
771
|
+
},
|
|
772
|
+
] as const)
|
|
773
|
+
expect(
|
|
774
|
+
classifyPr(
|
|
775
|
+
await read({ facts: { mergeStateStatus: "BEHIND" }, ...checks }),
|
|
776
|
+
),
|
|
777
|
+
).toEqual({
|
|
778
|
+
kind: "blocker",
|
|
779
|
+
blocker: { kind: "merge-gate", pr: context(27), reason: "behind-base" },
|
|
780
|
+
});
|
|
781
|
+
});
|
|
782
|
+
|
|
783
|
+
it("reports requested changes before a behind base, and a behind base before a required review", async () => {
|
|
784
|
+
for (const [reviewDecision, reason] of [
|
|
785
|
+
["CHANGES_REQUESTED", "changes-requested"],
|
|
786
|
+
["REVIEW_REQUIRED", "behind-base"],
|
|
787
|
+
] as const)
|
|
788
|
+
expect(
|
|
789
|
+
classifyPr(
|
|
790
|
+
await read({
|
|
791
|
+
facts: { mergeStateStatus: "BEHIND", reviewDecision },
|
|
792
|
+
fastPath: { kind: "checks", checks: [pendingCheck()] },
|
|
793
|
+
}),
|
|
794
|
+
),
|
|
795
|
+
).toMatchObject({ kind: "blocker", blocker: { reason } });
|
|
796
|
+
});
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
describe("a PR with no checks configured", () => {
|
|
800
|
+
const noChecks = {
|
|
801
|
+
fastPath: { kind: "none-reported" },
|
|
802
|
+
rollupPages: [{ kind: "no-rollup" }],
|
|
803
|
+
commitRollups: [{ oid: "head", state: null }],
|
|
804
|
+
} as const;
|
|
805
|
+
const read = (
|
|
806
|
+
overrides: Parameters<typeof fakeReader>[0] = {},
|
|
807
|
+
confirmNoChecks = () => true,
|
|
808
|
+
) =>
|
|
809
|
+
readSnapshot({
|
|
810
|
+
reader: fakeReader({ ...noChecks, ...overrides }),
|
|
811
|
+
context: context(30),
|
|
812
|
+
pendingHistory: "omit",
|
|
813
|
+
allowDraft: false,
|
|
814
|
+
confirmNoChecks,
|
|
815
|
+
});
|
|
816
|
+
const run = (...args: Parameters<typeof dependencies>) =>
|
|
817
|
+
runSimple({
|
|
818
|
+
dependencies: dependencies(...args),
|
|
819
|
+
contexts: [context(30)],
|
|
820
|
+
mode: "single",
|
|
821
|
+
statusOnly: false,
|
|
822
|
+
options,
|
|
823
|
+
});
|
|
824
|
+
// The suite polls every 10 seconds, so the 60 second floor is six polls.
|
|
825
|
+
const sixPolls = (...perPoll: string[]) =>
|
|
826
|
+
Array.from({ length: 6 }, () => perPoll).flat();
|
|
827
|
+
|
|
828
|
+
it("is ready once the no-checks reading is confirmed and GitHub reports it mergeable", async () => {
|
|
829
|
+
const snapshot = await read({ facts: { reviewDecision: null } });
|
|
830
|
+
expect(classifyPr(snapshot)).toMatchObject({
|
|
831
|
+
kind: "ready",
|
|
832
|
+
pr: { proof: { ci: { kind: "ci-none" } } },
|
|
833
|
+
});
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
it("waits on a first sighting instead of reporting ready or a merge gate", async () => {
|
|
837
|
+
for (const facts of [
|
|
838
|
+
{ reviewDecision: null },
|
|
839
|
+
{ mergeStateStatus: "BLOCKED" },
|
|
840
|
+
{ reviewDecision: "REVIEW_REQUIRED" },
|
|
841
|
+
] as const) {
|
|
842
|
+
const snapshot = await read({ facts }, () => false);
|
|
843
|
+
expect(snapshot).toMatchObject({
|
|
844
|
+
kind: "open",
|
|
845
|
+
ci: { kind: "ci-unreported" },
|
|
846
|
+
});
|
|
847
|
+
expect(classifyPr(snapshot)).toEqual({
|
|
848
|
+
kind: "waiting",
|
|
849
|
+
frontier: context(30),
|
|
850
|
+
reason: { kind: "checks-unreported" },
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
|
|
855
|
+
it("confirms no checks only once the same head has shown none for 60 seconds", () => {
|
|
856
|
+
let now = 0;
|
|
857
|
+
const confirm = noChecksConfirmer({ now: () => now });
|
|
858
|
+
const head = { context: context(30), headRefOid: "head" };
|
|
859
|
+
expect(confirm(head)).toBe(false);
|
|
860
|
+
now = 59;
|
|
861
|
+
expect(confirm(head)).toBe(false);
|
|
862
|
+
now = 60;
|
|
863
|
+
expect(confirm(head)).toBe(true);
|
|
864
|
+
expect(confirm({ ...head, headRefOid: "pushed" })).toBe(false);
|
|
865
|
+
now = 119;
|
|
866
|
+
expect(confirm({ ...head, headRefOid: "pushed" })).toBe(false);
|
|
867
|
+
now = 120;
|
|
868
|
+
expect(confirm({ ...head, headRefOid: "pushed" })).toBe(true);
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
it("times each PR from its own first sighting, not from another PR's", () => {
|
|
872
|
+
let now = 0;
|
|
873
|
+
const confirm = noChecksConfirmer({ now: () => now });
|
|
874
|
+
const first = { context: context(30), headRefOid: "head" };
|
|
875
|
+
const second = { context: context(31), headRefOid: "head" };
|
|
876
|
+
expect(confirm(first)).toBe(false);
|
|
877
|
+
now = 60;
|
|
878
|
+
expect(confirm(second)).toBe(false);
|
|
879
|
+
expect(confirm(first)).toBe(true);
|
|
880
|
+
now = 120;
|
|
881
|
+
expect(confirm(second)).toBe(true);
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
it("reads no checks as unreported when the caller supplies no confirmation", async () => {
|
|
885
|
+
expect(
|
|
886
|
+
await readSnapshot({
|
|
887
|
+
reader: fakeReader(noChecks),
|
|
888
|
+
context: context(30),
|
|
889
|
+
pendingHistory: "omit",
|
|
890
|
+
allowDraft: false,
|
|
891
|
+
}),
|
|
892
|
+
).toMatchObject({ kind: "open", ci: { kind: "ci-unreported" } });
|
|
893
|
+
});
|
|
894
|
+
|
|
895
|
+
it("reports a repository with no CI ready 60 seconds after the first sighting, however short the interval", async () => {
|
|
896
|
+
const clock = ticking();
|
|
897
|
+
const emitted: ProgressVerdict[] = [];
|
|
898
|
+
const verdict = await run(
|
|
899
|
+
fakeReader({ ...noChecks, facts: { reviewDecision: null } }),
|
|
900
|
+
clock,
|
|
901
|
+
emitted,
|
|
902
|
+
);
|
|
903
|
+
expect(kinds(emitted)).toEqual(sixPolls("WAITING:checks-unreported"));
|
|
904
|
+
expect(clock.now()).toBe(60);
|
|
905
|
+
expect(verdict).toMatchObject({
|
|
906
|
+
kind: "READY",
|
|
907
|
+
scope: { pr: { proof: { ci: { kind: "ci-none" } } } },
|
|
908
|
+
});
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
it("stops at the merge gate only once a blocked PR has shown no checks for 60 seconds", async () => {
|
|
912
|
+
const clock = ticking();
|
|
913
|
+
const emitted: ProgressVerdict[] = [];
|
|
914
|
+
const verdict = await run(
|
|
915
|
+
fakeReader({
|
|
916
|
+
...noChecks,
|
|
917
|
+
facts: { mergeStateStatus: "BLOCKED", reviewDecision: null },
|
|
918
|
+
}),
|
|
919
|
+
clock,
|
|
920
|
+
emitted,
|
|
921
|
+
);
|
|
922
|
+
expect(kinds(emitted)).toEqual(sixPolls("WAITING:checks-unreported"));
|
|
923
|
+
expect(clock.now()).toBe(60);
|
|
924
|
+
expect(verdict).toMatchObject({
|
|
925
|
+
kind: "BLOCKER",
|
|
926
|
+
exitCode: 6,
|
|
927
|
+
blocker: { kind: "merge-gate", reason: "merge-blocked" },
|
|
928
|
+
});
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
it("waits through a first sighting and honours checks that register on the next poll", async () => {
|
|
932
|
+
const base = fakeReader({
|
|
933
|
+
...noChecks,
|
|
934
|
+
facts: { mergeStateStatus: "BLOCKED", reviewDecision: null },
|
|
935
|
+
});
|
|
936
|
+
let polls = 0;
|
|
937
|
+
const reader = {
|
|
938
|
+
...base,
|
|
939
|
+
async checksFastPath() {
|
|
940
|
+
polls += 1;
|
|
941
|
+
return polls === 1
|
|
942
|
+
? { kind: "none-reported" as const }
|
|
943
|
+
: { kind: "checks" as const, checks: [pendingCheck("required-ci")] };
|
|
944
|
+
},
|
|
945
|
+
} satisfies GitHubReader;
|
|
946
|
+
let sleeps = 0;
|
|
947
|
+
const emitted: ProgressVerdict[] = [];
|
|
948
|
+
const running = run(
|
|
949
|
+
reader,
|
|
950
|
+
ticking(() => {
|
|
951
|
+
if (++sleeps === 2) throw new Error("stop after two polls");
|
|
952
|
+
}),
|
|
953
|
+
emitted,
|
|
954
|
+
);
|
|
955
|
+
await expect(running).rejects.toThrow("stop after two polls");
|
|
956
|
+
expect(kinds(emitted)).toEqual([
|
|
957
|
+
"WAITING:checks-unreported",
|
|
958
|
+
"WAITING:pending-checks",
|
|
959
|
+
]);
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
it("times out unconfirmed when the deadline is shorter than the interval or than the 60 seconds", async () => {
|
|
963
|
+
for (const [timeout, polls] of [
|
|
964
|
+
[options.interval / 2, 1],
|
|
965
|
+
[30, 3],
|
|
966
|
+
] as const) {
|
|
967
|
+
const emitted: ProgressVerdict[] = [];
|
|
968
|
+
const verdict = await run(
|
|
969
|
+
fakeReader({ ...noChecks, facts: { reviewDecision: null } }),
|
|
970
|
+
ticking(),
|
|
971
|
+
emitted,
|
|
972
|
+
timeout,
|
|
973
|
+
);
|
|
974
|
+
expect(kinds(emitted)).toEqual(
|
|
975
|
+
Array.from({ length: polls }, () => "WAITING:checks-unreported"),
|
|
976
|
+
);
|
|
977
|
+
expect(verdict).toMatchObject({
|
|
978
|
+
kind: "TIMEOUT",
|
|
979
|
+
exitCode: 5,
|
|
980
|
+
reason: { kind: "checks-unreported" },
|
|
981
|
+
});
|
|
982
|
+
}
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
it("confirms each PR of a stack on its own sightings", async () => {
|
|
986
|
+
const clock = ticking();
|
|
987
|
+
const emitted: ProgressVerdict[] = [];
|
|
988
|
+
const verdict = await runSimple({
|
|
989
|
+
dependencies: dependencies(
|
|
990
|
+
fakeReader({ ...noChecks, facts: { reviewDecision: null } }),
|
|
991
|
+
clock,
|
|
992
|
+
emitted,
|
|
993
|
+
),
|
|
994
|
+
contexts: [context(30), context(31)],
|
|
995
|
+
mode: "stack",
|
|
996
|
+
statusOnly: false,
|
|
997
|
+
options,
|
|
998
|
+
});
|
|
999
|
+
expect(kinds(emitted)).toEqual([
|
|
1000
|
+
...sixPolls("STATUS", "WAITING:checks-unreported"),
|
|
1001
|
+
"STATUS",
|
|
1002
|
+
]);
|
|
1003
|
+
expect(clock.now()).toBe(60);
|
|
1004
|
+
expect(verdict).toMatchObject({
|
|
1005
|
+
kind: "READY",
|
|
1006
|
+
scope: {
|
|
1007
|
+
kind: "stack",
|
|
1008
|
+
prs: [
|
|
1009
|
+
{ context: context(30), proof: { ci: { kind: "ci-none" } } },
|
|
1010
|
+
{ context: context(31), proof: { ci: { kind: "ci-none" } } },
|
|
1011
|
+
],
|
|
1012
|
+
},
|
|
1013
|
+
});
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
it("holds a queued frontier for the 60 seconds before reporting it blocker-free", async () => {
|
|
1017
|
+
const emitted: ProgressVerdict[] = [];
|
|
1018
|
+
const emittedAt: number[] = [];
|
|
1019
|
+
const clock = ticking(() => {
|
|
1020
|
+
if (clock.now() > 60) throw new Error("stop after the confirmation");
|
|
1021
|
+
});
|
|
1022
|
+
const queued = dependencies(
|
|
1023
|
+
fakeReader({ ...noChecks, facts: { reviewDecision: null } }),
|
|
1024
|
+
clock,
|
|
1025
|
+
emitted,
|
|
1026
|
+
);
|
|
1027
|
+
const running = runQueued({
|
|
1028
|
+
dependencies: {
|
|
1029
|
+
...queued,
|
|
1030
|
+
emit(verdict) {
|
|
1031
|
+
emittedAt.push(clock.now());
|
|
1032
|
+
queued.emit(verdict);
|
|
1033
|
+
},
|
|
1034
|
+
},
|
|
1035
|
+
contexts: [context(30)],
|
|
1036
|
+
options,
|
|
1037
|
+
});
|
|
1038
|
+
await expect(running).rejects.toThrow("stop after the confirmation");
|
|
1039
|
+
expect(kinds(emitted)).toEqual([
|
|
1040
|
+
"QUEUE",
|
|
1041
|
+
"STATUS",
|
|
1042
|
+
"WAITING:checks-unreported",
|
|
1043
|
+
"WAITING:merge-queue",
|
|
1044
|
+
]);
|
|
1045
|
+
expect(emittedAt).toEqual([0, 0, 0, 60]);
|
|
1046
|
+
});
|
|
1047
|
+
|
|
1048
|
+
it("still stops on conflicts, review threads, and merge gates", async () => {
|
|
1049
|
+
const thread = {
|
|
1050
|
+
id: "thread",
|
|
1051
|
+
firstComment: null,
|
|
1052
|
+
isBugbot: false,
|
|
1053
|
+
bugbotReviewPasses: 0,
|
|
1054
|
+
};
|
|
1055
|
+
const cases = [
|
|
1056
|
+
[{ facts: { mergeable: "CONFLICTING" } }, { kind: "merge-conflicts" }],
|
|
1057
|
+
[{ threads: [thread] }, { kind: "review-threads" }],
|
|
1058
|
+
[
|
|
1059
|
+
{ facts: { reviewDecision: "REVIEW_REQUIRED" } },
|
|
1060
|
+
{ kind: "merge-gate", reason: "review-required" },
|
|
1061
|
+
],
|
|
1062
|
+
[
|
|
1063
|
+
{ facts: { mergeStateStatus: "BLOCKED" } },
|
|
1064
|
+
{ kind: "merge-gate", reason: "merge-blocked" },
|
|
1065
|
+
],
|
|
1066
|
+
[{ facts: { isDraft: true } }, { kind: "merge-gate", reason: "draft-pr" }],
|
|
1067
|
+
] as const;
|
|
1068
|
+
for (const [overrides, blocker] of cases)
|
|
1069
|
+
expect(classifyPr(await read(overrides))).toMatchObject({
|
|
1070
|
+
kind: "blocker",
|
|
1071
|
+
blocker,
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
|
|
1075
|
+
it("fails closed while the head may not have reported yet", async () => {
|
|
1076
|
+
const unsettled = [
|
|
1077
|
+
{
|
|
1078
|
+
commitRollups: [
|
|
1079
|
+
{ oid: "earlier", state: "SUCCESS" },
|
|
1080
|
+
{ oid: "head", state: null },
|
|
1081
|
+
],
|
|
1082
|
+
},
|
|
1083
|
+
{ commitRollups: [{ oid: "head", state: "PENDING" }] },
|
|
1084
|
+
] as const;
|
|
1085
|
+
for (const overrides of unsettled)
|
|
1086
|
+
await expect(read(overrides)).rejects.toMatchObject({
|
|
1087
|
+
failure: { kind: "checks-unavailable", retryable: true },
|
|
1088
|
+
});
|
|
1089
|
+
});
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
describe("polling deadline sleeps", () => {
|
|
1093
|
+
for (const mode of ["single", "queued-stack", "query-retry"] as const) {
|
|
1094
|
+
it(`caps ${mode} sleeps at the configured deadline`, async () => {
|
|
1095
|
+
let now = 0;
|
|
1096
|
+
const sleeps: number[] = [];
|
|
1097
|
+
const pending = fakeReader({ fastPath: { kind: "checks", checks: [pendingCheck()] } });
|
|
1098
|
+
const reader = mode === "query-retry"
|
|
1099
|
+
? { ...pending, async pullRequest(): Promise<PullRequestFacts> {
|
|
1100
|
+
throw new WatcherQueryError({ kind: "command-exit", retryable: true, code: 1, detail: "temporary failure" });
|
|
1101
|
+
} }
|
|
1102
|
+
: pending;
|
|
1103
|
+
const polling = { ...options, interval: 60, timeout: 5 };
|
|
1104
|
+
const dependencies = {
|
|
1105
|
+
reader,
|
|
1106
|
+
deadline: new WatchDeadline(polling.timeout, () => now),
|
|
1107
|
+
clock: {
|
|
1108
|
+
now: () => now,
|
|
1109
|
+
observedAt: () => "2026-07-26T00:00:00.000Z",
|
|
1110
|
+
async sleep(seconds: number) { sleeps.push(seconds); now += seconds; },
|
|
1111
|
+
},
|
|
1112
|
+
emit() {},
|
|
1113
|
+
};
|
|
1114
|
+
const result = mode === "queued-stack"
|
|
1115
|
+
? await runQueued({ dependencies, contexts: [context(1)], options: polling })
|
|
1116
|
+
: await runSimple({ dependencies, contexts: [context(1)], mode: "single", statusOnly: false, options: polling });
|
|
1117
|
+
expect(result.kind).toBe("TIMEOUT");
|
|
1118
|
+
expect(sleeps).toEqual([5]);
|
|
1119
|
+
expect(now).toBe(5);
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
it("preserves the polling interval when the deadline is disabled", async () => {
|
|
1123
|
+
let now = 0;
|
|
1124
|
+
let reads = 0;
|
|
1125
|
+
const sleeps: number[] = [];
|
|
1126
|
+
const pending = fakeReader({ fastPath: { kind: "checks", checks: [pendingCheck()] } });
|
|
1127
|
+
const passed = fakeReader({ fastPath: { kind: "checks", checks: [passingCheck()] } });
|
|
1128
|
+
const result = await runSimple({
|
|
1129
|
+
dependencies: {
|
|
1130
|
+
reader: {
|
|
1131
|
+
...pending,
|
|
1132
|
+
async checksFastPath(pr) {
|
|
1133
|
+
reads += 1;
|
|
1134
|
+
return reads === 1 ? pending.checksFastPath(pr) : passed.checksFastPath(pr);
|
|
1135
|
+
},
|
|
1136
|
+
},
|
|
1137
|
+
deadline: new WatchDeadline(0, () => now),
|
|
1138
|
+
clock: {
|
|
1139
|
+
now: () => now,
|
|
1140
|
+
observedAt: () => "2026-07-26T00:00:00.000Z",
|
|
1141
|
+
async sleep(seconds) { sleeps.push(seconds); now += seconds; },
|
|
1142
|
+
},
|
|
1143
|
+
emit() {},
|
|
1144
|
+
},
|
|
1145
|
+
contexts: [context(1)], mode: "single", statusOnly: false,
|
|
1146
|
+
options: { ...options, interval: 60, timeout: 0 },
|
|
1147
|
+
});
|
|
1148
|
+
expect(result.kind).toBe("READY");
|
|
1149
|
+
expect(sleeps).toEqual([60]);
|
|
1150
|
+
});
|
|
1151
|
+
});
|