Repository navigation
fix(kin): land an L0 lead's shadow notes on the default branch once - #740
Open
Surajsm60720 wants to merge 2 commits into
Open
Surajsm60720 wants to merge 2 commits into
Surajsm60720 wants to merge 2 commits into
Conversation
A lead that ran at L0 before leads worked on the default branch kept its notes on kin/shadow/<agentId>, and nothing landed them, so it started from an empty index. The memory sync at start-up now lands, once per live lead, the items its shadow branch changed that the default branch lacks, through the writer's owner commit (secret scan, index rebuild). Where both changed an item the default branch's stays and the shadow branch keeps its own. A kin_memory_heads marker row records the landed shadow head, so later shadow writes stay off the default branch. Refs #12 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
People-change: A lead that ran at L0 before #155 now finds the notes it wrote then in its memory and index; the owner sees them in Memory, and a note that clashed with a newer one on main gets a recovery notice naming the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
kin/shadow/<agentId>. Nothing lands them, so when it works onmainit starts from an empty index (issue Kin: channel between lane A and lane B (messages both ways) #12).How
MemoryWriter.landShadows, run by the memory sync at start-up and every 5 minutes. For each live lead with an anchored shadow branch and no marker, it lands the shadow's changed items onmainthrough the owner commit, which runs the secret scan and rebuilds the index. It leaves out the journal and anything already onmain.mainalso changed an item since the merge base,main's version stays. The shadow branch is not touched, so it still has its own version, and a recovery notice names the path.kin_memory_headsrow (kin/shadow-landed/<agentId>) records the shadow head that was landed. It is written in the same transaction as the newmainhead, and with no migration. Later shadow writes, from chats the owner didn't place the lead in, stay offmain. The only level code involved is the existing shadow branch name.Tests
vp test run src/kin/memory/MemoryWriter.test.ts -t shadow: 6 passed. The two new cases cover three things: shadow notes land onmainand in itsINDEX.md; a second run changes nothing; and a conflict keepsmain's version while a non-conflicting note lands. Both fail on assertions whenlandShadowsdoes nothing.vp test runon MemoryWriter, Memory, lead/layer and WakeupRunner tests: 189 passed.vp run check:changed: all pass (format, lint, knip, typecheck, 10 test files).🤖 Generated with Claude Code