2948 Commits
Author SHA1 Message Date
ajbmachon 2fc643effd perf(extract): release edge keys and per-file rows once they are used
The alias de-duplication kept one JSON string per edge in the corpus; keep a
16-byte digest instead. Drop that table, and the per-file rows and raw calls,
as soon as call resolution has finished with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 87f090744a)
2026-11-03 21:36:30 +00:00
ajbmachon 088a40766f perf(resolve): hold one parsed file at a time in symbol resolution
The JS, Python and Java passes kept every file's source and syntax tree
until the last pass ended, so resolution held the whole corpus in memory.
Merge the JS and Python passes into one loop per file; each fact list keeps
its order. Java pass 2 only needs the imports, so keep those instead of trees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 3b74a0afb3)
2026-11-03 21:36:30 +00:00
ajbmachon 787f5fd026 perf(load): do not hold graph.json rows and the graph at once
Loading kept every parsed row until networkx had copied it, and a separate
copy of each repeated string. Hand rows over as they are used and share
repeated strings. Drop the TypeError retry at these sites: networkx>=3.4 is
required, and a retry over consumed rows would return a partial graph.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 34d86aafca)
2026-11-03 21:36:30 +00:00
safishamsiandClaude Opus 4.8 123da822a5 chore: release 0.9.102 with the go/kotlin/python/solidity/js, build-guard and perf batch
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 19:47:52 +00:00
safishamsiandClaude Opus 4.8 924be16018 chore: combined AST cache schema 37 for the solidity/python/kotlin/go extractor fixes
#4985, #4972, #4956 (#4935) and the Go cluster #4966/#4853/#4934 each change
per-file extractor output; fold them into one schema-37 entry (#4956 shipped
without its own bump) so warm caches re-run the affected extractions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 19:47:02 +00:00
nothariharan 6be19949d6 feat(go): dispatch interface method calls to implicit implementers
A call through an interface-typed field lands on the interface's method
node, and nothing joins it to the concrete method, because Go types
satisfy interfaces implicitly and the shared interface_dispatch pass
only reads `implements` edges. So the concrete method loses every caller
that goes through the interface.

The Go extractor now stamps interface type nodes with
metadata {"language": "go", "kind": "interface"}, and a new
graphify.go_dispatch pass infers implementers from method sets (every
method name the interface requires, own and embedded) and feeds those
pairs to resolve_interface_dispatch. Empty interfaces, type-set
constraints, interfaces embedding an interface outside the corpus, and
interfaces with more than ten structural implementers are skipped; an
unexported requirement only matches types in the same package. The AST
cache schema is bumped so cached Go extractions pick up the stamp.

