Repository navigation
fix(bin): clean up leftover Herdr tabs and retire stale journals - #5951
mehulbhagwani wants to merge 17 commits into
Conversation
[Medium impact] The PR appears safe to merge on the reviewed changes. Reviews (9) · Last reviewed commit: "no-mistakes(document): Correct Herdr cle..." · Reviewed by Greptile |
017d7a3 to
85dc045
Compare
85dc045 to
e7f75a6
Compare
e7f75a6 to
c20fc6f
Compare
c20fc6f to
5ed05ad
Compare
5ed05ad to
83db008
Compare
|
CI note on head |
83db008 to
4b7d8c8
Compare
|
Updated isolated-lab evidence for this PR at head The real Herdr 0.9.4/protocol 22 named-lab run passed stale-pane cleanup, exact focus preservation, idempotence, anchor-pane preservation, and journal retirement. The portable behavior suite also passes the bound-v2 close, unbound-v1 preservation, active/focused preservation, and focus-race guard cases. The four empty-projected-tab live cases are explicitly inconclusive: Herdr removes the tab and workspace immediately when the last pane closes, so that state cannot be constructed on this installed runtime. I am not claiming those cases were live-validated. Please review this hybrid evidence and accept the runtime limitation, or specify a supported Herdr fixture/version for the remaining live cases. |
|
Validation evidence for this re-raise:
Kun, please accept this evidence and triage the PR with the explicit live-validation limitation above. |
|
Speaking as Kun's firstmate: thanks @mehulbhagwani, and thanks for being straightforward about which cases were and weren't live-validated. What I checked at head
Before it goes to him, the live evidence needs to show the behavior you're adding. All four empty-tab scenarios are untested live, and your Herdr 0.9.4 lab shows Herdr removing the tab and workspace when the last pane closes, so the empty-tab state may not arise on current Herdr at all. Since #5945 was observed on Herdr 0.9.1, could you try the bound-v2 close, unbound-v1 preservation and focused-tab preservation cases in an isolated 0.9.1 lab and post the transcripts, or re-raise through This is waiting on you for that evidence. Once it's in, I'll take it to Kun for the default-behavior decision. |
4b7d8c8 to
9fced18
Compare
|
Speaking as Kun's firstmate: thanks @mehulbhagwani for bringing this up to date with main and for being clear again about which cases were live-tested. What I checked on head Contract class (my own read): still new-default. Default session-start cleanup can now close an exact, bound, empty projected tab. Main's docs leave that shape to manual cleanup, so merging is Kun's call, not an auto-merge. This is waiting on you. Two things:
FYI, not something you need to act on: #8420 restructures the same cleanup functions in |
…nd corrected the focus-switch fixtures. Executable regressions reproduced the bug and now pass; focused lint and documentation checks pass. Live empty-tab verification remains unavailable on Herdr 0.9.5. The PR-body update for kunchenguid#5951 remains with the outer executor because the requested exact line was omitted
A version-1 journal has no binding, and a failed binding publish can leave a later journal without one. Matching by title/token alone must not close another empty tab. Document that Herdr may remove a workspace only as the side effect of closing its last empty tab, never via workspace close.
State the product side effect plainly while keeping the rule that cleanup never closes a workspace that still has another tab.
…storation fix. Switched-during-close regressions fail on unfixed code and pass with the fix. Cleanup tests, fast lint, and documentation checks pass. Live empty-tab verification remains unavailable with installed Herdr
…nd corrected the focus-switch fixtures. Executable regressions reproduced the bug and now pass; focused lint and documentation checks pass. Live empty-tab verification remains unavailable on Herdr 0.9.5. The PR-body update for kunchenguid#5951 remains with the outer executor because the requested exact line was omitted
41c7737 to
ccd71e6
Compare
|
Speaking as Kun's firstmate: thanks @mehulbhagwani, the new head What I checked on Contract class (my own read): still new-default. Default session-start cleanup can now close an exact, bound, empty projected tab, so merging is Kun's call, not an auto-merge. This is still waiting on you for one small thing: the PR body doesn't have FYI, no action needed: #8420 touches the same cleanup functions, so whichever lands second will conflict. That conflict is ours to fix on a merge word. |
|
|
|
Speaking as Kun's firstmate: thanks @mehulbhagwani. Contract class: new-default (default session-start cleanup can now close an exact, bound, empty projected tab). This pass's |
|
Speaking as Kun's firstmate: head |
|
Speaking as Kun's firstmate: the Full suite passed on |
Closes #5945
Intent
Remove empty Herdr task tabs without closing a focused tab or issuing an extra focus change. Retire the cleanup journal once the exact tab is confirmed gone.
What Changed
Risk Assessment
Testing
Focused regressions passed, and pre-fix reproduction failed as expected. Live cleanup, focus preservation, ownership guards, and busy-pane protection passed; empty-tab scenarios remain unverified on Herdr 0.9.5. All labs were removed with fleet protection checks passing. Evidence contains CLI/API transcripts; no GUI screenshot was captured from the headless/PTY lab.
Evidence: Live cleanup transcript
Source: Live cleanup transcript
Evidence: Live cleanup results and empty-tab reproduction attempts
Source: Live cleanup results and empty-tab reproduction attempts
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed ✅
bin/fm-herdr-session-cleanup.sh:294- Deletion proof can still be lost: the close helper confirms tab_not_found, focus restoration fails, then this second presence read returns unknown. The journal survives permanently because later sweeps enumerate only live workspaces. Carry the helper's confirmed deletion result through to retirement instead of discarding it after a subsequent unreadable response.bin/backends/herdr.sh:2252- A successful close clears restore_from, disabling the focus-switch guard. If focus starts at w1:t1 and the user selects w1:t2 during close or restoration, cleanup forces focus back to w1:t1. Preserve the expected-current-focus guard for successful closes too; successful deletion does not establish ownership of a newer focus selection.bin/backends/herdr.sh:2217- Simplification: the active-target/no-viewer fallback and skip_restore mode exceed the required nonfocused empty-tab cleanup. Both candidate selection and immediate revalidation already reject focused targets. Remove this fallback and preserve the candidate if it becomes focused before closure; no stated requirement needs a separate mode for closing focused empty tabs.🔧 Fix applied.
✅ Re-checked - no issues remain.
bash tests/fm-herdr-session-cleanup.test.shbash -x tests/fm-herdr-session-cleanup-e2e.test.shpython3 ~/.no-mistakes/evidence/01M7A38YPG1BM3MH9YEZC0FDGJ/live-cleanup-check.pyRan the current focused regression against cleanup from commit4c544daein a disposable fixture; it failed specifically because the confirmed-deleted tab retained its journal.Usedbin/fm-herdr-lab.shfor provisioning, viewer attachment, real API operations, last-pane close/move reproduction attempts, and teardown.git status --shortand transient-directory inspection confirmed no remaining worktree changes.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.