Repository navigation
feat(cli): vocabulary:<word> in the city (M19b) - #33
Merged
jgrodziski merged 9 commits intoOct 27, 2026
Merged
Conversation
`--height`, `--footprint` and `--carry` take `vocabulary:<word>`: the word's weight in the names of the type and its members, the Vocabulary tab's type scope, so the City and Vocabulary tabs read one number. - Wired through cityOf's metric hook beside `history:`; the city package is unchanged. - A type whose names never say the word weighs 0, a measured zero; a stub, whose names the vocabulary never reads, is unmeasured. - The word is read by the splitter (`Order` is `order`); several words, none, or a word no name in the view says is a usage error. - Two classes of one text add up: the metric is about the text. - `serve` and the app job hand cityOf the vocabulary they already build; `city` counts one only when such a metric is named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The help dialog said "a taller tower holds more code", true only when height is `loc`. Height is whatever metric was bound (fanIn, sum: cyclomatic, vocabulary:order…), so the prose now defers to the legend. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`docs/cli.md`'s city section; the website's City metrics page gains a "Vocabulary form" section (what it reads, 0 against unmeasured, the usage errors); the `--height`/`--footprint` rows of `city` and `serve` as their help now reads; an "In the city" note on `vocabulary`; and the two commands in CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "Read its vocabulary" section and a fifth question in the README's table, showing the issue's two demo images: - `docs/vocabulary-broadleaf.svg`, BroadleafCommerce's corpus cloud (from the cloud PR); - `docs/vocabulary-city-broadleaf.png`, new: the City tab on BroadleafCommerce at `--height vocabulary:order --height-scale sqrt`, arrows hidden and `OrderServiceImpl` selected (vocabulary:order 203). `docs/cli.md` links the city image from the vocabulary section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tutorial listed Navigate, Graph, Cycles and Coupling. It now names all six and adds a Vocabulary step on its own subject, `TypeAdapter`, with numbers re-taken from gson at `gson-parent-2.14.0` (the model reproduces the tutorial's 1,855 nodes and 6,236 rows): 7 domain terms of 17, `tree` the heaviest at 7, carried by `fromJsonTree`, `toJsonTree` and `jsonTree`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
§20.2: the channel is a height, not a colour (the city's one colour channel is the categorical role); a type that never says the word weighs 0 and only a stub is unmeasured; the splitter reads the word; Broadleaf's numbers and the demo image's settings. §20.4's last two M19b items are checked and the milestone row marked done. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From feat/m19b-vocabulary-tab. 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 | 04ed6c0 | Commit Preview URL Branch Preview URL |
Oct 27 2026, 03:06 PM |
From feat/m19b-vocabulary-tab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From feat/m19b-vocabulary-tab. 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.
Third and last step of milestone M19b in PLAN.md §20 (word cloud / glossary, #6). Stacked on #32 (itself on #31, #30, #29, #28, #27 and #26): review those first. This PR's diff is the six commits after #32, plus the merge that brings #28's closure-check fix up the stack.
It makes a word a city metric:
--height vocabulary:orderraises each building by how much its type's names sayorder. It also adds the demo images to the README and updates the navigator tutorial.The metric (
packages/cli/src/vocabulary-metric.ts)What it measures.
--height,--footprintand--carryacceptvocabulary:<word>: the word's weight in the names of the type and its members, each name weighted by its role. This is the number in the type's row ofvocabulary.jsonand the Vocabulary tab. Aservetest checks that every served type's building equals its row.The word goes through the splitter.
vocabulary:Orderreads asorder. These are usage errors (exit 2):vocabulary:OrderService;vocabulary:orvocabulary:42;vocabulary:zebra.A typo would otherwise draw a flat city that looks like an answer.
Several classes, one sum. A word that two languages classify differently (Java's
type, Go's keywordtype) counts all of its classes.0, not unmeasured. A type whose names never say the word measures 0: its names were read and say nothing about
order. Only stubs are unmeasured, because their names are never read. With--internal-onlythere are no stubs.Counted only when asked.
codegraph citycounts words only when avocabulary:metric is named.serveand the desktop daemon reuse the vocabulary they already build.@codegraph/cityis unchanged: this is the CLI's metric hook, the same one that serveshistory:.--helplists the form.The viewer's help (
viz)The help said "a taller tower holds more code", which is only true when height is lines of code. It now defers to the legend, and a test checks that the help names no metric of its own.
Docs
docs/vocabulary-city-broadleaf.png(323 KB, 1600×1000). The real City tab on BroadleafCommerce with--internal-only --height vocabulary:order --height-scale sqrt, arrows hidden, andOrderServiceImplselected; its panel readsvocabulary:order 203.core.order.serviceandcore.offerstand as towers.docs/cli.md; on the website, City metrics gains a "Vocabulary form" section, and thecity,serveandvocabularypages are updated.CLAUDE.mdgets two command lines.TypeAdapter.gson-parent-2.14.0), which reproduces the tutorial's 1,855 nodes and 6,236 rows. OnTypeAdapter,treeweighs 7, carried byfromJsonTreeandtoJsonTree(3 each) and the parameterjsonTree(1).Worth a look in review:
order. On the sqrt scale, 589 of them rise above 5 of 40 height units; on the linear scale only 92 do, and the city reads as flat.Verification
pnpm -r buildand typecheck are green, eslint is clean on every changed file,pnpm run gen:schemasleavesschemas/unchanged, and the Hugo site builds.node:sqlitewarning test noted on feat(core): language lexicons on profiles (M19a) #26../build.sh --ts --seapasses its smoke checks. Its city gives the Java fixture's hand counts (Order8,AbstractOrder8,OrderService10,Notifications4), andvocabulary:zebraexits 2.Part of #6.
🤖 Generated with Claude Code