Skip to content

feat(bin): add session-end, asks and active-minutes - #35

Merged
Exploitacious merged 1 commit into
mainfrom
feat/session-end-tools
Nov 18, 2026
Merged

Exploitacious merged 1 commit into
mainfrom
feat/session-end-tools

Conversation

@Exploitacious

Copy link
Copy Markdown
Owner

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, starts branch-gc --apply for 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, runs verify-ops.sh --quiet when 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 advances last-closeout only when the last receipt completed. After a close it moves the thread's billing stamp files into a fresh reaped/ directory by rename, beside a reaped.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-tool and --zone.
  • bin/memory-index --pool-for: prints the existing pool the digest would use and creates nothing.

Limits, stated

  • Claude sessions only, Linux only, main thread only. hooks/git-guard.sh blocks a session-end run other than --dry-run from a helper agent, and the command refuses a T3 delegated lane. The guard reads command text, so a wrapper script is not seen.
  • Lint FAIL lines are reported as findings for the agent to sort; a lint that could not run or gave no readable summary fails the receipt.
  • Under tmux, finish does not archive a billing stamp.
  • active-minutes reads one ticketing tool's input shape for its time-entry check; --time-tool moves only the name match.
  • The skills under 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 in OPS_SANDBOX_SUITES; session-end is in OPS_DESTRUCTIVE_TOOLS.
  • asks-test.py and active-minutes-test.py: standard library only. memory-index-test.sh and guard-selftest.sh gain cases.
  • Shown failing first, by hand mutation: a repo only named in the transcript reaching branch cleanup; a repo outside the hook's managed set; a dry run passing --apply; the delegated-lane refusal removed; finish archiving 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.
  • Fresh-install smoke in a sandbox home: deploy twice, the skill mount check, verify-ops with 0 fail.
  • Private-term scan of the tree, the commit message and this title and body: 0 blocking hits.

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. asks keeps its counters after a prune and refuses to write over an unreadable register; active-minutes ignores 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.md and DEPLOYMENT.md are 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.

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.
@Exploitacious
Exploitacious merged commit 02d11a6 into main Nov 18, 2026
8 checks passed
@Exploitacious
Exploitacious deleted the feat/session-end-tools branch November 18, 2026 01:41
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