Skip to content

Regenerate a journal entry when its date is named explicitly - #22

Open
artcashin wants to merge 1 commit into
prime-radiant-inc:mainfrom
artcashin:feat/resummarize-explicit-date
Open

artcashin wants to merge 1 commit into
prime-radiant-inc:mainfrom
artcashin:feat/resummarize-explicit-date

Conversation

@artcashin

Copy link
Copy Markdown

A day gets summarized long before it is over, and there was no way to refresh that entry afterwards.

Group selection filtered out every (date, project) that already had an entry, and the --date check was applied inside that guard. So once the current day had an entry, neither --all nor --date <today> would revisit it — the only way to fold in the rest of the day's work was deleting the row by hand:

sqlite3 notebook.db "DELETE FROM journal_entries WHERE date='...' AND project_id='...'"

Naming a date is now treated as a deliberate request to regenerate it.

  • --all is unchanged: it still only visits dates with no entry, so routine incremental runs never rewrite existing work.
  • --date regenerates, replacing what's there. Pair with --project to narrow it to one project.

Persistence was already an upsert, so a regenerated entry replaces the old one in place rather than duplicating.

Testing

95 tests pass, typecheck clean. Written test-first — three tests, one for the new behaviour and two pinning the existing behaviour so the guard can't be loosened by accident:

  • an already-summarized group is returned when its date is named explicitly
  • already-summarized groups are still skipped when no date is named
  • naming one date does not return others

Branches from main; independent of #19, #20 and #21.

🤖 Generated with Claude Code

A day is summarized long before it is over. Because group selection filtered
out every (date, project) that already had an entry — and the --date filter was
applied inside that guard — no flag could refresh the current day's entry.
Neither --all nor --date reached it; the only way was deleting the row by hand.

Naming a date is now treated as a deliberate request to regenerate it. --all is
unchanged and still only visits dates with no entry, so routine incremental runs
never rewrite existing work. Persistence was already an upsert, so a regenerated
entry replaces the old one in place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@artcashin

Copy link
Copy Markdown
Author

Relationship to #10 / a8efb8f

Worth stating outright, since this touches the guard added by "persist skipped journal groups to prevent redundant Haiku re-evaluation": this does not undo that fix.

The concern in docs/plans/2026-03-07-persist-skipped-groups-design.md is the repeated cost of re-submitting trivial groups on every routine run — "with ~44 trivial sessions, this adds ~12 minutes to what should be an instant hourly job."

That path is --all, and it is unchanged here. --all still visits only dates with no entry, so skip stubs still suppress re-evaluation and an hourly job still completes instantly. Only an explicitly named --date regenerates, which is a one-off, operator-initiated action rather than something on the hot path.

The two behaviours are aimed at different problems: #10 stops the tool re-asking about days it has already judged; this stops the tool refusing to revisit a day that was not finished when it was judged. A day summarized at noon cannot otherwise be corrected once the afternoon's work lands.

Skip stubs are also regenerated by an explicit --date, which is intended: if a day was judged trivial while it was still trivial, that judgement should be revisitable once there is more in it.

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