Skip to content

Renaming keeps the run - #655

Merged
MerciHanrim merged 1 commit into
mainfrom
rename-keeps-run
Nov 23, 2026
Merged

MerciHanrim merged 1 commit into
mainfrom
rename-keeps-run

Conversation

@MerciHanrim

Copy link
Copy Markdown
Owner

Part of #619 (item 1 only; item 5 stays for its own scope).

What was wrong

SEMANTICS-W.md §W3 says a rename is a cosmetic edit: it does not reset the run or stale a Monte Carlo result. Measured on main 05257b3c, with the single run 3 steps in and a finished Monte Carlo result:

Rename The edit Its Undo Its Redo
a plain Parameter kept reset reset
an imported Parameter, first keystroke (label + labelAutoComposed: false) reset reset reset
an imported Parameter, later keystrokes kept — —
its data table (Manage bindings) reset reset reset

A reset sends the single run to step 0 and marks the Monte Carlo result stale, which turns its export off. Names reach neither the engine's values nor the semantic digest that checks a saved Workspace result.

The change (src/store/graphStore.ts)

One rule, RUN_KEEPING_NODE_KEYS = label, labelAutoComposed, accent, icon, used in two places:

  • updateNodeData resets the run only when a patched key is outside that set. Before, the set was label, accent, icon, so the first keystroke of an imported Parameter's rename, which also sends labelAutoComposed: false, reset it.
  • Undo / Redo: onlyDecorationDiffers leaves those keys out when it compares two snapshots' nodes. Before, it left out accent and icon and compared label.

renameDataImportTable no longer calls bump(). A table name, and the Parameter labels composed from it, are not engine input. Its commit (one Undo entry, ending "pristine") and persist (the autosave) are unchanged.

onlyAccentsDiffer (kept for its own test) compares exactly as before (accent, icon), and its test is unchanged.

No spec changes: this follows §W3.

Tests (src/store/renameKeepsRun.test.ts), written first

The fixture is an open project revision (via routeImport), an imported Parameter feeding a Source's flow, and a plain Parameter.

For each of the three renames (plain Parameter, imported Parameter, table):

  • The edit, its Undo and its Redo keep the single run's step, and the Monte Carlo result stays current. On main's code this fails for all three.
  • The rename is one Undo entry, the autosave record holds the new name, and the revision is marked changed. One Undo restores the name and the revision is unchanged again. This passes on main and after: it guards that dropping the table rename's bump() still saves it.

Also:

  • The engine's values after 3 steps and the semantic digest are the same after all three renames.
  • Control: a value change resets the run, and so do its Undo and Redo.
  • Control: a rename together with a value change resets the run.

The first version of the run-keeping test compared the step with a fixed 3, but each start of the runs adds 3 more steps, so a kept run read 6 or 9. It now compares the step with its value just before the action. The corrected tests were run again on main's code (the product change stashed): the same 3 fail. Both runs are kept as records.

Checks

  • npx tsc -b: clean.
  • npm run lint: 88 warnings, the baseline.
  • All check:* scripts: pass.
  • Unit suite: 5753 passed, 4 skipped.
  • Related e2e, one worker, no retries: e2e/data-import-refresh.spec.ts (the rename cascade) and e2e/workspace.spec.ts (a rename does not stale a result), 19 passed. They hold no screenshot comparisons.

What it touches

  • Whether a rename resets the run. The Undo / Redo rule covers any node's label, not only a Parameter's, as an edit already did.
  • What a rename writes is unchanged: the document, the Undo entry, the autosave, and an open revision's changed mark.
  • A finished Monte Carlo result keeps the Pool labels it was run with, as a plain Pool rename already did.
  • A value change, or any other engine field, resets the run as before.

A node's label and labelAutoComposed are not engine input (SEMANTICS-W.md W3). updateNodeData no longer resets the run for labelAutoComposed, renameDataImportTable no longer bumps, and Undo / Redo leave a node's label and labelAutoComposed out of the decoration check. The rename is still one Undo entry, autosaved, and marks an open revision changed. Part of #619.
@MerciHanrim MerciHanrim added the bug Something isn't working label Nov 23, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying cozy-loop-studio with  Cloudflare Pages  Cloudflare Pages

Latest commit: b67ea1a
Status: ✅  Deploy successful!
Preview URL: https://fc7d0b6a.cozy-loop-studio.pages.dev
Branch Preview URL: https://rename-keeps-run.cozy-loop-studio.pages.dev

View logs

@MerciHanrim
MerciHanrim merged commit 8e4c5b0 into main Nov 23, 2026
13 checks passed
@MerciHanrim
MerciHanrim deleted the rename-keeps-run branch November 23, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant