Files
hermes-desktop/docs/harness/orphan-audit.md
T
toor 01d9e301fc
Build / build (push) Canceled after 0s
Playwright / browser (push) Canceled after 0s
initialize Electron desktop app and remove unused files
2026-10-25 01:09:01 +08:00

4.0 KiB

Orphan-file audit — 2026-10-25

The audit followed static imports, re-exports, literal import() and require() from Electron, Vue, server, CLI and test entrypoints, then checked candidate paths and exported names against source, scripts, tests and documentation. Public assets were checked separately against HTML, Vue, CSS/SCSS, manifest and source references. No unresolved local imports were found during the audit.

Removed

Seven source files had no application or test callers:

  • packages/server/src/services/windows-command.ts: unused Windows shim helpers; active command launchers have their own implementations.
  • packages/server/src/services/credentials.ts: unused file-based credential store; active login uses the users database and profile credential services.
  • packages/server/src/services/hermes/context-engine/index.ts: unused barrel; compression code imports implementation modules directly.
  • packages/client/src/api/hermes/runtime-versions.ts: unused browser API wrapper; the server's runtime/version endpoints remain in use and were retained.
  • packages/client/src/api/hermes/global-agent.ts: unused browser socket wrapper; the active chat store owns its global-agent connection.
  • packages/client/src/components/hermes/kanban/KanbanColumn.vue: unused column component; the current Kanban view builds its active columns directly.
  • packages/client/src/components/hermes/chat/DrawerPanel.vue: unused old drawer; active file and terminal panels remain.

Nine unreferenced assets were removed: public/logo-original.png, src/assets/image.gif and all seven TTF files in public/fonts/ under packages/client/. Total source/asset reduction: 16 files, 16,571,452 bytes. The current logo, favicon, thinking animation and external KaTeX fonts remain.

Retained deliberately

  • api/hermes/stt.contract.ts is compiled by vue-tsc for request-shape assertions.
  • styles/arco-theme.ts is the documented token reference and a style-test input.
  • composables/useNotification.ts belongs to the documented frozen Arco adapter API, alongside the message and dialog adapters.
  • Modules imported only by regression tests remain test dependencies, including summary-cache, read-only conversation helpers, response-stream parsing and the disabled session-import guard. Removing these would change test coverage and safety checks, which is outside this cleanup.
  • prototype_reference/ is referenced by the current theme documentation and style comments. Historical documents, vendor provenance and vendored Python bridge files were preserved.
  • dist/, release/, dependencies, coverage and browser-test reports are ignored generated output, not source orphans. Existing tested installers are retained locally and excluded from Git.

Ongoing check

Run npm run check:orphans. The checker follows application and test module imports and explicitly lists the two documented non-runtime entrypoints above (STT contract and notification adapter). Declaration files and vendored code are excluded. Dynamically constructed paths and public assets still need manual review; the checker is not proof that an individual export is unused.

Component tests now enable Vue Test Utils automatic unmount in the JSDOM setup. This disposes watchers and animation work that could otherwise outlive the test document and intermittently fail coverage runs during environment teardown.

Validation

  • npm run harness:check and npm run check:orphans: passed.
  • npm run test:coverage -- --maxWorkers=4: 289 files passed; 2,141 tests passed, 2 skipped, no unhandled errors after the component cleanup fix.
  • npm run test:e2e -- --workers=2: all 69 browser tests passed.
  • npm run build: passed.
  • npm run test:electron: all three real Electron tests passed.

This checkout had no initial Git commit. The initial source snapshot excludes dependencies, installers, build output, local state and test reports. A scan of the candidate files found no private-key or provider-key patterns.