Repository navigation
feat(bin): add session-end, asks and active-minutes - #35
Merged
Merged
Conversation
session-end <pause|move|close> runs the mechanical half of every thread ending: a read-only git snapshot, branch-gc --apply for the current repo and each --repo (one detached, deadline-bounded worker, only the repos the pre-compact hook manages), the memory index rebuild, verify-ops when the thread named harness files, and on close a list of what the thread created. It never commits, pushes, compacts, settles or removes scratch. session-end finish advances last-closeout only after a completed receipt, and after a close moves the thread's billing stamp files into a fresh reaped/ directory by rename, beside a reaped.meta. Claude sessions, Linux, main thread only: git-guard.sh blocks a run other than --dry-run from a helper agent. asks is the per-thread register of open asks for the box's owner. active-minutes measures working minutes from a session transcript, with --time-tool and --zone. memory-index gains --pool-for. Tests: session-end-test.py (recording stubs, sandbox guard, listed in OPS_SANDBOX_SUITES), asks-test.py, active-minutes-test.py (standard library), memory-index-test.sh, guard-selftest.sh probes. Docs: bin/README.md, DEPLOYMENT.md, CHANGELOG.md.
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.
What this adds
Three commands for the end of a thread, so the steps stop living in skill prose.
bin/session-end <pause|move|close>: the mechanical half of every ending. It takes a read-only git snapshot, startsbranch-gc --applyfor the current repo and each--repo(one detached worker with a deadline, and only the repos the pre-compact hook manages), rebuilds the memory index of the existing pool, runsverify-ops.sh --quietwhen the thread named harness files, lists what the thread created on a close, and prints what is left for the agent to judge. It never commits, pushes, compacts, settles or removes scratch.bin/session-end finish [--logged N | --declined REASON]: run after the agent has saved its lessons and written the resume note. It advanceslast-closeoutonly when the last receipt completed. After a close it moves the thread's billing stamp files into a freshreaped/directory by rename, beside areaped.meta; nothing is copied or deleted.bin/asks: a per-thread register of open asks for the box's owner.bin/active-minutes: working minutes from a session transcript, with--time-tooland--zone.bin/memory-index --pool-for: prints the existing pool the digest would use and creates nothing.Limits, stated
hooks/git-guard.shblocks asession-endrun other than--dry-runfrom a helper agent, and the command refuses a T3 delegated lane. The guard reads command text, so a wrapper script is not seen.finishdoes not archive a billing stamp.active-minutesreads one ticketing tool's input shape for its time-entry check;--time-toolmoves only the name match.SKILLS/still describe the manual steps; they change in a separate pull request.Tests
session-end-test.py: every tool it calls is a recording stub beside a copy of the script, behind the sandbox guard and listed inOPS_SANDBOX_SUITES;session-endis inOPS_DESTRUCTIVE_TOOLS.asks-test.pyandactive-minutes-test.py: standard library only.memory-index-test.shandguard-selftest.shgain cases.--apply; the delegated-lane refusal removed;finisharchiving without the key check; the rename replaced by copy then unlink (a late append is lost); the guard rule disabled; lint findings failing the receipt.verify-opswith 0 fail.Review
Second-vendor review, one round on this port (after a plan review and two code rounds on the command it was ported from): integrate, with fixes applied in this commit.
askskeeps its counters after a prune and refuses to write over an unreadable register;active-minutesignores failed or ticketless time-entry creates and truncates the billing-hours display instead of rounding up; an exit 0 from the gate needs a clean summary line; the guard also handles quoted paths, comments and redirections.CHANGELOG.md,.claude-config/bin/README.mdandDEPLOYMENT.mdare updated in the same change.Models: Opus 5.5, Mythos 5.2 (premise consult), GPT-6.1 Sol (plan review, then code review, 1 round on this port); harness: Claude Code in T3.