Repository navigation
Conversation
Pages.blocks and Pages.titles were plain objects keyed by a typed title, so `toString` or `__proto__` hit what every object inherits (#62) and every reader needed an Object.hasOwn guard. They are Maps now, like Pages.properties already was, and the guards are gone. The state only ever crosses a structured clone or stays in memory as a checkpoint, and a Map survives both; nothing serializes it to JSON. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #146.
Pages.blocksandPages.titlesare nowMaps, likePages.propertiesalready was. A title is whatever was typed, so as a plain-object keytoStringor__proto__collided with inherited properties (#62), and every reader needed anObject.hasOwnguard. WithMapthose guards are gone.Changes
blocks.ts:Pagestype,blocksOn,titleOf,spell(copies once, on the first new name; same map back when nothing is new),find,onBlock,reduce'sblock.created,predict.pages.ts:pagesFold.initial,getPages,getReferences,getPreviews,searchPages.properties.ts: thetitlesconstraint onreduceProperties.blocks.test.ts, and one app test (pages-session.test.ts) that readstate.blocksdirectly.Safety
ledger.ts), and only events are written (records.ts).Pages, never the fold state, so nothing crossing IPC changes shape.Checks
npm testacross workspaces: all pass, including theObject.prototypetitle test without the guards.npm run typecheck: clean.🤖 Generated with Claude Code