Skip to content

fix(export): date-window the project export + include project summary - #353

Merged
cabcookie merged 3 commits into
mainfrom
fix/project-export-date-window
Sep 24, 2026
Merged

cabcookie merged 3 commits into
mainfrom
fix/project-export-date-window

Conversation

@cabcookie

@cabcookie cabcookie commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

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: getProjectMd assembled notes via assembleProjectFromCache without
passing the export's [startDate, endDate], so all activities rendered.

Fix: assembleProjectFromCache takes an optional dateWindow and filters
activities by effective date (inclusive, calendar-day granularity — same as the
account export). getProjectMd passes the task's window.

2. Feature: include the project summary

Adds the AI project summary as a ## Summary section (one level below the
project 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

Carsten Koch 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.
@cabcookie cabcookie changed the title fix(export): apply date window to project AI export fix(export): date-window the project export + include project summary Sep 24, 2026
@cabcookie
cabcookie merged commit 4562650 into main Sep 24, 2026
1 check passed
@cabcookie
cabcookie deleted the fix/project-export-date-window branch September 24, 2026 21:00
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