|
| 1 | +# Task plans and records |
| 2 | + |
| 3 | +A coding request's plan, as the CLI reported it, and a record of the turn you can save to the |
| 4 | +project's notes. This is the first part of [#280](https://github.com/TypeSafeAI/modex/issues/280) |
| 5 | +(CF-7 of tracker [#273](https://github.com/TypeSafeAI/modex/issues/273)). It builds on the |
| 6 | +[conversation-event contract](conversation-events.md) and [conversation evidence](conversation-evidence.md). |
| 7 | + |
| 8 | +Everything here is drawn from transcript items, and says no more than they do. A step the CLI |
| 9 | +marked completed is "reported done": what the CLI said, not a check Modex ran. |
| 10 | + |
| 11 | +## Plans |
| 12 | + |
| 13 | +| CLI | Native plan | Step statuses | |
| 14 | +| --- | --- | --- | |
| 15 | +| codex-cli 0.163.0 | `turn/plan/updated`: `plan: [{ step, status }]` and an optional `explanation` | `pending`, `inProgress`, `completed` | |
| 16 | +| Claude Code 2.1.302 | the `TodoWrite` tool: `todos: [{ content, status, activeForm }]` | `pending`, `in_progress`, `completed` | |
| 17 | + |
| 18 | +Both become a `plan.update` observation with `from` set to `codex-plan` or `claude-todo`. The |
| 19 | +statuses map to `pending`, `in-progress` and `completed`; a status Modex does not know becomes |
| 20 | +`unknown`. Each update replaces the whole plan, and the transcript keeps one `plan` item per turn, |
| 21 | +counting its revisions. Codex gives steps no ids, so a step is its position in the latest revision. |
| 22 | +Codex's experimental plan-mode `plan` items and `item/plan/delta` are not read. |
| 23 | + |
| 24 | +The plan card lists each step with its status: Not started, In progress, Reported done or Status |
| 25 | +unknown. It also shows where the plan came from and its revision. A plan never folds away under the |
| 26 | +turn header. When the turn ends, the card keeps the last statuses the CLI reported, and the plan's |
| 27 | +outcome is the turn's. |
| 28 | + |
| 29 | +## The task record |
| 30 | + |
| 31 | +`taskRecord` (`shared/task-context.ts`) summarises one turn: the request, the latest plan, the files |
| 32 | +its patch tools changed, the commands it ran with outcome and exit code, the final answer, and what |
| 33 | +is not settled. Not settled means commands that did not succeed and plan steps not reported done. |
| 34 | +`taskMarkdown` renders the record as portable Markdown that ends with a backlink to the thread. |
| 35 | + |
| 36 | +It leaves out reasoning, command output, and any path outside the project. Files inside the project |
| 37 | +are listed relative to the thread's working directory; files outside it are counted, not named. |
| 38 | + |
| 39 | +## Save to Notes |
| 40 | + |
| 41 | +Under each finished turn, **Save to Notes** (`task:save-note`, `ThreadRunner.saveTaskNote`) writes the |
| 42 | +record as a note in the thread's project notes, through the notes store with a human actor. Nothing |
| 43 | +saves on its own, and an agent cannot use this. |
| 44 | + |
| 45 | +- **Saving again** updates the same note. The thread remembers each turn's note and the revision it |
| 46 | + saved, in the main-owned `taskNotes` field. |
| 47 | +- **An edited note is kept.** If the note was edited since, the edit stays and this version becomes a |
| 48 | + new note marked "saved again". |
| 49 | +- **A missing note is replaced.** If the note was deleted or trashed, a new one is written. |
| 50 | +- **Saving never reruns** anything, and never reads beyond the transcript. |
| 51 | + |
| 52 | +## Not done yet |
| 53 | + |
| 54 | +- Clarification through question cards waits for the human-request lifecycle |
| 55 | + ([#276](https://github.com/TypeSafeAI/modex/issues/276)). |
| 56 | +- Verified steps, and marking earlier verification stale. Verification needs a check's observed |
| 57 | + result tied to the code revision the step changed. |
| 58 | +- An on-demand context map of relevant files and tests beyond those the turn changed. |
| 59 | +- Reopening a saved note as a read-only task view. |
0 commit comments