From 682007a2507f209c2378796442d4bc879516191a Mon Sep 17 00:00:00 2001 From: asepharyana Date: Thu, 16 Jul 2026 04:40:34 +0700 Subject: [PATCH] fix(plan): perkuat fixture test log agar benar-benar uji squash_log Ditemukan lewat trace manual (bukan implementer): fixture lama cuma punya 1 baris berpola error, di bawah ambang looks_log_shaped (>=3), jadi tanpa sadar selalu jatuh ke squash_generic -- test tetap lulus tapi tidak pernah menguji logika scoring/windowing squash_log sama sekali. Tambah baris error/warning lagi supaya jalur squash_log benar-benar terpakai. Co-Authored-By: Claude Sonnet 5 --- .../plans/2026-07-16-context-compaction-overhaul.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/superpowers/plans/2026-07-16-context-compaction-overhaul.md b/docs/superpowers/plans/2026-07-16-context-compaction-overhaul.md index d3474a8..8a99fd3 100644 --- a/docs/superpowers/plans/2026-07-16-context-compaction-overhaul.md +++ b/docs/superpowers/plans/2026-07-16-context-compaction-overhaul.md @@ -672,16 +672,28 @@ mod tests { #[test] fn log_like_output_keeps_error_lines_and_marks_omissions() { + // `looks_log_shaped` requires >= 3 lines matching error/warn/fail/ + // panic/stack-frame patterns before routing to `squash_log` at + // all — a single error line isn't enough and would silently fall + // through to `squash_generic` instead, so this fixture needs at + // least 3 such lines, spread apart, to actually exercise + // squash_log's scoring/windowing logic (not just its fallback). let mut lines = vec!["build started".to_string()]; for i in 0..200 { lines.push(format!("info: compiling module {i}")); } + lines.push("error: something failed early in the build".to_string()); + for i in 0..200 { + lines.push(format!("info: compiling module {}", i + 200)); + } + lines.push("warning: deprecated api used somewhere".to_string()); lines.push("error: something failed at the end".to_string()); let text = lines.join("\n"); assert!(text.len() > SQUASH_FLOOR_BYTES); let result = apply("bash", &text); + assert!(result.contains("error: something failed early in the build")); assert!(result.contains("error: something failed at the end")); assert!(result.contains("lines omitted")); assert!(result.len() < text.len());