Back to Qwen Code

CodeScope Graph Schema

.qwen/skills/codegraph/schema.md

0.15.113.0 KB
Original Source

CodeScope Graph Schema

Nodes

NodeKey PropertiesNotes
Fileid, path, language, loc, is_externalis_external=1 for system headers / library stubs
Functionid, name, qualified_name, signature, file_path, start_line, end_line, doc_comment, class_name, is_historicalis_historical=1 for deleted/renamed functions
Classid, name, qualified_name, file_path
Moduleid, name, path_prefixAuto-discovered from directories (e.g. kernel/sched)
Commitid, hash, message, author, timestamp, version_tagversion_tag='bf' means MODIFIES edges computed
Metadataid, valuePipeline state (e.g. oldest_commit)
PRid, title, author, risk_level, labelOpen pull request; populated by codegraph pr-review prepare
AUTHORlogin, name, company, location, bio, avatar_urlGitHub user who opened the PR

Edges

EdgeFrom → ToMeaning
CALLSFunction → FunctionStatic call graph (resolved from AST)
DEFINES_FUNCFile → FunctionFile defines this function
DEFINES_CLASSFile → ClassFile defines this class
HAS_METHODClass → FunctionClass contains this method
IMPORTSFile → FileInclude / import dependency
BELONGS_TOFile → ModuleFile belongs to this module
INHERITSClass → ClassClass inheritance
COMPOSESClass → ClassComposition relationship (strong ownership, filled diamond in UML)
AGGREGATESClass → ClassAggregation relationship (optional/weak, open diamond in UML)
USESClass → ClassDependency relationship (uses per-call, dashed arrow in UML)
MODIFIESCommit → FunctionCommit changed this function (requires backfill)
TOUCHESCommit → FileCommit changed this file (always present)
CHANGESPR → FunctionPR modifies this function; info = 'hunk' (modified in diff), 'deleted' (removed), 'related' (newly called), 'new' (newly added)
OPENSAUTHOR → PRAuthor opened this PR

Backfill State

Not all commits have MODIFIES edges — only those with version_tag = 'bf'. TOUCHES edges are always present for all ingested commits.

cypher
MATCH (c:Commit) WHERE c.version_tag = 'bf' RETURN count(c) AS backfilled
cypher
MATCH (c:Commit) RETURN count(c) AS total_commits

Neug Cypher Reference

Supported syntax:

  • MATCH, WHERE, RETURN, ORDER BY, LIMIT, WITH
  • Aggregations: count(), count(DISTINCT x)
  • Inline property filters: {name: 'foo'}
  • Variable-length paths: [*1..3]
  • String predicates: STARTS WITH, CONTAINS, ENDS WITH
  • Comparisons: =, <>, <, >, <=, >=
  • Boolean: AND, OR, NOT

Limitations:

  • Chained MATCH after WITH may be limited — prefer single MATCH clauses with multiple patterns separated by commas
  • No CREATE, SET, DELETE via Cypher — graph mutations go through the Python API