Skip to content

M67: code intelligence tools on both backends, and a repo map - #57

Open
RandyNorthrup wants to merge 6 commits into
mainfrom
feature/m67-code-intel
Open

RandyNorthrup wants to merge 6 commits into
mainfrom
feature/m67-code-intel

Conversation

@RandyNorthrup

Copy link
Copy Markdown
Owner

What

M67 (PLAN D49): the model finds definitions, references and symbols the way an IDE does, from VS Code's own language services, instead of grepping.

  • Model API: find_definition, find_references, workspace_symbols, document_symbols, hover, call_hierarchy and repo_map are read tools (no card in any mode, stopped by Stop). rename_symbol is planned before its card, judged as an edit (protected when any of its files is), rechecked file by file after approval and again right before each write, written atomically, and leaves one revertable patch across its files. The repo map goes into the prompt while museSpark.modelApiRepoMap (machine-scoped) is on.
  • Muse Code: the same tools on the extension's ide server (findDefinition … renameSymbol), each readOnlyHint: true; renameSymbol returns a unified diff and writes nothing.
  • Core in src/core/codeIntel/ (no vscode), the adapter in src/host/codeIntel/languageServices.ts (results converted to plain data, hover parsed with zod). The file tools' one-hunk patch moved into codeText.ts unchanged so the rename shares it.
  • Panel: row labels for all sixteen names in 15 tables; the rename card names up to five files and counts the rest.

Review

Three-class review by Claude Code agents, then two Grok Build rounds on the Kubuntu rig. Every finding was fixed with its class siblings (585af10, db23f6a): stale renames refused, file operations seen, unsaved editors matched by real path (symlinked roots), a cut-off repo-map batch dropped, the plan a hook saw is the plan written, call-hierarchy sites named honestly. Findings and answers are in docs/certification/m67.md.

Gate

Complete npm run quality on the Mac mini rig for be43dabb (db23f6a adds only the certification text): 187 test files passed, 2,794 tests, a11y 340 pages with 0 rules violated, no leaks, 0 Semgrep findings, exit=0 (lint:ps runs on Windows only; no PowerShell changed). Integration suite 15 passing on VS Code stable and 1.125.0. Red drills recorded in the certification record.

Live

  • Model API, case19 (muse-spark-1.3-contributor, empty temporary workspace): 3 requests, all 200, est. $0.0007; 4 references found, 4 edits in 2 files, the import left intact.
  • Muse Code 1.4.0-R4302.1 through the ide server (AGENTS rule 13): 4 model attempts from the CLI's trace log; Muse Code listed the tools, showed its own approval card for mcp__ide__findReferences despite readOnlyHint: true, and passed our text through verbatim.

🤖 Generated with Claude Code

RandyNorthrup and others added 5 commits September 28, 2026 08:08
The model finds definitions, references and symbols the way the editor
does, from VS Code's own language services (PLAN.md D49, M67).

- src/core/codeIntel/: find_definition, find_references,
  workspace_symbols, document_symbols, hover, call_hierarchy and repo_map
  over a LanguageServiceHost; inputs confined like the file tools' (D24),
  results workspace-relative, sorted, capped, with what lies outside the
  workspace left out and counted; "no language service" instead of an
  empty answer; a 20-second deadline per call.
- src/host/codeIntel/languageServices.ts: the vscode.execute… commands.
- Model API: native read tools (no card in any mode, Restricted Mode
  included) and rename_symbol, planned before its card, judged as an
  edit (protected when any file is), re-checked after approval, written
  file by file with one patch for Revert and rewind. The repo map in the
  prompt behind museSpark.modelApiRepoMap (off, machine-scoped).
- Muse Code: the same tools on the ide server, readOnlyHint on each (and
  on getDiagnostics); renameSymbol returns a diff and writes nothing.
- The file tools' one-hunk patch moved to codeText.ts as changeHunk,
  shared with the rename.
- Tests: unit suites over a fake language service, the adapter over the
  vscode mock, an integration suite over a TypeScript fixture (VS Code
  stable and 1.125.0), live case19 of the Model API sweep (3 requests),
  the code-intel harness scenario; 20 red drills in
  docs/certification/m67.md.
- Docs: README, CHANGELOG, PLAN (as built, Q10, Q11), AGENTS layout,
  SECURITY, PRIVACY; strings in all 15 tables.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ap bounded

Every finding from the three class reviews of c5c4045, in one pass:

- A rename's every edit range must cover exactly the old name in the text
  written, and the position's file must still be the text the provider
  answered on, or it is refused (P1).
- File operations in a rename are read from WorkspaceEdit._allEntries()
  (size only counts text edits in VS Code); unreadable means refused.
- Each file is checked again right before its own write; a change partway
  stops the rest with a revertable patch; Stop after approval writes
  nothing.
- Repo map only in a trusted workspace, never pinned empty or failed,
  three tries at most, a child task uses its parent's map, the Stop
  listener is removed and the file listing is bounded.
- Hover held back when defined only outside the workspace and the
  languages' libraries; unsaved files: positions refused, lines from the
  editor, noted.
- rename_symbol matches Edit hooks, which get the planned files; a Stop
  while planning still leaves the call its row and output.
- Protected files named first on the card; a failed rename with a patch
  keeps review, revert and rewind; an edit row's file is only a path.
- No Promise.withResolvers in the repo map (Node 20 for VS Code 1.99);
  the M67 commands and WorkspaceEdit._allEntries checked in 1.99.0.
- Honest "no language service" wording; the live stand-in skips string
  literals and asserts main.ts exactly; certification updated with the
  live Muse Code capture through the ide server and the red drills.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…est call sites

Grok Build's review of 585af10 (one P1, five P2), all fixed:

- An editor with unsaved changes is matched to a file by its real path
  too (ToolIo.unsavedFiles, unsavedDocumentPath), so a workspace opened
  through a link no longer lets a rename write over unsaved edits; lines
  and targets are read at the editor's own path.
- The repo map drops a batch the time or a Stop cuts off, and says "no
  language service" only when every lookup ran and found nothing.
- The rename plan shown to PreToolUse hooks is the plan written.
- Outgoing call sites name the file of the function asked about; of
  several call items the one declared at the position is asked and the
  others are counted.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T19:14:49.472883Z db23f6a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db23f6a2c6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/codeIntel/repoMap.ts Outdated
Comment thread src/core/codeIntel/codeIntelTools.ts Outdated
… path

Codex on PR #57 (two P2s), each fixed with its siblings:

- The repo map counts every line it renders against its budget: the lead,
  the count of files left out, the notes, and the prompt section's
  heading. repo_map refuses a max_tokens too small for its own fixed text
  and names the size that would do; an empty map is held to the budget
  too.
- document_symbols opens and outlines the file through openAsEdited, at
  the path of an editor holding unsaved changes to it, as the other tools
  already do.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@RandyNorthrup

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

This branch has not been deployed

No deployments
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