Commit graph

5 commits

Author SHA1 Message Date
sid
89c1400c83 feat(planctl): scripts/jj-hook.sh planctl session tracking (parent 3.0)
- planctl_start_ticks helper: Linux safe /proc/<pid>/stat parse (LastIndex ')'
  + awk field 20); macOS ps -o lstart + date epoch conversion (R6.2, R7.3)
- session-start: validate canonical-UUID session_id, append CLAUDE_SESSION_ID
  to $CLAUDE_ENV_FILE (if set), atomically write /tmp/planctl-sessions/<PPID>
  with UUID + start-stamp via mktemp + mv (R6.2, R7.1, R7.3)
- session-end: rm -f /tmp/planctl-sessions/<PPID> (idempotent) (R7.2, R7.3)
- test-jj-hooks.sh: PID file lifecycle test + non-UUID rejection test (R7.1,
  R7.2)
- Manual smoke: PID file + $CLAUDE_ENV_FILE updates verified

Parent 3.0 from dev/plans/26174-planctl-context-tokens/tasks.md
2026-04-23 18:52:52 -06:00
sid
deb87b37a9 feat(commitd): legacy cleanup, conflict detection, session inventory, configurable reap/debounce
- On startup, daemon sweeps orphaned /tmp/jj-claude-*-files from pre-daemon
  hook versions and dead-PID tracking files from all repos
- Cross-session file conflicts detected on post-edit and returned in response
  (logged as warnings, non-blocking)
- session-start now returns inventory of all other active sessions with their
  tracked files, PIDs, and ages
- Stale session reap reduced from 2h to 30min default (matches idle shutdown),
  configurable via JJ_HOOK_STALE_MIN env var
- Debounce interval configurable via JJ_HOOK_DEBOUNCE_SEC env var (default 3s,
  max 30s) — previously documented but not implemented
- handleEvent response changed from bare bool to structured JSON with ok/error/
  sessions/conflicts fields (backward compatible — ok field still present)
- 30 Go tests (up from 13): inventory, conflicts, env vars, legacy cleanup
2026-03-29 03:50:06 -06:00
sid
9fe9bf33dd fix: remove session-start auto-snapshot that clobbers in-progress work
The startup hook was auto-committing the working copy with a generic
message before sessions began. This caused file reverts during manual
repo cleanups (jj new/restore sequences) because the hook would
snapshot the transitional working copy state. Session-end still
commits tracked changes, so nothing is lost.
2026-03-23 21:17:17 -06:00
sid
cab94355fd feat: add session bookmarks, base tracking, auto-squash, and bug fixes
- Fix: set -e for manual commands (squash-wip, status, reap)
- Fix: portable mkdir lock for session-end leftover commit race condition
- Fix: ARG_MAX guard for large file lists (>500 files)
- Fix: walk up PPID chain to find long-lived ancestor process
- Fix: default mtime when stat fails (prevents arithmetic error)
- Add: wip/claude-{session} bookmark on each session commit
- Add: base revision tracking (-base file, shown in status)
- Add: JJ_HOOK_AUTO_SQUASH=1 opt-in auto-squash at session end
- Change: settings.local.json → settings.json (team-shared by default)
- Tests: 77 total (8 new for bookmarks, base, auto-squash, status, reap)
2026-03-23 04:16:01 -06:00
sid
fb1c2124c3 chore: initial jj + claude code workflow template 2026-03-21 11:30:08 -06:00