Repository navigation
feat(insights): the word readers (M19c) - #37
Open
jgrodziski wants to merge 3 commits into
Open
jgrodziski wants to merge 3 commits into
jgrodziski wants to merge 3 commits into
Conversation
Layer 3 of PLAN §20.3, as pure functions over the store port. The port gains four projections: wordHits(word) through the insight_word index, glossaryEntries(word?) over the module blocks, concernRows() and withoutWords(); stats() counts the records a model wrote without words (prompt 1). glossary.ts rolls them up: wordReport, polysemyReport, concernsReport, wordsAbsence (prompt 1's or a template's) and moduleOf. A record is placed in its module by its natural key, rendered by core and grouped on naturalKeyIndex; the id is never parsed. Lookups are exact on any string: a word with a lone surrogate is not what the binding sends for the index's TEXT, so it is found by a scan, and JS equality decides either way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
codegraph insights --word WORD, --glossary MODULE_ID, --polysemy and --concerns: tab-separated like the command's other lists (the module first, so the grouping survives sort), each with a --json kind. A record explained under prompt 1 is answered as such: --id says so, --glossary on such a module says why it has none, and the summary and every word answer count what they cannot see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/cli.md: the four flags, their JSON kinds and the prompt-1 answers. docs/insights.md: the readers over the port. PLAN §20.3: as built; §20.4 notes the readers and the prompt-1 answer as in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
codegraph | b94cafd | Commit Preview URL Branch Preview URL |
Oct 28 2026, 03:34 PM |
This was referenced Oct 28, 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.
Third step of milestone M19c in PLAN.md §20 (word cloud / glossary, #6). Stacked on #36 (itself on #35): review those first. This PR's diff is the three commits after #36.
codegraph insightsgains four readers of the words the model defined: what a word means wherever the code spells it, a module's glossary, the words that mean different things in different places, and how many of each module's words are domain or technical. They read the store alone, like the rest of the command.The four readers (
codegraph insights)--word order: every explained entity whose names spell the word, grouped by module. Each module's own glossary entry comes first, then the module, its types and its operations. One tab-separated line per entry: module, level, id, concern, confidence, sense, and the identifiers the word is in.--glossary MODULE_ID: a module's glossary whole: word, concern, sense, meaning, and its types' senses where they disagree.--polysemy: the words a module flagged as polysemous, and the words two modules' glossaries define differently, every module's entry side by side, the most senses first.--concerns: per module, how many distinct words its records define, and how many the model called domain, technical and ambiguous.Each has a
--jsonform (codegraph.insightsWord/1,…Glossary/1,…Polysemy/1,…Concerns/1).From the CLI test's store (tabs shown as aligned spaces):
What a reader says about a prompt-1 record
PLAN asked for "a reader's answer for a record explained under prompt 1". A record a model wrote without
wordspredates them; one no model wrote is a template.wordsAbsence(record)tells the two apart, and:--idsays so on the record ("words: not defined — explained under prompt 1…", or "words: none — templated…");--glossaryon such a module says why it has none;The store (
packages/insights)wordHits(word)reads theinsight_wordindex joined to each record's envelope.glossaryEntries(word?)reads the module blocks'glossarythroughjson_each.concernRows()andwithoutWords()round them out.stats()gainswithoutWords.glossary.tsbuilds the reports from them:wordReport,polysemyReport,concernsReport, pluswordsAbsenceandmoduleOf.->>made of a word; for a lone surrogate that is not what the binding sends, so such a word is looked up by a scan. Either way a result is kept only if it equals the word once parsed back from JSON. A property over arbitrary side-cars (binary strings included) checks all four projections against the blocks.Worth a look in review:
insightsnever opens the model, so a record is placed in its module by its key: core renders the module id fromlangandmodule, and groups compare throughnaturalKeyIndex. The id is never parsed. PLAN's "module → type → operation" is therefore by level within a module: an operation is not nested under its own type, which only the model knows. A record without a key goes under-.meaningin--word. The table doesn't hold it (PR 10);--glossaryand--idshow it.--concerns; the columns can add up to more than the word count.Docs
docs/cli.md: the synopsis, the four flags, the JSON kinds, and what the answers say about prompt-1 records.docs/insights.md: a "words' readers" paragraph.Verification
pnpm -r buildand typecheck are green, eslint is clean on every changed file, andpnpm run gen:schemasleavesschemas/unchanged. Nothing on the website changes: it has noinsightspage.--id,--glossaryand the summary, one question per invocation);node:sqlitewarning test noted on feat(core): language lexicons on profiles (M19a) #26.--word order(549 entries, 19 glossary entries) 0.46 s,--polysemy0.48 s,--concerns0.54 s,--glossary0.30 s../build.sh --ts --seapasses its smoke checks.Still owed for M19c:
vocabulary --drift-insights;/glossary.jsonwith the Vocabulary tab and Navigate panel entries;docs/vocabulary.mdand the README.--word ordertiming on a re-explained Broadleaf store.Part of #6.
🤖 Generated with Claude Code