Skip to content

fix(pstack): report statechart actions that made no step - #1303

Open
JasonOA888 wants to merge 1 commit into
cursor:mainfrom
JasonOA888:fix/statechart-unfired-actions
Open

JasonOA888 wants to merge 1 commit into
cursor:mainfrom
JasonOA888:fix/statechart-unfired-actions

Conversation

@JasonOA888

Copy link
Copy Markdown

Summary

Refs #1235 (level 2: list the actions of Next that made no step). Level 1 (carrying TLC warnings into the report) is in #1254. This PR is independent of it and only touches adjacent lines in report.ts / run.ts.

A rule can be listed under "Rules that hold" when the only action that could break it never fires: a guard that is never true, a constant that disables a branch, or the UNCHANGED typo from #1235. Missing chart arrows can't show this, because the chart can merge, hide, or fall back to bug paths. With the spec from #1235, report.md now reads:

TLC reached 3 states and 3 steps. The chart draws 3 states and 2 arrows.
The chart does not draw 1 steps that stay in one chart state.

Actions that made no step: BankAccepts.

## Rules that hold
NeverPaidTwice, NoDeadlock

How

  • Verdict runs pass -coverage 0. The new frontends/coverage.ts reads TLC's next-action summaries (message 2772) and uses the generated-successor counter, so a Done self-loop counts as a step. It groups parameter instances by declaration and keys on the declaration's location, so same-named actions from different modules stay distinct; the module is printed as Mod!Name only when names collide.
  • judge() merges coverage across all verdict runs: an action counts as seen if any run generated a successor for it.
  • Coverage is complete only when a run explored every reachable state: it exited 0, or broke a temporal property under -lncheck final, and was not cut at the 100,000-state ChartBound. If no run was complete, the report adds: TLC did not explore every reachable state, so these actions may still happen beyond the explored states.
  • The line is informational. Exit codes and rule outcomes don't change, and a spec where every action steps gets no new line.

Limits (also in SKILL.md)

  • An action under an empty \E domain is never instantiated by TLC, so it is not listed.
  • TLC counts successors before applying state/action constraints.

Tests

  • New corpus cases:
  • Parser unit tests: an imported module, a parameterized action, the disjunct-location suffix, CRLF input, and malformed or missing coverage. Cross-run aggregation tests, and an extended live 100,000-state-bound test.
  • The corpus was re-recorded (STATECHART_UPDATE=1) because the verdict flags changed. Two existing report.md files change: CounterInitPast and CounterInitPastHolds now say Actions that made no step: Inc., which is correct because their constraints exclude every initial state. No chart.mmd or graph.dot changed. The other recording diffs are the coverage messages plus run metadata (seed, JVM, paths, timestamps).
  • pstack bumped to 0.15.47, and the harness trees were regenerated.

Verification (Linux, Node 24, TLC 2.19 at the pinned hash, JDK 17):

  • statechart tests with TLA2TOOLS: 431 / 431 pass
  • statechart tests without TLA2TOOLS: 322 pass, 0 fail, 73 skipped
  • node scripts/generate-pstack-harness-trees.mjs --check: up to date
  • node scripts/validate-plugins.mjs: all valid
  • node scripts/check-pstack-docs.mjs: 0 problems
  • git diff --check: clean

Not run on macOS or native Windows.

Read TLC verdict-run coverage, group action instances by declaration, and qualify unseen actions when exploration is incomplete. Add guard, warning, early-stop and bounded regression coverage. Refresh TLC recordings and generated harness trees. pstack 0.15.47.
@devin-ai-integration
devin-ai-integration Bot force-pushed the fix/statechart-unfired-actions branch from 995abc9 to ba32603 Compare November 20, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant