* fix(mcp): answer server/discover locally in the stdio proxy (#2084)
Clients that probe `server/discover` before the legacy `initialize`
(Antigravity 2.5) wait for its answer. The proxy forwarded it to the shared
daemon, so no reply was written until the daemon connected: a client that
closed stdin first got nothing, and with the daemon unavailable the reply
came ~6s later as -32603 "daemon unavailable". Answer it in the proxy with
-32601 Method not found, which is what sends such a client on to
`initialize`. The direct and daemon sessions already answer unknown methods
with -32601; the new test pins that too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 77db6c659c)
* docs(changelog): credit the server/discover fix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: danusha2345 <ewidusoc498@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(prompt-hook): skip Claude Code <agent-message> subagent hand-backs
Claude Code delivers a subagent's report to the parent session as a
UserPromptSubmit prompt wrapped in <agent-message from="…">…</agent-message>.
The prompt hook treated it as user input and ran a full codegraph_explore
on the whole report, which is slow on a multi-KB prose query (past the
30 s hook timeout in the report) and injects context unrelated to the
user's question.
Add isAgentMessage next to isTaskNotification (#1832) with the same rule:
only a prompt that is entirely the envelope is skipped, so a user question
that mentions the tag still goes through the gate.
Fixes#2184
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 240022db70)
* docs(changelog): credit the prompt-hook hand-back fix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: danusha2345 <ewidusoc498@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(windows): hide the git calls that flash console windows (#2094)
The two git calls added for exclude-standard scope parity (#1728),
`git config --get core.excludesFile` and
`git ls-files -o -i --exclude-standard --directory`, ran without
windowsHide. Inside the detached, console-less MCP daemon each one got a
fresh visible console, so a window flashed several times on daemon start
and again on every auto-sync. With Windows Terminal as the default
terminal each flash is a full Windows Terminal window. `git config
user.name` in the viewer's trails API had the same gap.
Add windowsHide: true to all three, and replace the per-file regex guards
with an AST guard over every child_process spawn in src/: options passed
through a variable or a function parameter are traced back to the object
literal that defines them, through every call site.
Supersedes #2095 (same fix, rebased on current main). Closes#2094,
closes#2096.
(cherry picked from commit dd2db41f1b)
* docs(changelog): credit the Windows console-window fix
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit cf93d497fd1b38fd9214945eeb55b6b0be9e2007)
---------
Co-authored-by: Suharaz <minesuhara@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A Vapor route whose handler is a trailing closure had no handler symbol and
linked to nothing (vapor's own repo: 76 of 80 routes bound to nothing in the
viewer browser pass). The closure is the handler: its body's calls, each once
with its receiver, are referenced from the route, as an Express inline
handler's are.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(cobol): a file ending inside the sequence area no longer hangs the parser
The vendored COBOL grammar's external scanner skips the fixed-format
sequence area (columns 1-6) with `while (get_column() <= 5) advance()`.
At end of input advance() is a no-op, so a file whose last line stops in
that area (` .`, `X\n .`, a sentence closed by a short ` .` line)
never reached column 7 and the scanner spun forever inside wasm. Indexing
hit the parse worker's hard timeout three times (~93 s) and stored the
file with zero symbols; the viewer's highlighter froze on the same text.
The loop now also stops at eof(). It is upstream code (present at
e99dbdc3), so the change is a standalone upstreamable fix; inputs that
parsed before are unaffected (412 NIST + ocesql test sources give
byte-identical trees with the old and new wasm, and the upstream corpus
keeps its single pre-existing failure).
Regenerates docs/grammars/tree-sitter-cobol.patch, rebuilds the wasm per
docs/grammars/tree-sitter-cobol.md, and adds an out-of-process regression
test under a hard deadline (a regression is an uninterruptible wasm loop).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(viewer): force the highlight deadline instead of relying on a grammar bug
The bounded-highlight test used the COBOL ` .` slice as its slice that
never finishes; the grammar fix makes it parse, so the deadline is now
forced through tokenizeBounded's deadline parameter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Only `XController@action` was claimed and resolved, and the written
namespace was stripped, so akaunting's 'Common\\Uploads@inline' (and a
Route::resource with a string controller plus options) bound 304 of 313
routes to nothing. Any `Class@action` is claimed; the namespace path under
App\\Http\\Controllers is kept and picks between same-named controllers;
a resource reads its first argument and resolves its controller class in
the Laravel resolver (no `use` brings a string-named class into scope).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A Nuxt pages/x.vue or Astro src/pages/x.astro route linked to nothing, so
the viewer's Steps drew a page alone and the routes list never named what
serves it. Each page route now references its file's own component (never a
same-named one — every index.vue is a component named index), an Astro
endpoint its exported verb handlers, and the routing manifest accepts a
component as what serves a route, which also lists Vue Router screens.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The viewer's server classifies a code slice with the engine's tree-sitter
grammars on its one thread. The COBOL grammar's scanner loops forever on a
line like ` .`, which a cobolcraft Flow card's window ends with, so the
whole server froze — /api/stats included — and a parse inside WebAssembly
cannot be interrupted from JavaScript. Slices are now classified in a
worker that is terminated past a 2 s deadline; the slice is served plain
and the next one gets a fresh worker. Request-time parses also carry a
progress-callback budget.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Only a bracketed list (and the scoped reader's bare :sym) was read, so
maybe's `resources :family_exports, only: %i[new create index]` drew all
seven RESTful routes — four to actions the controller lacks, listed by the
viewer as routes bound to nothing. Both route readers now share one option
reader for every form Rails accepts.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
pickDefaultRoot ignored files loose in the repository root, so git's
top-level .c files made builtin/ the program's root. And a source folder
whose files all sit in one folder (Express lib/, R's R/, Erlang src/)
drew one box at any depth; pickDefaultView opens the whole repository
then, when it draws more.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The single-file-component extractors kept the delegated script's file node
and made the component contain it and every node, so the hierarchy ran
file-inside-component, members had two parents, and a file with no script
had no file node. And a per-instance script's top-level calls stayed on the
file, so a walk from the component found nothing. Now: one file node (the
whole file) holds the component; the component holds what the script holds
at top level, nested symbols keep their parent; <script setup>, a Svelte
instance script and Astro frontmatter give their top-level calls — a
top-level constant's initializer's included — to the component, while
imports and module-level scripts stay with the file. Svelte 5's
`<script module>` is a module script too.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(js): a CommonJS require and a module path import the file they name
A `require('./application')` was only a call, so a CommonJS file depended
on nothing at file level: Express's lib/express.js showed no imports and
impact missed the files it loads. Local require specifiers are now read
after extraction (both the wasm extractor and the kernel, including its
deferred-decode transport) as `imports` refs from the file, and a JS/TS
module path resolves to its file the way the runtime finds it —
extensions, index files, aliases — which also lands an extensionless
`import './polyfills'` on its file instead of its own import node.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(js): read require imports inside each extractor, so kernel parity holds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The Flow strip's from/to were run through explore's free-text token filter,
which drops an Objective-C selector (`initWithFrame:`), a Ruby predicate
(`valid?`) and any name under three letters (`ok`) — then reported the
OTHER end as naming nothing in the index. Directed mode now takes the two
names as written; explore's named mode is unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(viewer): a repeated id no longer blanks Entry points or a component's Symbol view
The viewer keys its lists by id and a repeat stops the page drawing. The
routes list was a row per (route, edge), so an inline handler came back once
per call in its body; it is now one row per route — its bound handler, or
the route itself as an inline handler. A Vue/Svelte/Astro component's
members listed its script's symbols twice, plus the component and its file;
each member is now listed once.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(viewer): Steps reads a function full of checks in one pass
The in-order reading kept every way forward through an `if` with no
`else` twice — under its condition and without — so eighty checks that
draw nothing (jsoup's `parse`) made 2^80 ways and the page died on a
stack overflow. Ways waiting at the same place are merged, keeping the
conditions they all share.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
An Express handler written inline as `function (req, res) {…}` — the form
Express's own examples use — fell to the named-handler branch, so the route
linked to nothing and Steps drew a lone box for `POST /login`. The handler
is now the registration's LAST argument, inline as an arrow or a function
expression, bare or inside a wrapper call, past a trailing comma; an inline
middleware before a named handler no longer stands in for it.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
resolvePythonModuleMember (`mod.member` after `import mod` / `from pkg import
mod`) looks the member up with pythonModuleSymbol, so a package's
__init__.py re-exports lead to the definition.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
pythonModuleSymbol: a name imported from a module is its top-level
definition, or one the module re-exports by name (`from .tokens import
Token`) or through a star import (`from .users import *`, read from source),
three packages deep, memoized.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
In a TS/JS module the *Service/*Controller convention picks the file's own
class or the convention file beside it (users.controller.ts → users.service.ts),
never a same-named class elsewhere preferred for its file name; anything
farther is the import resolver's or name matching's.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Astro components are used in Astro markup; a .ts / .d.ts type name sharing a
component's name (Playwright's Page, a declaration file's Image) is no
component.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#2243 put the calling file's candidates first, which let resolveMiddleware
pick the file's own `import cors from 'cors'` node; candidates are now
functions, methods, values and classes only.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The middleware/controller/service heuristics took the first same-named node
anywhere; a JS/TS module reaches another file's only through an import or
require (the import resolver's), so they now keep a same-file pick only.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The SwiftUI/UIKit/Vapor resolvers apply to Swift refs only; the shared name
pick never returns the declaring type for an inheritance ref; and the
supertype re-choice prefers the declaring file, then a protocol/interface for
`implements`.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Solidity joins OVERLOADING_LANGUAGES, so retargetSelfOverload moves a call
whose argument count the settled overload cannot take to the one sibling
that can.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A JS/TS module reaches another file's hook or context only through an import
(already the import resolver's), so resolveHook/resolveContext pick from the
reference's own file alone there; an optional call `f?.(…)` is a bare call.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
R looks a call up among functions only; a calls ref named after a base R
function (c, list, df, …) is refused a variable/constant target that is not
bound to a function literal.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
retargetSelfOverload for Swift matches the call's argument labels against
each same-owner overload's external parameter labels (defaulted and variadic
ones optional), instead of the argument count alone.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The extractor names `extension on X` after X; such a node is never a target,
and its members are out of reach from other files (Dart scopes unnamed
extensions to their library) — before ranking in Strategy 3 and as a veto.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
isJavaTypeVisible (before ranking and as a veto): a top-level type from its
package or a single-type/on-demand import; a nested type from inside its
owner, a subtype (anonymous classes by their $anon supertype), an import, or
written through its owner; constructors follow their type; enum constants
only in their enum, a case label, a static import or through the enum.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
isPhpClassVisible: an unqualified PHP class name means the current
namespace's class or the one a `use` imports (none in the project for a
library's); applied before ranking and as a cross-file veto.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
matchReference refuses a method target for a calls ref from a C file: C has
no methods and cannot call a C++ one.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
isVisibleAcrossFiles (before the same-file shortcut) rejects every Go
candidate for a reference its line writes as `pkg.Name` through an import
from outside the module (stdlib or third-party).
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
In a .kts file, a bare call reaches a method/field/property only when its
owner is no class the project declares (build logic's extensions on Gradle's
types); the old rule let every member through.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
In isRustNameInScope, a type reference written `Self::Name` is in scope only
as a type alias declared in the enclosing impl/trait block above it, and one
written through a generic type parameter (`V::Value`) names no project item.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
isScalaPackageObjectMemberVisible: a member of `package object X` resolves
from its package and those under it, or a file that imports through it;
applied before ranking (so the visible namesake wins) and as a veto.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
An extends/implements ref that settled on the declaring type is re-chosen
among the other types of its name, the one the written qualifier leads to
(owner path plus file package), or none.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A receiver that is the test's own parameter takes the type its in-reach
fixture returns (`return Cls(…)` or a local assigned `Cls(…)`), so calls on
it resolve on that class, or on nothing when it is a library's; fixtures a
conftest.py star-imports or lists in pytest_plugins are in reach.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
isVisibleAcrossFiles rejects a declaration in a .svelte instance <script> or a
Vue <script setup> from another file; a Svelte <script module>, a plain Vue
<script>, and a type a <script setup> exports stay reachable.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A JS/TS parameter or plain var/let/const above the reference shadows a
same-named function declared elsewhere in the file, whichever strategy found
it; destructured call results, member calls and followed aliases are left
alone.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
One shared pick behind the Django/FastAPI/Flask, ASP.NET, Gin, SwiftUI/Vapor,
Spring and Rust name heuristics: never a function-local declaration, a type
nested in another file's type, or a node the language keeps out of the
reference's file; the reference's own file first, then its directory (not
Rust), then a conventional folder.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The Rust resolver's handler/service/struct heuristics took the first
same-named item and then checked scope; they now drop items declared inside
a function body and out-of-scope names before choosing, and take the file's
own item first.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Generalizes the collapsed-chain self veto beyond TS/JS this./window. roots: a
call the extractor recorded by its bare name but the source writes as a member
call on anything other than this/self/super is never the calling method; and a
value's initializer never calls the value itself.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The Spring resolver's entity/service/controller name heuristics took the first
same-named class under a conventional folder; they now prefer the ref's own
file, then its package, and never reach another file's nested class by its
bare name.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A TS/JS call written through this.<field>… or window.<x>… reaches the resolver
by its bare name; it resolves to the calling method only when the field is
declared as the caller's own class. A name-scored receiver guess never lands
on the calling method.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A block namespace qualifies only its own body (a nested one is Outer.Inner),
mirrored in the kernel; a using names the project's namespace, never another
file's using; a global using is its own project's; a nested type is reached
by bare name only from inside its owner or a type deriving from it, through
any partial part; visible C# types are filtered before ranking.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A function nested in another function is reachable only from inside it; a
Python name the enclosing function binds is that local's value; a pytest
fixture is a test's parameter only in its own module or under its conftest.
Unreachable same-named functions still count against a lone cross-file guess.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A lone project method now stands for an untyped receiver's member value only
when the receiver is named after the method's class: netbox's
`device=self.parent.device` model-field reads no longer reach a GraphQL
filter's `device` method.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A kind-projector placeholder (`Align[Either[A, *]]`, `Functor[Map[K, ?]]`)
reached the resolver as a type reference named `*`, and exact or fuzzy
matching bound it to the one `*` in the project - algebra's
`Signed.Sign.*` operator - 567 times in cats. A symbolic name in a Scala
type now resolves only to a type or type alias of that name (cats'
`F ~> G`), and otherwise to nothing, whatever strategy runs.
cats -567; sttp unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A bare C# type name could mean any same-named project type. Newtonsoft's
`async Task` tests (`using System.Threading.Tasks;`) bound `Task` to a test
class `Task` in `Newtonsoft.Json.Tests.Schema` 433 times; AutoMapper's DTOs
in `OmmitedDTOModel3` extended `OmmitedDatabaseModel3`'s `BaseEntity`;
Newtonsoft's `BindingFlags` went to its portable-build polyfill.
A type in namespace N is now in reach of a file whose code runs in N or a
namespace inside it, or that imports N: its `using N;`, any file's
`global using N;`, the project files' `<Using Include="N" />`, the SDK's
implicit usings when `<ImplicitUsings>` is on (serilog's own
`System.TimeProvider` polyfill is seen through them), or an alias naming
the type (`using License = AutoMapper.Licensing.License;`). A type in the
global namespace is seen everywhere; qualified names are not judged.
Newtonsoft -529, AutoMapper -72, eShop -4; serilog, CleanArchitecture
unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The Rust scope rule (#2124) only checked prelude names; every other bare
name could mean any same-named project item, and a name after any path
(`io::Result`) could mean any at all. The Rust framework resolver's
PascalCase / handler / service patterns bound names with no scope check at
0.7-0.8. tokio's 1,221 `io::Result<...>` went to a private
`runtime::task::Result` alias, 642 `Context<'_>` (from `use
std::task::{Context, Poll}`) to `runtime::context::Context`.
- A type or function from another file is in scope only through a `use`
that binds it (its leaf, `as` alias, or `{self}`) or a glob over its
module; methods and fields (reached through a value), import refs and
module / file targets are unaffected.
- A name a file imports from outside the project - `std` / `core` /
`alloc`, or a crate its Cargo manifests declare as a dependency - is that
outside item. (An inline `mod support { pub mod panic; }` is the
project's.)
- A path names its module: `seg::Name` reaches an item of module `seg`;
a path rooted at std (`std::io::Error`) or at an outside import (`io::`
under `use std::io`) reaches none; `crate::` / `self::` / `super::` and a
project crate's name (`clap::Command`, re-exported) look it up as before.
The path is read anywhere on the line, not only at the reference's column.
- The framework resolver's patterns apply the same check.
tokio -3008 +610, serde -792 +650, ripgrep -602 +247, axum -453 +186, clap
-342 +32, bat -38 +9. Sampled losses: std / core / futures / syn / http /
anyhow imports and paths, associated types (`S::Ok`, `S::Error`, `V::Value`,
`Fut::Output`); gains are same-module items the old first match hid.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
#2212 moved a method's call to its own name onto the sibling overload the
arguments fit. The same holds for every caller: a match landing on an
overload whose parameters cannot take the call's arguments moves to the one
same-owner overload they fit - commons-lang's
`HashCodeBuilder.reflectionHashCode(this)` from the three-parameter overload
indexed first to the `(Object, String...)` one, Newtonsoft's
`SetToken(token, value)` from `SetToken(token)`, halo's four-argument
`menuItem(...)` from the one-argument `menuItem`.
Overload sets and arities are read once per target node, and a target with
no same-owner sibling costs one lookup, so indexing time is unchanged
(commons-lang 4.67s vs 4.70s, Newtonsoft 4.04s vs 4.05s, wasm both arms).
C++ keeps only the self-call case: its overload sets (templates, SFINAE
priority tags, `data()` on any container) move targets unreliably.
Targets moved between same-named overloads: commons-lang 2,334, Newtonsoft
697, halo 286, gson 232, okhttp 188, Alamofire 50; nlohmann json and fmt
unchanged. Edge counts unchanged.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>