(cherry picked from commit 97ccefff72)
2026-11-03 19:46:14 +00:00
nothariharan d90f9f5342 fix(go): resolve member calls on receivers typed from another package (#3368)
1695efae resolves a Go member call through the receiver's declared type,
but only when that type is declared in the caller's own package:
_go_single_type_name drops a qualified_type (`pkg.T`) because no bare
local name can stand for it. A dependency held as a field is almost always
typed from another package (`*plugincontext.Provider`, `plugins.Client`),
so the common case of #3368 still produced no calls edge, including when
the struct is declared in a sibling file (fdd25f7b).

The file's import of `pkg` is exact evidence of which `T` is meant. The
type table now keeps `pkg.T` as written, and _resolve_go_member_calls binds
it only to a `T` whose node carries the import path the caller imports
`pkg` from. Each Go type node records that path (`_go_package_path`, from
go.mod), and the incremental resolution context forwards it, so an
unchanged declaring file still answers on an update.

A sibling file's struct field (`_go_fields`) is stored as
`<import path>.T`, settled by the declaring file's imports: the method
file reading it, like Grafana's datasources.go reading
`HTTPServer.pluginClient plugins.Client`, need not import `pkg` itself.

Stdlib and out-of-corpus types stay unresolved and are not parked. The
qualifier also settles two packages declaring the same `T`, which the
bare-name path must leave alone.

Bumps _AST_CACHE_SCHEMA to 34 so cached Go extractions re-run.

(cherry picked from commit 048685ada1)
2026-11-03 19:45:14 +00:00
xiongjianxu 8ed0f30698 fix(go): resolve same-file member calls through receiver types
Resolve same-file member calls through declared receiver types, preserve lexical receiver bindings, and keep bare package calls distinct from methods.

Refs #4962

(cherry picked from commit 4872e284df)
2026-11-03 19:41:59 +00:00
Deepjyoti-Sarmah d7bff93019 fix(resolve): don't bind a bare call to a class its caller can't reach (#4935)
`class Screen : Activity() { fun title() = getString(1) }` got an INFERRED
`calls` edge to `Prefs.getString`, a method of an unrelated class. A bare call
can only name a member of the caller's own class, a superclass or an enclosing
class, but the corpus-wide name match accepted the only `getString` it found.
Activity is outside the corpus, so nothing in the graph says it declares
getString, and the guess landed on the wrong class.

When a class in the caller's chain extends a class with no source file, keep
only candidates that are not class members, that belong to the chain, or that
the file imports by name (`import pkg.Obj.member`, `import static`). Callers
whose whole chain is in the corpus are untouched, so a receiver lambda such as
`with(p) { getString() }` keeps the edge it has today, and top-level functions
still resolve. This mirrors the unresolved-base guard the C# resolver already
uses.

(cherry picked from commit f4723706a7)
2026-11-03 19:41:46 +00:00
Deepjyoti-Sarmah 3844e681f2 fix(kotlin): attribute calls inside an init block to the class (#4935)
An `init { ... }` block parses as `anonymous_initializer`, which the engine
never visited, so a call inside it produced no raw call at all. The block has
no node of its own, which left nothing to attach the edge to.

Property initializers already solved this in #2565 by pushing the expression
onto `initializer_nodes` with the enclosing class as owner. Do the same for
`init`, including the file-node fallback a property initializer in a nested
class gets, so the two ways of running code at construction agree.

This changes extractor output, so the AST cache schema needs the usual
maintainer bump; cached Kotlin results keep missing these edges until then.

(cherry picked from commit 21b79abe08)
2026-11-03 19:41:46 +00:00
Deepjyoti-Sarmah 209b2a5b4e fix(kotlin): resolve a Kotlin call to an overloaded method (#4935)
Java gives every overload of a method the same node id, because the id carries
no parameter types, so a type holds two `method` edges to one target.
`_resolve_kotlin_member_calls` counted list entries instead of distinct ids, so
`Logger.overloaded("a")` found two candidates, read them as an ambiguous name,
and wrote no edge. The same happens for overloads in a Kotlin `object`.

Count distinct ids. Two different methods of one name on one type still cannot
exist, and two same-named classes still stop at the receiver lookup, so the
god-node guard is as strict as before.

(cherry picked from commit 55f54d3091)
2026-11-03 19:41:46 +00:00
Deepjyoti-Sarmah be413f32a7 test(kotlin): pin the Kotlin/Java call edges that already resolve (#4935)
Before changing the resolvers, pin the shapes the fixes must leave alone: a
Kotlin call to a non-overloaded Java method, a property-initializer call
(#2565), two same-named classes staying ambiguous, and members inherited from
an in-repo base in Kotlin and Java.

(cherry picked from commit fc13ed5ab6)
2026-11-03 19:41:46 +00:00
Shubham Padkonde dce3af740e fix(extract): resolve Python module instance method calls
Recognize direct constructor bindings at module scope while rejecting shadowed, rebound and uncertain receivers. Preserve inferred provenance and invalidate old AST cache entries.

Fixes #4970

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 9ebe3d91fb)
2026-11-03 19:41:33 +00:00
rohit-jsfreaky 874173c583 fix(solidity): resolve ../ imports to the real file
A Solidity import was joined to the importer's folder without normalising it,
so `import "../utils/Errors.sol"` from contracts/proxy/ pointed at a dangling
contracts/proxy/utils/errors.sol stub whose id kept the checkout's absolute path.
Normalise the joined path like the other extractors do (os.path.normpath).
OpenZeppelin Contracts v5.4.0: 87 -> 681 of 681 Solidity imports_from edges reach
a real file; no node ids carry the checkout path any more.

Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 192966f075)
2026-11-03 19:41:32 +00:00
safishamsiandClaude Opus 4.8 ddf0c08bc1 chore: translate #4967 comments to English and restore the default-export docstring
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 19:41:16 +00:00
xiongjianxu 5bab54d8d6 fix(js): resolve calls through default-exported object methods
Refs #4963

(cherry picked from commit fadb09db1a)
2026-11-03 19:40:38 +00:00
safishamsiandClaude Opus 4.8 2460bab3b9 chore: translate the ignored-paths pruning comment to English (#4969)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-03 19:40:30 +00:00
xiongjianxu 90e1b5f343 fix(extract): report paths skipped by ignore rules
Refs #4965

(cherry picked from commit 71958934cf)
2026-11-03 19:40:14 +00:00
jinsoo a328198f84 perf(resolution): index edges by source file for the #3252 repoint (#4980)
The #3252 repoint step in _resolve_cross_file_imports scanned every
edge in the corpus once per Python file with import targets, so the
pass cost files x edges.

Index the edges by source_file once, the first time a file needs it,
and visit only the importing file's edges. Each index entry keeps the
edge's position in all_edges, so a file's edges are visited in the
same order as before. The loop only rewrites edge["target"], so the
index stays valid while it runs.

On a corpus with 4,115 Python files and 360,996 edges, graphify update
went from 3:36 to 2:55 with an unchanged graph topology.

The new test counts full passes over all_edges: 10 before the fix
(8 importing files + 2), at most 3 after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fjj5WaN6sDPLQ2gWGnkGob
(cherry picked from commit c35850fa83)
2026-11-03 19:40:06 +00:00
Deepjyoti-Sarmah f9fbd6daf0 test(build): cover edge repoint, incremental update and write-back for ghost folds (#4955)
An edge into a folded ghost lands on the survivor, an ordinary update
that brings a new AST node next to a saved semantic twin no longer
raises, and build_merge(dedup=False) followed by to_json round-trips
each of the three folds.

(cherry picked from commit 539fc6286f)
2026-11-03 19:40:05 +00:00
Deepjyoti-Sarmah 7fe71dda9f fix(build): don't count intentional ghost folds as drops in build_merge (#4955)
The #479 guard in build_merge excused one legitimate collapse, the #1799
doc twin. The #1145, #3344 and #3705 folds that build_from_json performs
on purpose looked like unexplained losses, so an on-disk graph holding
such a twin could not be updated through build_merge(dedup=False): the
saved nodes are stamped by shape on load, which makes the AST twin the
canonical node, and the fold runs even under dedup=False.

Excuse an id the fold mapped onto a survivor that is still in the graph.
A survivor that is gone excuses nothing.

(cherry picked from commit 9839bc9aec)
2026-11-03 19:40:05 +00:00
Deepjyoti-Sarmah fde54b56c3 fix(build): report ghost folds on the dedup remap channel (#4955)
build_from_json folds a semantic ghost into its AST twin (#1145), a
document node that names a file into that file (#3344), and a bare
method into its AST method (#3705). Entity dedup already reports its
folds as {merged-away id: survivor} on G.graph (#4940) so to_json's
shrink guard can excuse them; the ghost folds were never reported.
to_json re-derived the first two from labels and missed the third, so
a saved method ghost made it refuse to write.

Record the ghost folds on the same channel, and merge into it in build()
instead of overwriting it. to_json already pops the key before it
serialises the graph.

(cherry picked from commit 2e6831e85b)
2026-11-03 19:40:05 +00:00
Deepjyoti-Sarmah 7a64ccfb61 test(build): pin the build_merge guard behaviours that already hold (#4955)
Clean graphs, semantic-vs-semantic duplicates under dedup=False, ghosts
with their own rationale (#4896), ambiguous file labels and
prune_sources are all left alone by build_merge. Pinned first so the
guard change that follows cannot loosen them.

(cherry picked from commit 8d3c88f9a2)
2026-11-03 19:40:05 +00:00
safishamsiandClaude Opus 4.8 8e6a6d2129 docs: date the 0.9.101 changelog section
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
v0.9.101
2026-11-02 19:16:39 +00:00
safishamsiandClaude Opus 4.8 197db0140b docs: changelog for the build-guard, semantic-evidence and C++ extractor batch
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 19:08:43 +00:00
safishamsiandClaude Opus 4.8 0a4408b177 chore: bump AST cache schema to 36 for the C++ extractor fixes
#4951 (type-alias exact-spelling binding + salted alias contains edge),
#4946 (receiver typing from parameters and fields), #4920 (split-header
owner binding via _cpp_qualified), and #4921 (local-callable suppression)
all change per-file C++ extractor output, so warm caches must re-run.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 19:08:04 +00:00
azizur100389 bd318e933c fix(cpp): keep local callable values out of global call resolution
Refs #4917.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit a8cf1d4103)
2026-11-02 19:07:35 +00:00
azizur100389 9466cac7e5 fix(cpp): fail closed on conflicting qualified type identities
A pre-existing same-kind ID collision must not supply positive owner evidence. Add a namespace-collision regression.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit f1716db97c)
2026-11-02 19:06:42 +00:00
azizur100389 a1f7d89f1e fix(cpp): bind split-header definitions to their included owner
Refs #4916.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 405f5dfd4f)
2026-11-02 19:06:42 +00:00
madhusudanpatnaik b492c8f05b fix(cpp): bind alias references by exact spelling, keep a salted alias's contains edge
Two follow-ups to the declaration-id registry (#4854, #4904), both visible
on C++ aliases.

Since #4904 split case-only twins apart, `using Session = int;` (or
`typedef int Session;`) and `void session()` in one file are two nodes, but
DeclIdRegistry.lookup normalizes the name and walks kinds in a fixed order
with "fn" before "alias", so `Session s;` bound to session(). lookup now
prefers the one declaration spelled exactly like the reference and falls
back to the kind order only without one. Registering aliases as "type"
instead would merge them with a same-kind case twin: doctest's
`using string = basic_string<...>` and `class String` collapsed into one
node. On nlohmann/json this change moves 14 `std::string` references in
doctest.h from `class String` to the `string` alias they name; fmt, leveldb,
googletest, express, zod, okio, guzzle and 12 Swift, Java, C#, Scala,
Python and Ruby repos are unchanged.

The C++ alias site also decided whether it minted a node before the
registry could salt its id, so an alias whose id spells its file's own id
(`using cpp = int;` in a.cpp) got a node but no `contains` edge. Read that
off seen_ids after decl_node_fn, as the Swift alias site does.

AST cache schema 34 -> 35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit d0da57d8b1)
2026-11-02 19:05:55 +00:00
nothariharan d3b314d92e fix(cpp): type receivers per function and keep untyped receivers bound in-file
Review follow-ups to the previous commit.

The receiver table is one dict for the whole file, filled first-write-wins,
so `void g() { Response r; }` retyped `r` in `void f(Request& r)` and f's
`r.send()` went looking on Response. Build each function's table on its
own (a local still shadows a parameter there), then drop any name the file
types two different ways, including a field declared with different types
in two classes. An ambiguous receiver gets no type rather than a guess.

Defer a member call only when its receiver is typed. `auto w = make();
w.paint()`, smart pointers and range-for variables have no table entry, and
deferring them dropped the in-file edge they had on v8.

(cherry picked from commit 539e96f821)
2026-11-02 19:05:45 +00:00
nothariharan ffbdae50c2 fix(cpp): bind x.m() by the receiver's type, not the file's same-named method
A C++ member call with a variable receiver fell through to the file-wide
bare-name map, so `void render(Base* b) { b->draw(); }` in a file that also
defines `Derived::draw` produced an EXTRACTED edge to Derived::draw, the one
the static type rules out, and no edge to Base::draw.

Defer `x.m()` / `x->m()` to _resolve_cpp_member_calls like JS/TS already
do (#4598). With the parameter and field typing from the previous commit,
`b` is typed as Base and the call reaches Base::draw (INFERRED). An untyped
receiver now gets no edge instead of a name guess. `this->m()` and
`Foo::m()` keep their existing in-file binding.

(cherry picked from commit 971f564076)
2026-11-02 19:05:45 +00:00
abhay-codes07 92bb7fd189 test(cpp): make the shadowing test a real same-name block shadow with a decisive edge
Review follow-up: the old test declared a differently-named local (T2, not T),
so it never exercised shadowing, and its assertion passed on an empty result.
Now a parameter Thing T is shadowed by an inner-block local Other T, and the
call binds to Other::Ready — which resolves only if the local wins the
first-write-wins fold (locals before parameters); a params-first regression
leaves Thing (no Ready) and yields no edge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JJbLfztSxm2tH5cJwBbe9q
(cherry picked from commit 8d355f919e)
2026-11-02 19:05:45 +00:00
abhay-codes07 2128bca775 fix(cpp): type member-call receivers from parameters and class fields (#3215)
_resolve_cpp_member_calls types a receiver from cpp_type_table, which was
populated ONLY from local variable declarations - parameters never entered
it, so a call through `const Thing& T` / `Thing* P` / `Thing V` (the
dominant C++ idiom for passing state) was silently skipped while the
identical call through a local resolved. TS/JS have an explicit
augmentation pass for exactly this; C++ had none.

Two halves:

  * the per-file table now folds in the enclosing function's parameters
    (_cpp_parameter_types) and class/struct member declarations
    (_cpp_field_types), in C++'s own shadowing order - a local beats a
    parameter beats a field, enforced by the table's first-write-wins;
    the same precision rules as locals apply (class-like type nodes only,
    qualified names keyed by their simple tail, multi-declarator and
    builtin-typed entries contribute nothing);
  * the resolver's capitalized-receiver arm treated `T.IsOk()` as an
    explicit type name and bailed when no type called T exists - but a
    capitalized receiver is very often a VARIABLE (parameter T, field
    Inner). When the explicit-type lookup finds no unique type, it now
    falls back to the file's var->type table exactly like the lowercase
    arm, mirroring what the C# resolver already does for Pascal-cased
    locals; a table miss still bails rather than guessing.

_cpp_declarator_name learns field_identifier (fields use it where locals
use identifier). Chained receivers (B.Inner.IsOk()) stay deferred.

(cherry picked from commit 16a41b38c9)
2026-11-02 19:05:45 +00:00
safishamsiandClaude Opus 4.8 cfd9846667 fix(build): narrow independent-evidence test to genuine provenance (#4896)
#4927's _has_independent_semantic_evidence counted metadata and captured_at
as evidence, but extract.py attaches both to ordinary INFERRED mention
ghosts, so those ghosts would stop folding into their AST file-self twin and
proliferate as duplicates on real graphs. Keep only rationale, source_url,
author and contributor. Add a regression test that a metadata-only ghost
still folds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 19:04:58 +00:00
Ethan-Ethan-Ethan 18813bbb41 fix(watch): handle multi-source AST aliases without semantic collision
Some AST extractors emit multiple records with the same ID, already coalesced by build. Re-key all those records consistently using the original AST ID, retaining coalescing while separating independently evidenced semantic nodes. Full/incremental coverage. Refs #4896 #4927. AI-assisted tests and implementation by OpenAI ChatGPT (GPT-6).

(cherry picked from commit 3304457602)
2026-11-02 19:04:02 +00:00
Ethan-Ethan-Ethan 8daebd8e0f docs: describe same-ID AST semantic preservation contract
Refs #4896 and #4927.

(cherry picked from commit 1dfae3bb31)
2026-11-02 19:04:02 +00:00
Ethan-Ethan-Ethan 0c786ea667 fix(watch): preserve semantic metadata on AST ID collisions
Keep old semantic IDs stable on full and incremental YAML AST extraction; source-qualified alias fresh AST identities and retarget fresh AST edges. Check same-ID provenance downgrades before publishing even when node count grows. Regression coverage includes colliding file nodes, sourceless AST placeholders and full/incremental re-extraction. Refs #4896 #4927. AI-assisted implementation and tests by OpenAI ChatGPT (GPT-6).

(cherry picked from commit fa4f0fad51)
2026-11-02 19:04:02 +00:00
Ethan-Ethan-Ethan 1c2b17d8e6 fix(build): retain YAML semantic provenance across AST upgrades
A full code rebuild can newly AST-extract YAML sources whose legacy semantic file-self nodes carry independent rationale. Preserve those records even on the same (source_file,label) key, and account for evidence-free twins by exact source identity after AST label disambiguation. Cover multiple same-basename YAML sources and maintain strict fail-closed behavior.\n\nRefs #4896, follow-up to #4927. AI-assisted implementation and tests: OpenAI ChatGPT (GPT-6).

(cherry picked from commit f6280e98f0)
2026-11-02 19:04:02 +00:00
Ethan-Ethan-Ethan 7612ac7c30 fix(build): preserve independently sourced semantic file evidence
Pass 2b's label-only file-node fold may delete distinct semantic records whose separate source documents explain the same named file. Preserve records with source-specific evidence, and mirror the predicate in the shrink guard so a true loss remains fail-closed. Add independent-rationale, cold-reload, edge, and simple-mention regression cases.\n\nRefs #4896; builds on #4778/#4779.\nAI-assisted implementation and tests: OpenAI ChatGPT (GPT-6).

(cherry picked from commit c381636027)
2026-11-02 19:04:02 +00:00
ayushcodes10 863a024b3b Add regression tests for the cross language alias gate
Covers both the clustered build path and the raw no cluster write
path with the reported Dart to Java shape: an unambiguous old stem
alias whose only claimant is in a different, known language family
than the dangling edge naming it must not resolve.

(cherry picked from commit 1776eed2bd)
2026-11-02 19:03:51 +00:00
ayushcodes10 7f7c0ed441 Gate the build alias index on language family
The alias index maps every old stem spelling of a node to its
canonical id, committing an alias only when exactly one node claims
it. That uniqueness check protects against two same stem files in
one language racing for the same bare alias, but nothing checked
whether the one claimant left standing was even in the same language
as the edge naming it. A dangling Dart type reference and an
unrelated Java file of the same name both collapse to the identical
bare old stem alias, and since only the Java file ever registers it,
the alias committed unconditionally and bound the Dart reference
onto the unrelated Java file, producing the only cross language edge
in the whole corpus.

Kept the alias index separate from the main normalized id map instead
of merging it in directly, and added a small language family check
consulted only when falling back to an alias: skip the candidate when
the edge's own file and the alias target's file are both in a known
and different language family, permissive whenever either side's
family is unknown so a legitimate same language or provenance less
alias still resolves exactly as before. Applied at both places the
alias index is consulted, the clustered build path and the raw no
cluster write path, so they keep resolving endpoints identically.

(cherry picked from commit 00acbbeb68)
2026-11-02 19:03:51 +00:00
azizur100389 f5c126d8a3 test(skill): cover deletion-only semantic manifest preservation
Refs #4914.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 02f09f1437)
2026-11-02 19:03:50 +00:00
Andre Brait 19f865361d fix(watch): preserve saved semantic evidence on AST id collisions
(cherry picked from commit 6e0de8f9f2)
2026-11-02 19:03:50 +00:00
Deepjyoti-Sarmah 7566615de3 fix(guard): a saved node dedup folded into a twin is not a lost node (#4940)
to_json refused a valid --update when entity dedup merged a re-extracted
node into a twin: the saved id was no longer in the new graph, so the
#479 guard called it lost and the previous graph.json stayed on disk.

Treat a saved id as present when dedup folded it into a survivor that is
in the new graph. A survivor that is itself gone excuses nothing, so a
real loss beside a merge is still refused and only it is named. The
node-count check gets the same allowance, counting N merged ids as N - 1
when the survivor is new this run and N when it is a saved id.

Full rebuilds were refused the same way and are fixed by the same change.

(cherry picked from commit 4c3b38ba6e)
2026-11-02 19:03:49 +00:00
Deepjyoti-Sarmah 4c81e6f5a9 feat(build): carry the dedup merge map on the built graph (#4940)
build() passes remap_out to entity dedup and stashes the result on
G.graph['_dedup_remap'], next to the existing _dedup_collapsed count.
take_dedup_remap() reads and removes it. to_json drops it before
node_link_data runs, because that would otherwise write G.graph into
graph.json. Nothing reads the map yet.

(cherry picked from commit 268513afff)
2026-11-02 19:03:49 +00:00
Deepjyoti-Sarmah e7bf2adb33 feat(dedup): report which ids deduplicate_entities merged away (#4940)
The write guard has to know whether a saved id disappeared because dedup
folded it into a survivor or because the node was lost, and dedup is the
only place that knows. Add an optional remap_out dict that is filled with
{merged-away id: surviving id}. Callers that do not pass it see no change.

(cherry picked from commit 89f34e1449)
2026-11-02 19:03:49 +00:00
Deepjyoti-Sarmah ba6d292bae test(guard): pin that the #479 write guard still refuses a real loss (#4940)
The guard compares saved semantic ids against the new graph. A fix for
#4940 must excuse ids that entity dedup folded into a twin without
excusing ids that are simply gone. These three cases pass today and
fence the guard's existing job before it is touched: an update with
nothing merged or lost writes; a saved node that vanished is refused and
named; a re-extracted node dropped after the merge is refused.

(cherry picked from commit 54423fc26f)
2026-11-02 19:03:49 +00:00
safishamsiandClaude Opus 4.8 2ab621790f test(cache): update order-independence salt test for case-preserving keys
#4937 made the file_hash salt case-preserving (dropped the .lower() on the
absolute-path fallback), but the existing order-independence test still
asserted the lowercased salt. Update its exp_abs to match the written-case
salt so it pins the new behavior instead of the retired one (#4925, #4937).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 18:10:44 +00:00
safishamsiandClaude Opus 4.8 cd1400f25f chore: release 0.9.101 with the hook, rust, llm, rebuild, watch and cache batch
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-11-02 18:03:31 +00:00