Repository navigation
同步 CodeGraph v1.6.7,保留 Desktop 运行时契约 - #20
Merged
Merged
Conversation
Hold codegraph.lock through database recreation and indexing so a refused rebuild cannot remove the database a running build is using. Refs colbymchenry#3494
…ymchenry#3503) A source file over the size limit is tracked and never parsed, so the graph holds none of its symbols. That is on purpose. What was wrong is that nothing said so: `index` printed "Indexed 1,678 files", `status` printed "Index is up to date" with no parse errors, and the file's own symbol map read "No indexed symbols in this file", for src/resolution/name-matcher.ts in this repository, 37,000 lines of hand-written source at 1.9 MB. A search, a caller list or an impact report over such a project is missing whatever the file holds, and silence reads as "not there". - `getIndexHealth()` lists the files left out for size, with their sizes. - `status` names them and reports them in its JSON as `index.filesOverSizeLimit`, `index.oversizeFiles` and `index.sizeLimitBytes`. It still says the index is up to date, and `--strict` still passes: nothing is stale, and a sync would change nothing. - `init`, `index` and `sync` print the same line when a file is left out. - `codegraph node --file <path> --symbols-only` says the file was not indexed and why, in place of an empty map. The smallest are named first: a generated parser of 30 MB is what the limit is for, and a file just over it is the likeliest to be written by hand. In this repository that puts name-matcher.ts ahead of four generated parser.c files of 7 to 35 MB. The limit itself is unchanged. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…x files up to 4 MB (colbymchenry#3504) * perf(index): a large file indexes in the time its size asks for; index files up to 4 MB A large source file took time in the square of its size. A Python file of plain functions took 3 seconds at a third of a megabyte and 27 at nine tenths, a Ruby one twice that; a table of rows that each call a helper took 37 seconds at a third of a megabyte; one string of hex 30 KB long cost a second, which is eighteen minutes for a megabyte of it. Past about a megabyte a file was given the 180 seconds a file is allowed and then given up on, with none of its symbols indexed. That is why the size limit could not be raised. Every cause was the same shape: work done for each symbol, or each reference, that went through the whole file or everything before it. In both extractors (the native kernel and the wasm one): - A declaration's decorators were looked for after finding where it stands among its parent's children, counted from the first (seven languages). The walk now starts from the declaration. - A Ruby method's visibility walked back over every sibling before it; a C++ member read every child of its parent. Each now keeps what the last answer was, per parent. - A node's children were read by index, and tree-sitter reads the children before the one asked for when they are a flat run, as some thousand consecutive comment lines are. They are now stepped through (278 loops in the kernel; in the wasm extractor, the 97 that read every child). - Each JS/TS constant compiled a pattern and searched the whole file to see if a later statement exports it. The names are read once per file. In the kernel alone: - A column was counted character by character from its line's start, so a script minified to one line paid its length for every symbol. It is read from a table built once per file. - The C scan searched for `struct` and for `union` from its place on every turn, to the end of the file for whichever the file does not use. - A declaration's walked initializers were kept as a list and searched for every node under it: a Go `const (…)` block of some thousand names. In the resolver: - "Does the function's code, from its first line through this one, bind this name?" read that code again for each line asked about (JS/TS, Scala), and a Python reference read its whole statement, which for a table is the whole file. Each is now read once and answered for any line. - What is around a reference (its function, its class, its namespace) was found by going through every node of the file, in nearly forty places. The nodes that can hold a line now come from a per-file index (nodes-around.ts); the test each place makes is unchanged. - A file's imports were gone through for every reference at each step of import resolution. They are indexed by name and by source (import-lookup.ts). - Import statements named alike (`crate` for every `use crate::…` of a Rust project) went through each other; a file's nodes were filtered by name, or queried one name at a time, for every reference. - The line of an offset was written `text.slice(0, i).split('\n').length` in more than fifty places, a pass over the file for each match of a route or handler scan. They share one helper (lineAt). - A few checks stripped or split their whole file for each reference (object-literal aliases, store calls). One change is a change of what is read, not only of how fast: the resolver's patterns are no longer given a run of name characters longer than 1,024 (an embedded asset, a key, a table of hex). A pattern that reads a name starts one at every character of such a run and reads to its end. The run is blanked, at its length, in the text the resolver reads (withoutLongRuns); the file on disk, its symbols and its positions are untouched. With that, the limit goes from 1 MB to 4 MB. At 4 MB a file of some hundred thousand imports or references also overflowed the stack where a list was spread into a call's arguments; those lists are now added item by item. Checked against the engine as it was: the graph built from this repository's test fixtures, from its own source, from the desktop app, from parts of the Python, Ruby and Go standard libraries and five Rust crates, and from 300 generated files (one a language and shape) is the same, node for node and edge for edge, with the kernel and with the wasm extractor. At 3.9 MB, 317 generated files (17 languages, 24 shapes) index in 2.2 seconds on average, the slowest in 12 (130,000 `#include` lines). Fourteen real files of 1 to 3.8 MB found on one machine (generated Go, tree-sitter parsers, Arm headers, a bundle, icon typings, this repository's own name-matcher.ts) take 0.3 to 4.2 seconds each. Memory per megabyte is as it was, so a file four times the old limit can take four times the memory while it is indexed: 0.15 to 0.7 GB at its peak for those real files, 1.8 GB for the 3.8 MB bundle. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * perf(index): large files in the other languages, in routes files and across the bridges The commit before this one measured the seventeen languages the native kernel reads. The README lists about twice that many, and the frameworks whose routes and handlers are linked; none of those had been timed. Timed now, at 1.2 MB: an Express file of inline handlers took 58 seconds, Liquid markup 41, a CodeIgniter routes file and its controller 31, ArkTS components 22, a React Native Fabric spec 20, a file of event listeners 16, and a Rails, Play, React Router or Angular routes file 8 to 12. The causes were the same shape as before, work for each symbol, reference or route that goes through the whole file, in the places that commit did not reach: In the wasm extractor and the extractors that read without a grammar: - An ArkTS declaration's decorators were looked for after finding where it stands among its parent's children, counted from the first. - Liquid read the text before each tag for its line, and split the whole source for each line's start. Both come from a table built once. - A member's qualified name looked for each id on the stack among every node extracted so far (five places). They are kept by id. - A Vue options component looked for the member around each reference among all of them. The member of each line is written down once. - The ninety loops over a node's children that leave early were still read by index (the first commit converted those that read every child). They step with a cursor (childrenOf, namedChildrenOf): a megabyte of comment lines under a VB.NET module took four seconds. In the resolver and the framework passes: - "The node of this file named X" was a pass over all of the file's nodes, once per route for a routes file and its controller (CodeIgniter, Rails, Play, Laravel, Drupal, Vue, Angular, React) and once per reference in a dozen other places. The nodes of a file are indexed by name, by name in any case, and by owner (nodesNamed, nodesNamedLower, nodesUnder). - React Router looked for the routes around each route among all of them, and for a page claiming the same path among all of them. Routes are kept by stretch of the source and by path. - The scan for the line that declares a receiver's type keeps its last answer and goes on from it when asked about a later line; asked about an earlier one, it scanned again from that line up. It now answers from what it kept. That was the Express file: each handler calls a method on a parameter nothing declares. - Event listeners, Angular templates and the enclosing-function helpers went through every node of the file for the ones around a line; the line of an offset was counted from the file's start for each Angular binding and each React Native bridge method. - A JSX file of many components searched the whole scope for each tag name written bare. The words are read once. - A React Native Fabric spec looked for each prop's name from the first line of its props interface, and for the interface itself each time: twenty seconds for an interface of 1.2 MB. Where each name first occurs is read in one pass (firstIndexOfEach). - An Objective-C message that a Swift `@objc` method might answer split the Swift file into lines, to read the three above the method's declaration: seven seconds for 0.8 MB. The file's lines are split once. - A member called on a module's default import asked whether the module's file says `module.exports`, then read the file for what it states as its default, for each call: four seconds for a megabyte of calls on one TurboModule. Each is asked once per file. - A Tauri front end tried a pattern on the code before each `invoke` call to see whether the function destructures a binding of that name. Where the first such binding ends is kept per function. Nothing here changes what is read. The graph is the same as the engine at main builds, node for node and edge for edge, over the bodies of code the first commit was checked on, over 96 more generated projects, one for each remaining language, framework and bridge, and over small projects written for what the faster paths decide, with the kernel and with the wasm extractor. One slowness is left, and it is the parser's: tree-sitter's Objective-C grammar does not parse `RCT_EXTERN_METHOD(...)` lines inside an `@interface`, and its error recovery takes the square of their number. Two thousand such lines take half a second and sixteen thousand seven; thirty-two thousand are given up on at the parse limit, with the timeout reported. A real shim has tens of them. Blanking the lines before the parse would change what the parser makes of every such shim today, which this commit does not do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * docs(index): what made large files slow, how to measure it, how to keep it out The two commits before this one removed about forty instances of one fault, and nothing in the repository said what the fault is, what to write instead, or how it was found. The next change to an extraction or resolution loop would have put it back, and the next report of a slow file, or of one with no symbols, would have started from nothing. - docs/design/large-file-performance.md: the rule (a file costs its size), the shape of the fault with each form it took and what to write instead, the rules for a lookup that keeps an index, how to measure, how to find the line, how to prove the graph unchanged, the traps that cost a run, what is known and left as it is, and what to do with an issue or a pull request. - AGENTS.md: the rule and the pointer, in the guide every session loads. - scripts/benchmarks/large-files/: the two harnesses the numbers came from (the kernel's 17 languages in about 24 shapes; the other languages, each framework's routes file and each bridge), a profiler that names the line, and compare-graphs.mjs, which indexes a project with two builds and compares what scripts/dump-graph.mjs prints for each. - CONTRIBUTING.md and docs/README.md point at the guide. - CHANGELOG.md: this pull request's entries without timings, as the rules for entries ask. compare-graphs.mjs uses the repository's own dump, which also holds the unresolved references. Run over what the earlier commits were checked on (the fixtures, this repository's src, real code in five languages, the generated projects and the small ones written for each decision, 117 projects in all), it finds every graph the same, with the kernel and with the wasm extractor. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…xpands to (colbymchenry#3506) A Swift module reaches JavaScript through an Objective-C file that is all macros: `@interface RCT_EXTERN_MODULE(Name, Super)`, a line of `RCT_EXTERN_METHOD(…)` for each method, sometimes lines of `RCT_EXPORT_VIEW_PROPERTY(…)`, and a method or two with bodies. The grammar parses none of it. It read an interface named for the macro and recovered from every line under it. What that gave, on 21 shims of six published libraries and on written ones: - a class named `RCT_EXTERN_MODULE` or `RCT_EXTERN_REMAP_MODULE`, and for 11 of the 21 no class at all; - a method written after the macros as a function on the first macro's line, or not at all, and nothing its body calls; - time in the square of the macro lines, inside the parser: 2,000 lines took half a second, 16,000 took seven, and 32,000 ran out the parse budget twice (40 seconds) and left the file with nothing. The macro expands to an interface for `Name`, closed at once, and then `@implementation Name (RCTExternModule)`: what follows is an implementation's body. The parser is now given that, at the same length, in the pre-parse step (objc-rn-extern.ts). The head becomes `@implementation` and the native class's name, where it stood, which is the second argument of `RCT_EXTERN_REMAP_MODULE`. Each of React Native's macros among the body's declarations that has no body of its own is blanked, with its `;`. A macro followed by `{`, a macro inside a method's braces, comments and strings are left, and a shim that does not close or does not name a class is left as written. The React Native bridge finds what a shim exposes from the file's text as written, so it reads what it read before. What changes in a graph, measured against main on the six libraries and on an app written for this: - each shim has a class named for the native class, not for the macro, and the methods written in it, at their own lines, with what they call; - every JavaScript-to-Swift edge through a shim is as it was, and no unresolved reference changes; - a component whose view manager is a Swift class behind a shim gains the `calls` edge the Fabric and Paper pass draws to a native class of the conventional name, there being no Objective-C class of that name before; - an Objective-C reference to the class by name can now land on the shim's class node instead of the Swift class, as it already does for any category on a Swift class, each `@implementation` being a class node of its own. No such reference is in the six libraries. A file with no shim is untouched. Over the fixtures, this repository's src, real code in five languages and the generated projects, with the kernel and with the wasm extractor, the graphs are the same as main's, but for the one generated project that is a shim. A 32,000-line shim now indexes in 0.4 seconds, and the benchmark's shim case (27,000 lines beside the Swift class and its JavaScript callers) in 2 seconds where it took 18. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…it is written (colbymchenry#3507) A code-based TanStack route's address is composed through `getParentRoute`, up to the root. The root was read only when written with an options object, `createRootRoute({ … })`. Written any other way it was no declaration at all, every route under it had a parent the file never declared, and the file gave no route and no navigation. Nothing said so: a tree left uncomposed is also what a parent in another file looks like. Two other ways are common: - with its context's type, where a first call takes nothing and returns the factory: `createRootRouteWithContext<{ auth: Auth }>()({ … })`. TanStack's kitchen-sink examples and its query examples are written this way, 6 of the 28 example apps in its repository that declare routes in code; - with nothing: `createRootRoute()`, as its docs write it in ten places and its tests do. A root is the root whatever it is given, so it is read in each of those forms, and as `…<Ctx>()()`, with type arguments on `createRootRoute`, and with its options in a variable. The type arguments are stepped over with their braces, parentheses and strings, so the `>` of an arrow in a function type closes nothing, and ones that never close are no root. A route other than the root still needs its options written out, since they hold its path, and a parent declared in another file is still not composed. Against main, on those 28 apps: - kitchen-sink and kitchen-sink-react-query, and their Solid twins, go from 0 routes to 11 each, the 16 declarations less the three layouts an index route stands in for and the two pathless ones, each bound to its component, with 2 navigation edges; - basic-react-query and basic-solid-query go from 0 routes to 5 with 6 navigation edges, which is what basic, whose root has options, gives; - the two search-validator-adapters apps gain the 4 routes their tests declare under a bare root; - the 20 apps whose root has options are the same, node for node; - nothing is removed anywhere, and no unresolved reference changes. Everything that holds no such tree is untouched: over the fixtures, this repository's src, real code in five languages and the generated projects, with the kernel and with the wasm extractor, the graphs are the same as main's but for the one generated project that is a route tree under a bare root. That project is the benchmark's: 20,000 routes in 3 MB index in 4.4 seconds, the time the same tree takes under a root with options. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The version in package.json, ui/package.json and package-lock.json, which is what the Release workflow reads, and the changelog made ready for it: a Highlights block at the head of [Unreleased], and the 29 fixes grouped by area now that they are past fifteen. No entry is reworded or dropped. The workflow promotes [Unreleased] to [1.6.5] itself. Rehearsed on a copy: prepare-release.mjs renames the block and extract-release-notes.mjs gives the notes, 39 entries in 9,500 characters. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
[skip ci] Auto-generated by Release workflow.
…t cap it (colbymchenry#3514) `goStatementEnd goHeaderValueEnd goValueIsCall goDeclaredValueType` names four helpers, 58 lines together. Explore answered it as it answers a description: it also looked the names up by their parts, so "value", "is" and "call" brought in a `Call` from another language's resolver, and it then filled the tier's whole budget. 483 lines came back, most of them code the query had not named. Agents fixing issues in that project asked explore about three times a run and made their other lookups with grep, which answers "where are these four functions" in 350 characters. Their answers at the tier's ceiling brought in four times the text they saved in file reads. Named symbols. A query is anchored when two to eight of its tokens are written like code and defined in the index once to three times, whatever else it holds: words, a name the index lacks, an overloaded name. Such a query is now: - matched by exact names only (`exactNamesOnly`): no stems, no text search of the words, no camelCase parts. The graph around the definitions is gathered as before, so a flow between two named functions still shows the step between them, and an overloaded name is still matched as it was. - sized to the code named (`sizedToNamedSymbols`): the answer's frame, the anchors' source, and as much again for the code around them, never less than 4,000 characters. The ceiling is the tier's budget, so naming large symbols changes nothing and the budget stays monotonic with repo size. A host's cap. `CODEGRAPH_EXPLORE_MAX_CHARS` holds any answer to that many characters (never below 6,000, never above the tier). The tiers are sized for an agent that answers a question from one or two calls; an agent that edits code asks more often and pays for each answer again on every later turn. The default is unchanged. An answer under 18,000 characters is framed as the small tiers frame theirs: no relationships section, no list of further files, no advisory note. The completeness note stays at every size. Every other query is answered as before. `CODEGRAPH_EXPLORE_NAMED_SIZING=0` restores the old answer for named symbols; three tests of the allocator at the tier's ceiling set it, as one already does for the one-symbol answer. Replayed on 57 questions those agents asked: 20 answers are smaller under the named-symbol rule and the text returned falls 16%; with the cap at 8,000 it falls 57%. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
colbymchenry#3515) The answer sized to the symbols a query names (colbymchenry#3514, not released) passed the whole suite and had lost a named definition in 173 of 1,033 questions, 92 of which came back as "No relevant code found". Found by asking the 1.6.5 release and main the same questions about a project for every language, framework, router and bridge in the README, and about three real codebases. Five causes, each closed and each a shape in explore-named-sizing.test.ts: - A capitalised name with a digit in it (Thing0, MEMBER_191, sha256Hex) is read by none of the patterns that take names out of a query, and with the word search off nothing else looked it up. Every token written like code is now handed to the search as an exact name, and the definitions a query is anchored on are in the answer whether or not the search reached them. - A named container that is most of its file keeps its opening lines. - A Scala object, a Pascal unit and a COBOL program are module nodes: an anchored query takes a module or a namespace for a name too. - A lowercase word the index defines is a name once two names written like code anchor the query, unless it is a word a question is asked with. - A file a named symbol is defined in has a place in the answer whatever its rank. Eight names in eight files had three left out by the default file count, in the general answer as well. Behind them is one check on the finished answer: if a named definition is neither in it nor already held by the session, the query is answered again with the sizing off, and that answer is returned when it shows a named definition the sized one does not. A config key's file is never one of those files (colbymchenry#383): its line holds the value. One round of this change printed it; config-secret-redaction.test.ts caught it, and the render loop now refuses any file that holds a config key. After: none of the 1,033 loses a definition the release showed, none comes back empty, 4,080 of 4,184 names are shown (release 3,622), and answers average 25% shorter than the release's. Every other kind of question, and every question with CODEGRAPH_EXPLORE_NAMED_SIZING=0, is answered exactly as the release answers it. Also: scripts/benchmarks/explore-answers holds the sweep, to run before a change to explore is released; and CODEGRAPH_EXPLORE_MAX_CHARS is described as what it is, the budget an answer is built to (its text can reach one and a half times that). Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
…ts to listeners (colbymchenry#3516) A script minified to one line took the pass that links an emitted event to its listeners time in the square of its size, and worse. The 0.4 MB `echarts.common.min.js` of colbymchenry#3501 took 37 seconds on 1.6.5 (39 on 1.6.4, where it was reported), the 0.7 MB `echarts.min.js` six minutes, and a project that vendors a folder of such builds did not finish. Every other step took about a second. With the watchdog on, the index was stopped as unresponsive. The pass reads scope by line. On one line, every function of the file is "around" every call, and "that function's source" is the whole file: - A registration with an inline function that has no name, `on('e', function (x) {…})`, was read as naming a handler called `function`. Nothing declares that, so each function around the call was read to its end, by up to ten patterns, looking for it. That file has six such registrations among its 44, and they were the 37 seconds; the 0.7 MB build has 27. - A named handler did the same once for each function, for every registration, where no function declared the name. - What the nodes around the line resolve a name to was asked of each node, for each registration. - An event emitted and listened to from a thousand sites that are one dispatcher and one handler on one object went through every pair. Now a word that is no name is refused before anything is looked for; what a stretch of lines says of a name is read once for those lines and that name; the functions around a line, the nodes a reference on it can belong to, the handler a name on it stands for and what its names resolve to are each found once for the line; and pairing takes the first site of each group it cannot tell apart. `enclosingFn` and `enclosingValue`, which every pass asks for every site it finds, keep their answer by line: the React Native event pass had the same fault behind this one, 17 seconds on a 3.9 MB bundle. No graph changes. Every node and edge is the same before and after on the two bundles of the report, three real codebases, a project for each of the 96 other-language, framework, router and bridge cases, and the 316 kernel language shapes (420 projects, compare-graphs.mjs). On one Mac: echarts.common.min.js (0.4 MB) 37 s -> 1.2 s echarts.min.js (0.7 MB) 377 s -> 2.5 s echarts.simple.min.js (0.3 MB) 3.6 s -> 0.8 s js/events-minified, the new benchmark case: 65 s at 0.05 MB before; after, 0.4 s, 1.1 s and 4.2 s at 0.3, 1.2 and 3.9 MB. The large-file benchmark had a one-line script and a file of listeners, and no one-line script of listeners, which is why the work in 1.6.5 did not reach this. The case is added, with a 2 MB test of it. Fixes colbymchenry#3501. Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The suite runs when someone runs it, on what its tests hold. Twice in a month a change passed all of it and carried a regression: - colbymchenry#3362 fixed which event reaches which listener. It was validated for accuracy on six real projects and for speed on two, all hand-written. On a script minified to one line it took 37 seconds for a 0.4 MB file. It shipped in 1.6.4 (colbymchenry#3501), and the large-file work in 1.6.5 did not reach it, because its benchmark had no one-line script with listeners in it. - colbymchenry#3514 sized an answer to the symbols a query names and lost them in 173 of 1,033 questions. It was caught before release, by hand. Neither was careless. Each was checked on the inputs its author thought of. scripts/regression/gate.mjs (`npm run gate`) checks a build against a fixed set of projects it did not choose: a small generated project for every language, framework, router and bridge in the README, the engine's own source at a release tag, and the real file colbymchenry#3501 named, fetched from the npm registry by checksum. 172 projects, six to eight minutes, no model. It is run by hand, by the maintainer or an agent working on the engine: before opening a pull request, before merging someone else's, and before a release. Nothing runs it on a pull request, by the maintainer's choice. GRAPH every node, edge and unresolved reference is what scripts/regression/expected.json has. A change that means to alter the graph updates that file in its pull request, one project a line, where the reviewer sees which changed. SPEED no project over its budget (five times what it took when kept); with --against <dist>, none a third slower than another build. An index that hangs is stopped and reported, not waited for. GROWTH both large-file harnesses at 0.3 and 1.2 MB: a case that takes more than eight times as long for four times the size fails, and one that prints nothing for four minutes is stopped and named. ANSWERS codegraph_explore still shows every definition it showed for each kept question, answers none with nothing, and no answer is a quarter longer. Run against the builds that had the faults: - main before colbymchenry#3516: FAIL. real/echarts-min stopped at 102 s against a budget of 17; js/events-minified stopped at both sizes. - colbymchenry#3514 as first merged: FAIL. 279 answers lost a definition or came back empty, in under four minutes. - main: PASS, twice with the same results on macOS, and in a fresh clone in a Linux container (7.1 minutes), so what is kept does not depend on the machine that kept it. In that container `npm test` passes but for two bundle tests that need `zip`, which the image lacks. The harnesses learn BENCH_LIST and BENCH_CASES, so the gate can carry on with the cases after one that hung. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…t a parse error `interface Effect<out A, in E>`, `class Box<in out T>` and `type Sink<const in T>` were parse errors: the bundled grammar (tree-sitter-typescript 0.23.2) has no rule for TypeScript 4.7's `in` and `out`, and upstream's is still open (tree-sitter/tree-sitter-typescript#370). The declaration was still read, but every file that writes one had an error in its tree, the native kernel handed each such file to the wasm parser, and the report measured references lost later in large files of a library that annotates most of its types (colbymchenry#3276). The TypeScript extractor's preParse now blanks each `in` and `out` to spaces, offsets kept, before either engine parses, the way `export type *` is read (colbymchenry#2474). Variance changes nothing the graph records, so the list reads as `<A, E>`. Only the type parameter list of a class, an interface, a type alias or a function whose declaration starts a statement is read, so prose in a comment, a string or JSX text (`in, out there,`) keeps its words. Within a list a parameter's last word is its name: `<in out>` declares `out`, `<out extends T>` declares `out` with a constraint, and `const` stays, which the grammar reads. A file with no `in` or `out` after a `<` or a `,` is not scanned. No grammar is rebuilt and the kernel is unchanged: its route already parses the preParse output. Tests: the three sources of the report and five shapes a library writes, in `.ts` and `.tsx`: no parse error after the preParse, the kernel reads each file itself, the kernel and the wasm extractor agree, and the symbols and references are those of the same code without the annotations. 48 of the 52 fail without the change. Not measured: the 8 edges the report counts on Effect, which was not downloaded; small files lose nothing on main either. Reported by @inth3shadows. Fixes colbymchenry#3276. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
One line for each of colbymchenry#3276, colbymchenry#3308, colbymchenry#3417, colbymchenry#3422, colbymchenry#3428, colbymchenry#3429, colbymchenry#3430, colbymchenry#3431, colbymchenry#3443, colbymchenry#3444, colbymchenry#3445, colbymchenry#3446 and colbymchenry#3448. The fixes are seven pull requests, written side by side from one commit of main. Each adding its own line where the others add theirs would make every one of them conflict with the rest, so the lines are here, in one change that touches nothing else and merges in any order with them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d only its real uses (colbymchenry#3519)
…class's static method
`ky.create({})`, where `ky` is ky's default export (a `KyInstance`), was
linked to the static `Ky.create` (colbymchenry#3429): three calls in sindresorhus/ky, at
0.8.
The receiver reaches the guesses untyped (a package's import of itself, or a
destructured dynamic `import()`). The first of them capitalises the receiver,
finds `class Ky`, and takes its method of the name. Its premise is that the
value is an instance of the class it is named after, and nothing stopped it
from returning a member an instance cannot reach. With that one declined, the
next guess (the receiver's words against each owner's) picked the same static
method.
For TypeScript and JavaScript both now give an instance no static method:
- the capitalised-receiver guess takes the class's instance method of the
name, its own or a base class's (`tsMethodUpChain`, instance only), and
otherwise goes on to the next class and the later guesses;
- the word-overlap guess, when the method it scores highest is static and the
receiver is only named like the owner, takes an instance method that scored
the same, or nothing. It does not fall to the next class down the scores:
`userService.build()` beside a static `UserService.build` is not
`OrderService.build`.
What stays: the class written by its own name (`Ky.create()`), a member
assigned on a function reached through that function's name (`ky.extend = …`,
`ky.extend()`), capitalised receivers, `this` / `super` / `self` /
`x.constructor`, and the last guess, the one method of a name in the project,
which assumes nothing about the receiver. Other languages are untouched.
`__tests__/js-instance-receiver-static-methods.test.ts` is the issue's
project with its three variants, and five controls. Four of its eight cases
fail on main. The 165 TS/JS/receiver test files pass (1,716 tests).
Reported by @inth3shadows.
Fixes colbymchenry#3429.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… member returns `const s = m.make(); s.area()` linked `area` only when it was the one method of that name in the project (colbymchenry#3422), though `make` says it returns `Shape`. The reader of a local's call value typed it from a free function's return type and, since colbymchenry#3371, from a class's static method. For `recv.member(x)` on an instance it accepted one shape, a method that returns its own argument, on a receiver whose type is a class. The return type an instance method, an interface method or a function-typed property declares was never read. It is read now, with the static reader's limits (`tsOneWrittenType`, shared with it): the receiver's binding in scope types it (an annotation, or a `new`); that type, a class, an interface, or a type alias (of one, or with members of its own), declares the member once, not generic; and the return type written is one type, beside at most `null` and `undefined`, that is no type parameter of the declaring type. An inherited method is the nearest up the chain, as a call on the instance finds it. The files read are recorded, so a sync re-reads the call when one changes. What stays: an overloaded or generic member, a union of two types, an array, `this`, an accessor, a static method through an instance, a member with no return type written, a chain (`m.a().b()`), a receiver nothing types: all read as before, which with a second method of the name in the project is no edge. A method returning its argument is still read as that argument. Not covered: a receiver that is itself a call-valued local or an imported value. The 62 `.extend(…)` calls the issue counts in sindresorhus/ky are of that kind (`const parent = ky.create(…); parent.extend(…)`, with `ky` a default import whose own value is a call) and stay unlinked: they need the type of `ky` first, which nothing reads yet. `__tests__/ts-member-call-result-types.test.ts` is the issue's project (four functions), six more shapes that are read, fourteen that are not, and a sync. Three of its five cases fail on main. The 193 TS/JS/receiver/sync test files pass (2,044 tests). Reported by @inth3shadows. Fixes colbymchenry#3422. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…an one step calls no project method colbymchenry#2947 stopped `ctx.translate()` from linking to the project's only `translate` when `ctx` is `canvas.getContext('2d')!` on a parameter typed `HTMLCanvasElement`. The guess was still made (colbymchenry#3444) when the canvas was itself a local with no type written, came out of a project function declared to return `HTMLCanvasElement`, or the whole value was one chain: 45 `context.translate(…)` calls in excalidraw went to `AppViewport.translate`. The reader of a value from outside the project took exactly one call, `head(…)` or `head.member(…)`, on a package's import or on a binding written with a type no project file declares. It now also reads: - calls chained on such a call, each past a `!` or through a `?.` (`document.createElement('canvas').getContext('2d')!`): a library value's method gives a library value; - a method of one of the browser's own objects the file doesn't bind (`document.createElement(…)`; not `window`, `self` or `globalThis`, whose members include what a project hangs on them); - a method of a local with no type written, when that local's own value is one of these, or a project call whose result the checker types as a type no project file declares, with no type arguments (`const canvas = createCanvas()`, declared `(): HTMLCanvasElement`), and nothing assigns the local before the call. Followed through four locals, read once per binding. When the type was read in another file, a call that links nothing waits for that file (`jsReceiverTypeFile`), so a sync re-reads it. What stays: `fromParam` and the annotated local; a call handed a project class (`moduleRef.get(Service)`), `useX(() => …)`, at any link of a chain; a generic call; a typed project value, a project function's result and a project member's; a local reassigned on the way; a file that binds `document` itself; `window.x()`; a return type written with type arguments. `__tests__/js-outside-value-locals.test.ts` is the issue's file (five functions) with three more shapes, a factory in another file with a sync, and nine controls. Two of its four cases fail on main; the sync case fails without the wait. The 194 TS/JS/receiver/sync test files pass (2,048 tests). Reported by @inth3shadows. Fixes colbymchenry#3444. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… calls that type's method
`const onChange: OnChange = ({ scene }) => { scene.mutateElement(…) }`, with
`type OnChange = (props: { scene: Scene }) => void`, linked the call to
`App.mutateElement`, another class's method of the name, at 0.7 (colbymchenry#3443). The
same call on a parameter with its own annotation linked `Scene.mutateElement`.
In excalidraw 27 `scene.mutateElement(…)` calls went to `App`.
Two things combined.
1. Nothing read the type a function type gives its function's parameters. A
receiver was typed by a written annotation, or, for a callback passed to a
project function, by that function's parameter type. A function that is
the value of a variable written with a function type was neither, so its
parameters stayed untyped. They are read now
(`jsDeclaredFunctionParameterReading`), where that is exact: the function
is the whole value of a `const`/`let`/`var` written with a type; the type
is a function type written there, or one alias of one that the file
imports or declares; the parameter is a plain name, typed at its position,
or a name an object pattern takes from a property of an object type
written out at that position. The alias's file names the type, and is
recorded, so a sync re-reads the call when it changes. Only a TypeScript
file is read back for such a declaration, at each function it assigns.
2. The by-name fallback kept only candidates of the caller's exact language,
and `tsx` and `typescript` are two languages there. From a `.tsx` file the
`Scene` in a `.ts` file was dropped, `App` was the one method left, and the
one method of a name is taken. Where the caller's own kind of file has a
method of the name, the other kind's now join it (`sameScriptLanguage`:
`.ts` with `.tsx`, `.js` with `.jsx`), and the receiver's name decides
between them, or nothing does. Where the caller's kind has none, every
method of the name is scored as before. The rule that takes a lone method
still asks for the caller's own language, so no call gains a guess it did
not have.
What stays: a parameter with its own annotation (0.9); a callback passed to a
project function, typed by that function; a union, an array, a rest
parameter, a nested pattern, a named props type, a generic function type, a
parameter typed by the alias's own type parameter, a union of function types,
an interface with a call signature, a type from a package, a parameter
assigned before the call: all read as before.
Measured on the engine at v1.6.5, TanStack Router and six React Native
libraries, main's build against this one. The reader changed no edge there.
The filter changed three: rnmapbox's `commands.setNativeRef(…)` in Camera.tsx
and Viewport.tsx, where `commands` is `new NativeCommands(…)`, moved from
`AbstractSource.setNativeRef` to `NativeCommands.setNativeRef`, and one call
in TanStack Router kept its target at 0.65 for 0.7. A first cut of the
filter, which also dropped other languages' methods where the caller's kind
of file had none, lost rnmapbox's `locationManager.setRequestsAlwaysUse()`;
the test holds that case.
`__tests__/ts-declared-callback-parameters.test.ts` is the issue's project in
its three file layouts, eleven more shapes that are read, fifteen that are
not, a sync, and the fallback from a `.tsx` file. Four of its seven cases
fail on main. The 203 TS/JS/receiver/sync/large-file/framework test files
pass (2,443 tests).
Reported by @inth3shadows.
Fixes colbymchenry#3443.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…all results The gate's one real codebase, the engine's own source at v1.6.5, changes with the fix for colbymchenry#3422, and only with it: 150,025 edges become 150,036, and 185,479 unresolved references become 185,468. Nothing else the gate keeps moves: no other project, no answer, no budget. Every changed edge, read against the source: - 18 keep their target and go from a guess by name (0.7) to the type their local was given (0.9): `cursor.gotoFirstChild()` on `const cursor = node.walk()` is `TreeCursor`'s, `firstChild.namedChild(…)` is `Node`'s, `adapter.methodOn(…)` is `ParameterFlowAdapter`'s. - 11 are new, all on a local a member call fills in: `stmt.all()`, `.get()` and `.iterate()` on `const stmt = db.prepare(sql)` reach `SqliteStatement`, `raw.exec()` and `raw.prepare()` reach `SqliteDatabase`, and `cursor.delete()` reaches `TreeCursor`. Each had no edge before, because a second class in the project has a method of the same name. The full gate run on this branch, with all four of its fixes, reports this project and nothing else. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…tion only its module names Python and Go member values keep their receiver (colbymchenry#1820). When nothing types the receiver, the value falls back to the one symbol of the member's name in the project. For a method that guess stands only when the receiver is named after the method's owner (colbymchenry#2218). For a function nothing looked at the receiver, so an attribute or a field read as a value was linked to an unrelated function that happened to be the only one of its name: def ask(option): return prompt(option.prompt) # a reference to termui.prompt() The same held for `other = option.prompt`, `run(label=option.prompt)`, `return option.confirm`, `{"label": option.prompt}`, `run(self.option.prompt)` in a method, and in Go for `run(global.Prompt)` on a package variable nothing types and `run(tt.req)` in a table-driven test. A module-level function is a member of one thing, its module. The guess now stands only when the receiver's last link is that module: the Python file, or the folder for a package's `__init__.py`; the Go package, by its `package` clause, since the folder may be named otherwise. A function declared inside another is no module's member. It is a veto like the method's, never a filter: filtering first would promote some other lone match into a new guess. A value read through a module the file imports is resolved before this fallback and is unchanged. So is every method. Found while fixing colbymchenry#3431; nobody reported it. Measured on code already on this machine, main against this change: - Fourteen Python packages (click, httpx, requests, rich, jinja2, starlette, fastapi, aiohttp, redis, tqdm, docutils, fsspec, huggingface_hub, networkx; 1,406 files): 12 edges gone of 63,152, none new. All 12 were wrong: `e.doc` of a JSON error to a function `doc` nested in another file (requests), `windll.kernel32.GetStdHandle` to the wrapper of the same name the file defines for it (rich, eight of them), `node.color`, `graph_params.G1` and `state_params.mapping` to a function or a test of that name (networkx). - Eleven Go projects (cobra, viper, afero, testify, logrus, bubbletea, lipgloss, websocket, client_golang, hcl, and ten folders of the standard library; 989 files): 30 edges gone of 54,738, none new. All 30 were wrong, fields of a struct nothing types (`tt.req`, `test.args`, `s.glob`, `CommandLine.args`, `n.Index`) linked to a function of that name. Indexing time is the same on all twenty-five. Not covered: a module held under another name with no import in the file (`backend = importlib.import_module(...)`, then `run(backend.prompt)`) is no longer guessed; and a receiver that is not the module but is named like it still links. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…efore-database fix(cli): take the index lock before replacing the database
The line for colbymchenry#3494 was written when the list above 1.6.4 was still unreleased, so the merge of colbymchenry#3496 placed it under 1.6.5, which shipped on 2026-11-28 without the fix. It moves to Unreleased, with the issue number and the thanks the other lines carry. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…roots fix(python): honour the import roots pytest and Pyright configs declare
…ked-worktrees fix(extraction): skip linked git worktrees where git does not list the files
…g-and-gate docs(changelog): the fixes of this batch, and the one kept graph they change
… headings Unreleased had no Highlights block and 28 fixes in one list. The block is the part most people read, and a list that long is grouped by area (AGENTS.md, "Writing changelog entries", rule 6). Every entry is kept word for word; only its place changes. The Windows highlight says what an upgrade from 1.6.5 or older needs: that version runs its own upgrade script, so the first upgrade from a PowerShell 7 session still fails and is run once from Windows PowerShell or cmd. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`npm run gate -- --against <dist of the last release>` is the check before a release. Run against 1.6.5 it went through 171 projects and then ended with an uncaught error on the last, the echarts bundle of colbymchenry#3501: 1.6.5 is the build that hangs on it, the other build's indexing was stopped at its limit, and nothing caught that. The run printed no verdict. The other build is the measure, not what is measured. One that does not finish a project, or cannot index it at all, sets no time to compare with: that is now a note with this build's own time, and the run goes on. This build's own limit and budget are checked as before. Run on main at e2f24ec against 1.6.5 on macOS: PASS, 172 projects and 171 growth cases, with the one note (the other build stopped at 102 s; this build took 6.0 s). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…next docs(changelog): highlights for the next release, and its fixes under headings
…nfinished fix(gate): a release that cannot finish a project is noted, not a crash
…whether it runs in a container (colbymchenry#3543)
… truthfully (colbymchenry#3545) * fix(telemetry): work the installed day out from stored proof, and count new users truthfully What an independent review of the user rule found. The day a machine became a user was one column that each event moved as it arrived, and the same events gave different days by their order. An upgrade stored before that day's agent start dated a machine to its first day; the same two rows read by the pass over stored rows dated it to the day of the upgrade, as a new user. That is the commonest case there is: someone upgrades and uses their agent the same day. The proof is now what is stored, each kind by its earliest day (migration 0007: fresh_install_day, agent_day, upgrade_day), and installed_day is worked out from it by one rule, in the ingest path and in the cron alike. A test feeds the same events in a shuffled order, then reads them back from stored rows, and gets the same day each way. A machine first seen before the records now held begin (USER_RECORDS_FROM, set to the day ingest came back) is a user since its first day. And for the first thirty days of the records a machine that was already a user cannot be told from a new one, so the new-users chart draws those days as gaps, the tiles say where their count starts, and retention and the first-use funnel leave those cohorts out. They were mostly long-standing users, and read far better than new ones do. One rule now says who is counted, and the windows, the days, the cohorts and the page's live tail all apply it: new users, the cohorts and the daily chart held CI runs and containers seen once, which the headline refused. A day rolled up before users were counted is rolled up again. The pass keeps its place after each day, and the purge returns what it deleted when a later step fails, where both threw their progress away. Each table has its own purge allowance again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> * fix(telemetry): make the dating pass safe to meet an earlier one, and to be run again What a third review of the stored-proof dating found. None of it can happen on a database the earlier dating (colbymchenry#3542) never ran on, which is every database there is; all of it is closed anyway. - The pass that reads stored rows for proof of install keeps its place under a key of its own (`proof_scan`). It used the key of colbymchenry#3542's pass, so a 'done' left by that one would have had this one skipped with every proof column empty. - When the pass ends, every count of users made before it is due again: the days lose their user count, the cohorts and the windows are emptied and counted afresh. On a first deploy there is nothing to empty. - Moving `USER_RECORDS_FROM` works every installed day out again from the stored proof on the next run, and the counts with it. It used to change nothing until each machine next uploaded. - A run that cannot read its state does not start. On a blank one it read the stored rows all over again and saved the blank over the real state. - The purge gives a day's usage counters their own allowance of round trips when that day's events have used theirs, as the comment said it did. - An agent's prompt hook is told by its name as written in stored rows too (`LIKE` does not tell upper case from lower; the ingest path does). - `smoke-rollup` clears its own machines on every day: run on a later UTC day it found the rows of the day before, and the cron's catch-up dated its machines by them. Tests: 58 in telemetry-services (5 new, each failing with its change taken out), and the six local smoke checks. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The version in package.json, ui/package.json and package-lock.json, which is what the Release workflow reads, and one more line in the Highlights block at the head of [Unreleased], for what changed in telemetry (colbymchenry#3543). No entry is reworded or dropped. The workflow promotes [Unreleased] to [1.6.6] itself. Rehearsed on a copy: prepare-release.mjs renames the block and extract-release-notes.mjs gives the notes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
[skip ci] Auto-generated by Release workflow.
Codex CLI runs `UserPromptSubmit` hooks the way Claude Code does: it pipes
`{prompt, cwd, …}` to a command and adds what the command prints to the
model's context. `codegraph install` now offers Codex the same front-load
hook, running the same `codegraph prompt-hook`.
With Codex chosen and the question answered yes (or `--yes`), the installer
adds one entry under `UserPromptSubmit` in the layer's `hooks.json`:
`$CODEX_HOME/hooks.json`, or `.codex/hooks.json` for a local install.
- The user's other hooks, on this event and every other, are kept, and
uninstall or a later "no" removes only the CodeGraph handler. A file left
with nothing in it is removed.
- An entry that is already there is never rewritten, whatever its spelling.
Codex runs a hook only after the user has reviewed it in `/hooks`, and
records that against a hash of the whole entry, so changing a field would
switch the hook off until it is reviewed again. The installer says to
review it when it adds one.
- One entry serves every system: `command` and `commandWindows`. Codex runs a
hook through a shell, and Git Bash on Windows does not find `codegraph.cmd`
for a bare `codegraph` (colbymchenry#1466).
- `timeout` is 60 seconds, where Codex's default holds a prompt for 600.
- `additionalContextLimit` is 10,000. Codex counts a hook's output as
bytes / 4 and, past 2,500, shows the model a preview of a file instead. The
hook's own cap of 9,000 characters is under that for ASCII source and over
it for source in a three-byte script.
- A `hooks.json` that is not JSON, or not the shape Codex reads, is left
alone with a note. Codex drops such a file whole, and it is the user's to
put right.
- No `hooks.json` is created beside hooks declared in `config.toml`: Codex
warns at every start when a layer uses both. The README has the TOML form.
- A refresh, as `codegraph upgrade` runs it, neither adds the hook nor
removes it. Upgrade still wires the hook for Claude Code only.
The installer's question now names the chosen agents it applies to, through
a new `supportsPromptHook` on the target interface.
Checked against Codex CLI 0.157.1 on macOS, in a scratch `CODEX_HOME` with no
login and no model call: its app server's `hooks/list` reads back the entry
the built installer wrote (and the README's TOML form) with every field, no
warning and no error, as an enabled hook waiting for review. Not checked: a
live Codex turn, and Codex on Windows.
Requested in colbymchenry#3335, with a first implementation in colbymchenry#3421, by flipcyde101.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ays if the call was running (colbymchenry#3286) Two of the things asked for in colbymchenry#3286. Query workers open read-only. A worker opened its project for writing, and a writable open migrates the schema, rebuilds the search table and the indexes an interrupted bulk load left out, and truncates an oversized WAL. That is the writer's work, which a concurrent reader must leave to it (colbymchenry#1963), and the writer is the main thread: it opens every project, the default one and each `projectPath`, before it sends a call to a worker. A worker that started while the writer was inside a bulk load found the search triggers gone, took it for a crash, and rebuilt the search table itself. The worker's own project and the ones it reaches through `projectPath` are now both opened with `readOnly: true`, as the CLI's read commands already are. The "busy" answer says which it was. After 45 seconds a caller is answered whether or not its call is done, and the answer always read "this call waited 45s in the queue", from a pool with every worker but one idle, when the call had been running the whole time. It now says so: "still working on this call: it has run for 45s without finishing", with the wait for a worker when there was one. A call no worker reached keeps the old words. The log says where a slow call's time went. One line for a call answered "busy" (waiting or running, and how busy the pool was), one when a call finishes after its caller stopped waiting, and one for any call slower than ten seconds that did answer, each with the time waited and the time run. The tool's name only: a query can be the user's code. Not done, on purpose: ending a worker that is past its deadline. A worker thread that is terminated at the wrong moment takes the process down on Windows (worker-teardown.ts), and one inside a single long statement cannot be stopped anyway. Queued calls whose caller was already answered are skipped, as before. Tests: eight new in query-pool. A real worker answers search and explore on two projects whose search triggers are dropped and leaves them dropped, where the old open put them back; six behaviours were each taken out and a test fails for each. The issue's own pattern (cold three-class explore, waves of six, six more during a 20-file sync) on a generated Java project of 3,101 files and 201,501 nodes answers as before the change, with the same answers, and the edit is visible to the read-only workers after the sync. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…olbymchenry#3408) In JavaScript and TypeScript, a comment written above a member of a named object literal was in no node. The constant's signature keeps the first 100 characters of its initializer, and that was all of the literal the index held, so a member further down could be found neither by its name nor by a word of its comment. A data member with a comment of its own is now a `field` node under its owner (`SETTINGS::sessionIdleMinutes`), with the comment as its docstring and the start of its value as its signature. Nested literals are followed, through `as const`, `satisfies` and parentheses, and a member that holds a literal gets a node when something under it has one, so a nested member keeps its whole path. Both extractors, the same nodes. Only members with a comment. A node for every member of a long literal was built first and measured: one large file showed nothing, and a project of a thousand small settings files grew to seventeen times its index and took three times as long to build. A literal no comment is written in is left without visiting a member: where a comment could begin is read once for the file, and a literal or a member with no such place in its stretch of the source is skipped. These nodes are for search, not for references. The resolver is never shown one (a settings field named `Widget` took `new Widget()` of a class a package declares), a sync does not count one as a changed definition (a comment above a field named `id` sent every reference to an `id` back to be resolved), and the dead-code report does not call one unreferenced. The graph gains the nodes and their `contains` edges and nothing else: on this repository's source, 98 of each, and no other line of `dump-graph.mjs` differs. `codegraph_explore` looks among members (properties, fields, enum members) when a question matched nothing else, from the text index only, and answers with the member and what holds it without walking out of it. The kept graph of `real/engine-v1.6.5` gains 106 nodes and 106 edges, those fields and their `contains` edges. Its kept questions are unchanged and pass. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…chenry#3408) traverseBFS read every edge of a node and fetched every neighbour before it looked at any, to keep a few of them or none. A question that landed on a class of 10,000 methods spent 59 ms there. With colbymchenry#3408 an object literal can hold as many documented fields, a kind `codegraph_explore` does not walk to: one field of such an object cost 50 ms, all of it reading the others. - The neighbours of a step are fetched a batch at a time as the loop reaches their edges, and only while the walk can still keep a node. - `getNodesByIds` takes the kinds the caller keeps, so a node of another kind is never read into a row. - A node with more than 256 outgoing edges has them read by the kinds the walk keeps. A node's id begins with its kind, and the edges of one source are indexed by target, so the edges to those kinds are a few stretches of `idx_edges_identity` and the rest are not read. What a walk returns, and in what order, is what it was: 840 generated graphs against the walk as it was written, and 60 walks on a real index against the same walk reading every edge. The id rule the third point leans on is held by a test over every fixture, in both extractors; it holds for the 305,000 nodes of a generated project in each of the 37 languages the benchmarks write. The field of an object of 10,000: 50 ms to 6. The class of 10,000 methods: 59 ms to 21. No index changes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…ymchenry#3408) A constant's signature is the first hundred characters of its initializer. When the hundredth was the first half of a surrogate pair, the two extractors wrote different signatures for the same file. The wasm extractor kept the half, which the index stores as a replacement mark, and added `...`. The kernel, which cannot hold a half, stopped before the pair and added nothing, so the value read as whole. Both now stop before the pair and mark the cut. In the wasm extractor every length-limited piece of source text a node keeps is cut by one helper (`sliceUnits`, and `initSignature` over it): the initializer signatures of every language, the 80 and 120 character signatures in TypeScript, and the import signatures of Lua, R and Nix. In the kernel, `init_signature` marks a cut that stopped a unit short, and Dart's own copy of it is gone. Found by the parity check of the pull request before this one, which moved its test's emoji away from the cut instead of fixing it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…mchenry#3408) A member of a named object literal has a node only when it has a comment: a node for every member made a project of settings files seventeen times its size. A member without one could not be found by name past the hundred characters its owner's signature shows. Every declaration whose literal is longer than that now keeps a list of the literal's members beside its node: two strings in a new table, `object_members`, with a text index over the names (`src/search/object-member-names.ts`). A name is written with a `.` between its words, so `apiBaseUrl` is found by `base`. A search asks the text index which lists hold its words, reads those lists for the members, and answers with a `field` node made from the owner's row: no row of `nodes`, no edge, nothing the resolver could take for a definition. `getNodeById` reads one back by its id. About 25 bytes and half a millionth of a second a member. Both extractors write the lists and write the same ones. The kernel asks the tree once for each member; the wasm extractor reads a plain member from the source text and asks the parser only about the rest. `codegraph_explore` reads the lists when a question matched nothing else. When it matched declarations, a member is shown beside them if the question names it, letter for letter and written as a name is, or says two words of an object literal's field. `codegraph_search`, `codegraph query` and `codegraph_node` answer for a listed member too. One kept answer of the gate changes, in `rn-paper-props`: a question that names six properties showed none of them and now shows all six, in 3,952 characters where it had 1,366. Schema version 17 adds the tables, empty until a file is indexed again. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…o a call and a class property (colbymchenry#3408) The lists of member names (the commit before) were kept only for the value of a module-level `const`, `let` or `var`. A setting is as often written another way, and a field written there was still answered "not in the index": `export default {…}` (a file of messages), `module.exports = {…}`, `export default defineConfig({…})`, `defineStore('cart', {…})`, a class's `static defaults = {…}`. The members of those are now listed, and a documented one is a `field` node, as for a declaration: - on the declaration, for the literals handed directly to the call or the `new` it is initialized with; - on the class property, for a property that holds a literal; - on the owner an object with function members already has (`default`, `module.exports`, `App.utils`, a local `api`); - on the file, for a value no declaration holds: a default export, and a module-level assignment to a name or a path of names. A file keeps one list for all of them, so a line can step back and is written with a sign. Not a literal written inside a function. This repository's own source has 143 of them with 969 keys, and the ten commonest keys are each written fifty to sixty times: they build records and are no settings. Not a single-file component's default export either, which is the component. A lookup reads at most 256 lists (`OBJECT_MEMBER_SCAN_LISTS`): a word that is in the names of five thousand small lists cost a read of each, 49 ms. And a question that names a member, letter for letter, is answered with that member and not with every member that shares a word with its name. The graph of `real/engine-v1.6.5` gains 7 nodes and 7 edges: the documented settings of its `vitest.config.mts`. Its kept questions are unchanged and pass. Nodes and edges of this repository's source and of a second real codebase are the same before and after, on both extractors. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…y#3408) The walk out of a node with more than 256 edges read only the stretches of the edge index that the ids of the kinds it keeps fall in (35cf712). That is every edge it could keep only if every node's id begins with its kind, and a bridge's does not: the React Native, Expo and Fabric bridges give their nodes ids of their own (`expo-module:…`, `rn-export:…`, `fabric-component:…`, `fabric-prop:…`). A function that called 285 methods of an Expo module walked to none of them, and `codegraph_explore` answered a question about the module with a fifth of what it had, once without the class the question named. It now leaves unread the stretches of the kinds it does NOT keep and reads everything else, whatever an id begins with. The rule that makes that sound is narrower and holds for every bridge: an id that begins with a kind's name is a node of that kind. The stretches are written with both their ends, or SQLite reads every edge of the node and tests each (2.3 ms for ten thousand where seeking takes 0.005). Found by the explore-answer sweep before a release, against 1.6.6, on 489 projects: the one project where a node is that wide and its edges lead to a bridge's nodes. The change that brought it in was never released. The walk tests gain that project's shape, held to what the walk returned when it read every edge. It fails on the code before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
An index built before this release holds no `field` node for a documented member of an object literal and none of the lists of member names: a field of a settings object, a default export or a tool's configuration cannot be found in it by name or by its comment. Only indexing the files again writes those, so `codegraph status` and `codegraph upgrade` should say so. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The version in package.json, ui/package.json and package-lock.json, which is what the Release workflow reads, and a Highlights block at the head of [Unreleased]. No entry is reworded or dropped. The workflow promotes [Unreleased] to [1.6.7] itself. Rehearsed on a copy: prepare-release.mjs renames the block and extract-release-notes.mjs gives the notes. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
[skip ci] Auto-generated by Release workflow.
Exercise the fork's actual runtime builder in the bundled Node regression and reject pins below the October security baseline without dropping the Windows watcher and exit smoke tests.
PinableAgents
marked this pull request as ready for review
December 1, 2026 04:56
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
同步上游稳定 tag v1.6.7(1dd70eb2),保留六平台打包、launcher、校验清单及发布关闭状态。未恢复旧主题、翻译、星点图。已通过 TypeScript/Viewer/组件库构建、32 项打包测试、8 项 watcher 测试、Go launcher 测试,以及固定 Node v24.21.0 + 上游校验过的 Linux x64 内核的 3 种原生安装目录 smoke。完整回归、六平台打包和 Desktop 从已发布 1.6.5 升级验证完成之前,不合并或发布。