DOCS Β· ARCHITECTURE
ALL DOCS FIG. 15 Β· DWG VC-015

Perception: How Agents See the Codebase

Language models cannot guess architecture topology. And they should not pretend to.

Synced β€” 2026-05-12 source: docs/PERCEPTION.md

Perception: How Agents See the Codebase

Language models cannot guess architecture topology. And they should not pretend to.

In πš…πš’πš‹πšŽπšŒπš›πšŠπšπšπšŽπš., agents do not β€œread code” β€” they perceive structure through instruments. The instruments deliver objective truth. The agent delivers interpretation and action.

Loctree: Your Senses

Loctree MCP is the primary perception layer. Every tool is a different sense:

SenseToolWhat it reveals
Overviewrepo-viewFiles, LOC, languages, health score, top hubs
FocusfocusModule internals, edges, external dependencies
X-RaysliceFile + all dependencies + all consumers in one view
Blast RadiusimpactWhat breaks if you touch this file
SearchfindDoes this symbol already exist? (regex, multi-query)
SignalsfollowDead code, cycles, twins, hotspots β€” field-level detail
LayouttreeDirectory structure with LOC counts

The Discipline

Before editing, an agent maps. Before deleting, an agent measures blast radius. Before creating, an agent searches for existing parts.

This is not overhead. This is the difference between a craftsman who studies the material and one who cuts blind.

1. repo-view    β†’ know the territory
2. focus        β†’ narrow the scope
3. slice        β†’ X-ray before cutting
4. impact       β†’ measure what depends on your target
5. find         β†’ check if the part already exists
6. follow       β†’ pursue structural symptoms to root cause
7. grep/read    β†’ now detail matters
8. validate     β†’ run gates, confirm the patient is stable

Dual-Source Truth

When multiple senses disagree, the disagreement is the signal:

  • sniff says an export is dead β†’ dist says it is in the bundle
  • That disagreement reveals a dynamic import the static analysis missed
  • The correction eliminates an entire class of false positives

This is convergence through counterexample applied to perception itself.

Mylik

A mylik is a small, plausible misread that grows into documentation drift.

It happens when an agent copies a true shape from one actor, layer, or runtime surface into another one where it no longer applies. The source was not fake; the mapping was wrong.

Typical myliki:

  • operator fallback paths get documented as application runtime paths
  • one endpoint serving two functions gets treated as one policy
  • an empty template value gets mistaken for a configurable topology
  • source code suggests one story while deployed env truth says another

The antidote is not more prose. The antidote is actor/layer/runtime separation:

  1. name the actor using the surface
  2. name the function of the path or endpoint
  3. verify real deployed values before updating docs
  4. mark fallback/admin paths as such when they are not product runtime truth

If a future agent says β€œthe docs drifted, but the code looked convincing”, look for the mylik first.

Living Tree

Agents working in a shared workspace use these senses to avoid collisions, understand side-effects, and make safe decisions without demanding constant human micromanagement.

When you install πš…πš’πš‹πšŽπšŒπš›πšŠπšπšπšŽπš., this perception engine is available by default in every AI session.


//πšŸπš’πš‹πšŽπšŒπš›πšŠπšπšπšŽπš.