Repository navigation
feat(reaper): judge an idle session's claims by the delivery oracle; end only on the oracle's own may-end line - #108
Merged
Conversation
…cle (refs stima-api #6315, EL-SESSION-AUTO-CLOSE-LOOP-2694) Ended claims no longer keep a session; owed ones keep it as owed-step and are marked stalled when overdue; unknown ones keep it as issue-unknown. Briefs are cached 10 minutes.
…udge the claimant against live sessions (refs stima-api #6315) The phrase "the session may end" matched anywhere in a brief, so check-by text from an issue comment could end an owed claim. ended now needs a wait header and the owner line as the brief's last line. A claimant counts as another session only when it is another live session; this session's sid or an owned worktree marker is owed, anything else unknown. The oracle call passes --repo.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For theQuert/stima-api EL-SESSION-AUTO-CLOSE-LOOP-2694 (refs stima-api #6315).
An idle session whose only reason to stay was an open claimed issue is now judged by the stima-api delivery oracle (
delivery_state.py N --brief --repo <repo>, cached 10 min) instead of by "the issue is open":ended: the header isclosed; or the header is-> waitand the brief's last line is the oracle's ownowner: … wakes it; no watcher needed, and the session may end; or the claimant is another live session.owed: the claimant is this session's sid or a worktree marker it owns (survives/clear), or an agent step is owed (stalled when its check-by is overdue). Kept.unknown(kept): oracle failure, timeout, unparseable brief, foreign repo, an unknown claimant.Non-idle sessions keep the old path. All other gates in
decide()are unchanged.Review: Opus, two rounds. Round 1 found P1 (free check-by text containing "the session may end" classified an owed claim as ended), P2 (claimant sid after
/clear), P3 (--repo). Round 2 on fcd77bd: all closed, MERGEABLE.Tests:
python3 tests/session-reaper.py88 OK (was 66 before this branch). Contract fixtures from realbrief()output intests/fixtures/delivery-state-briefs.json; a mutation back to the substring match fails 7 tests.Preview (APPLY=0, HOME redirected) before the repair: 9 sessions, 0 would close.
Open question, recorded not blocking: when a claimant is reaped at a
-> waitstep, the oracle namestech.stima.stranded-step-dispatcheras the owner that wakes the step, which is the premise of "may end".