daily recap: filter failed cards and cap prompt size (#285)#306
Open
praxstack wants to merge 2 commits into
Open
daily recap: filter failed cards and cap prompt size (#285)#306praxstack wants to merge 2 commits into
praxstack wants to merge 2 commits into
Conversation
27aa193 to
b62a94a
Compare
Follow-up hardening pass. Adds 4 tests for uncovered branches: - empty card list -> "no activities" message - summary rendering: distinct summary included, summary==title dropped (no dup) - filter + truncation compose: "Processing failed" cards removed before the budget is measured, so they never consume budget or inflate the omitted count - boundary: no "omitted" notice when all cards fit (off-by-one guard) All 6 tests pass (2 original + 4 new); no production code changed.
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.
Helps with #285 (complements #304, which fixes the regeneration side). The Daily Recap prompt concatenated every card for the day, so a day flooded with duplicate "Processing failed" cards blew past the model context (5.88M tokens against a 262K window). This filters "Processing failed" cards out of the activity log and adds a 60K-character ceiling; when it bites, oldest cards are kept and the tail collapses into "... and N more activities omitted". Normal days are unaffected since the cap only triggers on pathological card counts.
Tested with the new DailyRecapCardsTextTests plus the existing suite:
Follow-up hardening pass (2026-07-08)
Ran an internal hardening pass (test coverage + code review) — no additional issues found. Re-verified at head
b62a94a: build succeeds and the full DayflowTests suite passes 8/8 (including both new tests,testExcludesProcessingFailedCardsFromPromptandtestTruncatesDeterministicallyWhenOverCharacterBudget); logic re-traced against #285 (failed-card filter matches the exact"Processing failed"literal produced by LLMService, and the 60k-char cap accounts for the newline join cost per entry).Follow-up hardening pass (2026-07-08)
Added 4 edge-case tests (no production code change): empty-list path, summary-rendering branch (distinct summary shown, summary==title dropped without duplication), filter+truncation composition (failed cards removed before budget measurement so they never inflate the omitted count), and an all-cards-fit boundary check on the omission notice. Full suite: 6/6 pass.