Report malformed enum values without hashing them, and use conservative builder fallbacks so one structured field cannot abort a usable extraction.
Refs #5086
Co-authored-by: OpenAI <noreply@openai.com>
(cherry picked from commit 00da7d0155)
Preserve lexical receiver types and access operators, resolve fields by their declaring class, and unwrap supported standard smart pointers without guessing ambiguous targets. Persist class metadata for incremental resolution and invalidate older AST caches. Add regression and negative coverage for split headers, shadowing, namespace collisions, forward declarations, and cached rebuilds.
(cherry picked from commit 287b78caca)
A C# property's accessor bodies, an indexer and a user-defined operator
or conversion were never walked, so every call made inside them was lost.
On Dapper, AutoMapper and Newtonsoft.Json (Roslyn answer key) that is 144
call links made from property/indexer accessors and 186 from conversion
operators, none found.
- A property's `get`/`set` bodies and an expression body (`int P =>
F();`) are walked with the existing property node as the caller. An
auto-accessor has no body and an initializer runs in the constructor,
so neither adds calls. Only the declaration that owns the property
node is walked: when the id is already another member's (an explicit
`IFoo.Name` property spelled like a method `Name()`), its calls are
dropped instead of being credited to that member.
- An indexer is a `this[]` node beside the properties (`defines`,
context `field`), id `_make_id(type_id, "this")`, salted per
signature (including an explicit interface) and away from a member
spelled `This`.
- An operator or conversion is a `.operator +()` / `.operator int()`
node owned through `method`; its id always carries a hash of the
signature, since several conversions share one parameter list.
- A property/indexer counts as owned by its type for caller lookups
(in-file unqualified calls, `this.`/`base.` member calls, the
partial-type own-type preference), like a method. It is never a call
target by name, and `operator` is kept out of the member-call index.
- No existing node id moves (checked on all three projects).
- AST cache schema 40.
Calls TO properties, indexers and operators are not linked: in these
projects they are about 3,500 property get/set links (more than half
to auto-properties), 27 indexer and 60 conversion links, against 0
user-defined binary operator calls. Linking them needs member-access
typing and a decision on the relation, so it is left out.
Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 0e6806a93b)
A C# constructor had no node. Calls in its body were credited to the
type (#4246), calls in `: base(...)`/`: this(...)` arguments were never
walked, and `new X(a, b)` could only point at the type, never at the
overload it runs. On Dapper, AutoMapper and Newtonsoft.Json (Roslyn answer
key) 151 call links made from constructors were all lost and none of the
130 constructor initializers was linked.
- Each constructor (instance, static, and a type's primary constructor)
is a node owned by its type through a `method` edge, labeled
`.TypeName()` with metadata kind "constructor" plus arity/signature.
The id is `_make_id(type_id, TypeName)`, the one a method named after
the type would get; other signatures are salted like method overloads
(#4584), a static constructor is its own "static" signature, and if a
member spelled like the type in another case (`foo()` in `Foo`)
already owns that id the constructor takes a salted one. No existing
node id changes (checked on all three projects).
- Body and initializer calls belong to the constructor.
- `new X(...)` sites and initializers are recorded in raw_calls with no
callee (so every name-keyed consumer skips them and the id passes
remap their caller). A tail C# pass links the constructor whose
parameter count fits, next to the existing edge to the type.
`: this(...)` uses the own type, `: base(...)` the single resolvable
base. Two fitting overloads, an unresolved base, or a type the caller
did not bind give no edge.
- Constructors are left out of every name-keyed call index (in-file
label map, global label index, member-call index, overload index,
interface dispatch), so a constructor can never be picked for an
ordinary call or shadow its type.
- AST cache schema 40.
Co-Authored-By: Claude <noreply@anthropic.com>
(cherry picked from commit 10332b79f5)
Only omit hints when recognized literal targets all resolve outside the project. Preserve advisory hints for mixed paths and uncertain shell syntax.
Fixes#4961
Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 2ef48b214f)
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)
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)
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)
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)
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)
Carry unchanged typed bindings through self.field assignments and associate
method-result receivers with the exact resolved producer call. Preserve
INFERRED provenance, fail closed on ambiguous or rebound values, and retain
return-type context during incremental CLI and watch rebuilds.
Bump the AST cache schema and cover the four missing task-service calls,
cache reuse, incremental rebuilds, and negative resolution cases.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 9f42b5eca9)
Two files can mint the same stem (`Spec.cs` / `_Spec.cs`, `Cfg/Helpers.cs` /
`Cfg_Helpers.cs`), so the type ids in them collide. The C# partial merge ran
before _disambiguate_colliding_node_ids: it rewired the edges of every half
onto the canonical half's still-colliding id, and the disambiguation, which
remaps by (id, source_file of the edge), then missed every edge that came from
another half and left it on a dead id. The members of that half had no owning
type. When both colliding files declared a half of the same partial type, the
second node kept the canonical id, was not removed by the merge, and was split
off again, so the type stayed two nodes. And since the merge removes
merged-away halves by id, an unrelated node in another file that shared such
an id was removed with them.
Run the disambiguation first. Every edge is still on its own half when ids are
salted, and the merge joins the halves by type path, whatever their ids.
Fixes#4411.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 78575576a8)
The partial merge grouped halves by (namespace, label) and skipped nested
types, because nested ids omit the enclosing type. A nested partial type split
across files stayed split, and `Box` / `Box<T>` partials were folded into one
node although they are distinct types (#4249).
- The C# extractor records each partial type's path inside its namespace,
enclosing types first, each with its arity (`Outer`1.Inner`), as
metadata.type_path; the merge keys on (assembly, namespace, type_path).
- The cross-file call pass binds a C# unqualified call to the one candidate
that is a member of the caller's own type, so a call into another half of a
partial type is not lost to a same-named method elsewhere (#4252 does this
in-file only). Ties fall through unchanged.
- After C# type resolution, a merged partial type drops a placeholder base
that sits next to a real base of the same name; one half resolving a sibling
nested base and the other not left two bases, and base-chain lookups failed.
- _AST_CACHE_SCHEMA 8 -> 9, so cached C# results without type_path are
re-extracted.
Fixes#4363.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit 92d9197787)
Keep operator scopes separate from their containing file and ordinary normalized identifiers, including nested bindings.
Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit dc43c7c646)
graph.json is written "directed": false and carries direction in arc order
(#563), or in _src/_tgt markers on legacy files (#2309). A plain undirected
node_link_graph load re-orders endpoints by node-list position, so every
link whose target precedes its source in the node list came back reversed
(79% of links on graphify's own graph).
query, path/explain, affected, merge-graphs and the MCP server already
restore direction. The remaining reloaders did not:
- export html / neo4j / falkordb (cypher.txt and --push) / obsidian canvas
- graph.html re-rendered by update, watch and the git hooks
- the git merge driver, which wrote the reversal into the committed
graph.json, even when merging three identical copies
Add paths.restore_arc_direction, the inline idiom query and merge-graphs
already use, and apply it in load_node_link_graph and the export loader.
to_cypher, to_canvas and push_to_neo4j/falkordb now read _src/_tgt as
to_html already does. The merge driver writes direction back into arc
order before saving, as to_json does, so the committed file keeps the
post-#563 convention.
global add has the same bug and is fixed separately.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 5a461c99d7)
style: replace all em dashes with hyphens
fix: explain hidden .graphify/ folder in skill output and README
fix: rename .graphify/ to graphify-out/ so output is visible by default
- Add GitHub Actions CI workflow (Python 3.10 and 3.12)
- Add CI badge to README
- Add ARCHITECTURE.md: pipeline overview, module table, schema, how to
add a language extractor, security summary
- Move eval reports from tests/ to worked/httpx/ and worked/mixed-corpus/
- Fix README: test count 163→212, language table (13 languages via
tree-sitter), extract.py description, worked examples links
benchmark: 8.8x token reduction on nanoGPT + minGPT + micrograd
- Run AST extraction on 29 Python files across 3 Karpathy repos
- 177 nodes, 246 edges, 17 communities (Leiden)
- 8.8x avg token reduction vs naive full-corpus context stuffing
- Notable: micrograd cleanly splits into engine/nn communities;
nanoGPT model vs training loop correctly separated
- Honest: stdlib import noise flagged, config isolates documented
benchmark: 71.5x token reduction on mixed corpus (code+papers+images)
Full run: nanoGPT+minGPT+micrograd + 5 research papers + 4 images
285 nodes, 340 edges, 53 communities
Average BFS query: 1,726 tokens vs 123,488 naive (71.5x)
Code-only (AST) sub-benchmark: 8.8x on 13k-word corpus