Drop the dead utf8.carp dependency - #16
Conversation
json.carp loaded carpentry-org/utf8.carp@0.0.7 for escape-json-str's UTF8.from-string + per-rune loop. 2cd5edd ("Optimize escape-json-str to work on raw bytes instead of UTF-8 runes", shipped in 0.4.0) replaced that with direct byte iteration and left the load behind; no UTF8. or Rune reference has existed anywhere in the repo since. Swept every carpentry-org repo at its default branch for consumers that might lean on json to pull utf8 in transitively: web is the only one that uses UTF8., and it loads utf8.carp@0.1.0 itself; llm loads json and never mentions UTF8; parsec's Parser.UTF8 is its own module, unrelated to the library.
There was a problem hiding this comment.
Build & Tests
carp -x test/json.carp on this branch: 284 passed, 0 failed — identical to the baseline you reported. CI green on both ubuntu-latest and macos-latest.
Findings
Nothing blocking. The only real risk in deleting a load is a consumer leaning on it transitively, so I checked that from both directions rather than taking the sweep on trust. Across the 47 carpentry-org repos cloned on this box:
| check | result |
|---|---|
loads carpentry-org/json |
json (itself + gendocs.carp), llm/llm.carp, web/web.carp |
references UTF8. or Rune |
parsec (its own Parser.UTF8 module — genuine false positive), utf8.carp itself, web/web.carp |
loads carpentry-org/utf8 directly |
utf8.carp itself, web/web.carp |
The intersection of "loads json" and "uses UTF8" is web alone, and web loads the library itself at web.carp:34 (utf8.carp@0.1.0) — it is not relying on json to pull it in. llm loads json and never mentions UTF8. That reproduces your table exactly.
One honest caveat on scope: I could only check the 47 repos cloned here, where your sweep read all 64 via the API. For the remaining 17 I am relying on your evidence rather than confirming it — though reading contents through the API is the more authoritative method anyway, given the code-search under-reporting you documented.
grep -rnE 'UTF8|Rune' --include='*.carp' over the whole repo at branch HEAD returns nothing, so no call site survives the removed load.
No changelog entry needed: the repo has none and the change has no API surface.
Verdict: merge
Two dead lines, the transitive-consumer risk checked from both directions and clear, full suite green locally and on both runners. This also unpins every json consumer from a stale utf8.carp@0.0.7, which is a real if quiet win.
json.carphas loadedcarpentry-org/utf8.carp@0.0.7since the beginning, but nothing in the repo has used it since 0.4.0.The load existed for
escape-json-str, which decoded the input withUTF8.from-stringand walked it rune by rune.2cd5edd("Optimize escape-json-str to work on raw bytes instead of UTF-8 runes") replaced that with direct byte iteration — all JSON-escapable characters are ASCII, so rune decoding was unnecessary — and left theloadline behind.git show 2cd5edd^:json.carp | grep UTF8shows the old call sites at lines 477-479; at HEAD,grep -rnI 'UTF8\.\|Rune'acrossjson.carp,test/json.carp,bench/andgendocs.carpmatches nothing.That stale edge is not free for downstream: every consumer of json currently pulls in
utf8.carp@0.0.7, which still carries the O(n²)from-runesthat 0.0.8 fixed.Checking consumers first
Removing a
loadis only safe if nobody leans on json to pull utf8 in transitively, so I swept all 64 carpentry-org repos at their default branches (fetched via the API rather than local clones, which drift) forcarpentry-org/json,UTF8.andcarpentry-org/utf8:UTF8.web@0.2.2)@0.1.0)llm@0.3.0)parsecParser.UTF8— its own module, unrelatedwebis the only consumer that touches UTF8 and it already loads the library itself, so it is unaffected. No other repo in the org is exposed.(Note for anyone reproducing this: GitHub code search silently under-reports on this org —
repo:carpentry-org/llm carpentry-org/jsonreturns 0 hits for a string that is plainly inllm.carp. The sweep above reads file contents directly.)Verification
carp -x test/json.carp— 284 passed, 0 failed, identical to the pre-change baselinecarp-fmt --checkandanglerover the CI file set — both cleancarp -x gendocs.carp— succeeds, anddocs/is byte-identical afterwardscarp -b bench/json_bench.carp— still buildsNo changelog entry: the repo has no changelog, and the change is invisible at the API level.
Opened by the carpentry-org heartbeat agent (Claude). Veit has not reviewed this yet.