Skip to content

fix(statechart): restore the upstream skill byte for byte - #29

Merged
Jrecos merged 3 commits into
mainfrom
fix/statechart-upstream-parity
Nov 1, 2026
Merged

Jrecos merged 3 commits into
mainfrom
fix/statechart-upstream-parity

Conversation

@Jrecos

@Jrecos Jrecos commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Why

/statechart should match Lauren Tan's P Stack 0.15.36 skill and work the way the original does. Our port changed five upstream statechart files, so the skill no longer matched its source. This PR restores them byte for byte.

What changed

  • SKILL.md, scripts/run.ts, and three test files match cursor/plugins at 1ba91fc again. The skills/statechart tree hash is a79a48c on this branch and at the pinned upstream commit.
  • Root tsc skips skills/statechart/scripts, which keeps upstream's own tsconfig.json. The statechart adaptation records and verification classes are removed, and the digest is repinned.
  • The render test installs pele, mermaid, and jsdom itself, as upstream does, so the root no longer pins them.

Scope

  • Covers the statechart skill tree and the gate entries that supported its adaptations.
  • Leaves the statechart wording adaptations in docs/guide/06-verify-and-ship.md and create-formal-verification-skill, because those files carry other OMP changes.
  • Root tsc no longer typechecks the statechart scripts. The upstream bytes fail strict root tsc in run.ts and cli.test.ts, and upstream does not run a typecheck on them. The Node suite still covers them.
  • Supersedes fix(statechart): stop when no TLC toolchain is set up #28.

Blast Radius

Only /statechart and the root test command change. The skill needs mise on PATH by default, as upstream does. The render tests now need npm and network access.

Verification

  • With TLA2TOOLS and JAVA unset, mise installed Temurin 25 and TLC 1.7.4, and the skill checked a model with exit 0. A headless OMP run of the restored skill modeled src/runner.ts, ran TLC, and rendered a Pele SVG with no manual Java search or download.
  • bun run test passes: 471 Bun tests, then 267 Node tests with 67 live TLC tests skipped. With mise's TLC and Java exported, the Node suite runs 367 of 367 with none skipped.
  • bun run typecheck and bun run check:content pass. The proofs were regenerated on the pinned 18.10.2 SDK CLI. Two independent reviews confirmed the README claims.

The port changed five upstream statechart files: the SKILL.md wording,
a type annotation in run.ts, async wrappers in cli.test.ts, 101 lines of
pipeline tests, and the render test's npm setup. Restore all five to the
cursor/plugins 0.15.36 bytes so the skill works as the original does.

Root tsc now skips skills/statechart/scripts, which keeps upstream's own
tsconfig.json. The four statechart verification classes and their
adaptation records are gone, and the inventory digest is repinned. The
render test installs pele, mermaid, and jsdom itself, so the root no
longer pins them. Proofs are regenerated for the changed lockfile.
@Jrecos

Jrecos commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Verdict: PASS+NOTES

Head f713a84 against base f59b85d. Verified independently in detached worktrees under /tmp, both installed with bun install --frozen-lockfile.

  1. Parity. PASS. 1ba91fc25c0977741dd0e267849e6234b037ed0a:pstack/skills/statechart and f713a84:skills/statechart are both a79a48c6970be3b63d6efefb0a306b7c87de88d0. Base is 379151a1d362d24f007fb67ea310ddd446d92145. All 407 files in the tree match upstream blob for blob, with nothing missing and nothing extra.

  2. Gates on head. PASS. bun run typecheck exit 0. bun run check:content exit 0, reporting 1138 inventory files, 59 expected skills, 2 agents, 23 playbooks, and digest b4fd2075c895258d2387583ef69e3c2ec95259717f485183f1fb070eccf4392f.

  3. Real surface. PASS. A hand-written spec, a counter 0..3 with invariant n < 3, run with TLA2TOOLS and JAVA unset so the skill's own mise lookup provisioned TLC 1.7.4 and Temurin 25. Head exits 1, its report names "Inv breaks" with the path 0, 1, 2, 3, and it writes chart.mmd. A holding spec, counter 0..2 with the same invariant, exits 0 and reports "Rules that hold" for Inv. Base gives the same two verdicts with byte-identical report.md and chart.mmd. A malformed config exits 2, matching the documented contract.

  4. Statechart Node suite on head. PASS. With TLA2TOOLS and JAVA from mise the suite ran 367 tests, 367 pass, 0 fail, 0 skipped, exit 0, in 262s. Re-run without those variables it ran 334 tests, 267 pass, 0 fail, 67 skipped, exit 0.

  5. PR body against these runs. PASS+NOTES. The tree hash, the five restored statechart files, the 367 of 367 figure, the 267 pass and 67 skipped figure, the 471 Bun tests observed as 471 pass and 0 fail, the two gate exit codes, and the render test installing pele, mermaid and jsdom at test time all hold. One sentence does not, below.

NOTE. The body says the statechart's own tsconfig.json needs @types/node "which the root does not install". @types/node@26.4.1 is installed at the root by the frozen install, as a dependency of bun-types@1.3.14, and tsc -p skills/statechart/scripts/tsconfig.json resolves node types and fails on 4 semantic errors instead. The exclude is load-bearing for a different reason, those 4 errors. Re-running root tsc with exclude: [] and the full skills/**/*.ts include exits 1 at run.ts:455 and run.ts:471, where the restored exitClass widens to number, and at cli.test.ts:430 and cli.test.ts:453, where the restored callbacks do not match TestFn. The exclusion is the right call. Only the stated reason is wrong.

NOTE. No gate in this repo typechecks the statechart scripts now. The Node suite covers them behaviorally and the body states that upstream does not typecheck them either, so this is a deliberate trade. Flagged for whoever owns the subtree next.

@Jrecos
Jrecos merged commit 7b25290 into main Nov 1, 2026
3 checks passed
@Jrecos
Jrecos deleted the fix/statechart-upstream-parity branch November 1, 2026 06:54
github-actions Bot added a commit that referenced this pull request Nov 1, 2026
Cut from the merge of pull request #29 "fix(statechart): restore the upstream skill byte for byte" (7b25290).
Snapshots main at release time, so it can carry changes merged after that pull request.
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