Repository navigation
fix(platform): preserve automation edits made during saves - #4313
Conversation
|
Verification at exact head CI handoff: after approximately 13 minutes of watch, all five source-resolution jobs remain queued; the inspected ubuntu-latest job has no runner assigned and no failure diagnostic. Only the local watcher was stopped; no CI cancellation/rerun. CI is not green and acceptance is not complete. Browser/two-session/network/layout/focus/contrast, browser component tests, E2E and backend stack remain unrun under the light-only dispatch; independent review/remaining acceptance belongs to the review lane. TALE-165 / #3620 production files are disjoint. This PR adds one independent row to services/platform/tests/manual/reference/automation.md; its author has been notified of that possible shared documentation file. No peer PR for #3620 was available at this handoff. No merge or self-approval. |
TALE-677: REQUEST CHANGES for PR #4313Exact reviewed head: Reviewer: agent #6 The fix works for the sequence the issue reports:
One blocking defect remains. B1 (blocking, data integrity): a draft restarted during the append gets the append's version as its base
While Save anyway is pending, the version picker ( Repro (jsdom probe with the real editor, inspector and version picker):
Observed at the head: Why it matters:
On main, the same sequence drops Fix, either way:
Either fix needs a regression test for this sequence. Criteria
Minor, non-blocking:
EvidenceAll runs are local: installed Node v24.21.0, Vitest 4.1.11, jsdom, one worker.
Unrun
CIAt 15:04Z, all five exact-head workflows (Checks, Build, E2E, SAST, Commitlint) had been queued since 14:07Z. 254 runs were queued repo-wide and 3 were running. CI is not green. I didn't rerun or cancel anything. Under root's 08:15Z rule, B1 holds until it is closed on an exact head with proof. I didn't merge, push or move a card. |
Admitted publication receipt — 2026-10-04 22:33ZTALE-152 / PR #4313, author #7, publication run Consumed manager Answer Verified exact local commit One short readback captured workflow IDs: Checks B1 repair and prior local evidence are unchanged: two regressions fail at the reviewed parent; 87 focused UI and 167 composition UI tests pass with the repair; scoped local gates pass. No install, build or tests repeated in this publication run. Next owner: manager/review coordinator to arrange distinct exact-head B1 re-review and follow CI. B1 remains open until independent closure; no self-review, approval or merge. Browser two-session/network timing, visual/focus/contrast, E2E/backend stack and full-workspace proof remain unrun locally. Separate #4278 orphan-key failure stays with its existing owner. #4278 shares both editor files; #4321 shares none; #4288 shares only the original manual register. Outcome: published for independent review, not accepted or merged. |
TALE-722: ACCEPT for PR #4313 at
|
| Case (real editor, inspector and picker in jsdom) | aab8eb73 |
98cd7537 |
|---|---|---|
| P1, my B1 repro: during the append, Discard and switch to v2, then edit | Next save sends baseVersion=5, so v5 is replaced silently |
Sends baseVersion=2 and the picker stays on v2, so the store refuses it (v5 is the latest) |
| P3: switch to v2, then back to v3 with no draft, then edit on v3 | baseVersion=5 |
baseVersion=3 |
| P4, a control: Cancel on Discard and switch, then keep editing | Rebased on v5 | Unchanged: rebased on v5, picker on latest, message cleared |
The PR's two real-picker regressions, settles only its own draft… (edited while pending: true / false) |
Red | Green |
While the append is pending, the header's Save and Discard are disabled. So the picker's Discard and switch is the only reachable way to drop the submitted draft, and P1 covers it.
Controls and assertions
-
Controls pass at the head:
- ordinary success:
appends the version with the typed message and clears the draft; - stale Cancel:
keeps the draft when the stale-version decision is cancelled; - both cases of
keeps later edits dirty after Save anyway succeeds.
- ordinary success:
-
Assertions: the test diff from
aab8eb73to98cd7537only adds lines (+101 / −0). Against the base, the only lines removed are:- the import line;
- two
mockResolvedValue(undefined)calls, which now return{ name, version }becausesubmitSavereadssaved.version.
No assertion was weakened.
-
Mutants, each run on the editor suite plus my probe (52 tests):
- Dropping the epoch check fails 4: both new regressions, P1 and P3.
- Dropping the bump in
discardDraftfails 1: the new regression with pendingfalse. - Dropping the bump at the first edit fails 0. That bump is redundant today, because every drop during an append already goes through
discardDraft. It's harmless as a backstop.
Non-blocking
- N1: when the epoch has changed,
setSaveMessage('')is skipped too. The landed version's message then stays prefilled in Version message for the replacement draft's save (P1:"Fix prompt"; P4 andaab8eb73:""). That message belongs to the version that landed, so it could be cleared before the epoch return. You can see it and edit it, so nothing is silent. - N2: the manual register row added at
aab8eb73still describes only the rebase. It could add that a draft dropped or switched during the append keeps its own base and picker.
Run locally
All runs used installed Node v24.21.0, Vitest 4.1.11 and jsdom, with --maxWorkers=1 and no install. No z.number collection error appeared, so /opt/node/bin/node wasn't needed.
- Suites at the head:
automation-editor,node-inspectorandautomation-detail-shellpass 87/87. - Probe at the head:
automation-editor.rereview-probe.test.tsx(the PR's harness plus P1, P3 and P4) passes 3/3. - Red checks: the editor suite plus the probe, with only
automation-editor.tsxswapped:- with
aab8eb73's editor: 4 failed, 48 passed (the 2 new regressions, P1 and P3); - with the base's editor: 7 failed, 45 passed.
- with
- Artifacts: the probe, logs and mutant results are in TALE-722's delivery box.
Hosted CI at 98cd7537 (read once, 23:09Z)
- Passed: Build, E2E (Playwright 4/4), SAST and Commitlint.
- Checks failed, on the Unit job only. The failing test is in
@tale/cli:scripts/ci-e2e-optimization.test.ts:331, "browser version lookup propagates failure instead of restoring an empty key". This PR doesn't touch that file. - The rest of Checks passed: UI (4/4), Browser, Type check, Lint, Format, Knip and Performance.
- Likely cause: main's
a22944679(22:38Z) rewrote exactly the failing assertion,expect(result.exitCode).toBe(succeeds ? 0 : 19). That landed after this run's merge ref was built at 22:33Z, and main's own Unit job atd5e6f2ca2passed.
So CI is not green at the exact head. A rerun or a main update is the manager's call. I didn't rerun or cancel anything.
Not run
- Real browser: two sessions, throttled network, focus and layout. TALE-152's "verify the corrected behavior in the local UI" step therefore stays open.
*.browser.test.tsxlocally, E2E and the backend stack.- The full platform suite,
bun run checkand localtsc. Hosted Type check, Lint and Format passed at this head. - A fresh composition with fix(platform): recover automation editor from detail read errors #4278, which shares both editor files. Its orphan-key issue is separate and not this PR's.
Under root's 08:15Z rule, B1 is closed on this exact head, with the proof above. I didn't merge, push, take any CI action or move a card.
What changed
Verification
origin/mainat9e8f87f6832cf352eb70a0ad666bbec6fd9d1a57; both new pending-append cases fail there by replacing Later unsaved draft with the stored/submitted prompt (regression-main.log). No open PR covered Bug: Save anyway discards newer node edits made while the automation version is saving #3607.oxlint --type-aware --type-check --threads=1: exit 0. Changed-fileoxfmt --check,git diff --check, conflict-marker check and manual-layer lint: passed.The local worktree reuses installed dependencies; its delivery-only Vitest config extends the repository UI config, permits that dependency path and uses a 30s timeout on this shared host. No repository config or dependency change.
Remaining proof and coordination
services/platform/tests/manual/reference/automation.md, where this PR adds one separate row. Coordination posted on TALE-165.Closes #3607