Repository navigation
sync: keep an unpublished export instead of sealing it again every pass - #2544
Merged
Merged
Conversation
A relay that refuses every put (hosted 403 "storage_off") left a chat's frames in its outbox, and the background share pass retried the chat each minute. furrow's export seals every object the ledger lacks and rewrites the frames afresh, whatever the outbox already holds, so each retry re-encrypted, hashed and rewrote the whole chat: 470 MB per chat per minute for every chat whose folder was the factory's repository, and a laptop at 400% CPU. SyncEngine.Export now leaves kept-export.json beside the frames and answers it while the head, keys, ledger size, frame size and every frame file are unchanged. A moved head exports again and deletes the frames only the older export named, so an outbox no longer grows by a whole chat per turn.
AbirAbbas
added a commit
that referenced
this pull request
Nov 9, 2026
Brings in #2544 (an unpublished sync export is kept rather than sealed again every pass) and #2545 (idle job chats and an unchanged vault cost nothing per look). #2545 and this branch's engine rounds each fixed the person-Stop watch's per-look cost, in two different ways. The branch's kept implementation remembers the answer against the job document it came from and never keys a conversation that manages no job on the floor folder, whose time moves with every heartbeat file renamed into it; #2545's manager index was rebuilt on exactly that folder time, so a churning floor rebuilt it every few seconds. The branch's version passes #2545's own tests (TestAnIdleManagerWatchReadsNoJobs, TestTheManagerWatchSeesEveryChange) as well as its own, so factory_manager_index.go, which nothing calls any more, is not carried. Store.readDocument becomes a method so #2545's read counter reaches it, PERF.md describes the one mechanism, and the #2545 change entry no longer claims the index. The vault change is kept as is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
AbirAbbas
pushed a commit
that referenced
this pull request
Nov 9, 2026
…an AgentField node (#2478) General intake (inbox, Jira, the routing table with an AI filter and priority order), the factory as an AgentField node whose triggers are its intake, AgentField runs as factory steps, named pipelines and a pipeline library, the engine idle-cost rounds, codeaf --events/--steer for watched harness runs, and app/v3 (#2524 go-aheads, #2505 Claude Code, #2544, #2545) merged in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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 was wrong
On the owner's Mac (engine fb3ddf1)
codeaf appsat at ~400% CPU andfurrowat ~88%. The relay answers every frame put with403 "storage_off"(WorkAFengine.log). The background share pass (syncsetup.PublishLocalChats) retries each unshared chat on a backoff capped at one minute. Each attempt callsSyncEngine.Export, and furrow's export seals every object the ledger lacks and rewrites every frame. It does this even when the same frames are already sitting in the outbox. A frame leaves the outbox only when it is published, so every refused retry re-encrypted, hashed and rewrote the whole chat. For the chats whose engine-tree isfactory/repos/Agent-Field/CodeAF, that was 60 frames / 470 MB per chat per attempt.The fix
SyncEngine.Exportwriteskept-export.jsonbeside the frames. It reuses that note, without asking the engine, while all of these are unchanged:Anything that could make the note wrong breaks it: a publish, a ledger record, a new turn or a key rotation. When the head moves, the next export seals again and deletes the frames that only the older export named. Before this, those frames stayed in the outbox forever.
Proof
TestARefusedUploadIsNotSealedAgainOnTheNextPassuses the realcellstore.SyncEngineandPublisher.Uploadagainst a stub furrow and a relay that refuses every put. Over 5 passes on one head:TestANewTurnReplacesTheWaitingFrames: the outbox held 5 frames on base and holds 3 with the fix (only the newest export's frames).TestAPublishOrARecordEndsTheReuse: a publish forces a fresh export, and an unchanged pass reuses the note.TestARepeatedExportKeepsTheWaitingFramesRealEngine(-tags engine, real furrow 0.3.6): on base a repeated export rewrote 13 of 13 frame files; with the fix it rewrites 0.Not addressed here
storage_off. It is not inblobstore's wire table, so it is retried every ≤1 min indefinitely. Each retry still reads the waiting frames to ask the relay what it holds (skipHeld), and puts one 8 MB frame. That is I/O, not sealing. The fix is to add it as a halting refusal, once the relay's meaning of it is known.🤖 Generated with Claude Code