Repository navigation
feat(ledger): pause edits another session made - #142
Merged
Merged
Conversation
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>
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.
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:
ledger: records each Edit/Write/NotebookEdit per session in a shared$.storeledger, 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 passesledger.pause,ledger.record,ledger.end,ledger.failedledger(Background group):parts.json, marketplace,settings.base.json,install.shmenus, install/trace testsImpact:
ledgerAction required: live clone: run
./install.shafter merge so sessions loadledger.Not covered: edits made through Bash (
sed -i,>); two sessions writing the ledger at the same moment can lose one entry (shortcut:inregister.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)--plugin-dir; A wrotenotes.txt, B's Edit paused, A woke and replied, B re-read and retried (alpha/beta); store empty after both exited$.storereads fresh across sessions;$.session.senddelivers, dead id →isDelivered:false🤖 Generated with Claude Code