refactor(producer): tighten resolveChunkPlan assertion + trim comments

Address self-review findings:
- assertPositiveInteger now only runs on the caller-supplied path so the
  error message names `configChunkSize` only when the caller actually
  passed one. Previously, the assertion fired against `resolvedChunkSize`
  on both paths and would have lied about the offending input.
- Drop the call-site comment that narrated the diff/history; the
  function docstring already covers the contract.
- Drop the internal-track name and date from the MIN_CHUNK_SIZE rationale
  and the test block header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
James
2026-05-18 20:37:25 +00:00
co-authored by Claude Opus 4.7
parent e79a8faa42
commit fd3fce9955
2 changed files with 14 additions and 18 deletions
@@ -96,12 +96,9 @@ describe("resolveChunkPlan", () => {
});
// ── Auto-size when configChunkSize is undefined ───────────────────────
// Pre-fix, `plan()` defaulted `chunkSize` to 240 on a `?? DEFAULT_CHUNK_SIZE`
// line, so a 660-frame composition with `maxParallelChunks=16` ended up at
// 3 chunks (ceil(660/240)) regardless of the caller's fan-out intent.
// Surfaced by the lever-1 chunk-scaling benchmark on 2026-05-17. The
// auto-sizer now picks `max(MIN_CHUNK_SIZE, ceil(totalFrames /
// maxParallelChunks))` whenever the caller leaves `chunkSize` undefined.
// The auto-sizer picks `max(MIN_CHUNK_SIZE, ceil(totalFrames /
// maxParallelChunks))` whenever the caller leaves `chunkSize` undefined,
// honoring `maxParallelChunks` instead of clamping at a 240-frame default.
it("explicit chunkSize wins: 660 frames + chunkSize=240 + maxParallelChunks=16 → 3 chunks", () => {
// Regression guard for the "explicit number still works" half of the