Repository navigation
fix(insights): count polysemy on two senses - #44
Open
jgrodziski wants to merge 4 commits into
Open
jgrodziski wants to merge 4 commits into
jgrodziski wants to merge 4 commits into
Conversation
A module's `polysemous` flag now counts only when the senses it lists are two at least, case and spacing aside: `typesDisagree(entry)` in glossary.ts. PetClinic's `owner` module flagged `owners` with three types giving one sense, and `or` with two; `--polysemy` listed both. `--polysemy`, `--word` and `--glossary` ask the rule. A flag that does not hold adds no sense to a word's count. The record keeps what the model wrote; no fingerprint input moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKCVgyop39vhNa45r7zM8w
The Navigate panel and the Vocabulary tab said "its types disagree" for any flagged glossary entry with a sense listed. They now ask `typesDisagree`, restated from @codegraph/insights (the page imports nothing of it) and pinned to the package's by a test over the same cases. A sense of another shape counts as none: never a throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKCVgyop39vhNa45r7zM8w
docs/insights.md, docs/cli.md (`--word`, `--polysemy`) and the side-car reference's `polysemous` row: a reader counts the flag only when its senses are two at least. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKCVgyop39vhNa45r7zM8w
PLAN §20.3: an as-built note (the PetClinic flags, the rule, read not rewritten, lexical not semantic, the prompt unchanged) and a pointer from layer 3's `--polysemy`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PKCVgyop39vhNa45r7zM8w
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
codegraph | 9eb6583 | Commit Preview URL Branch Preview URL |
Nov 03 2026, 05:12 PM |
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.
Ninth step of milestone M19c in PLAN.md §20 (word cloud / glossary, #6). Stacked on #43 (itself on #42, #40, #39, #38, #37, #36 and #35): this PR's diff is the four commits after #43.
A module's
polysemousflag now counts only when the senses it lists are at least two. This is fix (d) from the PetClinic findings.Why
A module reconciles what its types said of a word. When its types disagree, it sets
polysemousand lists each type with its sense. On PetClinic, 2 of the run's 16 flags (over 52 glossary entries) listed one sense only:ownersownerorowner--polysemylisted both words.--glossaryand--wordprinted apolysemous:cell for them. The Vocabulary tab and the Navigate panel said "its types disagree", with nothing to disagree on.The change
typesDisagree(entry)in@codegraph/insightsglossary.ts: the entry is flaggedpolysemousand lists at least two distinctsenses, case and spacing aside. That is the comparison--polysemyalready made across modules.--polysemy, which lists a word when a module's flag holds or when two modules define it differently;polysemous:cell of--wordand--glossary;@codegraph/insights, not even types. A test runs both versions over the same cases and requires the same answers, the way the answer kinds are pinned. A sense the page cannot read counts as none, never a throw.--polysemy. Its one sense rewords the entry's own, so counting it would inflate the ordering.Worth a look in review
polysemous: trueas the model wrote it. The store holds what was paid for, and the side-car's decode → import → export stays the identity.ownermodule,petkeeps its flag over four wordings of "animal under care" ("animal subject", "animal being validated"…).PROMPT_VERSION, which every fingerprint includes: all 106 PetClinic calls again, for something a reader can check.oris gone twice. fix(vocabulary): no definitions of function words (M19c) #42 stopped asking for it. Until PetClinic is re-run, its paid entry is still in the store, and this rule hides its flag.Docs
docs/insights.md,docs/cli.md(--word,--polysemy) and the side-car reference'spolysemousrow: a reader counts the flag only when it lists at least two senses.--polysemy.Verification
Red first.
polysemyReportlistedtotal, whose flag lists one type, and counted 3 senses forprice, whose two types give one sense differing only in case and spacing.typesDisagreedid not exist.--glossaryprinted apolysemous:cell forlines, whose two types give one sense, and--polysemylisted it.owners, and the pin test had nothing to pin.Mutants, each run alone with the file restored byte for byte:
polysemyReport;Each one fails a test.
Not covered by a unit test: the Vocabulary tab's one-line change has no component test. A screenshot covers it instead (below).
Gate.
unknown output format "llms", pnpm -r build fails on a fresh clone: unknown output format "llms" for kind "home" #23)../build.sh --ts --seapasses its smoke gates ("all gates passed").Tests: insights 162 (+2, +1 skipped), navigator-ui 115 (+1), cli 1,037, vocabulary 348, core 544, analyzer 614, viz 143, city 94, extractor-typescript 66, scm 56, navigator 40, llm 34.
scale.test.ts, which timed out under the full parallel run and passes alone (the known flake; the analyzer is untouched).PetClinic, on a copy of the paid store in the scratchpad (the store in
~/spring-petclinicwas not opened):--polysemylists 14 words, down from 16:ownersandorare gone, and every remaining word is flagged with at least two senses.serveon the copy, Vocabulary tab, at 1600×1000:ownersshows theownermodule's sense and meaning with no "its types disagree" line;petskeeps it: Owner "owned pets", PetController "pet records".Still owed for M19c:
docs/vocabulary.mdand the README;Part of #6.
🤖 Generated with Claude Code
https://claude.ai/code/session_01PKCVgyop39vhNa45r7zM8w