Skip to content

Commit eee4566

Browse files
si1verwind17claude
andcommitted
Fixes from mapping real repos: scanner 0.7.0, Rules 3, router and layout, eval
Scanner (0.7.0): - a long callee keeps the called name at its end, and its line is that name's - Python and Scala record `optional` parameters (defaults, later and using lists, type parameters excluded); a call must pass every required one - an untyped receiver is narrowed by the types the caller's declarations name (a layer typed with one implementation reaches only that one) - a chained result's method matching many names is no "not drawn" loss - tapir: words no longer join across lines, a prefix may come from a method, an endpoint bound to server logic in another module is served there (the binding file's imports pick among same-named objects), an unbound one is a client when a client file names it, else drawn nowhere Rules 3: a request defaults to data forward; `data.two-way-call` warns on a request or ext-call set to both (a reply is not data moving back). Viewer: drones fly one speed per floor (its longest flight 5 s, trains 3 s); lines meet a side nearer its middle and keep off zone label rows and a heavily used item's badge room; labels keep off diagonal and layer lines; zone labels move up when the bottom rows are full; a service's airfield and long shelf, bay or hubs rows wrap; `floor.wide` audit check (row 46); mid-side ends beside a dock pass; webhook docks follow the arrival side. SKILL.md, feedback.md: count every form an unknown library declares with before trusting a pattern; a mounted route's path carries its prefix in problems (bare example keys need no problem); a one-line count is the printed counts line; a route's default method is the framework's (GET for most); feedback snippets use placeholder values and keep a library's own calls. eval: all scenarios rerun; latest 65/66 (S6's wildcard key left open). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent de45af0 commit eee4566

59 files changed

Lines changed: 1117 additions & 351 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎demo/parking-city/docs/viz-code/.gitignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ audit.md
1010
# a showcase: its page and the agent's working facts are committed here, for people to see the output
1111
!index.html
1212
!meaning.json
13+
feedback.md

‎demo/parking-city/docs/viz-code/code-map.json‎

Lines changed: 39 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎demo/parking-city/docs/viz-code/index.html‎

Lines changed: 49 additions & 51 deletions
Large diffs are not rendered by default.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
11
# Map notes
22

3-
- accept text.over-line site — zone name 'production line' over a belt; owner accepted 2026-10-11
4-
- accept lines.mid-side S9·P1·F6 — line turns at a box corner; owner accepted 2026-10-11

‎docs/field-guide.html‎

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

‎eval/README.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ by an independent judge on Opus.
5656

5757
| Scenario | Skill@ | Result | Notes |
5858
|---|---|---|---|
59-
| 1 | 5008e58 | 8/8 (2 repos) | Flask and http4s worked out from the code; each route pattern matched only route lines |
60-
| 2 | 5008e58 | 12/12 (2 repos) | Fiber and Hono routes, mounts and sinks; the Reported check graded from `stack.yaml` |
61-
| 3 | 5008e58 | 4/5 | 3 pins, an example per entry point and data type, fingerprints left to `assemble.py`; the reply's "4 relations" counted only the runtime ones of 8 |
62-
| 4 | 24fc1e0 | 5/5 | `renewals` written into the stale examples once `stale.json` named it (`value_lacks`); two runs before that change cleared the flags unchanged (3/5) |
63-
| 5 | 5008e58 | 15/15 (3 repos) | Rails `resources`, Laravel without a `use`, Spring with a Feign client; library's `PUT /members/{member_no}` got no relation (check 4 covers shop and orders) |
64-
| 6 | 5008e58 | 6/10, 9/10 (2 runs) | run to run variance: `main`'s skill scored 8/10 on the same fixture; misses: `common` not a library (so no `via`), the trigger, the wildcard key; both runs cite the backfill's README line one line early |
65-
| 7 | 5008e58 | 6/6 | the queue joined `place` to `cook` (the method that handles each ticket); `stock.py`'s local queue left as a problem |
66-
| 8 | d67f9ff | 5/5 | run on the branch before the squash (the form fields and the re-ask wording came after it); graded with check 3 as now written (strictly, 4/5: turn 4 asked again naming the digest of the text shown in full at turn 2). Earlier runs on the branch: 4/5 retyped and summarised previews, then 4/5 described a register call instead of the decorator; the procedure now asks for the code to be read and the preview pasted whole. Each run said the scan had no map yet, and one offered to finish the run first |
59+
| 1 | b77eff4 | 8/8 (2 repos) | Flask and http4s worked out from the code; `add_url_rule("/ping", view_func=ping)` keyed `GET /ping` with the view as handler (the 4b347fd `ANY` miss gone) |
60+
| 2 | b77eff4 | 12/12 (2 repos) | Fiber and Hono routes, mounts and sinks; problems write composed paths (`/api/items/{id}`, `/notes/{id}`); both runs keyed examples with the mount first, then bare after `examples.py` |
61+
| 3 | 4b347fd | 5/5 | 3 pins, an example per entry point and data type (both LoanOpened copies), fingerprints left to `assemble.py`; the reply pasted the printed counts line, which matched the map |
62+
| 4 | 4b347fd | 5/5 | `renewals` written into the `Loan` type and both entry responses from `value_lacks`; the export's pin took over the agent pin on `get_loan` in place, the first agent pin went to `unpinned`, `overdue-check` dropped, `export-comment.md` deleted |
63+
| 5 | b77eff4 | 15/15 (3 repos) | Rails `resources`/`resource`, Laravel `match` and an `/admin` prefix mount, Spring with a Feign ext-call, all from the packs; one example per route key; shop's problems still explained its bare admin key (with the prefix) |
64+
| 6 | 4b347fd | 9/10 | the trigger drawn as a `batch` keyed `task copy_customers`, backfill cited at README:5; miss: `copy_tables` drawn as one relation per literal table (no `shop.*` key, no `tables`) |
65+
| 7 | 4b347fd | 6/6 | the queue joined `place` to `kitchen.run`, `stock.py:7` left as a problem; the reply pasted the printed counts line (6 relations, calls included) |
66+
| 8 | 4b347fd | 5/5 | notice in full before any command; the snippet took placeholder values (`port=1234`) and kept the database library's own `connect`/`execute`; flagged words put to the user, no `--allow`; one `send` (strictly: one `sed` on a preview it ran itself, the text shown whole) |

‎skills/visualizing-codebases/CHANGES.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Only changes that can make facts on an existing map wrong or incomplete go here: a meaning rule in SKILL.md, or a new kind of fact to look for. Viewer, scanner and schema changes do not (the page refresh and the full rescan cover them).
44
Bump `RULES_VERSION` in `scripts/vizcode/__init__.py` with each new section; prune old sections from the bottom when the file passes about 10. The oldest section left is the floor: a map older than it gets a full meaning re-check.
55

6+
## Rules 3 — 2026-10-20
7+
- A call's direction (SKILL.md § data): a `request` now defaults to `data: forward`, and a `request` or `ext-call` set to `both` because of what the call returns goes back to `forward` (the `data.two-way-call` warning lists them). Only a flow both ways is two-way, as a `bidirectional` stream.
8+
69
## Rules 2 — 2026-10-15
710
- In-process queues (SKILL.md § In-process queues): where a trace stops at a put on a queue, channel or hub that a background task drains, add the `in-process-queue` node and its `hand-off` relations; clear each `queue.missing` warning.
811
- Actor and entity messages (SKILL.md § Matching interactions): where a trace stops at a send to an actor or sharded entity, add the `request` to the handler it dispatches to.

‎skills/visualizing-codebases/SKILL.md‎

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ inside the repo).
120120
but the page was not written (the message says why): report it, do not
121121
touch `meaning.json`.
122122
5. `assemble.py` prints the audit line last and writes `OUT/audit.md`. Fix
123-
each `ext.missing`, `queue.missing`, `module.empty`, `example.missing` and `pin.few` content warning
123+
each `ext.missing`, `queue.missing`, `data.two-way-call`, `module.empty`, `example.missing` and `pin.few` content warning
124124
in `meaning.json` and rerun `assemble.py`. An `ext.missing` key that names no
125125
outside endpoint (a test helper's, a tool's own setting such as `DOCKER_HOST`)
126126
gets a `problems` entry naming the key and why; that clears it. So does a
@@ -129,7 +129,8 @@ inside the repo).
129129
them. Map limits and findings are reported, not fixed.
130130
6. Open `OUT/index.html` in a browser. (`view.py REPO --out-dir OUT` rewrites
131131
only the page, for when the viewer changed but the map did not.)
132-
7. Report: commit scanned, the counts line it printed (paste that line as it is, never a retelling), every entry in `problems`,
132+
7. Report: commit scanned, the counts line it printed (paste that line as it is, never a retelling; when the user asks
133+
for one line of counts, it is that line), every entry in `problems`,
133134
the audit line, each map note as applied or "not supported yet", each
134135
`rules.recheck` entry applied, the number of pins and examples, each
135136
`## Pins` line applied, the `stack.yaml` entries added this run,
@@ -277,9 +278,12 @@ schedule and tasks, each Flyte workflow's launch plan schedule and every
277278
`tables` the concrete tables its callers pass in (literal arguments, or
278279
variables set right before the call) or that configs name.
279280
- `data` says which way data moves: `forward` (from → to), `back` (to → from)
280-
or `both`. Kinds default (request `both`, db-read `back`, the rest
281-
`forward`); a `stream` has no default and must be set: a subscription the
282-
service opens is `back`. The layout orders the production line by it.
281+
or `both`. Kinds default (db-read `back`, the rest `forward`); a `stream`
282+
has no default and must be set: a subscription the service opens is `back`.
283+
A call's reply is not data moving back: a `request` or `ext-call` stays
284+
`forward`, from the caller, whatever it returns (`both` draws a two-way belt,
285+
as if each end called the other); a flow both ways is a `bidirectional`
286+
stream. The layout orders the production line by it.
283287

