Skip to content

[P2][CF-7] Connect a bounded task plan to project files, verification evidence, and a saved Note #280

Open

Description

@BunsDev

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

  1. BunsDev commented on Oct 18, 2026

    @BunsDev
    ContributorAuthor

    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.

    Native plan data, from the CLIs (codex-cli 0.163.0 generated protocol; Claude Code tool inputs):

    • Codex. turn/plan/updated carries plan: [{ step, status }], where status is pending, inProgress or completed, plus an optional explanation. There are no step ids, only positions. Plan-mode plan items and item/plan/delta are marked experimental.
    • Claude. The TodoWrite tool input carries todos: [{ content, status, activeForm }].

    Plan for the first part:

    • A typed plan observation and transcript item.
    • Native statuses mapped honestly: completed is "reported done", never "verified".
    • A plan card that keeps each revision.
    • A serializable task record linking plan steps, referenced files and CF-5 command/patch evidence.
    • An explicit Save to Notes through the existing project-scoped Pages writer.
  2. BunsDev commented on Oct 18, 2026

    @BunsDev
    ContributorAuthor

    Checkpoint: CF-7 first part landed

    Landed: #289 squash-merged as f6976df on main (head 7a996f7, base d3711c6).

    What it contains: plan observations from Codex turn/plan/updated and Claude TodoWrite, 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, and docs/task-context.md.

    CI:

    • The first run failed in the full workspace build: apps/store-desktop/src/main/demo.ts keeps its own handler map and lacked task:save-note.
    • Fixed in 7a996f7. The offline demo refuses the command like its other Notes commands.
    • Then green: unit + e2e (macOS), iPhone companion, CLI and installers (linux, win32), CodeQL.
    • Locally, the root pnpm build passed and store-desktop tests passed 16 of 16.

    Still open for #280:

  3. BunsDev commented on Oct 19, 2026

    @BunsDev
    ContributorAuthor

    Checkpoint: CF-7 clarification half landed

    Landed: #312 squash-merged as f4cd67f on main (head 5f0959d, base d625eda).

    What it contains:

    • The task record. taskRecord lists 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)".
      • An unanswered question reads "not answered" with why it closed: the agent withdrew it, the turn was stopped, or it ended first.
      • An answer Modex could not confirm the CLI received says so (CF-6's delivery: "uncertain").
      • Unanswered and unconfirmed clarifications count as not settled. Nothing is filled in that the card does not hold.
    • 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.
      • The answer reaches Codex once, and Save to Notes records it with the secret hidden.
      • A stopped clarification is saved as "not answered: the turn was stopped".
      • No file under MODEX_HOME holds the secret.
    • Docs: docs/task-context.md describes clarifications, and docs/status.md is updated.

    Red first:

    • The record test failed: there were no clarifications.
    • The e2e failed at ## Clarifications in the saved note.

    Checks:

    • CI: all 11 green on 5f0959d.
    • Local on 5f0959d: build and typecheck passed; unit tests passed 12 of 12.
    • Local on the same code over CF-6:
      • Unit: 1,590 passed, 16 skipped, 0 failed, plus 21 of 21.
      • Store-desktop tests passed.
      • Five e2e specs passed 18 of 18.

    Still open for #280:

    • Verified steps, and marking earlier verification stale.
    • An on-demand context map.
    • Reopening a saved note as a read-only task view.
    • Live-provider plan and clarification captures. Claude Code 2.1.302 sends no structured questions.
  4. 18 remaining items

  5. BunsDev commented on Oct 23, 2026

    @BunsDev
    ContributorAuthor

    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.

    PR What Merged
    #375 A saved task note reopens as a read-only task view 71446cd
    #387 Claude plans decision after TodoWrite left Claude Code 2.1.308+ 584aa1a
    #370 Step linking decision: retired (neither CLI reports the link; Modex does not infer it) 68860a0
    #390 Live codex-cli 0.163.0 captures replayed as fixtures; Codex questions asked in a reply show their options; a turn Codex never ends is ended after five quiet minutes, with a notice 2824ed7
    #391 A turn that changed files or ran commands without a plan says "Claude Code / Codex reported no plan for this turn" in its footer and saved note 203a350

    From 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. The requestUserInput clarification, file edits and checks reached the task record exactly as Codex reported them, with no parser fix needed.

    Still open:

    • Reading Claude's TaskCreate/TaskUpdate as 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 in docs/status.md.
    • A live Codex turn that actually sends a plan, to replay as a fixture.

    🤖 Generated with Claude Code

  6. BunsDev commented on Oct 23, 2026

    @BunsDev
    ContributorAuthor

    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=1 used TaskCreate/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-sol asked its question, then proposed a plan item. This replay found two bugs, fixed in feat: read Claude's task tools and Codex's proposed plan from live captures (#280) #394:

      • the turn was wrongly labelled "Codex reported no plan";
      • the turn never ended, because Codex sent no turn/completed.

      A turn/plan/updated step plan is still unseen live.

    🤖 Generated with Claude Code

  7. BunsDev commented on Oct 23, 2026

    @BunsDev
    ContributorAuthor

    Refreshed goal prompts — 2026-10-23 (main at 203a350)

    On main already:

    None of this is released.

    In review: #394 (cf7-live-plans, head 2736a7c, CI green). It covers:

    • Claude's TaskCreate/TaskUpdate read as the turn's plan, from a live Claude Code 2.1.309 capture. Modex doesn't set CLAUDE_CODE_ENABLE_TODO_TOOLS (Val's option 1).
    • Codex's proposed plan item from a live plan-mode capture, with two bugs fixed: a false "no plan" line, and a turn that never ended.

    Still open:

    The cf7-live-plans worktree is claimed by session: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

    Finish CF-7 (#280) in TypeSafeAI/modex. Read AGENTS.md, docs/task-context.md, docs/notes.md, this issue's latest checkpoints, and PR #394 with its acceptance review comment, then verify main's SHA. Work in the cf7-live-plans worktree if you own it (scripts/worktree.sh check); otherwise claim it, or ask its owner. Never edit the primary checkout. (1) Fix the quiet-end/Stop race in apps/desktop/src/main/engine/backends/codex.ts. Once the user stops, the quiet timer must never report the turn completed, after either a final answer (on main since #390) or a proposed plan (#394). Write the red replay test first: a completed plan item, then Stop, then no terminal Codex event through the quiet timeout. Assert the turn isn't reported as completed. Add the same case for a final answer. Keep the existing stop/acknowledgement semantics. (2) Run pnpm build && pnpm test && pnpm test:e2e, including e2e/codex-native-plan.spec.ts, e2e/task-to-notes.spec.ts and e2e/plan-clarification.spec.ts. Record exact counts. Push signed commits to #394, update the PR description, and wait for CI and Val's go-ahead. It lands only through the merge queue. (3) Try once more for a live Codex turn/plan/updated step plan with a benign disposable task, recording the codex version and model. If none appears, leave the limit documented; don't fake a fixture. (4) Prepare one real task and its saved Note for Val's review, and record Val's verdict on #280. Tick ACs only with evidence. Update task-context.md and status.md in each PR. Close #280 when #394 has landed and the remaining items have evidence or Val's written deferral.
    

    Follow-up / resume prompt

    Resume CF-7. Confirm you own the worktree and fetch main. Check whether the quiet-end/Stop fix is on #394 with its red-then-green replay test, whether CI passed, and whether Val gave the go-ahead. Rerun the task-context unit tests and the codex-native-plan, task-to-notes and plan-clarification e2e specs. Post a checkpoint: SHA, results, decisions pending, live plan evidence (with CLI versions), and one next action.
    
  8. BunsDev commented on Oct 24, 2026

    @BunsDev
    ContributorAuthor

    CF-7 checkpoint: both remaining items landed

    #394 merged as 70123b9. It covers both items left open in the checkpoints above:

    • Claude's task tools. When Claude Code 2.1.309 offers 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 set CLAUDE_CODE_ENABLE_TODO_TOOLS (Val's option 1). This was captured live and is replayed in test/claude-live-capture.test.ts.
    • A live Codex plan. A gpt-6.1-sol turn in plan mode asked its question, then proposed a plan item. The task record and the saved note keep that plan, so the turn no longer says "no plan". It is replayed in test/codex-live-capture.test.ts.

    The replay also exposed two bugs, both fixed in #394:

    • Turn that never ended. Codex sent no turn/completed after its plan, so the turn stayed open. It now ends after the same quiet period as after a final answer.
    • Stop recorded as completed (from review). A Stop pressed after Codex's answer or plan could end up recorded as completed once that quiet period ran out. A stopped turn now waits for Codex to confirm the stop. This also covers the final-answer path from feat: live Codex captures, questions asked in a reply, and ending turns Codex never ends (#280) #390.

    The one thing still unseen is a live Codex turn/plan/updated step plan: no default-mode turn offered the plan tool. docs/task-context.md records this as not done yet.

    🤖 Generated with Claude Code

  9. BunsDev commented on Oct 30, 2026

    @BunsDev
    ContributorAuthor

    CF-7 checkpoint: close-out receipt landed, human review is Val's

    Landed: #443 squash-merged as 3d52f8b on main. 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:

    Suite Result
    CF-7 unit tests 46/46
    CF-7 e2e specs 8/8
    pnpm test, desktop 2,062 passed, 20 skipped, 0 failed; every other package green
    pnpm test:e2e, desktop 475 passed, 7 opt-in skips
    pnpm test:e2e, site 7/7

    CI:

    • PR CI was green.
    • The first queue run failed once, in e2e/canvas.spec.ts "Canvas refuses external requests…": after Escape, the main panel stayed hidden.
      • The PR changes no code.
      • The test passed 30/30 locally with --repeat-each 30.
      • It appears in none of the previous 14 failed CI runs.
    • The second queue run passed and merged.

    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:

    • ran a failing npm test;
    • edited greeting.txt after approval, then passed npm test;
    • read "Verified: npm test passed after the last change";
    • saved a Task Note and reopened it as a read-only Task view, with the transcript unchanged.

    Neither CLI was offered a plan tool, and each said so. That is still no live turn/plan/updated.

    Waiting on Val:

    1. The human review of the two saved Notes. The seeded homes are kept in .worktrees/cf7-closeout/apps/desktop/.probes/cf7-human/{claude,codex}/home, and the receipt has the launch commands. For that reason the cf7-closeout worktree is deliberately not removed yet.
    2. Three observations, each accept-as-documented or a follow-up:
      • a file Claude wrote with a shell redirect is listed as "read";
      • Codex's perl -pi edit lists no file;
      • the note title cuts the request mid-word.

    #280 stays open until Val records the review or a written deferral.

    🤖 Generated with Claude Code

  10. BunsDev commented on Oct 30, 2026

    @BunsDev
    ContributorAuthor

    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:

    • Files touched. Claude's printf … > greeting.txt redirect and Codex's perl -pi edit 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.
    • Note titles. A thread named after its opening message is now cut at a word break and ends in "…".

    The close-out receipt and docs/status.md record 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 of main at 108b814 or later.

    🤖 Generated with Claude Code

  11. BunsDev commented on Nov 1, 2026

    @BunsDev
    ContributorAuthor

    CF-7 checkpoint: review kit restored, ready for Val

    main is at 0a8c513. 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 and docs/status.md at 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.

    • A probe opened a copy of each home through Space → Personal → cf7-review-repo → Task note → Task view.
    • Both opened read-only: "nothing here runs again", no editable control, and the thread was unchanged afterwards.
    • The kit's file hashes match before and after.
    • These notes were saved on 2026-10-29, before Name commands that may have changed unlisted files, and cut opening titles at a word break (#280) #450, so they show the old files list and the title cut mid-word.
    • Each home still names the old repo path, so the side panel's Review tab reads "Not a git repository". That does not affect the Note or the Task view.

    Launch. The build is already done.

    cd ~/Documents/GitHub/TypeSafeAI/modex/.worktrees/cf7-review-kit/apps/desktop
    MODEX_HOME=$PWD/.probes/cf7-human/claude/home npx electron .   # Claude Note
    MODEX_HOME=$PWD/.probes/cf7-human/codex/home npx electron .    # Codex Note

    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:

    1. The Claude Note reads as a true, complete and portable record of the turn.
    2. The Codex Note reads as a true, complete and portable record of the turn.
    3. The Task view matches the saved Note and runs nothing.
    4. Observations 1–3: accept as documented. Name commands that may have changed unlisted files, and cut opening titles at a word break (#280) #450 and fix: preserve possible file writes from failed commands #453 have since addressed them in v0.4.1. Or open follow-ups.

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions