Autophagy cleanup: drop one unused JSDoc type import (sole mechanically-dead construct in the tree) - #682
Autophagy cleanup: drop one unused JSDoc type import (sole mechanically-dead construct in the tree)#682philcunliffe wants to merge 1 commit into
Conversation
Neither name is referenced anywhere in the file; both occur only on the `@import` line itself. Residue of the wizard integration in 4fb95dc. The module's `@ref LLP 0203#offer` annotation and the still-used `RunWizardSyncNowOptions` / `WizardSyncNowResult` import are untouched. npm test (3849 pass, 0 fail) and npm run typecheck are unchanged from the pre-change baseline on the same tree. Co-Authored-By: Claude <noreply@anthropic.com>
Review round: CLEANVerdict: clean. No findings at any severity. This is a one-line deletion of a JSDoc comment line, and it is correct. Recommend a human dispose of it as-is. Reviewed head SHA What the diff actually containsI checked the branch as it stands now rather than trusting the claim, and the head has not advanced past the single-trim commit: One commit, one file, zero insertions, one deletion:
Independent confirmation of the deadness claim: CONFIRMEDI re-ran the reachability work from scratch rather than reading the PR body's version of it. 1. Whole-tree bare-name grep (catches string-literal and manifest-key reachability, not just the import graph), against Seven occurrences in four files. In 2. The subtle trap, checked explicitly. 3. Positive control, the strongest evidence here. Grep proves absence of the string; it does not prove
4. Checklist, each item verified rather than assumed:
Scope discipline: CLEANZero insertions across the whole diff, so there is no room for style churn. No reformatting, renames, refactors, reordering, or comment rewording. The change is exactly one mechanically dead line. The PR body's "considered and deliberately not trimmed" section is correctly a negative record only: none of those 44 exports, 267 convention-discovered files, 7 barrel re-exports, or 2 post-return hoisted declarations appears in the diff, which is the right call. I confirmed the two post-return Gates, run by me on the branch head
Branch is 1 ahead / 0 behind A one-line diff deserves a plain answer: this is correct, minimal, and in scope. Nothing to fix, and I am deliberately not proposing further cleanups, since scope creep is itself against the autophagy brief. |
Autophagy cleanup tick. A full-tree mechanical dead-code sweep over 732 JS files turned up exactly one trim. Everything else that the scans flagged was verified reachable and left byte-identical.
Gate on this branch:
npm test3849 pass / 0 fail / 6 skipped,npm run typecheckclean. Both identical to the pre-change baseline measured on the same tree.Trim 1 (the only one): unused
@import { ChildProcess, SpawnOptions }src/core/cli/wizard/sync_now.jsline 17. Residue of the wizard integration in 4fb95dc.Reachability searches
Both names occur exactly once in the file, on the
@importline itself, and nowhere else in the repo in a way that binds to this file's JSDoc scope. A JSDoc@importis file-local, so the only binding site that matters is this file:That is the sole occurrence: no type annotation, no cast, no
@param, no@returnsuses either name.Whole-tree scan for unused JSDoc type imports across
src/,hypaware-core/,bin/,test/,scripts/reported this as the only file with an unused@importname:Checklist
@importbinds names only inside its own file; nothing outside can consume it.test/.@ref LLPattached to it: the module docblock's@ref LLP 0203#offer [implements]sits on line 15 and annotates the module's purpose, not the type import. It is untouched by this diff.sync_now.jsis not inpackage.jsonmain/exports/bin, and this is a comment line regardless.README.md,docs/, orCONTEXT.md.tsc -p tsconfig.json --noEmit(checkJs: true,strictNullChecks: true) passes with the line removed. The remaining@import { RunWizardSyncNowOptions, WizardSyncNowResult }is still used and is kept.Considered and deliberately NOT trimmed
Recorded so the negative result is auditable too.
44 exports with no consumer outside their own file
A scan for exported names with zero references anywhere else in the tree (searching
.js/.ts/.json/.mdacrosssrc/,hypaware-core/,bin/,test/,scripts/,docs/,llp/,notes-archive/and the root files, matching the bare name so string literals and manifest keys count) returned 44 names. Every single one is used inside its own file, so none is dead. Examples:These are over-exported, not dead. Narrowing an export is a refactor with real blast radius (
files: ["src/", ...]publishes the whole tree, so consumers can deep-import), and is out of scope for an autophagy tick.267 files no other file mentions by name
All are convention-discovered entry points, confirmed by reading the discovery code:
test/**/*.test.js(231 files):scripts/run-tests.jswalks directories and picks up anything ending.test.js.hypaware-core/smoke/flows/*.js(36 files): loaded by dynamicimport()from a string name.No orphan module exists under
src/or any pluginsrc/.2 statements after a
returnBoth are hoisted
async function walk(dir)declarations placed below thereturn, and both are called before it, so they are reachable by hoisting and deliberate style.src/core/cache/partition.js:169-await walk(root)on line 168, above thereturn results.src/core/cache/spool.js:411-await walk(root)on line 410, above thereturn tables.0 unused runtime imports
A scan of every
import ... fromclause (default, namespace, and named) acrosssrc/,hypaware-core/,bin/,test/,scripts/found no import whose binding is unused in its file. Empty output.0 unused module-level declarations
A scan for top-level non-exported
function/const/let/var/classdeclarations never referenced again in their own file, cross-checked against the whole tree for string-key reachability, returned nothing.0 commented-out code blocks
A scan for runs of 2+ consecutive
//lines whose bodies look like code returned 30 hits, and all 30 are genuine explanatory prose that the heuristic mis-flagged on backticked identifiers and trailing punctuation. Many carry@ref LLPannotations (src/core/cli/wizard/index.js,src/core/commands/clients.js,src/core/config/action_reconciler.js, and others). Nothing commented out.7 barrel re-exports with no consumer beyond the barrel
All left in place:
src/core/observability/index.jsandsrc/core/util/index.jsare publishedpackage.jsonentry points (./core/observability,./core/util), andbuildResourceadditionally reaches the././coreentry viaexport * from './observability/index.js'insrc/core/index.js:8. Explicitly excluded by the "not a package entry point" rule.src/core/usage-policy/index.jsis the subsystem façade, andfiles: ["src/", ...]publishes it. These are the subsystem's error-kind and version vocabulary, i.e. deliberate interface, not dead code.Trimming a barrel's public surface is an API decision for a human, not a mechanical autophagy trim.