Frontmatter
| id | 9439 |
| title | TreeStore: Apply "Anchor & Echo" JSDoc strategy for AI discoverability |
| state | Closed |
| labels | documentationenhancementai |
| assignees | tobiu |
| createdAt | Mar 11, 2026, 11:52 AM |
| updatedAt | Mar 11, 2026, 11:54 AM |
| githubUrl | https://github.com/neomjs/neo/issues/9439 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 9404 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| contentTrust | |
| projected | |
| quarantined | 0 |
| signals | [] |
| blockedBy | [] |
| blocking | [] |
| closedAt | Mar 11, 2026, 11:54 AM |
TreeStore: Apply "Anchor & Echo" JSDoc strategy for AI discoverability

tobiu
Mar 11, 2026, 11:54 AM
Implemented the Anchor & Echo JSDoc strategy for TreeStore. Changes committed and pushed in d0dbcc500.
Background
The AI Knowledge Base parses and chunks source files (like
TreeStore.mjs) by methods and properties. While the class-level documentation provided excellent context about the "Projection Architecture" and "Structural Layer", isolated method chunks (likeexpand()orcollapse()) often lacked this semantic weight. This "Implied Context" anti-pattern leads to poor discoverability during vector searches.Solution: Anchor & Echo Strategy
To balance human readability with AI discoverability, we are applying the "Anchor & Echo" strategy to
TreeStore.mjs:splice,filter) establish high-value architectural vocabulary (e.g., "Structural Layer", "Projection Layer").Changes Implemented
#allRecordsMap,#childrenMap): Now explicitly defined as the foundation and hierarchy of the Structural Layer.collapse()&expand(): Clarified that they mathematically move nodes between the Structural Layer and the Projection Layer.collectAllDescendants,collectVisibleDescendants): Updated to state they traverse the Structural Layer to build the Projection Layer or perform deep cleanup.updateSiblingStats(): Anchored its purpose to operations within the Structural Layer.These targeted JSDoc enhancements ensure that every chunk of
TreeStore.mjscarries sufficient semantic weight for accurate and context-aware retrieval from the ChromaDB knowledge base.