Architecture
The 4-layer model — sensors, symbol model, runtime semantics, agent context pack — that organises every loctree subsystem.
Loctree Architecture
Doctrine
Loctree is the structural perception and context-compiler layer for agentic software work. It tells agents what the code is, how it is connected, what runtime surface it participates in, and what context is safe to act on now. The parser is treated as a sensor, not the product; ground truth and derived views are kept explicit; and the agent context pack is the core UX.
Layer 1 — Sensors
- OXC (JS/TS)
- regex parsers (shell, makefile, zig, dart, go, css)
- planned: tree-sitter for selected languages (Cut 2.5, conditional)
- artifact metadata: source maps, gitignore, repo identity
Layer 2 — Symbol Model
- types.rs::FileAnalysis
- export/import edges
- node ranges + sensor tags
Layer 3 — Runtime Semantics
See docs/semantic-spec.md for idiom catalog.
- ShellSemantics (Cut 3A)
- MakeSemantics (Cut 3A)
- planned: PythonRuntimeSemantics, RustRuntimeSemantics, TauriSemantics (Cut 3B)
- contract: trait RuntimeSemanticAnalyzer, types SemanticFacts/IdiomTag/etc.
Layer 4 — Agent Context Pack
- planned: loct context (Cut 4)
- composition: structural + runtime + risk + action + memory + authority slices
- planned: --with-aicx overlay (Cut 5)
Cross-cutting
- Snapshot identity & rebuildability (Cut 2)
- Doctor surfaces (Cut 2)
- Reports / Leptos cockpit (Lane 4)
- Note: AICX integration depends on stable interfaces; live
memex-syncdrift must be resolved before use.