Uh oh!
There was an error while loading. Please reload this page.
Cleanup: one unused local, and the negative result for everything else - #420
Conversation
The only mechanically dead construct a full-tree sweep turned up this pass. `err` is destructured from `makeCtx()` and never read in that test body; the sibling tests that do assert on stderr keep theirs. Emitted `types/` tree is byte-identical before and after (340 files), which it must be: the change is in `test/`, outside the `tsconfig.build.json` rootDir. Generated by neutral's code-cleanup initiative (LLP 0036).
philcunliffe
commented
Jul 28, 2026
Calibration for whoever reviews this: the diff is one line, and closing this unmerged is a perfectly reasonable call. This pass found essentially nothing, which is the expected result now that #408 took the obvious pickings. The single trim is an unused The part that may be worth more than the diff is the negative result, so it is recorded here for the next pass rather than being re-derived:
Two things were found and deliberately left, since they are style churn rather than trims: duplicate import statements at
Generated by neutral's code-cleanup initiative (LLP 0036). Proposed, not asserted. |
philcunliffe
commented
Jul 28, 2026
Review round 1 - |
Uh oh!
There was an error while loading. Please reload this page.
A full-tree mechanical sweep for dead code. One trim survived. Almost everything this pass looked at came back alive, and the bulk of the value here is the negative result: the searches below are recorded so the next pass does not repeat them.
The one trim
test/core/remote-login-command.test.js:444- unused localerrtest('a session without a gateway credential seeds nothing and prints no forwarding output', async () => { const hypHome = await tmpHome() - const { ctx, out, err } = await makeCtx({+ const { ctx, out } = await makeCtx({erris destructured out ofmakeCtx()and never read anywhere in that test body. The test asserts onout(assert.doesNotMatch(out.join(''), /seeded|provisioned/)) and on the filesystem; it never touches stderr.Reachability evidence:
tsc -p tsconfig.json --noEmit --noUnusedLocalsreports exactlytest/core/remote-login-command.test.js(444,21): error TS6133: 'err' is declared but its value is never read.After the change that diagnostic is gone and no new one appears.err.test()callback, so it has no reachability surface at all beyond those 18 lines. Nothing imports it, no string can name it, no plugin kernel can dispatch to it.makeCtx()is unchanged and still returns the same object; only the binding is dropped. The three sibling tests in the same file that destructure{ ctx, out, err }or{ ctx, err }and do assert onerrare untouched.Not a package entry point (
test/is not inpackage.jsonfiles), not a CLI surface, no@ref LLPannotation attached.What was searched and came back alive
Recording these so the next pass can skip them.
Exports never referenced outside their own file: 82 found, 0 taken. A scan of all 1228
export function|class|const|let|vardeclarations acrosssrc/,bin/,scripts/,hypaware-core/, andtest/found 82 whose name appears in no other.jsfile in the tree. Removing theexportkeyword from any of them is an API change, not a dead-code trim, so all 82 were left alone - consistent with the previous pass (#408), which deferred the same category.Exports with zero references anywhere, including their own file: exactly 3. Re-running the scan against every
.js,.ts,.json,.md,.toml, and.yamlfile in the tree, only three exported symbols have a single occurrence (the declaration itself) and no mention anywhere else:getGascityRuntime(hypaware-core/plugins-workspace/gascity/src/runtime.js:35)stopSystemdUnit(src/core/daemon/linux.js:286)stopLaunchAgent(src/core/daemon/macos.js:357)These are precisely the three the previous pass deliberately left alone: a set/get/require trio member, and two members of a symmetric platform-adapter lifecycle family. This pass found no new evidence to overturn that, so they stay. The useful outcome is the confirmation that the "zero references anywhere" set is only these three - there is no fourth candidate hiding.
Never-imported modules: none. An import graph was built by resolving every
from '...',import('...'), andrequire('...')specifier across the whole tree, then checked against all 325 non-test, non-smoke-flow.jsmodules. 21 came back with no importer, and every one is a declared entrypoint:bin/hypaware.js(package.jsonbin),src/core/index.js/src/core/query/index.js/src/core/sinks/index.js(package.jsonexports),hypaware-core/smoke/index.js(package.jsonscripts.smoke), 14 pluginindex.jsfiles (each named asentrypointin itshypaware.plugin.json), and twoskills/hypaware-report-to-html/assets/copy-md.jsfiles (loaded by<script defer src="assets/copy-md.js">inassets/head.html). Test files andhypaware-core/smoke/flows/*are discovered dynamically by name and were excluded from the candidate set for that reason.Unreachable statements: none.
tsc -p tsconfig.json --noEmit --allowUnreachableCode falsereports zeroTS7027. A separate AST walk over every statement list (Block,SourceFile,ModuleBlock,CaseClause,DefaultClause), looking for anything following areturn/throw/continue/break, plus a pass for statements afterprocess.exit()/process.abort(), also found zero.Commented-out code blocks: none. Runs of two or more consecutive
//lines whose content parses as JS statements: zero hits. A deliberately looser scan surfaced four blocks (hypaware-core/plugins-workspace/claude/src/index.js:108-116,hypaware-core/plugins-workspace/codex/src/index.js:89-96,src/core/commands/clients.js:457-498,src/core/daemon/runtime.js:324-343); all four were read and are prose rationale carrying@ref LLPannotations, not code.Constant-false guards, write-only locals: none. No
if (false)/if (0)/while (false)/&& false/|| true. The only single-occurrence local bindings aresrc/core/cache/purge.js:155(for await (const _row of ...)) andsrc/core/cache/retention.js:201(for await (const _ of ...)), both intentional discard bindings in counting loops.Unused JSDoc
@importtype names: ~100, 0 taken. Still the largest mechanical signal in the tree (TS6196plus JSDoc-sourcedTS6133/TS6192), and still wide, low-value churn. Deferred, same as last pass.Deliberately not touched
Two files import the same module twice:
src/core/cli/remote_commands.js:20and:24both import from../remote/gateway_seed.jssrc/core/commands/clients.js:13and:16both import from../runtime/client_assets.jsEvery imported name in all four statements is used. These are redundant statements, not dead bindings, so folding them together would be style churn rather than a dead-code trim. Left alone.
Also flagged and not acted on:
pidFilePathis re-exported fromsrc/core/daemon/runtime.js:1089but every consumer imports it fromsrc/core/daemon/pid.jsinstead. Dropping a name from an export list is an API change, so it stays.Verification
npm test- unchanged, no regression:All 8 failures are the pre-existing ones in
test/core/leave-command.test.js(not ok 796, 797, 798, 800, 801, 802, 803, 804), identical before and after by name and number. No other file fails. This change adds none.npm run typecheck- clean, no output.npm run build:types- the emittedtypes/tree is byte-identical before and after:diff -r types-before typesproduces no output across all 340 files. This is the expected result and worth stating plainly, sincetsconfig.build.jsonsetsrootDir: srcand the change is intest/; the published declaration surface could not have moved, and the diff confirms it did not.Generated by neutral's code-cleanup initiative (LLP 0036). Proposed, not asserted: every trim above is a claim to check, not a fact to trust.