Skip to content

List the project files a turn touched, as the CLI reported them (CF-7 context map) - #355

Merged
BunsDev merged 8 commits into
mainfrom
cf7-context
Oct 21, 2026
Merged

BunsDev merged 8 commits into
mainfrom
cf7-context

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Current candidate

The path-resolution repair #360 is merged here at 44524dc1081444fec399527de927c9c582bc70a8. Codex paths now resolve from the command's cwd; normalized project boundaries handle parent traversal, Windows drive-relative paths and UNC roots. Outside-file counts deduplicate resolved identities without exporting private paths.

Repair 0c70c6ed: build/typecheck, 1,918 unit passes (16 skips), 23 focused context tests and four Notes E2E passes. Its immediate predecessor dc5c80c4 passed the full E2E suite (374 desktop passes, six opt-in skips, seven site passes); the final count-only correction was checked with the full unit suite and Notes E2E. Required CI passed on the repair before merge; the combined head requires fresh CI.

This delivers the context-map portion of #280. Read-only task-view reopening, plan-step/revision verification and native/human acceptance remain open. The separate cross-project Note-save fix is #363.

The original implementation evidence below is historical and identifies its own scope; its earlier local E2E failures are not the repair's results.

Part of #280 (CF-7), tracker #273. This is CF-7's open item "An on-demand context map". It was built on #351, which has since landed (d1902d2). The plan is in docs/superpowers/plans/2026-10-20-cf7-context-map.md.

Native capability used

  • codex-cli 0.163.0 sends commandActions with every command: its own parse of the command as read {path}, search {path, query}, listFiles {path} or unknown. Modex dropped these. It now keeps the first three on exec.actions (codexActions). It drops unknown and a read without a path.
  • Claude Code tools name their files: Read and Edit/Write (file_path), Grep/Glob/LS (path). A Bash cat carries no parse, so it isn't counted as a read.
  • The offline engine: read_file, list_dir and write_file (path).

What it does

  • taskContext() (shared/task-context.ts) lists each project file the turn changed, read or searched. All relations are observed, meaning the CLI reported them: nothing is indexed, inferred or suggested.
    • A denied or failed tool touched nothing.
    • Paths are relative to the thread's working directory. Paths outside it are counted, never named.
    • The order is changed, then read, then searched, each by first touch.
  • Footer: Files touched · N, a disclosure button. It lists at most 20 entries, then "and N more", then how many were outside the project.
  • Note: a "Files the turn touched" section with the same cap. The record keeps every file.

Evidence

Check Result
Red The 3 context unit tests and the Codex commandActions test failed on stubs. The footer e2e found no toggle
task-context + codex-backend + conversation-events 76/76
e2e/task-to-notes.spec.ts 4/4
pnpm typecheck passed
pnpm --filter @modex/desktop test 1,731 passed, 16 skipped of 1,747; second stage 21/21
pnpm --filter @modex/desktop test:e2e 367 passed, 6 skipped (opt-in), 6 failed, all environmental: 4 had no Playwright Chromium (it was cleared from ~/Library/Caches). After npx playwright install chromium, those specs (browser-attachments, browser, usage) passed 5/5. 2 are browser-document "native login labels": "1Password could not be read", which needs the 1Password app unlocked. CI runs them

Coven-Harness: Claude Code / claude-opus-5-5

… (CF-7)

verification() in shared/task-context.ts reads a turn's tools in
transcript order:
- A check is a known test, build, typecheck or lint command, read
  inside sh/bash/zsh -c with quotes respected. An exit-zero echo or
  the model saying "tests pass" is not one.
- A check passes only as succeeded with exit code 0 or none reported.
- A check goes stale when an edit that was not denied, or a command
  that might write, runs after it.
- The turn reads verified, failed, unknown, stale or none.

taskRecord carries it, and the note gets a Verification section that
marks stale checks. Anything short of verified goes under Not settled;
a failure a later fix superseded does not. Plan steps keep the CLI's
statuses: neither CLI links a check to a step.

Red first: five of six new tests failed on a stub, then edits and
displayCommand on theirs. task-context passes 13/13; the desktop
unit suite 1,723 passed, 16 skipped.

Part of #280 (CF-7), tracker #273.

Coven-Harness: Claude Code / claude-opus-5-5
A finished turn's footer reads, for example, "Verified: pnpm test passed
after the last change" or "Not verified: pnpm test ran before a later
change". It also covers a check that failed, a check that did not say
how it ended, and a turn whose changes no check followed. A check
shows as the script its shell ran, with the exact command on hover. A
turn that changed nothing and ran no check shows nothing.

Red first: the new e2e test found no verification lines (expected 2,
received 0). task-to-notes.spec.ts passes 3/3.

docs/task-context.md gains a Verification section, and status.md an
entry.

Part of #280 (CF-7), tracker #273.

Coven-Harness: Claude Code / claude-opus-5-5
ThreadView keeps both imports; docs/status.md is main's page plus
this PR's entry.

Coven-Harness: Claude Code / claude-opus-5-5
Coven-Harness: Claude Code / claude-opus-5-5
taskContext() in shared/task-context.ts gives each project file a turn
changed, read or searched, from what the CLI reported:
- patch tools and write_file (changed);
- Claude's Read, the offline engine's read_file, and Codex's own parse
  of a command (read);
- Grep, Glob, LS, list_dir, and Codex's search and listFiles
  (searched).

A denied or failed tool touched nothing. Paths outside the project are
counted, never named. Nothing is inferred: an unparsed shell cat is not
a read. The order is changed, then read, then searched.

The Codex backend now keeps commandActions (codex-cli 0.163.0) on
exec.actions, dropping unknown actions and reads without a path. The
validator accepts them. taskRecord carries the map, and the note gets a
"Files the turn touched" section capped at 20, with "and N more".

Red first: the three context tests and the Codex test failed on stubs.
task-context, codex-backend and conversation-events pass 76/76.

Part of #280 (CF-7), tracker #273.

Coven-Harness: Claude Code / claude-opus-5-5
A finished turn's footer has "Files touched · N" when the turn touched
any project file. It opens a list of at most 20, each with how it was
touched (changed, read, searched), then "and N more", then how many
were outside the project.

Red first: the new e2e test found no toggle. task-to-notes passes 4/4.

docs/task-context.md gains a Context map section,
docs/conversation-evidence.md describes Codex's commandActions, and
status.md has an entry.

Part of #280 (CF-7), tracker #273.

Coven-Harness: Claude Code / claude-opus-5-5
main's tree after #351 is byte-identical to this branch's base merge
(c6cf23f, tree 8944330), so -s ours changes no content.

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 21, 2026 1:06am UTC

Request Review

@github-code-quality

github-code-quality Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main 4e9d965 cf7-context 44524dc +/-
64% 65% +1%
View coverage of the 3 most impacted files.
File main 4e9d965 cf7-context 44524dc +/-
apps/desktop/sr...ckends/codex.ts 97% 97% 0%
apps/desktop/sr...red/evidence.ts 99% 99% 0%
apps/desktop/sr...task-context.ts 99% 100% +1%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.


Updated October 21, 2026 01:40 UTC

@BunsDev
BunsDev added this pull request to the merge queue Oct 20, 2026
@BunsDev
BunsDev removed this pull request from the merge queue due to a manual request Oct 20, 2026
@BunsDev
BunsDev marked this pull request as draft October 20, 2026 23:58
…es (#360)

* Resolve context files against command cwd and normalized project boundaries

* Count external context files by normalized identity

This branch was successfully deployed

1 active deployment
Preview — 44524dc1 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant