Repository navigation
refactor(pstack): delete statechart comments that repeat the code, and rename helpers - #779
Merged
Merged
Conversation
…d rename helpers
Deletes comments in the statechart scripts that say what a name or the code
already says. Where a comment held a fact, a name or a shared constant holds
it now:
- splitComments is splitCommentsKeepingOffsets.
- checkTlcOutput is tlcOutputWarning.
- quote is escapeMermaidQuotes.
- luminance is wcagRelativeLuminance.
- declared in parseMermaid is declaredInRegion.
- cited(from, to, above) takes { above }.
- PRIMES_OR_UNCHANGED replaces two copies of one regex, in uncitedConditions
and in the label map scaffold.
The scaffold keeps the note that it lists a definition that only another
action calls, though TLC names no step after it. Behavior does not change.
Co-authored-by: lauren <poteto@users.noreply.github.com>
caelaxie
added a commit
to pstack-ports/devin-pstack
that referenced
this pull request
Oct 23, 2026
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> synced to [`4ec7ffa`](cursor/plugins@4ec7ffa). compared `88d4751..4ec7ffa` for `pstack/`. later commits on upstream `main` through [`9b93e81`](cursor/plugins@9b93e81) do not touch `pstack/`. version is `0.15.30` in `plugin.json`, `.devin-plugin/plugin.json`, and the readme marker. ported: - [`eb4db2b`](cursor/plugins@eb4db2b) ([#741](cursor/plugins#741)) add the statechart skill. guide page 6, poteto-help, and the readme skill table match. slash commands keep the `/pstack:` prefix. `disable-model-invocation: true` stays `triggers: [user]`. - [`7698375`](cursor/plugins@7698375) ([#776](cursor/plugins#776)) six fixes to the statechart skill. scripts copied verbatim. - [`4ec7ffa`](cursor/plugins@4ec7ffa) ([#779](cursor/plugins#779)) delete statechart comments that repeat the code, and rename helpers. the version bumps to `0.15.30`. the same bump is in `.devin-plugin/plugin.json` and the readme marker, which is where this repo records the version. skipped: - `harness/pstack/claude-code/` copies in [#741](cursor/plugins#741), [#776](cursor/plugins#776), and [#779](cursor/plugins#779). this port does not carry the generated claude code tree. - [#741](cursor/plugins#741) `pstack/.cursor-plugin/plugin.json`. cursor packaging. the version bump lands in `.devin-plugin/plugin.json` instead. - [#741](cursor/plugins#741) `.github/workflows/validate-plugins.yml` test step. that workflow belongs to the cursor/plugins monorepo and also checks generated harness trees. this repo's ci is separate, so the step was not copied. `node --test skills/statechart/scripts/test/*.test.mjs` passed locally (67 tests, with tlc). harness proof (install, `devin plugins list`, exercising `/pstack:statechart` and `/pstack:poteto-mode`) will follow as a comment. the devin cli can't log in from this cloud environment. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-00f3aebc-53ad-54ad-9327-63073f2102cb?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-00f3aebc-53ad-54ad-9327-63073f2102cb&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kaitian Xie <caelaxie@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Many comments in the statechart scripts say what a name or the next line already says. This change deletes them. Where a comment held a fact that the code did not show, a name or a shared constant now holds that fact. Behavior does not change.
What changed
lib.mjs(7),statechart.mjs(5), andtlc-to-chart.mjs(2).splitCommentsissplitCommentsKeepingOffsets.checkTlcOutputistlcOutputWarning. Its callers and tests change with it.quoteisescapeMermaidQuotes.luminanceiswcagRelativeLuminance.declaredinparseMermaidisdeclaredInRegion.cited(from, to, above)takes{ above }. It has one call site.PRIMES_OR_UNCHANGEDinlib.mjsreplaces two copies of one regex: one inuncitedConditions, one in the label map scaffold. It has nogflag, so.test()keeps no state.GocallsBumplabels stepsGoand neverBump, while the scaffold listsBump.harness/pstack/claude-code/skills/statechart/is the generated copy.Differences from the source copy
A recursive diff of this copy against the source skill at the commit that landed this pass shows only the differences that #741 and #776 already have:
lib.mjs:findTlcfinds TLC only throughTLA2TOOLSandJAVA. The source also installs a repo-pinned TLC on demand. The source pass deleted two comments inside that install code, which this copy does not have.statechart.mjs: the TLC help says where to downloadtla2tools.jar.test/statechart.test.mjs: the "no TLC" message and environment, thenodehelper, and no tests for the repo-pinned install.SKILL.md: one sentence does not name the source repo's spec folder.No hunk of this pass differs. The other eight files are byte-identical.
Blast radius
Only
pstack/skills/statechart/scripts/and its generated copy change. The renamed functions have no callers outside the skill. The pstack version stays at 0.15.30. A separate PR bumps it.Verification
main. The full suite then passed 67 of 67 with nothing beside it.validate-plugins.mjs,check-pstack-docs.mjs, andgenerate-pstack-harness-trees.mjs --checkpass.