Uh oh!
There was an error while loading. Please reload this page.
Cleanup: drop seven unused type-import specifiers - #428
Conversation
Three `.d.ts` import headers and one JSDoc `@import` header carried type-import specifiers that no declaration or annotation in their own file references. Type imports are erased, so this is a header-only change with no runtime and no emitted-declaration effect. - src/core/cli/types.d.ts: AiGatewayCapability, PluginConfigInstance, CommandRegistration, CommandRunContext - src/core/daemon/types.d.ts: HypAwareV2Config, ConfigValidationError - src/core/registry/types.d.ts: CapabilityRegistration - src/core/observability/tracer.js: Span Automated neutral autophagy cleanup (LLP 0036). Held for human review. Co-Authored-By: Claude <noreply@anthropic.com>
philcunliffe
commented
Jul 28, 2026
Neutral review: cleanVerdict: clean. No actionable findings. Nothing was pushed. Reviewed head Independent reachability verificationI did not take the PR body's greps on trust. For every one of the seven removed specifiers I checked both the parent commit (
Exactly one occurrence before and zero after means the only deleted text was the import line itself, so no annotation or declaration site was collateral damage. The diff bears that out: every deleted line is an import specifier. Cross-file reachability, checked separately:
Convention and scope
Local checks (corroborating; PR CI is the authority and is green)
The 8 failures are pre-existing and unrelated. I reproduced them on a clean Agreed with the author that fixing them is out of scope for an autophagy trim, but they are a real RecommendationMergeable as-is. Ready for a human to take it out of draft. |
Uh oh!
There was an error while loading. Please reload this page.
Automated neutral autophagy cleanup (LLP 0036). This PR only proposes; a human reviewer disposes. It is never auto-merged, and it is opened as a draft.
Seven unused type-import specifiers, in three
.d.tsimport headers and one JSDoc@importheader. Type imports are erased at emit, so nothing here changes runtime behavior or the generated declaration tree. No construct, export, or file was removed.Trims and reachability evidence
Each name was proven unreferenced by grepping the file that imports it (a type-import specifier can only be consumed inside its own file: it is an import, not a re-export, so no other module can reach it through this path). The exported types themselves are untouched and still live in
hypaware-plugin-kernel-types.d.ts,src/core/config/types.d.ts, andsrc/core/observability/runtime.js.1.
src/core/cli/types.d.ts-AiGatewayCapability,PluginConfigInstance,CommandRegistration,CommandRunContextEach name occurs exactly once in the file: on its own import line. Other modules that use
AiGatewayCapability/PluginConfigInstance(src/core/commands/status.js,src/core/commands/clients.js,src/core/config/schema.js, several pluginindex.jsfiles,test/core/attach-policy.test.js) each declare their own@importfrom the kernel contract, not from this file.2.
src/core/daemon/types.d.ts-HypAwareV2Config,ConfigValidationErrorBoth occur only on their import lines. The other four specifiers on line 6 (
ActionReconciler,ConfigControlStatus,ConfigLayerDrop,V1Diagnostic) are used and were left alone.3.
src/core/registry/types.d.ts-CapabilityRegistrationOne occurrence, its own import line. Note
CapabilityRegistry(used) is a different name and was kept.4.
src/core/observability/tracer.js-SpanOne occurrence.
tsc --noUnusedLocalsindependently flags this one:src/core/observability/tracer.js(10,4): error TS6133: 'Span' is declared but its value is never read.TheSpantype itself remains exported fromsrc/core/observability/runtime.js.The checks that were run against each candidate
greped the whole tree for each symbol and for each module path. Import specifiers are not re-exported, so nothing outside these files can reach them.test/,hypaware-core/smoke/, orscripts/names them via these files; the tests that useAiGatewayCapability/PluginConfigInstanceimport from the kernel contract directly.@refannotation: none of the removed lines carry or sit under an// @ref LLP NNNN#anchorannotation.package.jsonmain/exports/bin/scripts, or underbin/.src/core/cli/types.d.tsis not a publishedtypestarget (./integrationpoints atsrc/core/cli/integration.d.ts).README.md,docs/,llp/, orAGENTS.mdtext depends on these specifiers.What was examined and deliberately left alone
The negative results, so the next run does not re-tread them:
exportkeyword: a de-export refactor, not a deletion, and out of scope for autophagy.stopLaunchAgent(src/core/daemon/macos.js) andstopSystemdUnit(src/core/daemon/linux.js) were the only two symbols with zero references anywhere. They survive anyway:src/core/daemon/install.js:340doesexport { macos, linux }, re-exporting both platform modules as whole namespace objects, so every export on them is reachable package surface. They are also the symmetric partners ofstart*/restart*/uninstall*in a deliberately complete platform adapter.tsc --allowUnreachableCode falsereports zero TS7027 diagnostics across the tree.src/,hypaware-core/plugins-workspace/,bin/, orscripts/is unreferenced. The only basename-unreferenced files aretest/**andhypaware-core/smoke/flows/**, which are discovered by glob at runtime.Checks
npm run typecheck- green:(no diagnostics)
npm test- 8 pre-existing failures, unchanged by this PR:All 8 are in
test/core/leave-command.test.jsand fail identically on unmodifiedorigin/master(verified by stashing this diff and re-running: same 8 names, samepass 2768 / fail 8counts):They assert
hyp leaveexits 0 and get exit 1 after "removed the central config layer". Unrelated to type-import specifiers, which cannot affect runtime. Flagging it here rather than fixing it: ahyp leaveregression onmasteris a behavior bug, out of scope for an autophagy cleanup.Branch name
autophagy/cleanup-2026-07-28already exists locally from an earlier pass today (merged as #420), as do-jsdoc-importsand-pass3. This run follows that established suffix convention rather than force-moving a stale branch.🤖 Generated with Claude Code