Repository navigation
fix(util): a key approval and the picker keep a write made at the same time (#861) - #894
Open
akleizor-hive[bot] wants to merge 5 commits into
Open
akleizor-hive[bot] wants to merge 5 commits into
akleizor-hive[bot] wants to merge 5 commits into
Conversation
3 tasks
…write (#299, #861) Squash of origin/hive/299-symphony at 9243c27 onto current main. The merge commit shape would replay #299's thirteen commits again under the gate's rebase and raise the same three conflicts that spent its landing retries; this lands them as one. Conflicts resolved: REVIEW.md keeps both sides, keyapproval.go keeps both imports and main's paths.IsSymlink and keyRefusedMsg, and main's `rm` confirmation now answers the new behaviour test. The changelog bullet moves from v0.5.8 to Unreleased. Co-Authored-By: Claude Code <noreply@anthropic.com>
rewriteProfileJSON holds the profile's live lock exclusively from its read to the rename, takes no lock and writes nothing when the edit changes nothing, and wraps ErrProfileInUse when a holder outlasts the bounded wait. ApproveKey's whole rewrite now runs through it; the read seam every regression test interleaves at became the helper's. Co-Authored-By: Claude Code <noreply@anthropic.com>
…ofile's live lock (#861) ProjectPicker rewrites the same two files a live session writes from the launch path. Its rewriteJSON now runs through rewriteProfileJSON, the one locked read-modify-write ApproveKey uses, so a session's own save can no longer be lost under a picker rename. With a session open the picker writes nothing and the launch goes on with the rows the files already hold; the next launch that can take the lock records them. Co-Authored-By: Claude Code <noreply@anthropic.com>
…nfig (#861) The changelog entry now names both writers the lock covers — the key approval and the picker's rows and layer — and ARCHITECTURE.md §1 says what .locks/<name>.live is and which rewrites hold it exclusively. Co-Authored-By: Claude Code <noreply@anthropic.com>
…s its rewrite (#299, #861) SeedPersonAnswers read the profile's .claude.json and edited it before taking the live lock, then renamed that snapshot: a key approval landing between the read and the rename was silently erased under it. The authoritative read and edit now run through rewriteProfileJSON, the one locked read-modify-write ApproveKey and the picker use — the unlocked read stays only to answer the no-gaps case and to report the gaps of a deferred seeding. A second-process ApproveKey met at the seeding's seam finds the profile in use and lands once the seeding ends, with both writes standing. Co-Authored-By: Claude Code <noreply@anthropic.com>
akleizor-hive
Bot
force-pushed
the
hive/861-symphony
branch
from
November 25, 2026 14:31
c27755d to
fb5beea
Compare
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
Recording a key approval and the project picker's launch-time rewrites of a
profile's
.claude.json(and the picker's settings-layer rewrite) are now onelocked read-modify-write:
rewriteProfileJSONinutil/profilejson.goholdsthe profile's live lock (
.locks/<name>.live) exclusively from its read toits rename — the lock a session holds shared for its life and the mode
SeedPersonAnswerstakes. No ccmorph session, launch, picker or secondapproval can write the file under another's rename, and no write is lost
(#299, #861).
Design points, each checked against INTENT.md and Scope and ownership:
ApproveKeyand both ofProjectPicker's rewrites(
.claude.jsonand the settings layer) go through the one helper; the seamevery regression test interleaves at (
profileJSONRead) belongs to it.common second-terminal case stays free of the
lockWait.holds the lock, the picker waits at most
lockWait, writes nothing andreturns
PickerDonewithout a word; the launch proceeds with the rows thefiles already hold, and the next launch that can take the lock writes them.
A key approval that cannot be recorded is saved (
SaveApprovalmarker) bylogin/addand recorded by the next launch before Claude Code starts; alaunch that finds a saved approval still waiting says so and starts nothing.
.claude.json.lock— another product's mechanics staywith its owner.
Commits
fix(util): a key approval holds the profile's live lock across its rewrite (#299, #861)— the squash oforigin/hive/299-symphonyat 9243c27 onto today's main (one squashed commit so the gate's rebase cannot replay the three conflicts that spent Recording a key approval rewrites the profile home's .claude.json with no lock, so a write Claude Code makes at the same time is silently lost #299's landing retries).refactor(util): one locked rewrite owns a profile's .claude.json (#861)fix(picker): the picker's .claude.json and layer rewrites take the profile's live lock (#861)docs: the live lock guards every whole-file rewrite of a profile's config (#861)Tests
go vet ./..., full Go suites under umask 077 andNO_PROXY='*', the four zsh suites and 475+ Python tests.Supersedes #345 (left open): #299 closed at its spend cap with this branch
accepted at its gate but out of landing retries; this PR replays that accepted
work onto current main and extends the same lock to the picker, per the scout
note on #861.
Closes #861
🤖 Generated with Claude Code