Stop get_journal from silently creating entries and carrying tasks forward

Open
#415 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp
Domain
api, backend

Research direction

Read assistant/src/TaskFlow.Mcp/Tools/JournalTools.cs and JournalResolver.cs, then trace JournalEntriesController.Create at lines 97–105 to understand when entries are created and tasks are carried forward. First resolve the design decision alongside #409 part 3 and #412 item 1; this work is blocked by #400. Done means the chosen read behavior, tool result, and "safe" wording are consistent, with any carried tasks disclosed.

Written by the indexing model from the issue text.

Description

bug

Follow-up from #413 (chore: move taskflow-assistant into assistant/), raised during review.

Problem

get_journal is described as safe to call ("calling it for today is safe"), but it creates the day's entry through JournalResolver.EnsureAsync, always passing the real timezone offset. For the user's own today, JournalEntriesController.Create then runs CarryForwardIncompleteTasksAsync and moves incomplete tasks from earlier days into it. The tool's output does not say so.

Scenario: a plan-my-day run calls get_journal for today as a read-only gather step. If today's entry does not exist yet, that call creates it and moves yesterday's incomplete tasks, with no mention in the result. The same EnsureAsync call sits behind set_journal_todos, add_log_entry and update_journal. A read of a past or future date also creates an empty entry for that date (carry-forward does not run for those).

Whether the carry-forward itself is wrong is a design question: the API does carry forward when today's entry is created with an offset, which is the intended web behaviour. The problem is that the assistant triggers it silently from a tool presented as a read, and creates junk entries on reads of other dates.

Severity: 🟠 Important. Pre-existing in the imported assistant code, not introduced by #413.

Location

assistant/src/TaskFlow.Mcp/Tools/JournalTools.cs:31 at 3c3e6b4 (permalink); see also JournalResolver.cs:12 and TaskFlow.Api/Controllers/V1/JournalEntriesController.cs:97-105.

Suggested approach

Decide the intended behaviour first. Options: have get_journal look the entry up read-only (FindAsync) and report "no entry yet" instead of creating it; or create only for today and say in the tool result when tasks were carried forward (the API returns movedCount/movedTaskItemIds); and correct the "safe" wording in the tool description and skill docs either way. Deferred from #413 because it needs a design decision and the assistant code was imported unchanged.

Related

The option that reports movedCount and movedTaskItemIds in the tool result overlaps #409 part 3 (report moved tasks) and #412 item 1 (JournalEntryDto drops those fields). Decide the three together, so the DTO and the wording change once. Blocked by #400, because assistant feature work waits for the merged pipeline.


Created by @nevridge with Claude Code during review of #413

Dominant language
C#
Stars
1
Forks
0
Avg merge
2h 2m
Merged PRs (30d)
98

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nevridge/TaskFlow

All issues in nevridge/TaskFlow

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.