Skip to content

test: fix E2E — add protection scenarios + include 05/06 in CI - #214

Merged
ranxianglei merged 1 commit into
masterfrom
2026-07-27_fix-e2e-tests
Jul 27, 2026
Merged

ranxianglei merged 1 commit into
masterfrom
2026-07-27_fix-e2e-tests

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Summary

E2E tests had severe gaps that made them ineffective at catching real bugs. This PR fixes them.

Problems Found

  1. ALL protection disabled in E2E config (preserveRecentMessages: 0) — the mechanism fixed 3 times (PR fix: split protected ranges + soften last-user-message protection #210/release: v1.14.2 — split protected ranges + soften last-user-message #211/fix: soften protected zone — filter instead of reject + reduce default to 5 #212) was completely untested
  2. CI ran only 4/6 scenarios — scenarios 05 (subagent) and 06 (nudge-triggered) existed but were NOT in CI
  3. verify.ts too shallow — only checked blockCount, never verified which messages were compressed vs protected
  4. Would NOT catch recent bugs: baseline-reset (fix: preserve growth baseline when nothingToCompress #207), giant-group (fix: split protected ranges + soften last-user-message protection #210), hard-reject (fix: soften protected zone — filter instead of reject + reduce default to 5 #212)

Changes

Verification

  • Build ✅ | Typecheck ✅ | 922 unit tests ✅
  • All 8 E2E scenarios pass locally:
    • 01-basic-compress: 1 block ✅
    • 02-quality-reject: 0 blocks ✅
    • 03-quality-acknowledge: 1 block ✅
    • 04-batch-compress: 3 blocks ✅
    • 05-subagent-compress: parent 0 + child 1 ✅
    • 06-nudge-triggered: 1 block + baseline set ✅
    • 07-protection-filtered: 1 block + compressedCount ≤ 14 ✅
    • 08-nudge-with-protection: 1 block + baseline set + compressedCount ≤ 10 ✅

E2E tests had severe gaps that made them ineffective:
- ALL protection disabled (preserveRecentMessages:0) — the mechanism
  fixed 3 times (PR #210/#211/#212) was never exercised
- CI ran only 4/6 scenarios (05 subagent, 06 nudge missing)
- verify.ts only checked blockCount, not which messages were protected

Changes:
- run-e2e.sh: per-scenario config override via 'acpConfig' JSON field
- verify.ts: compressedCount/min/max checks (byMessageId inspection)
- scenario 07: protection-filtered (production config, compress succeeds
  via soft-filter, protected msgs excluded from compressed set)
- scenario 08: nudge-with-protection (nudge→compress with protection
  enabled — tests exact bug from PR #207/#210/#212)
- ci.yml: all 8 scenarios now in CI

All 8 scenarios verified locally (8/8 pass).
@ranxianglei
ranxianglei merged commit 9da4e4e into master Jul 27, 2026
5 checks passed
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