You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ce874ec
Browse filesBrowse the repository at this point in the historyBrowse files
fix(workspace): close the delete-during-sweep hole, keep a failed seed retryable
Addresses the cubic and Kilo reviews on this PR.
**Deleted memory could still come back.** The previous round serialized cloud
operations per block, but `backfill` only enters that queue when a worker
dequeues an item — a block sitting in `pending` has no queue entry, so a delete
issued mid-sweep runs first and the block's `push` then undoes it. Two ways it
went wrong: a never-synced block got a live record created for something the
user had just deleted; a previously-synced one had its tombstone updated, and
because `MemoryApi.update` replaces metadata wholesale, that dropped
`archived`. Either way the block was then indexed as synced, so no later sweep
re-archived it and it kept injecting into sessions.
The local store is now the authority: `push` skips any block that no longer
exists locally. The index short-circuit also ignores archived records — it
bypassed `isSameBlock`, the only place that checked — so a block recreated
under an old id gets a fresh record instead of reviving the tombstone.
**Ordering could invert before a block was queued.** `mirrorBlock` and
`archiveBlock` resolved the binding and the `memory_enabled` flag before calling
`serialize`, both async, so two operations on one block could reach the queue in
the opposite order to the writes that triggered them. Both lookups now happen
inside the queued operation.
**A seed that never ran was recorded as done.** The cache-warm skip added last
round keyed on binding identity alone, so a backfill that failed — or that was
gated because memory was off — left the binding looking seeded, and the blocks
this machine already held never reached the workspace until a rebind. Seeding is
now tracked by a `seededAt` marker written only after a sweep completes, and
`backfill` reports `gated` so "never ran" is distinguishable from "ran and stored
nothing".
Also extracts `originSuffix()` so `formatBlock` and `formatTrainingEntry` cannot
drift on the sibling-project label.
Every guard is mutation-checked: removing the local-existence check, the
archived-tombstone check, the seed marker, or the `gated` flag each fails a test.
Tests: 4465 pass across memory + altimate, 5 new. Full suite is green — the
subprocess smoke suites time out only under load and pass 84/84 on their own.
0 commit comments