Full page · 03 · Unique

State ownership:
who truly owns a field.

Ask who owns a state variable and get the canonical write sites — the functions that actually set it — with every writer and the rationale, not every passing mention.

Core

Canonical write sites across ten languages. The query finds the state variables a function writes to and returns all writers for each affected variable, then names the canonical owner with the reason — highest write count — stated outright.

Live example

$ sot_query({ "variable": "manifest_hash" })
{
  "variable": "manifest_hash",
  "rationale": "Highest write_count for 'manifest_hash': check_index_staleness has 2 writes vs 1 in sorted_manifest_and_hash.",
  "write_count": 2,
  "writer_function": "check_index_staleness",
  "writer_file": "src/db/mod.rs",
  "writer_line": 2823,
  "all_writers": [
    {"file": "src/db/mod.rs", "first_line": 2823, "function": "check_index_staleness", "write_count": 2},
    {"file": "src/db/mod.rs", "first_line": 166, "function": "sorted_manifest_and_hash", "write_count": 1},
    {"file": "src/flow/mod.rs", "first_line": 1055, "function": "compute_flow", "write_count": 1},
[...]
  ]
}

Real MCP tool output — verbatim excerpt. Field names and values are byte-identical to the live response; [...] on its own line marks where the writer list was cut (7 writers total; 4 further entries cut), and the freshness block is omitted. Captured live against the DesignGraph codebase.

API surface

Tool
sot_query
Parameters
variable (required), project
Returns
All writers for the variable, the canonical owner, write counts, and the ownership rationale

Use cases

Honesty: the canonical claim always ships with its rationale and the full writer list — the evidence, not just the verdict.