28 Commits
Author SHA1 Message Date
sdivyanshu90 b327203c30 fix(build): tolerate structured enum fields
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)
2026-11-09 16:44:04 +00:00
Brenden Smith ae55b5b219 fix(cpp): resolve typed member chains across headers
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)
2026-11-09 14:09:57 +00:00
rohit-jsfreaky 85ad8daa1e fix(csharp): credit calls in accessors, indexers and operators to that member
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)
2026-11-07 17:21:33 +00:00
rohit-jsfreaky c3b6cfbd9f fix(csharp): make constructors nodes and link new/base/this to the overload by arity
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)
2026-11-07 17:20:08 +00:00
Shubham Padkonde 227028de75 fix(hooks): skip project hints for external searches
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)
2026-11-03 21:39:31 +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
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
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
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 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
ensell-yes 1954192a8c fix: preserve graph relations and tagged templates
(cherry picked from commit 016d9d6ad1)
2026-11-01 00:28:31 +00:00
yUm1k4 14d1f4d2bd fix(terraform): preserve cached IDs across project moves (#4858)
Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 0335efb73f)
2026-11-01 00:25:03 +00:00
keny11300 a5ea8bbd6b fix(python): resolve calls through injected fields and method results
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)
2026-10-25 17:25:50 +00:00
Neal 44079cbd9b fix(detect): skip binary media word counting
Co-authored-by: Codex <noreply@openai.com>
(cherry picked from commit 62663244fb)
2026-10-23 18:12:48 +01:00
JensD-git ab8d63bf4c fix(csharp): salt colliding ids before the partial merge, so a half keeps its members (#4411)
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)
2026-10-13 22:21:43 +01:00
JensD-git 371cb47e83 fix(csharp): merge nested and generic partial types by their full type path (#4363)
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)
2026-10-12 14:50:32 +01:00
xiehuanyi b50e1b3590 fix(python): preserve nested class identities by enclosing class
Co-authored-by: Codex <noreply@openai.com>
(cherry picked from commit e85a748445)
2026-10-08 14:29:19 +01:00
Huanyi Xie fb8b98fb52 fix(r): preserve symbol-only binding identity
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)
2026-10-06 20:54:15 +01:00
raditha dissanayake 5eeb037929 fix(export): preserve stored edge direction when reloading graph.json (#4066)
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)
2026-10-05 19:40:13 +01:00
azizur100389 bb20ef7234 fix(analyze): diversify suggested questions across signal types
Round-robin the existing question categories before truncating the result. Preserve within-category order, existing small-limit priority, candidate schema, and no-signal behavior. Fixes #3849.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
(cherry picked from commit 560b88d86f)
2026-10-04 20:40:34 +01:00
nikhil2004 d5916e6a20 docs: correct factual drift in architecture and security policies
(cherry picked from commit a61eeebb29)
2026-09-26 13:55:08 +01:00
rajashidattapy c1e41ea90e docs: refresh ARCHITECTURE.md module table + add a doc-parity test (keeps the #2558 'an' fix) 2026-08-12 20:57:39 +01:00
nelsondeleonc-source 39beeb9b4b docs: fix article typo (an extract_<lang>) in ARCHITECTURE.md 2026-08-12 20:56:28 +01:00
Porun db66b8727b feat: add callflow HTML export with Mermaid architecture diagrams 2026-05-09 23:26:01 +01:00
Safi 5db8f7ce39 docs: update surprising connections description, test count
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
2026-04-06 16:06:31 +01:00
Safi 64e07abd98 docs: CI, architecture guide, worked examples, README fixes
- 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
2026-04-06 16:06:31 +01:00