Skip to content

test+refactor(compaction): PruneSummarizerDisabled coverage + hoist ctx_max - #226

Merged
yogthos merged 1 commit into
mainfrom
fix/compaction-review-followups
May 29, 2026
Merged

test+refactor(compaction): PruneSummarizerDisabled coverage + hoist ctx_max#226
yogthos merged 1 commit into
mainfrom
fix/compaction-review-followups

Conversation

@yogthos

@yogthos yogthos commented May 29, 2026

Copy link
Copy Markdown
Collaborator

Post-merge review follow-ups for the compaction-improvements stack (#220/#225/#222/#223/#224).

MINOR — missing test for PruneSummarizerDisabled

context_compacted_reports_compaction_kind covered PruneAndSummary, PruneAndFailedSummary, and PruneOnly but not PruneSummarizerDisabled (the breaker-open kind). kind_for now takes a failure count; a new assertion runs a would-succeed summarizer with failures at the cap and asserts the emitted kind is PruneSummarizerDisabled — proving the kind derives from the breaker being open, not from the summarizer outcome.

TRIVIAL — context window looked up 3× per iteration

context_window_for_model was called at the turn-start fold, the snip cap, and the post-usage decision with an identical result. The window is constant within an inner-loop iteration (the model can only change at a turn boundary), so it's hoisted to a single binding at the top of the loop body.

Pre-existing 'pending_messages never cleared' — not a bug

Investigated: pending_messages is cleared unconditionally right after injection in the inner loop, so the reported infinite-spin path can't occur. The original finding was based on stale line numbers. No change made.

Full feature-matrix tests green at -D warnings (2141 passed).

…ax lookup

Follow-ups from the post-merge review of the compaction-improvements stack:

- Test gap: context_compacted_reports_compaction_kind covered PruneAndSummary,
  PruneAndFailedSummary, and PruneOnly but not PruneSummarizerDisabled. The
  kind_for helper now takes a failure count; a new assertion runs a
  WOULD-SUCCEED summarizer with failures at the cap and asserts the emitted
  kind is PruneSummarizerDisabled (proving the kind comes from the breaker
  being open, not the summarizer's outcome).

- context_window_for_model was looked up 3x identically per inner-loop
  iteration (turn-start fold, snip cap, post-usage decision). The window is
  constant within an iteration (model only changes at a turn boundary), so
  hoist it to one binding at the top of the loop body and reuse.

Note: the reported 'pending_messages never cleared' concern does not apply to
current code — it is cleared unconditionally right after injection (run.rs
inner loop), so no infinite-spin path exists.
@yogthos
yogthos merged commit 1dc2fe6 into main May 29, 2026
9 checks passed
@yogthos
yogthos deleted the fix/compaction-review-followups branch May 29, 2026 21:50
allen-munsch pushed a commit to allen-munsch/dirge that referenced this pull request Jun 3, 2026
…ew-followups

test+refactor(compaction): PruneSummarizerDisabled coverage + hoist ctx_max
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