Repository navigation
feat: inject the most recent daily logs instead of today and yesterday - #67
Open
pstanton237 wants to merge 1 commit into
Open
pstanton237 wants to merge 1 commit into
pstanton237 wants to merge 1 commit into
Conversation
Context injection read daily/<today>.md and daily/<yesterday>.md by calendar date. A day without a log (weekend, time off) left the slot empty, so the first session on a Monday got no daily log at all and the Friday context was gone. Pick the N most recent non-empty logs up to today instead. The newest keeps today's priority slot; the rest go after MEMORY.md, newest first. PI_MEMORY_DAILY_LOGS sets N (default 2, 0 disables daily injection). Signed-off-by: pstanton237 <4250687+pstanton237@users.noreply.github.com>
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
Context injection picked daily logs by calendar date (today and yesterday). After a weekend or time off, both slots were empty, so the first session back had no daily log in context. This PR injects the N most recent non-empty daily logs up to today instead, skipping days without a log.
Fixes #66.
Approach
MEMORY.md). The remaining logs go afterMEMORY.md, newest first, so the 16K total cap trims the oldest ones first. Priority order is otherwise unchanged.(today)and(yesterday)are added only when they are true, so a Friday log seen on Monday is not labeled "yesterday".PI_MEMORY_DAILY_LOGSsets N (default2,0disables daily-log injection). Empty or invalid values fall back to the default. The value is shown inmemory_status.daily/are ignored.Compatibility: with the default, a user who has logs for both today and yesterday gets the same context as before. No change to the on-disk format or qmd behavior. Each context build now lists
daily/, which is onereaddir.Verification
0disables, ignored files, env parsing) failed before the change and pass after.bun test test/unit.test.ts(203 passed)npm run buildnpm run lint2026-11-17 (today)and2026-11-15.README (context injection list and env table) and CHANGELOG
[Unreleased]are updated.