Repository navigation
Description
Goal and dependencies
Parent: #273. Priority: P2 — cohesive task workflow after the conversation foundation. Blocked by: #274, #276, #277 and #278. Integrate replay in the final acceptance issue using #279; do not build a separate task runtime here.
For one coding request, make the proposed plan, relevant files/tests, actual execution evidence and final project Note a connected workflow. Start with a small on-demand context map, not an exhaustive repository graph.
Existing basis and boundaries
Modex already has real Markdown Notes, project-scoped modex_pages/Knowledge access, native CLI turns, owned assets and a Changes panel. Reuse these: status, Notes guide, AGENTS.md.
The complete plan → evidence → Note workflow is a proposed feature. Existing Notes or Knowledge alone does not prove it exists. No new graph/vector database, whole-repository indexing daemon, multi-agent scheduler, direct model API, or broad Jev disclosure.
Integration points
Existing: apps/desktop/src/shared/{types,pages,knowledge}.ts, native plan-event mappings in src/main/engine/backends/{codex,claude}.ts, src/main/engine/runner.ts, src/renderer/components/ThreadView.tsx, and the current project-scoped Pages handlers (locate with rg -n 'modex_pages|PagesConnection' apps/desktop/src). Paths after the first are relative to apps/desktop/.
Proposed: apps/desktop/src/shared/task-context.ts, src/main/engine/task-context.ts, src/renderer/components/transcript/TaskPlanCard.tsx, apps/desktop/test/task-context.test.ts, and apps/desktop/e2e/task-to-notes.spec.ts. Use the existing scoped Notes writer rather than writing arbitrary filesystem paths.
Implementation steps
- Define a serializable task record using CF-1 IDs: project/repository revision, plan revision, step IDs, relevant relative paths and available file revisions/hashes, evidence references from CF-5, and the destination Note/revision. Label context relations as observed, model-proposed or user-confirmed; do not present guesses as indexed code dependencies.
- Build context on demand from the selected project, explicit selections, existing project notes and files actually inspected during the native turn. Default display is at most 20 file/test references with an explicit overflow count; do not silently drop underlying evidence. No automatic whole-repository graph build. Read-only Plan investigation cannot create notes or modify code.
- Ingest native plan updates only when supported by the installed CLI. Where structured updates are unavailable, display the assistant's plan as an explicitly unstructured proposal; do not parse Markdown into authoritative tool/permission state. A plan revision is a proposal, not permission to execute. Reuse normal Send/Plan mode and supported question cards for clarification.
- Render plan steps next to linked files/tests and actual command/patch evidence. Keep proposed, in-progress, reported-complete, verified, failed and unknown distinctions. Verified requires the relevant check's observed result tied to the corresponding code/plan revision; model prose or an unrelated exit-zero command cannot establish verification. Later edits mark prior verification stale.
- Add explicit Save task record to Notes using the existing project-scoped writer, revision/conflict checks and main-owned authority. Save a portable Markdown summary of request, plan, file references, changes, check results and unresolved items, with a backlink to the source thread. Do not store hidden reasoning, secrets, absolute private paths or raw full logs by default. Repeated save updates the associated Note instead of creating duplicates; conflicts preserve both the user's edit and the pending save for resolution.
- Reopen the saved Note into a read-only task view. Continuing requires a fresh user send through the ordinary CLI path. Resolve missing/moved files and changed project ownership safely. Respect Manage notes opt-in for agent writes; explicit human saves must use the existing human permission flow and cannot grant an agent wider access.
- Add the end-to-end fixture, update status and
docs/task-context.md, and prepare a bounded signed PR.
Acceptance criteria
- One request shows a plan with bounded relevant file/test references, explicit provenance and stable plan/step IDs where supplied.
- Unsupported native plan capability has a readable honest fallback; viewing or approving a plan does not bypass execution policies.
- A relevant passing check at the recorded revision can support verification; failed/unrelated checks, missing results and later edits cannot.
- Save creates/updates exactly the intended project Note with revision checks; conflicts, repeated clicks, rename/move and project removal never overwrite unrelated notes or cross project boundaries.
- Reopen/replay performs zero coding turns, tool execution or implicit Note writes; continuation is an explicit user action.
- No file bodies/context map are disclosed to Jev, no secrets/hidden reasoning enter exported notes, and existing read-only Plan/Manage notes tests remain valid.
- Existing Notes migration, asset references and scoped tools continue to work; no new graph infrastructure or autonomous scheduler is introduced.
Verification: demonstrate RED → GREEN for task/revision/ownership fixtures; pnpm build, pnpm typecheck, pnpm test, pnpm test:e2e; focused pnpm --filter @modex/desktop exec playwright test e2e/task-to-notes.spec.ts after build. One supported native task and human review of its saved Note are separate acceptance evidence.
Long-running goal prompt — implement
Implement CF-7 in TypeSafeAI/modex under #273 after reading the actual contracts landed for #274/#276/#277/#278, current AGENTS.md, project Notes/Knowledge guides and scoped Pages handlers. Use an owned worktree, pinned pnpm and Superpowers TDD. Build only the on-demand task-plan-to-evidence-to-Note workflow described here. Reuse native Codex/Claude turns, plan capabilities, existing request broker, evidence refs, Notes writer and asset ownership.
Keep plan proposals separate from authority and model-reported completion separate from verified checks. Tie relevant commands and file/test references to the applicable code/plan revision, marking stale evidence after edits. Show unsupported native plan metadata honestly. Add an explicit conflict-safe Save task record action, portable project-scoped Markdown and a read-only reopen path that never executes or writes on replay. Test repeated saves, changed revisions, cross-project attempts, read-only mode, missing files and fake success claims. Do not build a graph database, background indexer, scheduler or new model executor, and do not disclose file bodies to Jev. Run full applicable checks, document the workflow/status, and prepare small signed commits and a linked PR. Leave SHAs, exact results, remaining native/human checks and the next step in the checkpoint. No merge or release without authorization.
Follow-up long-running goal prompt — verify and finish
Resume CF-7 by reading current main, prerequisite PRs, its checkpoint and the implementation; verify ownership before editing. Walk one request from proposed plan through real file/test references, clarification, actual command/patch results, explicit save and reopened Note. Try an unrelated successful command, a failed relevant check and an edit after a passing test; none may produce a false verified state.
Repeat Save, race an outside Note edit, move/rename the destination, remove the project and submit a foreign-project ID. Confirm scoped revision checks preserve user data. Reopen/replay while counting CLI calls and writes; both must remain unchanged. Inspect exports and Jev payloads for prohibited data. Fix remaining gaps with failing regressions first, preserving native fallback and existing Notes behavior. Rerun build/typecheck/unit/E2E and record the actual native/human example separately. Update issue/PR evidence with exact SHAs, criteria, skips and next steps. Do not expand into indexing/scheduling infrastructure, merge, publish or mark partial acceptance complete.
Activity
BunsDev commentedon Oct 18, 2026
CF-7 claim, 2026-10-18, from the session that did CF-1 (#282), CF-4's typed turns (#284), CF-6's first half (#285) and CF-5's first part (#287)
#276 (CF-3) has not landed, so this session takes the part of #280 that does not need it. Clarification through question cards waits for CF-3.
.worktrees/cf7-task-plan, branchcf7-task-plan, stacked on Show the command that ran, its exit code, bounded output and honest source labels (CF-5, first part) #287 (CF-5) until it merges, then rebased ontomain.Native plan data, from the CLIs (codex-cli 0.163.0 generated protocol; Claude Code tool inputs):
turn/plan/updatedcarriesplan: [{ step, status }], where status ispending,inProgressorcompleted, plus an optionalexplanation. There are no step ids, only positions. Plan-modeplanitems anditem/plan/deltaare marked experimental.TodoWritetool input carriestodos: [{ content, status, activeForm }].Plan for the first part:
completedis "reported done", never "verified".Show the plan each CLI reports and save a turn's task record to Notes…
BunsDev commentedon Oct 18, 2026
Checkpoint: CF-7 first part landed
Landed: #289 squash-merged as
f6976dfonmain(head7a996f7, based3711c6).What it contains: plan observations from Codex
turn/plan/updatedand ClaudeTodoWrite, shown as a plan card in each CLI's own statuses. It also adds the turn task record (shared/task-context.ts), Save to Notes (task:save-note), which updates the same note unless it was edited since,e2e/task-to-notes.spec.ts, anddocs/task-context.md.CI:
apps/store-desktop/src/main/demo.tskeeps its own handler map and lackedtask:save-note.7a996f7. The offline demo refuses the command like its other Notes commands.unit + e2e (macOS), iPhone companion, CLI and installers (linux, win32), CodeQL.pnpm buildpassed and store-desktop tests passed 16 of 16.Still open for #280:
Record each clarification and its answer in a turn's task record
Prove a plan clarification end to end, and document it
Record CF-7's clarifications in status
Record each clarification and its answer in a turn's task record
Prove a plan clarification end to end, and document it
Record CF-7's clarifications in status
Keep each plan clarification and its answer in the task record and No…
BunsDev commentedon Oct 19, 2026
Checkpoint: CF-7 clarification half landed
Landed: #312 squash-merged as
f4cd67fonmain(head5f0959d, based625eda).What it contains:
taskRecordlists every question the CLI asked during the turn, from its question cards (CF-3), with the answer as the card shows it; a secret reads "(hidden)".delivery: "uncertain").e2e/plan-clarification.spec.ts. A scripted codex-cli 0.163.0 app-server reports a plan, asks a clarifying question on the card, and plans on from the answer.MODEX_HOMEholds the secret.docs/task-context.mddescribes clarifications, anddocs/status.mdis updated.Red first:
clarifications.## Clarificationsin the saved note.Checks:
5f0959d.5f0959d: build and typecheck passed; unit tests passed 12 of 12.Still open for #280:
Reconcile historical CF8 evidence and keyboard review kit with main (#…
Reconcile CF8 history with current main verification records (#364)
Exercise CR2 reads through production Electron IPC (#361)
18 remaining items
feat: Codex questions asked in a reply, and ending turns Codex never …
test: replay two live Codex turns with a clarification into the task …
docs: two more live Codex turns offered no plan tool (#280)
feat: Codex questions asked in a reply, and ending turns Codex never …
feat: live Codex captures, questions asked in a reply, and ending tur…
feat: a turn says when its CLI reported no plan (#280)
BunsDev commentedon Oct 23, 2026
CF-7 checkpoint: close-out landed
All five PRs from the close-out are merged on
main, each signed and through the merge queue. #374, which #375 superseded, is closed.71446cdTodoWriteleft Claude Code 2.1.308+584aa1a68860a02824ed7203a350From the live captures: four live Codex turns (gpt-6.1-sol and gpt-6-astra) were never offered
update_plan, so no live Codex plan has been seen yet. Plan rendering is covered only by schema tests and by #385's plan collaboration mode. TherequestUserInputclarification, file edits and checks reached the task record exactly as Codex reported them, with no parser fix needed.Still open:
TaskCreate/TaskUpdateas the turn's plan once a live Claude turn using them has been captured (CLAUDE_CODE_ENABLE_TODO_TOOLS=1). This is listed In flight indocs/status.md.🤖 Generated with Claude Code
BunsDev commentedon Oct 23, 2026
CF-7 follow-up: both open items captured live
Both "still open" items from the checkpoint above now have live captures and an implementation in #394. It is waiting for Val's go-ahead to queue.
Claude's task tools. Claude Code 2.1.309 with
CLAUDE_CODE_ENABLE_TODO_TOOLS=1usedTaskCreate/TaskUpdate. Modex reads them as the turn's plan and does not set the variable (option 1).A live Codex plan. In plan collaboration mode,
gpt-6.1-solasked its question, then proposed aplanitem. This replay found two bugs, fixed in feat: read Claude's task tools and Codex's proposed plan from live captures (#280) #394:turn/completed.A
turn/plan/updatedstep plan is still unseen live.🤖 Generated with Claude Code
BunsDev commentedon Oct 23, 2026
Refreshed goal prompts — 2026-10-23 (
mainat203a350)On
mainalready:TodoWriteleft Claude Code 2.1.308 (docs: CF-7 Claude plans decision after TodoWrite left (#280) #387);docs/task-context.mdlists it under Retired;None of this is released.
In review: #394 (
cf7-live-plans, head2736a7c, CI green). It covers:TaskCreate/TaskUpdateread as the turn's plan, from a live Claude Code 2.1.309 capture. Modex doesn't setCLAUDE_CODE_ENABLE_TODO_TOOLS(Val's option 1).planitem from a live plan-mode capture, with two bugs fixed: a false "no plan" line, and a turn that never ended.Still open:
planitem, the quiet timer can end a turn the user stopped ascompleted. The guard incodex.tsdoesn't checksignal.aborted, andonAbortdoesn't clear the timer. The same guard is already onmainfor the final-answer path from feat: live Codex captures, questions asked in a reply, and ending turns Codex never ends (#280) #390, so the fix should cover both. The review asks for a replay regression: a completed plan item, then Stop, then no terminal Codex event through the quiet timeout.turn/plan/updatedstep plan. None has been seen live; four default-mode turns never offered the tool.task-context.mdsays so.The
cf7-live-plansworktree is claimed bysession:cf7-live-plans. Worktrees from landed CF-7 PRs (cf7-reopen,cf7-note-reopen,cf7-step-linking,cf7-claude-plans,cf7-codex-capture,cf7-no-plan,cf7-path-repair) are still checked out; their owners release them.Long-running goal prompt
Follow-up / resume prompt
fix: a Stop is never turned into a completed turn by Codex's quiet end (
BunsDev commentedon Oct 24, 2026
CF-7 checkpoint: both remaining items landed
#394 merged as
70123b9. It covers both items left open in the checkpoints above:TaskCreate/TaskUpdate, the tasks it creates and updates become the turn's plan (shown as "Claude's task list"). A call counts only once the CLI confirms it, and nothing is guessed. Modex does not setCLAUDE_CODE_ENABLE_TODO_TOOLS(Val's option 1). This was captured live and is replayed intest/claude-live-capture.test.ts.gpt-6.1-solturn in plan mode asked its question, then proposed aplanitem. The task record and the saved note keep that plan, so the turn no longer says "no plan". It is replayed intest/codex-live-capture.test.ts.The replay also exposed two bugs, both fixed in #394:
turn/completedafter its plan, so the turn stayed open. It now ends after the same quiet period as after a final answer.The one thing still unseen is a live Codex
turn/plan/updatedstep plan: no default-mode turn offered the plan tool.docs/task-context.mdrecords this as not done yet.🤖 Generated with Claude Code
BunsDev commentedon Oct 30, 2026
CF-7 checkpoint: close-out receipt landed, human review is Val's
Landed: #443 squash-merged as
3d52f8bonmain. It is docs only and adds the close-out receipt.Acceptance criteria. The receipt maps all seven to the PRs (#289 through #394) and tests on
main. Every one has evidence, from fixtures, live captures, or the live turns below.Checks on
eca2bd9, first pass:pnpm test, desktoppnpm test:e2e, desktoppnpm test:e2e, siteCI:
e2e/canvas.spec.ts"Canvas refuses external requests…": after Escape, the main panel stayed hidden.--repeat-each 30.One real task per CLI, through the app in Chat mode, 2026-10-29. Claude Code 2.1.312 (Haiku) and codex-cli 0.164.0 (
gpt-6.1-sol) did the same work:npm test;greeting.txtafter approval, then passednpm test;npm testpassed after the last change";Neither CLI was offered a plan tool, and each said so. That is still no live
turn/plan/updated.Waiting on Val:
.worktrees/cf7-closeout/apps/desktop/.probes/cf7-human/{claude,codex}/home, and the receipt has the launch commands. For that reason thecf7-closeoutworktree is deliberately not removed yet.perl -piedit lists no file;#280 stays open until Val records the review or a written deferral.
🤖 Generated with Claude Code
BunsDev commentedon Oct 30, 2026
CF-7 checkpoint: close-out observations fixed, Val's review is the only open item
#450 merged as
108b814. It fixes all three observations from the close-out's live runs:printf … > greeting.txtredirect and Codex'sperl -piedit now show up in the context map. Each is listed under "These commands may have changed files that neither the CLI nor Modex named". The footer reads Files touched · 1, maybe more or · not listed, and Modex still guesses no file.The close-out receipt and
docs/status.mdrecord this.Still open: Val's human review of the two saved Notes. The review homes in
.worktrees/cf7-closeout/apps/desktop/.probes/cf7-human/were saved before #450. They reopen exactly as they were saved, so they show the original live turns. To see the new footer and title, run a fresh turn on a build ofmainat108b814or later.🤖 Generated with Claude Code
BunsDev commentedon Nov 1, 2026
CF-7 checkpoint: review kit restored, ready for Val
mainis at0a8c513. The receipt's old launch path (.worktrees/cf7-closeout) was removed by the 2026-10-31 prune. I restored the kit from the task-evidence copy into a new worktree,cf7-review-kit, and checked that it opens. #473 (docs only, auto-merge through the queue) points the receipt anddocs/status.mdat the new location. I ticked the issue body's seven AC boxes; each one cites evidence in the receipt. The step boxes and the human review are unchanged.Check on a build of
0a8c513. That build includes #450, #453 and #463.Launch. The build is already done.
In each, open Space → Personal → cf7-review-repo → "Task: If you have a task-list…", then Task view. An untouched copy stays under
~/.claude/task-evidence/worktree-prune-2026-10-29/cf7-closeout/.Four rows for Val, all
open. Reply with a result or a written deferral for each:Not done. I did not run a fresh live turn to show #450's "maybe more" footer. The brief makes it optional, and it would use your signed-in CLI accounts. Say if you want it.
🤖 Generated with Claude Code
Fix LM5 fixture termination and qualify network evidence (#480)