Skip to content

(janitor/test-prune): remove extension tests that only pin constants and dead code - #6677

Open
kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/test-prune-extension-constant-tests
Open

kilo-code-bot[bot] wants to merge 1 commit into
mainfrom
janitor/test-prune-extension-constant-tests

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Prunes four low-value tests in the browser extension that add maintenance churn without detecting a plausible production regression. All changes are test-only; no production code is touched.

Removed and surviving coverage

apps/extension/src/shared/request-order.test.ts (deleted)

  • What it asserted: isLatestRequest(1, 2) === false and isLatestRequest(2, 2) === true.
  • Why it cannot detect a regression: isLatestRequest is (a, b) => a === b, and a repo-wide search shows it has zero production callers — it is dead code. The test re-asserts JavaScript === on a function nothing uses, so no production behavior change can fail it.
  • Surviving coverage: none needed; the module is unreferenced.

apps/extension/entrypoints/sidepanel/settings-dialog-state.test.ts (deleted)

  • What it asserted: store.get(settingsDialogOpenAtom) defaults to false.
  • Why it cannot detect a regression: the atom is declared atom(false). The test restates the literal initializer through Jotai; it verifies Jotai's default-value behavior, not repository-owned logic.
  • Surviving coverage: none needed; there is no transformation or branch to cover.

apps/extension/src/shared/agent-context-compaction.test.tsdescribe('tuning constants') block (removed)

  • What it asserted: KEEP_RECENT_EXCHANGES === 2, KEEP_RECENT_EXCHANGES_MANUAL === 0, SUMMARY_PREFIX.length > 0.
  • Why it cannot detect a regression: each assertion compares an exported constant to its own literal. Retuning the constant fails the test without any behavioral regression.
  • Surviving coverage: the same file still behaviorally tests splitEventsForCompaction, hasCompactableHistory, and renderEventsAsTranscript (including KEEP_RECENT_EXCHANGES_MANUAL as an argument), which exercise what these constants drive.

apps/extension/entrypoints/sidepanel/workflow-script-diff.test.tspins the exported context and ceiling constants block (removed)

  • What it asserted: DIFF_CONTEXT_LINES === 3, MAX_DIFF_LINES === 1200.
  • Why it cannot detect a regression: literal-to-literal comparisons with no independent oracle.
  • Surviving coverage: the same file behaviorally tests buildUnifiedScriptDiff, including MAX_DIFF_LINES via the { length: MAX_DIFF_LINES + 1 } too-large inputs.

Verification

  • pnpm --filter kilo-extension test (focused: the two edited files) — 21 passed.
  • oxlint (type-aware, extension config) on changed files — 0 warnings, 0 errors.
  • tsc --noEmit for the extension package — passes (after pnpm --filter @kilocode/trpc build).
  • oxfmt apps/extension — formatted; git diff confirms only the four intended test files changed.

Remove tests that cannot detect a production regression:

- request-order.test.ts: isLatestRequest is `a === b` with no callers, so
  the test re-asserts JavaScript equality on dead code.
- settings-dialog-state.test.ts: asserts a Jotai `atom(false)` default,
  restating the literal rather than exercising repository logic.
- agent-context-compaction.test.ts "tuning constants": asserts tuning
  constants equal their own literals.
- workflow-script-diff.test.ts "pins the exported context and ceiling
  constants": asserts DIFF_CONTEXT_LINES/MAX_DIFF_LINES equal their
  literals; behavioral diff coverage remains in the same file.
@kilo-code-bot kilo-code-bot Bot added the janitor Automated dead-code/duplication cleanup label Sep 24, 2026
@kilo-code-bot
kilo-code-bot Bot enabled auto-merge (squash) September 24, 2026 07:41
@kilo-code-bot

kilo-code-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Test-only pruning of four extension test files; no production code touched. Verified that isLatestRequest is unreferenced ((a,b) => a === b), that the removed constant-pinning blocks restated their own literals, and that the surviving imports (KEEP_RECENT_EXCHANGES_MANUAL, MAX_DIFF_LINES) remain used and behaviorally exercised. No unused imports, no behavioral coverage gaps, and no new defects introduced.

Files Reviewed (4 files)
  • apps/extension/src/shared/request-order.test.ts (deleted)
  • apps/extension/entrypoints/sidepanel/settings-dialog-state.test.ts (deleted)
  • apps/extension/src/shared/agent-context-compaction.test.ts
  • apps/extension/entrypoints/sidepanel/workflow-script-diff.test.ts

Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0

Review guidance: REVIEW.md from base branch main

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

janitor Automated dead-code/duplication cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants