compound-engineering.local.md
GitNexus is a code intelligence tool that builds a knowledge graph from source code using tree-sitter AST parsing across 12 languages and KuzuDB for graph storage. Two packages: gitnexus/ (CLI/MCP, TypeScript) and gitnexus-web/ (browser).
gitnexus/src/core/ingestion/type-extractors/ must follow identical patterns for: async unwrapping, constructor binding, namespace handling, nullable type stripping, for-loop element typing.await_expression unwrapping that TypeScript handled correctly; PHP backslash namespace splitting inconsistent with other languages' :: / . splitting.gitnexus/src/core/kuzu/schema.ts, adapter in kuzu-adapter.ts.close() hangs on Linux due to C++ destructor — use detachKuzu() pattern.lbug-adapter.ts fallback path needs quote/newline escaping for Cypher injection prevention.lbug-adapter.ts and kuzu-adapter.ts — watch for injection via unescaped user-provided symbol names.--repo parameter and file paths — validate against path traversal.getTreeSitterBufferSize() in constants.ts.export-detection.ts, constants.ts, utils.ts — changes here have wide blast radius.gitnexus-web package drifts behind CLI — flag if a change should be mirrored.Invoke these via the Agent tool alongside /ce:review for deeper specialist analysis. These cover gaps that compound-engineering agents don't:
When: Changes touch type-resolution logic, generics, conditional types, or complex type-level programming in type-env.ts, type-extractors/*.ts, or types.ts.
Why: The type resolution system uses advanced TypeScript patterns (discriminated unions, mapped types, recursive generics) that benefit from deep TS type-system review beyond what kieran-typescript-reviewer covers.
When: Changes touch MCP tool handlers, Cypher query construction, CLI argument parsing, or any code that processes external input.
Why: GitNexus is an MCP server — all tool inputs come from untrusted AI agents. Systematic OWASP-level audit catches injection vectors that spot-checking misses. Past finding: lbug-adapter.ts fallback path had unescaped newlines in Cypher queries.
When: Changes touch kuzu-adapter.ts, schema.ts, lbug-adapter.ts, or any Cypher query construction/execution.
Why: No CE agent specializes in graph database optimization. KuzuDB batch insert patterns, index usage, and query planning directly affect analysis speed on large repos.
gitnexus_impact() before approving changes to any symbol — check d=1 (WILL BREAK) callers.gitnexus_detect_changes({scope: "compare", base_ref: "main"}) to map PR diffs to affected execution flows.