284288
Read these optional facts from code and config. Each is set only on evidence
285289
you can cite; leave it out when unsure. Why: the viewer draws the shape from
@@ -354,6 +358,15 @@ Sort each line into one group of its language:
354358
pattern's; delete your entry.
355359
When a library in `imports` is an ORM, look for how it names tables and
356360
add a `tables` pattern even though no line asks for it.
361+
For a library no pack knows, search the files that import it for every form
362+
it declares a route, table or queue with before you trust your pattern: a
363+
verb with and without its own path, a base path set once for many routes (a
364+
`mount: true` route entry, below, or composed on the keys), a declaration
365+
that takes its path from a variable or a method, more than one per
366+
statement. Count each form's matches; each form the pattern cannot read
367+
goes into `problems` by name with one `file:line` example (what the map
368+
shows instead), so the gap is said, not found later. Why: a pattern checked
369+
against one example misses the other forms silently.
357370
4. Files whose facts a new or changed pattern touches count as changed in
358371
this run: on an incremental run, review them with the stale facts.
359372

@@ -408,8 +421,10 @@ scala:
408421
- A route (`form: regex`, the default): `name` (unique per language;
409422
`fastapi`, `tapir` and `tapir-client` are taken), `regex` (Python `re` over the whole file, multiline) with a
410423
named group `path`; the method from a `method` group, a `methods` group
411-
(each quoted word is one route), or the entry's `method:` (`ANY` for every
412-
method); methods are upper-cased (`get` → `GET`). A pattern with a
424+
(each quoted word is one route), or the entry's `method:`: the method the
425+
framework serves when the call names none (`GET` for most; `ANY` only where
426+
it serves every method, as pekko's `path` does); methods are upper-cased
427+
(`get` → `GET`). A pattern with a
413428
`methods` group and no `method` group must also set `method:`, the
414429
fallback for a match where the group is empty. `when`: an import prefix; the pattern runs only on files that
415430
import it. Without `when` it runs on every file of its language.
@@ -448,7 +463,9 @@ scala:
448463
example's key follows `scripts/examples.py`, which writes the relation's
449464
spelling when a relation names the route and the bare path when none does (Express
450465
`app.use("/v1", router)`, Ktor `route("/v1") { }`, Chi `Route`, NestJS
451-
`setGlobalPrefix`).
466+
`setGlobalPrefix`). In `problems` and any other text a route's path is
467+
composed too; only example keys follow `examples.py`. A bare example key
468+
under a mount is expected: no problem explains it.
452469
- An annotation route (`form: annotated`; any language but Python and
453470
Scala) reads the annotations on classes and methods instead of a regex.
454471
The Java pack's Spring entry, shortened (in `stack.yaml` this name would
@@ -617,7 +634,8 @@ what the code would output. Values need not agree across a chain.
617634
streams and jobs). A method that serves several routes gets one item per
618635
key. One item per route, not per spelling: a route that `files` lists
619636
without its mount prefix and a relation writes with it is one item, keyed
620-
as on the relation.
637+
as on the relation; a mounted route no relation names is one item, keyed
638+
bare as `examples.py` prints it.
621639
- **Data types:** a class whose `fields` the scanner lists, referred to by a
622640
signature (`signature.params[].refs`, `signature.returns_refs`). Give an
623641
`examples.types` entry (`"<class id>": {"value": {...}}`) to every type in
@@ -639,7 +657,8 @@ what the code would output. Values need not agree across a chain.
639657
entry point and data type that should have one, totals first, each `ok`,
640658
`missing` or `stale` (`ok 1/3 keys` when a method with several keys has
641659
fewer examples; `key gone` when an example's key is no longer one of its
642-
method's). Write the missing ones (for types, data types only)
660+
method's: change only that example's `key`, never the same path in other
661+
text). Write the missing ones (for types, data types only)
643662
and assemble again. The audit lists entry points still without one, and
644663
those with a key still without one (`example.missing`). A root route
645664
(`GET /`) under a mount stays a key apart from the relation's (`GET /v1`):
@@ -648,7 +667,9 @@ what the code would output. Values need not agree across a chain.
648667
## Problems
649668

650669
Record everything you could not resolve in `problems`, with the nodes it
651-
concerns. A visible gap is useful; a confident guess is not.
670+
concerns. A visible gap is useful; a confident guess is not. A route's path
671+
in problem text carries its mount prefix (`/notes/{id}`, never `/{id}`); bare
672+
example keys under a mount are expected and get no problem.
652673

653674
## Large repos
654675

@@ -713,7 +734,7 @@ map. Map limits are drawing-check failures the viewer cannot draw well yet:
713734
report them, never fix them, never put them on the map. Findings are what the
714735
map shows about the code; the only one is a cycle between services (events
715736
through a topic do not count). Content warnings `ext.missing`, `queue.missing`,
716-
`module.empty`, `example.missing` and `pin.few` you fix in `meaning.json`;
737+
`data.two-way-call`, `module.empty`, `example.missing` and `pin.few` you fix in `meaning.json`;
717738
`name.container` is a labelling gap in the scanner or viewer,
718739
`pin.start-missing` a pin whose start is gone (the user decides), and an
719740
audit error (`audit.error`) is a check that broke: report them. Without

0 commit comments

Comments
 (0)