Commit Graph
4 Commits
Author SHA1 Message Date
sam d591d02f0b fix(tools): stop silently truncating tracker titles in reachaudit output
The whole-package section hard-truncated tracker hit text to 56 chars
with no ellipsis, so long issue titles cut off mid-word (e.g. "...neither
re"). Switch to the same indented-list format already used for the
in-package section instead of a fixed-width single line.
2026-09-19 17:55:22 +10:00
sam 0c9d61eed3 feat(tools): surface half-wired symbols inside shipped packages in reachaudit
reachaudit classified whole unreachable packages but explicitly skipped
findings inside packages already in the cmd closure ("reported separately
as live-package findings" -- never implemented). That's the more common
half-built-feature shape: the package ships, one symbol at its call site
doesn't (crondelivery.ChatCourier, eda/playbook.Store.Dispatch,
gatewayrpc.StoreClient). Add a second in-package-* report section using
the same tracked/untracked/dynamic classification. Also wires the --md
flag, which was accepted but never written.
2026-09-19 17:37:20 +10:00
sam 38c0e485bc chore(tools): make unreachable-code analysis runnable from the Taskfile
Add `task deadcode` (whole-program RTA from ./cmd/...) and `task reachaudit`
(the existing classifier on top of it). Neither joins `task check`: both
report a standing backlog, so gating on them fails every run until that
backlog is zero, same as `task vuln`.

`task deadcode` shells to `go run ...@latest` rather than a local binary on
purpose. A deadcode built against an older Go than this module exits non-zero
and prints nothing, which reads as "no dead code" instead of "analysis
failed" -- the locally installed copy was built against 1.26 against a 1.27
module and had been silently reporting an empty tree.

reachaudit had two traps that made it answer confidently from nothing:
its --repo default pointed at a path that does not exist on either machine,
and it reused /tmp/reachaudit-deadcode.txt with no staleness check, so it
would serve a previous tree's analysis indefinitely. Key the cache on HEAD
and refuse it outright when the tree is dirty.

Also lands the design for tools/symbolrefs, the type-resolved reference
index that covers what reachability cannot: RTA treats every address-taken
function as live, so every reflect.ValueOf entry in the *extract tables
launders a dead symbol into a reachable-looking one, and deadcode reports
functions only, leaving dead package vars unrepresentable.
2026-09-18 13:15:26 +10:00
sam fa8b608c1f chore(tools): add reachaudit reachability report tool
Reports completion state rather than intent: walks the tree, finds
code no shipped binary can reach, and attributes each finding to its
package with provenance and tracker status, so "is it implemented?"
and "is it reachable?" are separately answerable.

Advisory only; it never proposes deletion.

Also ignore .local/ (gh CLI state created inside the tree).
2026-09-13 14:48:17 +10:00