Skip to content

Commit d0cec44

Browse files
si1verwind17claude
andcommitted
Comments name what the code does, not plan tasks, spec sections or review rounds
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 4a5592e commit d0cec44

53 files changed

Lines changed: 92 additions & 92 deletions

Some content is hidden

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

‎skills/visualizing-codebases/scripts/vizcode/examples.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
LABEL = "example values, not computed"
99
ENTRY_KINDS = ("request", "event", "stream", "batch") # a relation of these kinds ending at a method
10-
TRACE_KINDS = ("calls", "request", "event", "stream", "batch", "db-read", "db-write", "ext-call", "hand-off") # spec §3.3
10+
TRACE_KINDS = ("calls", "request", "event", "stream", "batch", "db-read", "db-write", "ext-call", "hand-off")
1111
HOPS = 2
1212
CONTAINER_KINDS = ("service", "library", "package", "file", "class")
1313
STALE_HINT = "stale — rewrite its value against the code, or delete it when its {gone} is gone; then delete the flag"
@@ -159,7 +159,7 @@ def add(method_id: str, why: str) -> None:
159159

160160

161161
def shape_errors(examples: dict) -> list[str]:
162-
"""meaning.json's `examples` shape, before assembling: {types: {class id: {value: {...}}},
162+
"""Meaning.json's `examples` shape, before assembling: {types: {class id: {value: {...}}},
163163
entries: [{node, key, request, response?}]}."""
164164
out: list[str] = []
165165
types, entries = examples.get("types", {}), examples.get("entries", [])
@@ -180,7 +180,7 @@ def shape_errors(examples: dict) -> list[str]:
180180

181181

182182
def check(cmap: dict) -> list[str]:
183-
"""assemble.py's refusals for an assembled map's examples, as a fix list (format.md § Examples)."""
183+
"""Assemble.py's refusals for an assembled map's examples, as a fix list (format.md § Examples)."""
184184
nodes = {n["id"]: n for n in cmap.get("nodes", [])}
185185
ex = cmap.get("examples") or empty()
186186
errors: list[str] = []

‎skills/visualizing-codebases/viewer/dist/audit.mjs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// audit-inputs: 81590b0af12330570b0cb561b06373932c9ba6eb4f3f7583d570f95777de3e35
1+
// audit-inputs: acb22615e21e93ffcdb51da2dd67881203b52b38e4f6a8bdfb205072c41e3e85
22
import { readFileSync } from "node:fs";
33
// src/model/model.ts
44
var SITE = "site";
@@ -213,7 +213,7 @@ var Model = class {
213213
}
214214
chains = /* @__PURE__ */ new Map();
215215
/** One bundle per pair of items on this floor, plus relations leaving the floor. `layered`: the lines kept out of
216-
* the base layer (spec §15), each tagged with the extra layer that draws it (a line in two layers is listed once per
216+
* the base layer, each tagged with the extra layer that draws it (a line in two layers is listed once per
217217
* layer, so count or collect its key once); `bundles` never holds them. Worked out once per floor and code-links
218218
* flag (the map never changes under a Model) and shared: callers must not mutate the result. */
219219
bundles(container, opts = {}) {
@@ -3397,7 +3397,7 @@ var band = (l) => ({
33973397
w: l.x1 - l.x0,
33983398
h: 3
33993399
});
3400-
/** `base`: given, this is a layer's pass (spec §15): the lines already laid on this floor, which `bundles` route over. Their tiles on top are
3400+
/** `base`: given, this is a layer's pass: the lines already laid on this floor, which `bundles` route over. Their tiles on top are
34013401
* held by a line no layer line may ride: a layer line goes round them where it can and under them where it must, never
34023402
* along them; they are read, never changed. */
34033403
function routeTiles(tf, bundles, base) {
@@ -5863,7 +5863,7 @@ var perView = (plan, check) => views(plan).flatMap(([view, routes]) => check(rou
58635863
detail: v.detail + view
58645864
})));
58655865
var perRoute = (plan, check) => perView(plan, (routes) => routes.filter((r) => r.pieces.length).flatMap(check));
5866-
/** Every check over one floor's plan, in the order of the check table (spec §3). */
5866+
/** Every check over one floor's plan, in the order of the check table. */
58675867
function checks(model, c, plan, measured) {
58685868
const { tf } = plan, { bundles } = model.bundles(c);
58695869
return [

‎tests/regressions/test_review_fixes.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Regression tests for the final-review findings (symlinks, subdirectories, excludes,
1+
"""Regression tests (symlinks, subdirectories, excludes,
22
route idioms, commit drift, defaulted libraries, output-dir paths)."""
33
import copy
44
import json

‎tests/scanner/test_annotated.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_spring_exact_routes(make_repo):
129129
("ANY", "/orders/any", f"{CTRL}#any/0", 16), ("ANY", "/v1/orders/any", f"{CTRL}#any/0", 16),
130130
("DELETE", "/orders/{id}", f"{CTRL}#remove/0", 20), ("DELETE", "/v1/orders/{id}", f"{CTRL}#remove/0", 20)]
131131
assert {(r["framework"], r["source"]) for r in s["facts"][f]["routes"]} == {("spring-mvc", "stack.yaml")}
132-
# Review Focus 2: a verb method without a class prefix gives the method path alone
132+
# a verb method without a class prefix gives the method path alone
133133
assert routes_of(s, "src/main/java/io/demo/shop/Health.java") == [
134134
("GET", "/health", "io.demo.shop.Health#health/0", 6)]
135135
# a class prefix with no verb methods gives nothing; no `when` import, no routes
@@ -138,7 +138,7 @@ def test_spring_exact_routes(make_repo):
138138

139139

140140
def test_annotated_non_literal_path_skipped(make_repo):
141-
"""Review Focus 1: `@GetMapping(PATH)` gives no route, no crash, and the report counts the other matches."""
141+
"""`@GetMapping(PATH)` gives no route, no crash, and the report counts the other matches."""
142142
repo = make_repo(SPRING_SRC)
143143
with_stack(repo, SPRING)
144144
s = structure.build(repo, "docs/viz-code")

‎tests/stack/test_packs_js.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def test_express_mounts_sinks_tables(express_repo):
9999

100100

101101
def test_express_negatives(make_repo):
102-
"""Review Focus 3: `map.get("x")`, a one-argument `app.get('title')` (a setting), a template path and a
102+
"""`map.get("x")`, a one-argument `app.get('title')` (a setting), a template path and a
103103
member of another name are not routes; nothing matches without the `express` import."""
104104
src = ("const app = makeApp();\nconst map = new Map();\nmap.get('/x', 1);\napp.get('title');\n"
105105
"app.get(`/t/${id}`, h);\nmyapp.get('/m', h);\napp.get('/real', h);\napp.use('/v2', r);\n"
@@ -244,7 +244,7 @@ def shape(lang, items):
244244

245245
@pytest.mark.parametrize("lang", ["typescript", "javascript"])
246246
def test_every_js_pack_regex_entry_has_when(lang):
247-
"""Review Focus 3: a pack regex without `when` would fire on any file of the language."""
247+
"""A pack regex without `when` would fire on any file of the language."""
248248
st = stack.default()
249249
for p in (*st.patterns, *st.tables):
250250
if p.lang == lang and p.source == "pack":

‎tests/stack/test_packs_jvm.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def test_spring_sinks_and_tables(spring_repo):
4242

4343

4444
def test_spring_beside_jaxrs(spring_repo):
45-
"""Review Focus 5: both frameworks count in the pattern report; a method both annotate is one route."""
45+
"""Both frameworks count in the pattern report; a method both annotate is one route."""
4646
s = structure.build(spring_repo, "docs/viz-code")
4747
stock = "legacy::io.demo.shop.legacy.StockResource"
4848
assert routes(s, f"{LEGACY}/StockResource.java") == [
@@ -142,7 +142,7 @@ def test_ktor_routes_mounts_tables(ktor_repo):
142142

143143

144144
def test_ktor_regex_negatives(make_repo):
145-
"""Review Focus 3: Ktor's route and mount patterns fire only under `io.ktor.server.routing`, and never on a
145+
"""Ktor's route and mount patterns fire only under `io.ktor.server.routing`, and never on a
146146
member call (`client.get("/x") { }`, `m.get("/x")`) or a string template path."""
147147
src = ("package a\n\nfun f(client: Any, m: Map<String, Int>) {\n client.get(\"/remote\") { }\n"
148148
" m.get(\"/k\")\n get(\"/x\") { }\n route(\"/v2\") { }\n}\n")
@@ -207,14 +207,14 @@ def test_python_tables():
207207

208208
@pytest.mark.parametrize("lang", ["java", "kotlin"])
209209
def test_every_pack_regex_route_has_when(lang):
210-
"""Review Focus 3: a pack regex route without `when` would fire on any file of the language."""
210+
"""A pack regex route without `when` would fire on any file of the language."""
211211
for p in stack.default().patterns:
212212
if p.lang == lang and p.source == "pack":
213213
assert p.when, p.name
214214

215215

216216
def test_pack_names_do_not_block_a_stack_yaml(tmp_path):
217-
"""A stack.yaml written before the packs (Task 1's example names) still loads."""
217+
"""A stack.yaml written before the packs (the old example names) still loads."""
218218
st = stack.load(write(tmp_path, "java:\n routes:\n - name: spring-mvc\n form: annotated\n"
219219
" verbs: {GetMapping: GET}\n tables:\n - {name: jpa-table, regex: '(?P<table>x)'}\n"))
220220
assert {p.name for p in st.patterns if p.lang == "java"} >= {"spring-mvc", "spring-web"}
@@ -232,7 +232,7 @@ def test_table_dedupe_across_patterns(make_repo):
232232
("Order", 4, "quill"), ("Item", 4, "quill")]
233233

234234

235-
# Carried fixes (Task 3 review): stack.yaml replaces a pack entry by name; framework wiring ignored by its pack;
235+
# stack.yaml replaces a pack entry by name; framework wiring ignored by its pack;
236236
# a stack.yaml pattern a pack pattern duplicates is reported as such; pack gaps; dedupe order per group
237237

238238
def test_stack_yaml_entry_replaces_the_pack_entry_of_that_name(make_repo):

‎tests/stack/test_packs_other.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def test_go_gin_echo_chi():
9595

9696

9797
def test_go_negatives():
98-
"""Review Focus 3: look-alikes and missing imports give no route, mount or table."""
98+
"""Look-alikes and missing imports give no route, mount or table."""
9999
http = ('q := r.URL.Query()\nq.Get("id")\nresp, _ := client.R().Get("/orders")\nh.Handle(event)\n'
100100
'mux.HandleFunc("orders", h)\nmux.HandleFunc(path, h)\n')
101101
assert found("go", http, ["net/http"]) == []
@@ -180,7 +180,7 @@ def test_aspnet_minimal_api_and_tables():
180180

181181

182182
def test_csharp_negatives():
183-
"""Review Focus 3."""
183+
"""Look-alikes give nothing."""
184184
# minimal APIs run without `when` (implicit usings: Program.cs names nothing); the look-alikes give nothing
185185
src = ('app.MapGet("/ping", h);\nconfig.Map("/x");\ndict.MapGetter("/y", h);\nvar g = app.MapGroup("/g");\n'
186186
'cfg.MapGet("/one");\nm.MapGet(path, h);\nm.MapPost($"/i/{x}", h);\nMapGet("/bare", h);\n'
@@ -251,7 +251,7 @@ def test_axum_forms_and_actix():
251251

252252

253253
def test_rust_negatives():
254-
"""Review Focus 3."""
254+
"""Look-alikes give nothing."""
255255
src = ('.route("/a", get(h))\n.nest("/n", r)\n#[get("/x")]\nfn x() {}\nweb::scope("/v1")\n'
256256
'map.route("k")\n#[test]\nfn t() {}\n')
257257
assert found("rust", src, ["std::collections"]) == [] and found_mounts("rust", src, ["serde"]) == []
@@ -303,7 +303,7 @@ def test_rails_routes(make_repo):
303303

304304

305305
def test_ruby_negatives_and_tables():
306-
"""Review Focus 3: Rails needs `to: "c#a"`; Sinatra needs its import and a block; tables need ActiveRecord."""
306+
"""Rails needs `to: "c#a"`; Sinatra needs its import and a block; tables need ActiveRecord."""
307307
src = ('get "/x"\nget "/y", to: redirect("/z")\nget "/w", to: "nohash"\nclient.get "/v", to: "a#b"\n'
308308
'cache.get("/k") do\nend\n')
309309
assert found("ruby", src, []) == []
@@ -413,7 +413,7 @@ def test_expand_entry_shape():
413413

414414

415415
def test_php_negatives_and_tables():
416-
"""Review Focus 3."""
416+
"""Look-alikes give nothing."""
417417
# a routes file may call the global `Route` alias without a `use`: the Route patterns run without `when`
418418
route = "Route::get('/x', [C::class, 'a']);\nRoute::match(['get'], '/m', h);\n" \
419419
"Route::middleware(['auth'])->prefix('v1');\n"
@@ -454,7 +454,7 @@ def test_php_import_kinds():
454454

455455
@pytest.mark.parametrize("lang", ["go", "csharp", "rust", "ruby", "php"])
456456
def test_every_pack_regex_entry_has_when(lang):
457-
"""Review Focus 3: a pack regex without `when` fires on any file of the language. The exceptions are files
457+
"""A pack regex without `when` fires on any file of the language. The exceptions are files
458458
that import nothing, each with a tight regex and look-alike tests: Rails routes and resources, C#
459459
minimal APIs (implicit usings), Laravel routes (the global `Route` alias), Rails models (`self.table_name`)
460460
and gorm models (`TableName`)."""

‎viewer/src/App.svelte‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
saveCodeLinks(safeStorage(), codeLinks);
5353
scene?.setCodeLinks(codeLinks);
5454
}
55-
// layers (spec §15): the floor's extra layers (one per heavily used item, named by its code), the one shown (the
55+
// layers: the floor's extra layers (one per heavily used item, named by its code), the one shown (the
5656
// scene's, reset to the base on a floor change), the line kinds it draws (the legend's line rows follow it) and the
5757
// list's state
5858
let layers = $derived(model ? floorLayers(model, container) : []);
@@ -74,7 +74,7 @@
7474
scene?.keepCentre();
7575
requestAnimationFrame(() => scene?.resize());
7676
}
77-
// the trace pane (spec §3): what it traces, where it is drawn, the divider's place and whether it fills the screen
77+
// the trace pane: what it traces, where it is drawn, the divider's place and whether it fills the screen
7878
// the trace graph is built on the first trace, not on load: this line alone reads it, and only once `trace` is set
7979
let graph = $derived(model ? new TraceGraph(model) : null);
8080
let trace = $state.raw<TraceState | null>(null);
@@ -197,7 +197,7 @@
197197
let resizeWatch: ResizeObserver | null = null;
198198
let tracePane = $state<{ escape: () => boolean }>(); // the pane's own Esc: its pin form, then its detail panel
199199
200-
/** Start a trace on `focus` (spec §3.1, S1, A2): any map node or floor group, or a line (`line`); the pane opens below
200+
/** Start a trace on `focus`: any map node or floor group, or a line (`line`); the pane opens below
201201
* the floor; the floor keeps its zoom, and the selection is cleared so the floor and the pane show one subject. */
202202
function startTrace(focus: string, direction: PinDirection = "both", line?: LineStart) {
203203
if (!model || (!line && !traceable(model, focus))) return;
@@ -206,7 +206,7 @@
206206
}
207207
208208
/** The pane's own new state: its direction, depth and folds keep the floor as it is; Trace from here, a new focus,
209-
* clears the selection as startTrace does (S1). */
209+
* clears the selection as startTrace does. */
210210
function retrace(st: TraceState) {
211211
const refocus = st.focus !== trace?.focus;
212212
trace = st;
@@ -223,7 +223,7 @@
223223
224224
/** What the inspector shows (audit row 64): with the pane open, the item the floor's blue mark is on (the pointed
225225
* row's node, else the trace's focus; a line's trace, its line while this floor has it) — shown, not selected, so the
226-
* floor and the pane keep one subject (S1, A1); with the pane closed, the selection (nothing: the floor). */
226+
* floor and the pane keep one subject; with the pane closed, the selection (nothing: the floor). */
227227
let shown = $derived<Target>(trace && model
228228
? traceSubject(model, trace, point, (k) => {
229229
const b = model!.bundles(container);

‎viewer/src/audit/run.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const perView = (plan: FloorPlan, check: (routes: TileRoute[]) => Violation[]) =
2626
const perRoute = (plan: FloorPlan, check: (r: TileRoute) => Violation[]) =>
2727
perView(plan, (routes) => routes.filter((r) => r.pieces.length).flatMap(check));
2828

29-
/** Every check over one floor's plan, in the order of the check table (spec §3). */
29+
/** Every check over one floor's plan, in the order of the check table. */
3030
function checks(model: Model, c: string, plan: FloorPlan, measured: () => FloorMeasures): [CheckId, () => Violation[]][] {
3131
const { tf } = plan, { bundles } = model.bundles(c);
3232
return [

‎viewer/src/factory/clear.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const BADGE_FONT = 10.5;
105105
* 0.62 em wide here, plus 4 px padding each side): the drawn badge is never larger, so its spot holds it. */
106106
export const badgeSize = (n: number) => ({ w: Math.ceil(`used by ${n}`.length * BADGE_FONT * 0.62) + 8, h: 14 });
107107

108-
/** Where a `used by N` badge stands beside its machine (spec §15) and how far it may grow: its box at scale `k` has
108+
/** Where a `used by N` badge stands beside its machine and how far it may grow: its box at scale `k` has
109109
* its corner at (`ax` + `ox`·w·k, `ay` + `oy`·h·k), so the anchor (`ax`, `ay`) stays put and the badge grows away
110110
* from the box (`ox` 0 grows right, -1 left; `oy` 0 grows down, -1 up, -0.5 both ways, centred). `side` is the side of
111111
* the box it stands on. `maxK` is the largest scale (up to MAX_K) whose box is clear of every obstacle, so the badge

0 commit comments

Comments
 (0)