Skip to content

feat(ledger): pause edits another session made - #142

Merged
HT0710 merged 2 commits into
release/1.6from
feat/ledger
Oct 23, 2026
Merged

HT0710 merged 2 commits into
release/1.6from
feat/ledger

Conversation

@HT0710

@HT0710 HT0710 commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Why: sessions sharing one clone can edit the same file unaware; the built-in stale-read check misses a fresh re-read of another session's half-done work (roadmap v1.6 #1).

Changes:

  • New mod ledger: records each Edit/Write/NotebookEdit per session in a shared $.store ledger, keyed by the resolved path; the first edit of a file another live session edited in the last 30 min is denied once and that session is messaged ($.session.send); the retry passes
  • Undelivered message (other session gone) → no pause, entry taken over; entries pruned after 30 min and dropped at session end; a store failure never blocks an edit
  • Trace rows ledger.pause, ledger.record, ledger.end, ledger.failed
  • New install part ledger (Background group): parts.json, marketplace, settings.base.json, install.sh menus, install/trace tests
  • Docs: plugin README, README, GUIDE (Git and safety, What runs on its own, parts list), CONFIGURATION

Impact:

  • Full installs get the plugin on their next update; Custom installs can untick ledger
  • A message to an idle session wakes it, costing one short turn there

Action required: live clone: run ./install.sh after merge so sessions load ledger.

Not covered: edits made through Bash (sed -i, >); two sessions writing the ledger at the same moment can lose one entry (shortcut: in register.ts); a session pauses on each file only once for its whole life; agent-team teammates count as separate sessions and pause each other (unverified).

Test plan:

  • claude plugin test plugins/ledger (14 pass)
  • tsc -p plugins/ledger --noEmit (exit 0)
  • tests/*.test.sh, all 9 CI suites (0 failed)
  • Live: two tmux sessions with --plugin-dir; A wrote notes.txt, B's Edit paused, A woke and replied, B re-read and retried (alpha/beta); store empty after both exited
  • Spike: $.store reads fresh across sessions; $.session.send delivers, dead id → isDelivered:false
  • Code review (opus): ready with fixes; all 6 fixed (pause kept on undelivered send, Write through a link re-keyed, resolved path in message, deny wording, README line, recipient test)

🤖 Generated with Claude Code

HT0710 and others added 2 commits October 24, 2026 00:40
Why: two sessions sharing a clone could edit one file unaware; the
built-in stale-read check misses a fresh re-read of half-done work.

Impact: new install part `ledger` (Background group). The first
Edit/Write/NotebookEdit of a file another live session edited in the
last 30 min is denied once and that session is messaged; the retry
passes. Ledger lives in the plugin's $.store, shared by all sessions.

Verify: claude plugin test plugins/ledger (14 pass); tests/*.test.sh;
live two-session tmux run (pause, message, retry)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@HT0710
HT0710 merged commit 77c0696 into release/1.6 Oct 23, 2026
5 of 6 checks passed
@HT0710
HT0710 deleted the feat/ledger branch October 23, 2026 17:53
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