Skip to content

feat(sessions): add the session closer planner and runner - #1855

Merged
igorjs merged 2 commits into
mainfrom
feat/issue-536-s8b-closer-core
Nov 15, 2026
Merged

igorjs merged 2 commits into
mainfrom
feat/issue-536-s8b-closer-core

Conversation

@igorjs

@igorjs igorjs commented Nov 15, 2026

Copy link
Copy Markdown
Member

Summary

S8b of #536, first of three PRs for WU-10 (the closer). sessions/close.rs adds the named constants, the single report-text-to-Verdict mapping (fails closed), the Guards and AuditSink traits, plan (done sessions quiet for more than 900 s, retry after 86400 s, own session excluded) and run for the guarded worktree path: verdict, in-use check, audit row first, remove, close only when the path is gone. A refusal sets a block code and writes an audit row only when the code changes. The module is dead code until sessions sweep --apply (S9).

Notes for reviewers

  • Next PRs: S8c adds the ignored-files allowlist, shared-worktree, unmanaged, remove_failed and the store-backed set_blocked; S8d adds the branch step, no-worktree and closed-PR rows, bounds, real guards and the real-git tests. WU-10 is far over 500 lines, so it ships in parts.
  • Over the 500 line target (about 730 lines, about 330 production) because of the call-log tests.
  • Guard methods take the session row instead of the plan's argument lists; two error-text constants moved into worktree/mod.rs (same strings).
  • 5 lens reviews; fixed: a discarded guard result (removed until its PR), closing on Removal::Nothing, repeat refusals writing a second audit row, stale-row test that was really idle, circular verdict table.

Refs #536

close.rs plans which finished sessions to close and runs the guarded worktree
path on fakes: the typed verdict from the worktree report texts, the in-use
check, an audit row before the removal, and a close only when the worktree
path is gone. A refusal stores a block code, retries after a day, and writes
an audit row only when the code changes. Nothing calls it yet.

Refs #536

Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
@igorjs
igorjs enabled auto-merge November 15, 2026 10:45
Signed-off-by: igorjs <2278164+igorjs@users.noreply.github.com>
@igorjs
igorjs added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 68d1970 Nov 15, 2026
30 checks passed
@igorjs
igorjs deleted the feat/issue-536-s8b-closer-core branch November 15, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant