Repository navigation
Update picomatch to address audit findings - #197
dragonnite1221-lgtm wants to merge 18 commits into
Conversation
…tion (colbymchenry#191) * feat(mcp): steer agents to explore-first; fix Kotlin/Swift test detection Two changes from diagnosing why Claude Code's Explore agent wasn't using codegraph_explore on a benchmark run (37 calls / ~90k tokens via search+Read+grep, vs a general-purpose agent that led with explore: 13 calls / ~55k tokens for the same question). 1. Tool guidance reframed across server-instructions.ts, instructions-template.ts, and .cursor/rules/codegraph.mdc (+ the explore/search tool descriptions): codegraph_explore is the workhorse for understanding/architecture/"how does X work" questions. Seed it with the key symbol names (a quick search/context first if the question names nothing concrete), read its output, and fill gaps with node/Read — instead of searching then Reading each file. The old "search first to find names, then explore" wording was short-circuiting: agents searched, got file:line locations, and Read them, never reaching explore. 2. isTestFile now recognizes Kotlin (*Test.kt, jvmTest/commonTest/ androidTest source sets), Swift (*Tests.swift), and other camelCase test conventions, so test code is deprioritized in explore/context ranking. Previously only Java/JS/Python were known, letting tests dominate Kotlin/Swift exploration (OkHttp "trace a request" went from 8/9 test files to surfacing Call.kt/OkHttpClient.kt/Request.kt/Response.kt). Capital-led matching keeps latest.kt/manifest.kt unflagged. An IDF common-term down-weighting was prototyped for the cold-query case but dropped — it was a measured no-op (the "common" terms weren't actually common in the test indexes); the test-detection gap was the real cause. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore(agent-eval): add agent-behavior eval harness for codegraph MCP usage Tooling to measure how a Claude Code agent actually uses the codegraph MCP tools on a real repo — does it lead with codegraph_explore, how many Read/Grep follow-ups, token cost — for validating tool-guidance changes (server-instructions, tool descriptions) against real agent behavior. - itrun.sh drives the real interactive TUI via tmux (the faithful Explore path). Hardened for unattended runs: type-and-verify prompt delivery (the ❯ glyph is drawn ~6s before the input accepts keys), auto-accepts the "trust this folder" dialog, busy-detection keys on the universal "(Ns · …)" spinner so the pre-stream thinking phase counts as busy, and fails loudly instead of capturing an empty pane. - parse-session.mjs reports the tool breakdown + token accounting (gen / fresh-in / cached-in / billable) from the session and subagent logs, consistent across main-thread and subagent runs; counts main-thread Bash in the grep verdict. - run-agent.sh / parse-run.mjs are the headless stream-json complement (exact per-tool tokens/cost via claude -p). - run-interactive-test.md documents how to run it and how completion is detected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Folds all changes since 0.7.10 into 0.7.12 (0.7.11 was unpublished from npm): size-adaptive codegraph_explore output budget (colbymchenry#185/colbymchenry#187), line numbers in explore source sections (colbymchenry#188), explore-first tool guidance (colbymchenry#191), language-neutral source-omission markers, and Kotlin/Swift test-file detection (colbymchenry#191). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This bump is worth prioritizing — the The Rust framework resolver compiles workspace-member globs read straight from an indexed repo's
The change here (
(Reachability verified against the current code graph. Filed a standalone issue for this and am closing it as a duplicate of this PR.) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ddd75c9ce
ℹ️ 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".
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Addresses the review note that this branch had drifted from main since May and
that its lockfile needed regenerating. The branch was 76 commits behind, and
package-lock.json is the release-bundled artifact, so merging a lockfile built
against a May tree would have reverted dependency work that landed since.
Merged upstream/main (no conflicts) and re-ran npm install --package-lock-only.
The regeneration produced no further diff, i.e. the merged lockfile was already
the tree npm resolves from package.json; npm ci then installs from it cleanly,
which is the check that actually proves lockfile and manifest agree.
Also drops a duplicate `import type { FrameworkResolver }` in
__tests__/frameworks.test.ts. That duplicate predates this branch and exists on
main too, where the older transform tolerated it. The dependency bump this PR
carries brings vite 8, whose oxc transform rejects it as a parse error, so the
file stopped loading entirely. Line 2 already imports the symbol, so the second
import is removed rather than the two merged.
Verification against upstream/main as the baseline, two full runs each:
upstream/main 58 failed / 2451 passed (16 files, identical across runs)
this branch 22-25 failed / ~2492 passed (4 files, identical file set)
npm ci exit 0
npm audit --omit=dev 0 vulnerabilities
installed picomatch 4.0.5 (no 4.0.3 anywhere in the tree)
npm run build exit 0
Two of this branch's four failing files, extraction.test.ts and
multi-repo-workspace.test.ts, do not fail on main. They pass in isolation
(631 tests, exit 0) and fail only in the full parallel run, always as
"Test timed out in 5000ms" -- 18 of the 21 timeouts in the run -- with no
assertion failures among them. That reads as contention against the default 5s
timeout under vitest 4's scheduling on a loaded machine rather than a behaviour
change, but it is reported here rather than smoothed over; the bundle default
stays pinned at Node v24.16.0 as agreed earlier in review.
This reverts commit 4b915c0.
|
Scope repair complete on The accidental Vitest 4 change is removed with a normal revert, latest upstream Local validation on final tree:
There is still no CI workflow/status attached to this PR. @colbymchenry, please review the now-minimal diff and the local evidence; I am not treating the PR as merge-ready without maintainer review. |
|
Thanks for flagging the picomatch advisory! main's lockfile has carried picomatch 4.0.7 since 1.6.1, which is past the 4.0.4 fix for CVE-2026-33671, and the release bundles install from that lockfile, so 1.6.1 and 1.6.2 already ship the patched version. The bundle script has since been reworked (Node 24.22.1 plus a checksum check against nodejs.org), so the other changes no longer apply cleanly. Closing this one. |
Summary
picomatchdependency from^4.0.3to^4.0.4and lock exactly4.0.4.nvmrcand Voltaunzipandzipbefore any Windows bundle downloadmainScope
This PR now contains only the picomatch ReDoS fix, the contributor/release Node split, and Windows bundle preflight. The accidental Vitest 4.1.10 squash commit was reverted normally; no force-push or destructive reset was used.
package.jsonandpackage-lock.jsonare back on Vitest 2.1.9, and no Rolldown package remains in the lockfile.The Vitest 4 work remains preserved on the fork branch
agent/update-vitest-4atcb19eb4. It can be retargeted or recreated from upstreammainafter this PR lands.Verification
npm ci— passednpm run build— passednpm audit --omit=dev— 0 vulnerabilitiesnpm ls picomatch—picomatch@4.0.4v24.16.01.5.0picomatch@4.0.4node:sqliteopen —sqlite-ok, noExperimentalWarningunzipand missingzipeach exit 1 before the download messagegit diff --check— passedThere is no repository CI workflow/status for this PR, so the local logs above are the available validation evidence; maintainer review is still required.