Stop get_journal from silently creating entries and carrying tasks forward

Aperta
#415 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
api, backend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
C#
Stelle
1
Fork
0
Merge medio
2h 2m
PR unite (30g)
98

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nevridge/TaskFlow

Tutte le issue di nevridge/TaskFlow

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.