fix: make IdeaLoom list deletion actually delete, and pin its federation boundary - #5364
Merged
Conversation
b989353 added image-generation routes without re-running `npm run generate:api-docs`, so the generated catalog no longer covered them and generate-api-route-catalog.test.js has been failing on main since. Regenerated; no hand edits.
…ion boundary (#5361) `deleteList` returned `store.deleteOne(id)`, which resolves to `undefined` whether or not a record existed. The route reads that as "not found", so `DELETE /api/brain/ideas/idealoom/lists/:id` answered 404 for every list and the Brain IdeaLoom UI could never delete one — it just toasted "Failed to delete IdeaLoom list" and left the row in place. `deleteList` now probes for the record inside the same per-id write queue as the removal and returns a real boolean. The bug survived because the CRUD coverage #5336 implied was never written. This adds it: read-by-id, delete, the idempotent second delete, the malformed-id guards on all three id-addressed operations, and both 404 shapes at the route. Also adds `idealoomLists.boundary.test.js`, the missing proof that no list payload or vault sync metadata crosses the Brain federation seam. It drives the real modules over a temp data root and asserts the reconcile snapshot carries a native Brain idea but none of the list's id/prompt/note path, that the reconcile checksum is byte-identical across list writes (with a native-write bypass probe so the assertion cannot pass vacuously), that `brainSync.applyRemoteChanges` and `applyBrainSnapshot` both refuse an `idealoom-lists` payload without writing to the store, and that the memory bridge has no mapping for the type. Today those hold only structurally; #5338/#5339 are about to hang vault paths and note hashes off these records, so the guarantee needed a test rather than a comment. Closes #5361
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.
Summary
Fixes a real bug:
DELETE /api/brain/ideas/idealoom/lists/:idanswered 404 for every list, so the Brain IdeaLoom UI could never delete one — it toasted "Failed to delete IdeaLoom list" and left the row in place.deleteListreturnedstore.deleteOne(id), which resolves toundefinedwhether or not the record existed. It now probes for the record inside the same per-id write queue as the removal and returns a real boolean.Adds the CRUD coverage Add machine-local IdeaLoom list storage and validated local API #5336 implied but never wrote — read-by-id, delete, the idempotent second delete, the malformed-id guards on all three id-addressed operations, and both 404 shapes at the route. That gap is exactly why the delete bug shipped.
Adds
server/services/idealoomLists.boundary.test.js, the missing proof that no IdeaLoom list payload or vault sync metadata crosses the Brain federation seam (ADRdocs/decisions/2026-08-08-privacy-records-machine-local.md). It drives the real modules over a temp data root rather than asserting on mock calls:getBrainChecksum()is byte-identical across list create/update/settings writes, with a forced cache invalidation plus a native-write bypass probe so it cannot pass vacuously;brainSync.applyRemoteChangesandbrainReconcile.applyBrainSnapshotboth refuse anidealoom-listspayload and write nothing to the store;brainRecordToMemorycannot bridge a list.Today those guarantees hold only structurally — nothing fails if a later slice registers an IdeaLoom type in
BRAIN_ENTITY_TYPESor the bridge'sTYPE_MAP. Add explicit opt-in IdeaLoom Obsidian import and export #5338/Make IdeaLoom Obsidian sync conflict-safe and document its contract #5339 are about to hang vault paths and note content hashes off these records, so the boundary needed a test rather than a comment.Unrelated fix rolled in
The first commit regenerates
server/lib/apiRouteCatalog.generated.json.b9893531cadded image-generation routes without re-runningnpm run generate:api-docs, soscripts/generate-api-route-catalog.test.jshas been failing onmainsince — it would have reddened this PR's CI. Regenerated by the script; no hand edits.Test plan
cd server && npx vitest run services/idealoomLists.test.js services/idealoomLists.boundary.test.js routes/brain.test.js— 125 passed.deleteListchange fails the newdeletes a list and reports whether anything was removedtest withexpected undefined to be true.cd server && npm test— full suite green (the two pre-existing route-catalog failures are resolved by the first commit).Closes #5361