cgis_drift
Compare your ingested code graph against declared ideal patterns to detect per-domain architectural drift, returning verdicts, fit bands, residual scores, and coverage.
Instructions
Report per-domain architectural drift against declared ideal patterns.
Returns JSON: ``any_critical`` verdict, per-domain reports (each carrying a
``fit`` block — nearest alphabet template + residual + good/weak/none band),
the observe-only quotient layer, and ``coverage`` (graph prefixes bound by no
domain). Call after ``cgis_ingest`` to learn whether your edits pushed a
domain past its drift tolerance.
``max_drift`` is now the default tolerance only for domains that omit
``drift_tolerance`` — it no longer caps domains that declare their own
(see #170).
``profile``: when set, score only domains with this profile (plus
profile-less ones). Use when your patterns.yaml mixes languages but the
graph holds one language — avoids false EMPTY reports for other-language
domains that would otherwise fail the gate.
``max_residual``: a domain whose nearest template is farther than this gets
``fit.band = "none"`` ("no template fits") — a grab-bag module or an
alphabet gap, independent of drift tolerance (#177).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| 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 |
| profile | No | Score only domains with this profile, plus profile-less ones — e.g. one language when patterns.yaml mixes several. | |
| max_drift | No | Drift tolerance for domains that declare no drift_tolerance of their own. | |
| max_residual | No | Distance to the nearest template beyond which a domain's fit band is "none" (no template fits). | |
| patterns_path | No | patterns.yaml (.yaml or .yml) declaring each domain's expected pattern and tolerance, relative to the server's working directory. cgis_init_ontology proposes one. | docs/ontology/patterns.yaml |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |