Repository navigation
Merge v8 and fix the Dart regressions from the #3651 review - #1
Open
bounty1342 wants to merge 1099 commits into
Open
bounty1342 wants to merge 1099 commits into
bounty1342 wants to merge 1099 commits into
Conversation
…using name Follow-up to Graphify-Labs#4847. Its fix stripped any trailing dotted segment, so a dotted module name with no file extension (using module Az.Accounts) resolved to 'az' (dropping .Accounts). Restrict the strip to real module/assembly suffixes (.psm1/.psd1/.ps1/.dll/.exe) so file names like Helpers.psm1 still resolve to 'helpers' while Az.Accounts keeps its full name. Adds a regression test. Co-Authored-By: Claude Opus 4.8 <[email protected]>
… js imports, extractors, serve/export/pdf) 13 PRs folded into the unreleased 0.9.98; dups Graphify-Labs#4869/Graphify-Labs#4852/Graphify-Labs#4871 to close at release. One combined _AST_CACHE_SCHEMA bump (29->30) covers the output-changing extractors and the file/declaration id change. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…fy-Labs#4881) Second half of Graphify-Labs#4881. 'path'/shortest_path returned an arbitrary route among equal-length shortest paths (nx.shortest_path), so the reported confidence could reflect a strong route while a weaker route of the same length existed. Among all shortest paths (bounded at 256 to avoid exponential enumeration), choose the one whose weakest hop is weakest and note it was the weakest of N equal-length routes, so the confidence never overstates the connection. Factors _path_weakest out of _path_confidence_line and adds _path_hop_datas / _path_confidence_key / _weakest_shortest_path in serve.py, used by both the CLI path command and the MCP tool. No cache bump (path rendering is post-extraction). Refs Graphify-Labs#4881. Idea/report by @SyedFahad7. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…fy-Labs#2800) On Windows the gemini user-global skill went to ~/.agents/skills/graphify, the same path the `agents` platform installs to. The two ship different SKILL.md files, so installing either one overwrote the other, and uninstalling either one deleted the other's skill, references/ and stamp. The Windows branch came from Graphify-Labs#368 on the belief that Gemini CLI prefers ~/.agents/skills there. Gemini CLI reads both ~/.gemini/skills and the ~/.agents/skills alias on every OS (docs/cli/skills.md), with the alias winning a name clash, so the branch bought nothing and caused the clash. gemini now uses ~/.gemini/skills/graphify everywhere. Because the alias wins, a copy an older Windows gemini install left in ~/.agents/skills would hide the new one. gemini install now prints a note naming that folder instead of deleting it, since it may be a real `agents` install. (cherry picked from commit 037fc62)
…raphify-Labs#3398) A global `graphify install --platform opencode` passed Path(".") as the plugin base and joined `.opencode/plugins/graphify.js` onto it, so the "global" plugin landed in whatever directory the command ran from and loaded only for that project. OpenCode's global plugin dir is ~/.config/opencode/plugins, with no `.opencode/` segment, so the base path alone could not be swapped. The plugin helpers now take the OpenCode config dir itself, chosen by _opencode_dir(): <project>/.opencode for a project install and ~/.config/opencode for a global one. `graphify uninstall` removes the global plugin as well, and the OpenCode 2 plugin refresh also checks the global dir. The legacy `.opencode/plugins/graphify.js` entry that older releases wrote into opencode.json is still matched by its old string. The slash-command half of the issue no longer applies: v8 has no _install_opencode_command. (cherry picked from commit c5cb910)
…raphify-Labs#2360) extract_go walks only function and method bodies for calls. A package-level `var` initialiser was recursed into and never registered as a body, so a call there, most often inside a `var provider = func(...) {...}` closure kept as a swappable hook, produced no edge and its callee lost the caller. A package-level var_declaration is now walked by the existing walk_calls, owned by the file node: the initialiser runs at package init and has no enclosing function. A `var` inside a function is unchanged. The AST cache schema goes to 30. (cherry picked from commit a05773e)
Graphify-Labs#1566) A Go handler or callback is registered by passing a method value: `routing.Wrap(s.Health)`, `r.Get("/p", s.Health)`. The call walk looked only at what a call expression invokes, so the method got no edge from its registration and a handler reached only through its route had no caller. walk_calls now records each `x.M` argument (on a plain identifier, not an imported package) as an `indirect` raw member call, typed the way a direct `x.M()` is. _resolve_go_member_calls resolves it through the same receiver type, single-declaration and single-method guards and emits an INFERRED `indirect_call`, as Python and JS do. It is never parked for a merge: a value argument is as often a field as a method. The AST cache schema goes to 30. (cherry picked from commit e724c0c)
…ling file (Graphify-Labs#3368) 1695efa types `s.field.M()` through the caller file's own go_type_table. When the struct is declared in another file of the package, the usual Go layout, that file has no binding for `field` and the call is dropped, even for a same-package field type. Each Go file node now carries the field types of the structs it declares (`_go_fields`, keyed by struct id), and a self-rooted raw call names the struct that owns the field (`field_owner`). When the caller's table has no binding, the resolver reads the owner struct's fields, only when the owner is a single type declared by a single file. The fields ride on the file node, not the struct node: every method file emits the struct's id too, and on an incremental rebuild that fresh copy shadows the declaring file's. `_go_fields` is carried through the incremental resolution context, and the AST cache schema goes to 30. (cherry picked from commit f3b1e7d)
…raphify-Labs#1566) A dict/list/set/tuple literal of bare function names already yields `indirect_call` edges, but the same table written with the module prefix, the usual shape of a plugin registry: from payments import card, cash PROVIDERS = {"card": card.card_charge, "cash": cash.cash_charge} got no edge at all, because only bare identifiers counted as values. Such a value now becomes an `indirect` member raw call, and the Python member-call resolver binds it through its module arm only: the receiver must be a module imported into the caller's own file, holding exactly one callable of that name. It is emitted as the INFERRED `indirect_call` (0.85, context `collection`) the bare-name path uses, never to a class used as a value, and never when a parameter or local shadows the module name. A module-level table resolves from the file node. The AST cache schema goes to 26 so cached Python extractions re-run. (cherry picked from commit 28934b6)
…Labs#4061) The fast path tells the agent to skip Steps 1-5 for an existing graph, then the next paragraph said 'Follow these steps in order. Do not skip steps.' Reword the latter to defer to the fast path in all three source fragments (core.md, aider.md, devin.md), and add the reword to the sanctioned monolith-diff predicates so --monolith-roundtrip accepts it. Regenerated the 14 split-host skill artifacts and expected snapshots with tools.skillgen; --check and --monolith-roundtrip both pass. (cherry picked from commit 41141ef)
Go (Graphify-Labs#4867/Graphify-Labs#4868/Graphify-Labs#4866) and Python (Graphify-Labs#4773) extractor changes alter per-file AST output and are AST-cached, so one combined _AST_CACHE_SCHEMA bump 30->31 forces stale caches to re-extract. Install (Graphify-Labs#4770/Graphify-Labs#4771) and the skill reword (Graphify-Labs#4721) need no bump. Folded into the unreleased 0.9.99. Each PR omitted its own bump / carried a stale number; the single combined bump lands here. Co-Authored-By: Claude Opus 4.8 <[email protected]>
graph.json stores a confidence_score next to every INFERRED edge (C# interface dispatch writes 0.85 / 0.75 / 0.65 by implementer count), but `path`, `explain` and the MCP shortest_path / get_neighbors renderers only printed the bare tag, so `[INFERRED]` hid whether an edge was a strong or a weak inference. A shared _confidence_tag() now renders a scored non-EXTRACTED edge as `[INFERRED 0.75]` at all four sites. EXTRACTED stays bare (it is 1.0 by definition), and a missing, non-numeric, boolean or non-finite score keeps the bare tag instead of printing a guess. Tests: tests/test_confidence_score_output.py runs the issue's Report.cs repro through extract/build and checks CLI explain, CLI path, MCP path and MCP neighbors; the four output tests fail without the fix. Fixes Graphify-Labs#4882 Co-Authored-By: Claude <[email protected]> Co-authored-by: Syed Fahad <[email protected]> (cherry picked from commit 10559b3)
…raphify-Labs#4889 (for Graphify-Labs#4888) Graphify-Labs#4888 was built on 0.9.97, before Graphify-Labs#4881 (path weakest-hop refactor), Graphify-Labs#4889 (qualified C# method labels) and Graphify-Labs#4891 (also_seen) landed. Its cherry-pick dropped the merge commit that reconciled expectations. Update the per-hop confidence assertions to carry scores ([INFERRED 0.85]) and the C# path/explain/neighbor labels to their owner-qualified form (Exporter.Run, IReport.Build) - the correct composed output of all four features. Resolved the serve.py conflict by keeping Graphify-Labs#4881's _path_weakest/ _path_confidence_line and adding only Graphify-Labs#4888's _confidence_tag, applied over edge_evidence so parallel/also_seen evidence keeps its scores. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…raphify-Labs#4888) Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
_hooks_dir and _rev_parse_path read git's path output with text=True and no encoding, so Python decodes it with the locale codec. On Windows that is cp1252, while Git for Windows prints paths as UTF-8. In a linked worktree git returns an absolute path, so a non-ASCII directory such as café comes back as café, and hook install creates and writes into that phantom tree instead of the real .git/hooks. Pass encoding="utf-8" to both calls. Linux and macOS already decode as UTF-8, so their behaviour is unchanged. AI-assisted: Claude Code (reproduction, regression test, PR description). (cherry picked from commit 2836041)
Keep code-only Suggested Questions focused on possible missing edges while preserving the documentation-gap explanation for semantic graphs. Fixes Graphify-Labs#4886 AI-Assistance: OpenAI Codex (cherry picked from commit 2f942fd)
…zers Class constant / enum-case accesses (`Role::Viewer`) in const values, property defaults and parameter defaults (including promoted constructor properties) produced no edge: the call-graph pass only walks function bodies, so these class-level initializers were never visited. Emit their `references_constant` edges from the enclosing class during the structural walk. Adds regression tests covering all four positions plus a method-body control; they fail before the change and pass after. Fixes Graphify-Labs#4648 (cherry picked from commit f609a59)
Address review on Graphify-Labs#4895: resolve the Scope::MEMBER class scope to an existing local node instead of minting a stub, skip self::/static::/parent:: (which otherwise linked to the member name), and reduce a fully-qualified scope to its class segment so it no longer creates a synthetic raw-name target. Adds edge-case tests for self/static/parent and fully-qualified scopes. (cherry picked from commit d3e8f2f)
The skill goes straight to the build steps, so an agent choosing its own tool for a one-off lookup gets no steering toward a plain search. A build can cost minutes and tens of thousands of tokens when docs need semantic extraction. Add a short passage before the steps: query a graph that already exists, search directly for one targeted lookup, build when the corpus or question calls for it. An explicit /graphify is still followed as asked. It is two paragraphs because the lean core has an 800-line limit. The passage goes in the core, aider and devin fragments, and generated files are regenerated. It is an addition to the monoliths, so its two exact lines are sanctioned in the round-trip check. Fixes Graphify-Labs#4829 Co-Authored-By: Claude Opus 5.5 <[email protected]> (cherry picked from commit f2e5b95)
DeclIdRegistry reused the id of any declaration that normalized alike, so class Foo and function foo collapsed into one node. Reuse now needs the same kind or the same spelling, which keeps TS class + namespace merging. Bump the AST cache schema. (cherry picked from commit 9c44667)
(cherry picked from commit dd7fcd1)
The Graphify-Labs#4854 stub-binding pass scanned every edge once per import fact. That made a full rebuild O(imports x edges): 14m7s on a 21k-node TS corpus, versus 26.8s on 0.9.48. Group reference edges by their emitting source file once, then scan only that file's edges per import. The 21k corpus now rebuilds in 25.5s, and the written graph is identical. (cherry picked from commit d6eec6d)
…og for 0.9.100 Graphify-Labs#4908 (case-collision ids) carried the 31->32 bump; Graphify-Labs#4895 (PHP class-level initializer const refs) also changes AST output and shares that global bump, so extend the comment to credit it. Opens the unreleased 0.9.100 section. Co-Authored-By: Claude Opus 4.8 <[email protected]>
faster-whisper 1.2.1 decodes with av.open(..., metadata_errors="ignore"). PyAV 19.0.0 removed that argument, and the video extra resolved av 19 on Python 3.12+, so transcription raised TypeError before any audio was read. PyAV 16.1.0 through 18.1.0 still accept the keyword. The compatible range is av>=11,<19, on the same interpreter marker as faster-whisper. [all] carries the same constraint. Relocking also records the package version as 0.9.97, matching pyproject.toml. Co-Authored-By: Grok <[email protected]> Co-authored-by: Syed Fahad <[email protected]> (cherry picked from commit 0175716)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
R6Class spells its superclass argument inherit, but setClass and setRefClass both spell the identical argument contains instead. Only inherit was checked, so a setRefClass or setClass that inherits via contains silently lost its inheritance edge, with no error, since both class constructor forms are routed through the same member scanning function. Recognize contains alongside inherit when looking for a class's superclass argument, reusing the exact same base name lookup, external class node creation and inherits edge already in place for inherit. (cherry picked from commit 9043a52)
Covers a setRefClass that inherits via contains now getting its inherits edge, plus a control confirming R6Class's own inherit keyword still works alongside it. (cherry picked from commit bf306cc)
The in file resolver for an unqualified call built one flat label to id table mapping a bare function name to a node id across the whole file, with a later definition silently overwriting an earlier one while the table was built. In a file with two modules that each define a same named function, a bare call made from inside one module resolved to whichever module's definition the walk reached last, not to the caller's own sibling function, misattributing the call to a completely unrelated module. Removed the flat table. Extended the existing qualified call lookup, already keyed by container and name for Mod.fun() calls, to also register a top level def under its own file container, then resolve a bare call by checking the caller's own container first and falling back to the same import and use scope chain the cross file pass already walks. This is the same scoping invariant already enforced across files, now applied to the in file case too. (cherry picked from commit 7286098)
Read the declared type of `recv` in `recv.f(..)` and park the call as a
`member` raw call carrying that type, so a later pass can bind it through
the receiver's contract type or the `using` directives in scope. Nothing
binds `member` calls yet, so no edge changes.
A receiver is typed from a parameter, return variable or local of the
calling function (a name declared with two different types is ambiguous
and stays untyped), a state variable of the calling contract, an element
of a typed mapping or array, a field of a struct declared in the same
file, a conversion (`IERC20(a)`, `uint256(x)`, `payable(a)`) or a few
builtins (`msg.sender`, `keccak256(..)`, `abi.encode(..)`). The type is
normalized (`uint` -> `uint256`, whitespace) and a struct, enum or value
type declared in a contract is qualified with that contract's name, so
`Trace208` inside library Checkpoints and `Checkpoints.Trace208` in a
caller compare equal. A type name (`Lib.f()`) is not a typed receiver and
keeps its qualified-call path.
What only the cross-file pass can know is left to it: a state variable
node carries its `declared_type` and a function with one return value
its `returns` type, and `g(..).f()` records the call `g` it is the result
of. resolve_solidity_inherited_calls gains the helpers the binding passes
share: `receiver_types` (the extractor's reading, a base contract's state
variable, or the return type of `g`), `visible_types` (optionally through
re-exporting imports: `import {IERC20} from "./ERC20.sol"`) and a cached
`linearization`.
Co-Authored-By: Claude <[email protected]>
(cherry picked from commit abe5429)
`IERC20 token; token.transfer(to, v)`, `IERC20(a).transfer(..)` and
`Ownable(x).owner()` got no edge: the extractor parked `token.transfer`
as a qualified call on a type named `token`, which never exists, and a
call on a conversion as a bare member call the shared pass drops. On
OpenZeppelin v5.4.0, 0 of the 74 such calls solc resolves were linked.
Bind `recv.f(..)` by name and arity through the receiver's declared
contract or interface type and that type's C3 linearization, the lookup
the compiler does. The type comes from the receiver typing the previous
commit adds, or from a base contract's state variable (`hevm.prank()`)
or the return type of `g` in `g().f()`. An interface method links to the
interface's declaration; no implementer is guessed. A type may be
imported through a file that re-exports it (`import {IERC20} from
"../ERC20.sol"`, the usual OpenZeppelin form), searched only when the
file declares and directly imports no type of that name.
Fail closed: no edge when the receiver is untyped, its type is not
exactly one visible contract/interface, the name/arity matches two
overloads, or a public state variable of that name (a getter) is found
first.
OpenZeppelin v5.4.0 (solc 0.8.28 AST as the answer key): typed calls
0/74 -> 71/74; solmate: 0/725 -> 716/725. No other kind changes. The 3
calls left on OpenZeppelin are made inside `_installModule` and
`_uninstallModule`, which share a node with `installModule` /
`uninstallModule` (the `_name` / `name` id merge), so they land on that
merged node until the id merge is fixed.
Co-Authored-By: Claude <[email protected]>
(cherry picked from commit 752eaaf)
`using SafeCast for uint256; x.toUint48()` and `using EnumerableSet for
EnumerableSet.AddressSet; _set.add(a)` call the library function with
the receiver as its first argument, but the extractor parked
`x.toUint48` as a qualified call on a type named `x`, which never
exists, so no such call got an edge. On OpenZeppelin v5.4.0, 0 of the
228 calls solc resolves through a `using` directive were linked.
Record the directives in scope: a contract's own (`using` is not
inherited since 0.7), the file-level ones, and the `global` ones on a
type's declaration, as `using` metadata on the contract and file nodes,
and give library and free functions their `first_param_type`. The
resolver binds `recv.f(args)`, when the receiver's declared type is
known (the receiver typing of the previous commit, a base contract's
state variable or the return type of `g` in `g().f()`), to a function
`f` that a directive whose target is `*` or that type attaches, with
args + 1 parameters and the receiver's type as its first. The type must
match exactly, including user-defined value types and library structs
(`Trace208` inside Checkpoints reads as `Checkpoints.Trace208`, as a
caller writes it). An operator binding (`using {eq as ==} for T`)
attaches no member.
Fail closed: no edge when the receiver's type is unknown, a directive's
library name is ambiguous, or more than one function fits.
OpenZeppelin v5.4.0 (solc 0.8.28 AST as the answer key): using-for calls
0/228 -> 180/228; solmate: 0/10 -> 6/10. No other kind changes. Most of
the rest are chained calls (`slot.asBoolean().tload()`), calls written
inside a `?:` that tree-sitter parses as the member's object, and 7
calls made inside `_name` functions that share a node with their
`name` counterpart (the `_name` / `name` id merge), which land on that
merged node until the id merge is fixed.
Co-Authored-By: Claude <[email protected]>
(cherry picked from commit 7bd9be0)
…erload by arity A C# constructor had no node. Calls in its body were credited to the type (Graphify-Labs#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 (Graphify-Labs#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 <[email protected]> (cherry picked from commit 10332b7)
…t 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 <[email protected]> (cherry picked from commit 0e6806a)
Graphify-Labs#5058, Graphify-Labs#5060, Graphify-Labs#5062, Graphify-Labs#5054 and Graphify-Labs#5056 each change per-file Solidity or C# extraction output and each bumped _AST_CACHE_SCHEMA to 40 on their own. Landed together in one release window they share a single bump; this folds their descriptions into one chained schema-40 comment over the prior 39 so a warm cache re-runs the affected Solidity and C# extractions exactly once. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…atch Co-Authored-By: Claude Opus 4.8 <[email protected]>
…ative data `_suppress_ambiguous_python_imports` mints a node-less `ambiguous_python_import_<sha1>` target for an import that more than one scanned module could satisfy. The hash included the edge's `source_file` and `source` id as they are at that point in the pipeline, which is before relativization: `source_file` is still the absolute path and the importer id is derived from it. The same commit built in two directories therefore produced different placeholder ids, so `graph.json` was not reproducible across checkouts and community detection could differ. Hash the scan-root-relative `source_file` (POSIX form) with the module name and source location, and drop the path-derived `source` id. These already identify the import site uniquely, and the existing `while target in node_ids` guard still prevents a collision with a real node. Adds a regression test that builds the same tree in two checkout directories and asserts identical placeholder edges; it fails without this change. Fixes Graphify-Labs#5044 Co-Authored-By: Claude <[email protected]> (cherry picked from commit ff047df)
CloudFormation and SAM templates spell their intrinsic functions as short local tags such as Ref, Sub, GetAtt and Equals. SafeLoader has no constructor for any of them, so loading such a template raised a constructor error and the whole file produced zero nodes, even though nothing about the tag itself is unsafe. Composing the node tree never hit this, since composing never resolves a tag into a value, only constructing the actual document did. Added a SafeLoader subclass with a multi constructor registered on the bare exclamation mark prefix that builds a plain scalar, sequence or mapping from the tagged node's own shape, exactly as if the tag were absent, and never evaluates the intrinsic itself. Every built in safe tag keeps its own constructor unchanged, since those are registered under the full yaml.org tag namespace rather than a bare local tag, so a python object tag still raises exactly as before. (cherry picked from commit e018cc2)
Covers a SAM style template using nested Equals and Ref tags extracting its structural nodes instead of failing the whole file, plus a control confirming a python object tag alongside an intrinsic tag still raises rather than executing. (cherry picked from commit 4e2b26b)
…y-Labs#1504 `graphify update sub` run from sub's parent stores source_file relative to the build cwd (sub/pkg/mod.py, Graphify-Labs#2603) while ids are minted relative to the scan root (pkg_mod). graph_has_legacy_ids derived the expected stem from the stored path (sub_pkg_mod), so the real id matched the old one-parent form and every query/MCP load of a freshly built graph told the user to rebuild with `graphify extract --force`, which changes nothing. Read the cwd->scan-root offset from the relative .graphify_root marker (new legacy_id_source_prefix) and strip it before deriving the stem. Absolute, ".", and parent-escaping markers mean no offset, so behavior for root-anchored graphs is unchanged and genuine legacy ids are still reported. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01TGb7YtZeBXGNQMw6JjuqZu (cherry picked from commit f5ee99d)
Refs Graphify-Labs#5016. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit 4f0d5ea)
Refs Graphify-Labs#5017. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit 84ca430)
Refs Graphify-Labs#5018. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit de8345a)
Refs Graphify-Labs#5019. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit 344f2ae)
Keep source-less annotations while discarding malformed non-string paths. Refs Graphify-Labs#5019. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit 44a7ca5)
Refs Graphify-Labs#5020. Co-Authored-By: OpenAI Codex <[email protected]> (cherry picked from commit b424a2f)
…Graphify-Labs#5020) Follow-up to Graphify-Labs#5025. The landed guard raised on any non-dict repo value, so a single malformed entry backed up the whole manifest and dropped every tracked repo. Keep the whole-file backup only for an unrecoverable shape (non-dict root or repos map); when repos is a dict, drop just the malformed entries, keep the valid repos, and report which went. Matches the per-entry isolation of Graphify-Labs#5024. Co-Authored-By: Claude Opus 4.8 <[email protected]>
(cherry picked from commit 035b0ad)
…r pricing flags (cherry picked from commit e39355c)
…-Labs#5030 follow-up) tree_html.build_tree folded aliases in a different order (src first) than build._fold_node_aliases (src last), so a node carrying two conflicting file aliases could key on different paths in the viewer vs the built graph. Use the same order and pop the consumed alias, as the build-side fold does. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…bs#5031 follow-up) The landed fix caught a non-numeric price but still accepted nan, inf and negative values, which parse as floats and then flow into cost estimation as NaN/inf/negative. Validate each --pricing-input/--pricing-output through _valid_price (finite and >= 0) with the same clean error + exit(1), and test that nan/inf/-inf/1e999/-5 are rejected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…9.104 Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tute it (Graphify-Labs#4762) The generated /graphify runbook substituted the agent-supplied scan path straight into Python string literals across every code block: detect(Path('INPUT_PATH')), extract(cache_root=Path('INPUT_PATH'), root=Path('INPUT_PATH')), the semantic cache check/save, build_from_json/generate/diagnose, the manifest write, and the --update detect_incremental + merge. A scan root whose NAME carried a single quote or a $(...) / backtick broke out of the literal and ran as arbitrary code the moment the block ran (e.g. a cloned repo with a subdirectory named $(...) ). The shell transport was already hardened (Graphify-Labs#3642/Graphify-Labs#3844 write the path to graphify-out/.graphify_root through a quoted heredoc); this extends the same trust boundary to the Python blocks. Each block now reads the resolved root from graphify-out/.graphify_root (the file Step 1 writes) into an INPUT_PATH variable and passes the value, so the path is always inert data, never code. The prose no longer tells the agent to substitute a path. Applied to the assembled hosts (core.md, references/shared/update.md) and to the Aider and Devin monoliths; a new _is_input_path_sidecar_fix_line sanctions the monolith diff and --monolith-roundtrip / --check / --audit-coverage stay green. A fast regression guard asserts no generated skill body carries a quoted 'INPUT_PATH' code literal. SPEC_PATH (the skill's own extraction-spec install path, not attacker-controlled) is left substituted and tracked as a follow-up. Reported and first proposed by @danikdanik in Graphify-Labs#4762. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Co-Authored-By: Claude Opus 4.8 <[email protected]>
…4762 per-block reads The scan-path injection fix reads graphify-out/.graphify_root once per Python block, so the lean claude core grew from ~795 to 807 lines. Raise the ceiling to 820 — still far under the ~1156-line pre-split monolith the guard exists to catch. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…tness batch The @azizur100389 cluster fixes Graphify-Labs#5016/Graphify-Labs#5017/Graphify-Labs#5018/Graphify-Labs#5019/Graphify-Labs#5020 (one each), not a shared Graphify-Labs#5020, and the fresh-subfolder query fix references Graphify-Labs#2603. Correct the thanks/issue refs and add the PR numbers. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Brings the branch up to date with v8 (about 1,100 commits). Conflicts: - graphify/extractors/dart.py: kept the tree-sitter rewrite from this branch as-is. The Dart fixes v8 landed in the regex extractor in the meantime (part-file node, conditional URIs, anonymous extensions, mixin `on A, B`) are ported in the next commit; their v8 tests fail here. - uv.lock: taken from v8 and re-locked for tree-sitter-dart.
…e its regressions The merge with v8 left six tests in tests/test_dart.py failing. Running the rewrite on a 321-file Flutter app (flutter_bloc, go_router, freezed) also showed several regressions against the regex extractor. This commit fixes both. Ported from v8's regex extractor: - a `part of` file keeps its own node, with `includes` / `contains` edges - conditional URIs (`if (dart.library.io) 'x_io.dart'`) emit every branch - anonymous `extension on T` gets its node, members and `extends` edge - every constraint of a mixin `on A, B` clause inherits - the source is read through _read_source_bytes Regressions closed: - abstract / interface members (`Future<bool> openX();`) and static const/final fields were dropped - `typedef int Cmp(...)` named the alias `int` and pointed the edge backwards - the generic arguments of `implements` / `with` were emitted as supertypes (802 `implements` edges from 424 clauses) - top-level getters/setters were dropped; enhanced enum members are now extracted too - Flutter heuristics matched inside comments. The heuristics now run on comment-blanked bytes (length preserved, so lines do not move). Strings are kept: route paths live in them. - `type_lookup` was emitted up to three times per call site - `_make_id` drops `_` and `$`, so freezed's `mixin _$Vm` and `class _Vm`, or a field `_items` and its getter `items`, shared one id and one vanished. Ids now use the Python/C#/JS salting rule (_underscore_salted_nid). - add_edge hard-coded an off-rubric 0.5 confidence score Call pass: - The callee is found in every position: arrow bodies, initializers, conditions, arguments, closures. Calls in closures and local functions are credited to the enclosing declaration; constructor bodies are credited to the type. - A call binds only when its target is unambiguous: the caller's own member first, then a unique top-level or member name. Before, the last same-named node in the file won. A StatefulWidget and its State both declaring `build` now produce no edge instead of a wrong EXTRACTED one (fail closed). Also: tree-sitter-dart is capped below 0.2, matching the other grammars; _AST_CACHE_SCHEMA goes to 41 so cached Dart extractions re-run; the missing-grammar test uses mock.patch.dict(sys.modules). Every new test fails on the original rewrite and passes here. Refs Graphify-Labs#3651
2 of 3 tasks
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.
What does this PR do?
This is a follow-up to my review on Graphify-Labs#3651, opened against your branch so the upstream PR keeps its history. If you merge it, Graphify-Labs#3651 updates in place and becomes mergeable into
v8again.There are two commits:
Merge branch 'v8': resolves the conflicts only.dart.pyis your rewrite unchanged, anduv.lockis re-locked.fix(dart): …: the fixes below.Ported from v8: these are the six
v8tests that failed after the merge.part offile keeps its own node, withincludes/containsedges.if (dart.library.io) 'x_io.dart') emit every branch.extension on Tis extracted.on A, Bgets aninheritsedge._read_source_bytes.Regressions closed:
static const/finalfields were dropped.typedef int Cmp(...)was namedint.implements/withwere emitted as supertypes.type_lookupwas emitted up to 3× per site._$Vm/_Vmand_items/itemscollapsed into one id. They are now salted with the shared_underscore_salted_nidrule.0.5confidence score failedtest_inferred_confidence_rubric.Call pass:
Also:
tree-sitter-dart>=0.1.0,<0.2, capped like the other grammars._AST_CACHE_SCHEMA40 → 41.mock.patch.dict(sys.modules).Same 321-file Flutter app as in the review (flutter_bloc, go_router, freezed; aggregates only)
callsedgesimplementsedges (424 clauses in source)type_lookupedgesconfiguresedgescontains/includesThe local symbols
v8has but this PR doesn't are of two kinds:identical,operator,orElse,null,_,class,_that);Type of change
Verification & Invariants
Invariants:
Persisted state: the Dart AST output changes, so
_AST_CACHE_SCHEMAis bumped to invalidate cached Dart extractions.Regression tests: each of the 10 new tests in
tests/test_dart.pyfails on the original rewrite and passes here. I checked this by running the same test file againstv8with only feat(dart): replace regex extractor with tree-sitter-dart Graphify-Labs/graphify#3651'sdart.pydropped in.Read the CONTRIBUTING.md guide.
Reproduced the issue and identified the invariant.
Made the smallest fix necessary.
Added a regression test (if bug fix) or isolated boundary test.
Kept the PR description synchronized with the final implementation.
Documented any limitations / unsupported cases explicitly.
How was this tested?
The 68 full-suite failures are environmental:
test_terraform*,test_ext_tagged_id_clashandtest_install_references. They need optional grammars I didn't install, and they fail the same way on plainv8.test_pin_hash_seed(CLI re-exec). They fail only inside the full run and pass in isolation, on bothv8and this branch.All runs used Python 3.12,
tree-sitter==0.25.2andtree-sitter-dart==0.1.0.Limitations / unsupported cases
raw_calls: they still carryis_member_call: True, as in your version, so the corpus-wide resolver skips them. Cross-file Dart call resolution is a separate change.definesfrom both the type and the file, as in your version. Other extractors link a type to its members withmethod; that's for you or the maintainers to decide._Foocan still share an id with the library'sFoo.Graphify-specific checklist
uv run python -m tools.skillgen --bless) when changing their source fragments. (n/a: no skill sources touched)