Repository navigation
related_notes: the notes around a note, from the tree's links and one search - #2197
Merged
Merged
Conversation
`ask: "neighbors"` on /gateway/tree/facts reads the note's nodeLinks rows on both sides and resolves them the way the map does: a path, else the one visible note with that file name; a bare [[name]] beside the linking note first, else the one visible note carrying it. Every path passes canSee at the reader's clearance, a seed they may not see answers what an absent one does, and the answer says it may be short when the seed's links are unread or a side passed 200 rows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
A 200-row cap whose overflow marked the answer short counted rows from notes the reader may not see, telling a team reader when many hidden notes link to a note they can. Every row is read, as candidates reads them, and `complete` depends only on the seed's own links having been read. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
…y other An unbounded read could fail at Convex's query limit only for a note many hidden notes link to, which a reader could tell from the refusal. Each side reads at most 4,000 rows and a side past that answers normally; a hub that large loses the rest of its links silently. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
…d notes like it
Reached as fetch <note> { related: true, limit } and by name. The seed is
opened by read_note itself, so a note the caller may not see is refused as an
absent one is, before the tree is asked about it. Links and backlinks come
from the tree's facts (ask: "neighbors") and are judged again by the gateway's
canSee; similar text is one search over the seed's title and headings through
searchVisibleNotes, skipped for an encrypted seed. Linked notes rank first,
then by text rank, then by path; a part that cannot answer leaves the rest
and the answer ends "may be incomplete". Meaning search is not used yet.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
…ructurally From self-review: a note mid-move was looked up at a key its link rows do not use, so its answer came back empty and called itself complete. Link rows are now read at the names the tree shows (a queued move folded in, as the map does) and any queued move marks the answer may-be-short. Path links are percent-decoded as the map decodes them. read_note hands the note it opened (path, text, encryption) to related_notes as a non-enumerable field, so a path holding U+2028 is no longer cut short by parsing the printed header. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
Marking every answer short while any move was queued told a team reader that a move was under way somewhere they cannot see, such as inside a private folder. Only a move of the seed, or of a link row whose note this reader sees at its new name, marks the answer short now. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF
This was referenced Oct 26, 2026
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.
An agent can now ask what is around a note:
fetch <note> { related: true, limit }(orrelated_notes { path, limit }by name). Each line names a note and why:linked_from_here(this note links to it),links_here(it links to this note),related_text(its text is like this note's title and headings). Linked notes rank first, then by text rank. This replaces the path-keyed link graph on thelink-graph/*branches, which no longer fit id-keyed notes.How
nodeLinksthrough a newask: "neighbors"on/gateway/tree/facts(nodeFacts.neighbors,lib/nodes/neighbors.ts). Names resolve the way the map resolves them, among visible notes only. A queued move is folded in.searchVisibleNotescall, so it reads the search database where there is one. It is skipped for an encrypted seed.read_noteitself, which now also hands the note it opened to the caller as a non-enumerable field.docs/decisions/search/workspace-map.md, "Related notes are the map's links for one note, plus one search".Privacy (each has a test and a sabotage record)
completedepends only on the seed's own links having been read and on moves among notes the reader can see; a move inside a private folder changes nothing.Known limits
Evidence (local)
apps/mcp,node test/run.mjs): all 7 entry points pass; 2174 tests, 0 failures, 7 skipped.npx vitest run): 549 files, 6873 passed, 3 skipped.pnpm architecture: 0 errors.apps/convextypecheck passes;apps/mobiletypecheck has the same 113 errors asmain(no mobile files changed).🤖 Generated with Claude Code
https://claude.ai/code/session_01GqYLoY9HLUG3EJ2xKySxMF