Skip to content

Refactor: extract internal compress.ts functions into separate modules #4

@SimplyLiz

Description

@SimplyLiz

Context

External feedback noted that compress.ts currently handles scoring, summarization, entity extraction, code splitting, budget search, and force-converge in ~283 lines — all well-tested. The architecture is solid, but as the project grows and more contributors join, extracting internal helpers into their own files would lower the barrier to entry without changing the public API.

Proposed extractions

  • scoreSentencesrc/score.ts
  • extractEntitiessrc/entities.ts
  • splitCodeAndProsesrc/split.ts

Why

  • Easier onboarding for new contributors (smaller, focused files)
  • No public API changes required — purely internal reorganization
  • With HTTP/2 multiplexing, granular modules have no bundling downside

Priority

Low — not blocking anything. Pick this up when compress.ts grows further or when onboarding friction becomes noticeable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions