cgis_diff_check
Check a git diff against a code graph before review or merge to find subclasses, callers, and data-key dependants affected by changed or removed symbols.
Instructions
What else depends on what a diff changed: subclasses, callers and data keys.
Call this before review or merge. It reads the lines ``base..head`` changed,
finds the graph symbols they fall in (and symbols the diff removed, read from
the base text), and lists the classes that extend a changed class and the
functions that call a changed or removed function. For each data key the
changed lines read, write or declare (``doc["avatar"]``, a mapping field) it
lists the key's other readers, writers and declarers, reads of a dotted path
a mapping does not declare, and reads of a declaration the diff removed;
common keys (``id``, ``name``, or used in many files) are left out. Key items
need a graph ingested with data keys on (``cgis_ingest(data_keys=True)`` or
``cgis ingest --data-keys``); on a graph without them the answer says so and
lists subclasses and callers only. Sites in test files are counted, not
listed. An empty list means no static dependants were found, not that the
change is safe: dispatch the graph cannot see is not covered. How to read
the list: caller and subclass items are leads to read; data-key items are
noisy — measured on one application (owner-api), about a quarter of listed
items were worth a look (docs/lab-notes/2026-10-19-data-key-diff-check.md).
Before judging a code site that reads or writes a key unaffected, read its
callers (cgis_analyze_impact): they decide what values reach it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cap | No | Items listed; the rest are only counted. | |
| base | No | Base revision of the diff, e.g. origin/main or a sha. | origin/main |
| head | No | Head revision of the diff. | HEAD |
| prefix | No | The path of the ingested directory inside the repository (e.g. 'src' after cgis_ingest of ./src); empty when the repository root was ingested. Left out, it comes from the root the graph recorded at ingest. | |
| db_path | No | SQLite graph built by cgis_ingest. A relative path resolves against the MCP server's working directory, not the agent's — prefer an absolute path. | graph.db |
| repo_path | Yes | Git repository holding the diff; prefer an absolute path. | |
| output_format | No | 'text' or 'json'. | text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |