Skip to content

chore: remove orphaned old engine (dead code) (issue #42) - #275

Open
ranxianglei wants to merge 1 commit into
2026-08-05_acp-kernelfrom
2026-08-05_remove-old-engine
Open

chore: remove orphaned old engine (dead code) (issue #42)#275
ranxianglei wants to merge 1 commit into
2026-08-05_acp-kernelfrom
2026-08-05_remove-old-engine

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Stacked on #274 (base: 2026-08-05_acp-kernel). Retarget to master once #274 merges — or fold both into one merge, whichever @Dog prefers.

Per @Dog on dog/opencode-acp#42: 旧代码可以直接删除 在新分支 — delete the dead old engine, on a new branch.

What

Removes every source file + test that became orphaned after the one-shot acp-kernel rewrite (#274). The dead set was computed by a transitive relative-import closure trace from index.ts — only genuinely unreachable files are deleted; everything the kernel adapter and shared infra still import is kept.

Removed

  • 51 source files: lib/hooks.ts, lib/compress-permission.ts, whole lib/commands/, lib/gc/, lib/ui/, lib/compress/quality-gate/, lib/messages/filter/, lib/messages/inject/, plus selected files in lib/compress/, lib/messages/, lib/prompts/.
  • 47 test files (those covering the deleted modules).

Kept (still reachable — NOT dead)

All lib/kernel/, shared infra (config, logger, token-utils, auth, update, host-permissions, config-validation), and old modules still imported by them: messages/{query,shape}.ts, prompts/* (except dead extensions), state/*, message-ids.ts, protected-patterns.ts, parts of compress/.

Verification

  • npm run typecheckPASS (no dangling imports)
  • npm run buildPASS; dist/index.js = 175.53 KB, byte-identical to pre-deletion → confirms the removed code was already tree-shaken; zero runtime impact, pure source-tree hygiene.
  • npm testPASS (336 tests, 0 fail; 961 → 336, −625 dead-engine tests).
  • scripts/ci/check-pr.sh — PASS.

Devlog: devlog/2026-08-05_remove-old-engine/{REQ,WORKLOG}.md.

Per @Dog on issue #42: delete the old in-tree compression engine that became
dead code after the one-shot acp-kernel rewrite (PR #274).

Computed the dead set via transitive relative-import closure from index.ts:
only genuinely unreachable files were deleted; everything the kernel adapter
and shared infra still import is kept.

Removed:
- 51 source files: lib/hooks.ts, lib/compress-permission.ts, whole
  lib/commands/, lib/gc/, lib/ui/, lib/compress/quality-gate/,
  lib/messages/filter/, lib/messages/inject/, + selected files in
  lib/compress, lib/messages, lib/prompts.
- 47 test files (those covering the deleted modules).

Kept (still reachable): all lib/kernel/, shared infra (config, logger,
token-utils, auth, update, host-permissions, config-validation), and old
modules still imported by them (messages/{query,shape}, prompts/*,
state/*, message-ids, protected-patterns, parts of compress/).

Verification: typecheck PASS, build PASS (dist/index.js 175.53 KB —
byte-identical to pre-deletion, confirming the code was already tree-shaken;
zero runtime impact), npm test 336 pass 0 fail (961 -> 336, -625 dead-engine
tests).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant