Skip to content

refactor(session): drop dead compactor config, branch, and aliases - #1398

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10511-compactor-dead-code
Oct 12, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10511-compactor-dead-code

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

Removes dead config, an unreachable branch, and an inert alias from the session compactor (CL-10511). One item deviated (kept) because a real consumer exists — see below.

Changes

  1. maxAnchorTurns config (field + default + record entry) — Verified inert: no code reads it as a behavior input (grep over the repo shows it only copied into the output record.parameters, never consumed; no test asserts on it). Removed the field from CompactorConfig, its DEFAULT_COMPACTOR_CONFIG default, and the record.parameters.maxAnchorTurns entry. Mechanically dropped the now-invalid maxAnchorTurns: keys from compactor-pairing.test.ts (×13), context-compactor.test.ts (×7), and compaction-archive.test.ts (×1) so tsc --noEmit stays green.
  2. buildTurnSummary anchorCount param + unreachable branch — Verified inert: every call site omits it or passes 0 (production caller compactor.ts omits; context-compactor.test.ts omits; compactor-pairing.test.ts passed 0). Removed the param and the anchorCount > 0 ? … : "" branch; dropped the explicit 0 argument at compactor-pairing.test.ts:211.
  3. compactorNoOpFloor() → const COMPACT_NOOP_FLOOR = 1 — DEVIATION, not performed. The function is not inert: src/agent/compaction.ts imports it and uses it as MIN_TURNS_TO_COMPACT (a production behavior input that arms the compaction governor), and 4 test files call it. Removing/replacing it would require touching files outside this ticket's scope, so per the ticket rules it is left in place and reported as a deviation.
  4. isCompactSpacerTurn alias — Verified inert: private one-line alias for isHarnessCompactSpacer, with all 3 call sites inside compactor.ts (no external consumers). Inlined the call sites and deleted the alias.

Verification

  • bun test ./src/session/compactor-pairing.test.ts ./src/session/compaction-archive.test.ts ./src/context-compactor.test.ts — 70 pass, 0 fail.
  • bun run typecheck (tsc --noEmit) — passes.
  • oxfmt --check + oxlint on the 4 changed files — clean.
  • Diff: 4 files changed, 5 insertions(+), 35 deletions(-).

Fixes CL-10511

Plan: https://linear.app/abklabs/issue/CL-10511/remove-dead-code-and-inert-aliases-in-session-compactor

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

CL-10511

@corbits-triage

Copy link
Copy Markdown
Contributor

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios merged commit b9aa9b1 into main Oct 12, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10511-compactor-dead-code branch October 12, 2026 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant