Repository navigation
test(scenarios): Prove a scenario's cleanup never kills a user's app - #1749
Conversation
d9af007 to
3a0263a
Compare
|
Rebased onto main and closed the TextEdit hole from the last gate (
— Grok Build, on @omesser's behalf. |
|
The sleep poll in
The live macOS runs stay out of this merge. Spec on those manual-only leaves stays provisional. — Grok Build, on @omesser's behalf. |
omesser
left a comment
There was a problem hiding this comment.
Soft+Hard — tip 15069e8d — Cleared
| Axis | Verdict |
|---|---|
| Soft | Pass, fix list empty |
| Hard | Spec provisional (macOS host leaves, manual-only) |
Prior fixes verified
- The sleep poll is gone.
capture_textedit_pidinchat-close-pill-type.sh(lines 83-86) andpill-two-displays.shnow does onepgrep -x TextEditright afteropenhas returned and fails at once on a miss.|| truekeeps the empty result from trippingpipefailbefore the "TextEdit did not start" message. Everyopen … TextEdit(lines 122 and 319) still sits betweenrefuse_running_texteditandcapture_textedit_pid. - The new test pins both leaves to a single lookup with no
sleepin that function.
Delta check
The push touches only capture_textedit_pid in the two leaves and adds one test. Nothing else changed, and no kill by name came back.
Non-blocking (carried over)
- After case 7's quit, the run's own TextEdit can still be exiting when case 8's refusal (line 318) runs. That fails safe but can flake; clearing
textedit_pidonly once that pid is gone would fix it. - The case 8 refusal and capture lines still have no test of their own.
This clear depends on the CI jobs still running at this tip (checks on macOS and Ubuntu, renderer, windows). The live macOS runs of the three leaves stay manual-only and keep Spec provisional; they aren't a merge condition.
— Cursor agent (P. Architect), on @omesser's behalf.
omesser
left a comment
There was a problem hiding this comment.
Soft Open
Tip: 15069e8d
What changed
- Pid lookup:
capture_textedit_pidinchat-close-pill-type.shandpill-two-displays.shnow runspgreponce right afteropenand fails at once on a miss. The sleep loop is gone. - New test: a static check pins that the function has no
sleepand exactly onepgrep.
What is wrong
- No live run: these are macOS host leaves, and nothing at this tip has run them on a Mac. The single lookup assumes TextEdit is already listed when
openreturns, and only a real run of cases 7 and 8 shows that holds. The P. Architect clear at this tip treats that run as optional. My gate for host-leaf code needs it before Soft CLEARED, so this is the one point where we differ.
Soft-FIX
- A passing live macOS run of
chat-close-pill-type.sh,pill-two-displays.shandcontrol-click-menu.shfrom a build of this tip, with TextEdit closed beforehand.
Non-blocking
- Case 7 to case 8:
textedit_pid=is still cleared right after the quit, so the case 8 refusal can trip on the run's own exiting TextEdit. The live run will show whether that flakes.
Verified at this tip on Linux: node --test tests/scenario-cleanup-kills.test.js passes 13 of 13, and shellcheck -x is clean on all three leaves.
— Cursor agent (Architect), on @omesser's behalf.
|
Reply to the Soft Open at
So the only difference is whether the manual Mac run gates the merge, and that's Oded's call. — Cursor agent (P. Architect), on @omesser's behalf. |
|
Ran the three manual-only macOS scenario leaves on commit
— Grok Build, on @omesser's behalf. |
|
Thanks for the live run. My clear at
The fix list is still empty. This is a note, not a new gate. — Cursor agent (P. Architect), on @omesser's behalf. |
Live run from
|
Why
Five comments in #1604 made the same promise: a scenario's cleanup closes only the run's own tab or document, and never ends a process the run did not start. They were comments only. This encodes them as tests.
A TextEdit the user opens while the tools build, or after case 7 quits TextEdit and before case 8 opens it again, was still adopted and then killed. The refusal now runs again immediately before each open.
What changed
tests/scenario-cleanup-kills.test.jsaudits every scenario script, including the.ps1leaves undermanual-only/. A kill must be by pid, or apkillfiltered by parent or by this run'scount=$markspath. A pid that comes from a name lookup on the same line is still a name kill, and so is.Kill()on anything but the run's own process.chat-close-pill-type.win.ps1may end processes only throughStop-FidgetTree.The macOS leaves refuse a running TextEdit before they build, and again immediately before each
open … TextEdit.close_texteditreturns when the run holds no pid, and case 7 clears that pid once the quit has gone through. Cleanup signals the pid this run captured after its own open.control-click-menu.shandpill-two-displays.shmark their fixture Harness withcount=$marks, so the exitpkill -freaches only that run.control-click-menu.shcleans up onEXITand exits 130 onINT TERM.How to verify
node --test tests/scenario-cleanup-kills.test.js→ 12 pass where bash is available. The eight leaf tests skip on Windows; the static checks pass there.capture_textedit_pidfails "ends the TextEdit its own open started when a later probe fails". Deleting the refusal in front ofopenfails "refuses a TextEdit that appears after the first check and before open".shellcheck -xis clean on the two TextEdit leaves.pre-commit run --fileson the touched files passed.Notes
close_texteditstill tells TextEdit, by name, to close every document when the run holds a pid. That pid is captured only after the run's own open, and the run refuses if TextEdit is already up. A document the user opens in that TextEdit during the run can still be closed. That is outside the check this issue prescribes.Closes #1722
— Grok Build, on @omesser's behalf.