fix(export): date-window the project export + include project summary - #353
Merged
Merged
Conversation
added 3 commits
September 24, 2026 22:46
The project export (dataSource "project") assembled its activity notes via
assembleProjectFromCache WITHOUT passing the export's [startDate, endDate]
window, so it rendered the project's entire history — a "last 28 days" export
returned months of notes. (The account export already windows correctly;
getProjectMd's own doc comment claimed it did too, but the code didn't.)
- assembleProjectFromCache takes an optional dateWindow and filters activities
by their effective date, inclusive at calendar-day granularity (same
semantics as withinDateWindow / the account export).
- getProjectMd passes { startDate: task.startDate, endDate: task.endDate }.
- Adds cached-assembly tests covering the window, the no-window case, inclusive
end-day, and the empty result.
Adds the AI-generated project summary as a `## Summary` section (one level below the project heading), placed after the meta and before the (windowed) notes. Included in BOTH the single-project export (getProjectMd) and each project rendered in the account export (renderProject). The summary is whole-project (not windowed), so it's always included when present — this also means an account export now surfaces a project that has a summary but no in-window notes (previously dropped as empty), which is the intended "always give the overall context" behavior. Adds projects.test.ts covering summary placement/level, summary-only projects, omission when absent, and summary-before-notes ordering.
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.
Two related project-export improvements.
1. Fix: date window was ignored (bug, prod)
A project AI export for "last 28 days" returned the project's entire history
(reported from prod on /projects/42d0c284-…, showing June–September notes).
Cause:
getProjectMdassembled notes viaassembleProjectFromCachewithoutpassing the export's
[startDate, endDate], so all activities rendered.Fix:
assembleProjectFromCachetakes an optionaldateWindowand filtersactivities by effective date (inclusive, calendar-day granularity — same as the
account export).
getProjectMdpasses the task's window.2. Feature: include the project summary
Adds the AI project summary as a
## Summarysection (one level below theproject heading), after the meta and before the notes, in BOTH the single
project export and each project in the account export. The summary is
whole-project (not windowed), so it's always included when present.
Consequence: an account export now surfaces a project that has a summary but no
in-window notes (previously dropped as empty) — the intended "always give the
overall context" behavior.
Testing
cached-assembly.test.ts— window filtering (incl. inclusive end-day,no-window, empty)
projects.test.ts— summary placement/level, summary-only project, omission,summary-before-notes ordering
tsc --noEmit -p amplify/tsconfig.json— green; lint — clean