Repository navigation
test: Tier 1 behavioral test coverage + dead code cleanup - #23
Merged
Merged
Conversation
Dead code cleanup (Phase 1 of test coverage hardening for MIT relicensing): Deleted (never called anywhere): - sendUnifiedNotification (lib/ui/notification.ts, 45 LOC) - truncateExtractedSection (lib/ui/notification.ts, 15 LOC, cascade-dead) - formatPruningResultForTool (lib/ui/utils.ts, 16 LOC) Cleaned: - 3 commented-out // logger.info debug lines (lib/state/state.ts) Unexported (internal-only, no external importers): - appendToToolPart (lib/messages/utils.ts) - truncate (lib/ui/utils.ts) - shortenPath (lib/ui/utils.ts) - MESSAGE_REF_MAX_INDEX (lib/message-ids.ts) - getConfigKeyPaths (lib/config-validation.ts) - checkAutoUpdate (lib/update.ts) Updated: - AGENTS.md test count 350 -> 407, file count 22 -> 31 Verification: typecheck pass, 407/407 tests pass. Dual-agent review: both APPROVED (dead code + unexport safety verified).
New test files covering previously untested core modules: - tests/prune.test.ts (16 tests) — filterCompressedRanges, pruneToolOutputs/Inputs/Errors - tests/reasoning-strip.test.ts (7 tests) — stripStaleMetadata - tests/sync.test.ts (8 tests) — syncCompressionBlocks - tests/protected-content.test.ts (14 tests) — extractProtectedPromptInfo, appendProtected* - tests/persistence.test.ts (7 tests) — saveSessionState, loadSessionState round-trip - tests/inject.test.ts (9 tests) — injectMessageIds, injectCompressNudges - tests/pipeline.test.ts (5 tests) — prepareSession, finalizeSession These tests serve as the behavioral spec for the clean-room MIT rewrite. Dual-agent reviewed: all config factories complete, Logger usage corrected, SearchContext/SelectionResolution mocks match actual interfaces. Total: 473 tests pass (was 407).
ranxianglei
added a commit
that referenced
this pull request
Jul 11, 2026
…heck Two new E2E tests for issue #23: 1. 'nudge survives compress → restart → re-establishment → growth': Full lifecycle test — compress clears baseline, save/reload, re-establishment turn, save/reload again (verifies persistence), then growth turn must fire nudge. This test would have caught the baseline persistence bug before it shipped. 2. 'nudge recommendation content includes composition breakdown': Verifies that the injected suffix text contains 'Breakdown:', tool category, and compress guidance — ensuring the nudge actually delivers useful information to the model. 623 tests pass, 0 failures.
ranxianglei
added a commit
that referenced
this pull request
Jul 12, 2026
This was referenced Jul 12, 2026
ranxianglei
added a commit
that referenced
this pull request
Jul 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Step 1 + Step 2 of the test coverage hardening iteration, preparing the behavioral spec foundation for the clean-room MIT rewrite.
Step 1: Dead Code Cleanup (commit f6d8b10)
sendUnifiedNotification(45 LOC),truncateExtractedSection(15 LOC),formatPruningResultForTool(16 LOC) — zero callers confirmed via dual-agent reviewStep 2: Tier 1 Behavioral Tests (commit c39ef36)
7 new test files, 66 new tests covering 7 critical previously-untested modules:
Total: 473 tests pass, 0 failures (was 407).
Dual-Agent Review
Both review passes APPROVED. Issues found and fixed:
autoUpdate,summaryBuffer,batchCleanup— fixedLogger({ level: "error" })should beLogger(false)— Logger takes boolean — fixedcreateSessionState(SID)called with nonexistent parameter — fixedpromptsfield — fixedTest plan
npm run test— 473 pass, 0 faildevlog/2026-06-27_test-coverage-hardening/REQ.md+WORKLOG.md