strata map renders a function’s call lineage as a deterministic terminal tree. It
is the read-and-explore counterpart to strata check’s enforcement:
where check imposes the repository’s structure, map lets you see it. It is
useful for recovering the mental map of a large codebase on demand, without paying
a model to rediscover it each time.
strata map SYMBOL [--root ROOT ...] [--depth N] [--paths MODE] [--color MODE]
strata map does not require Strata configuration or rule adoption. It
resolves import roots on its own, so you can run it on any Python repository.
Usage
Point it at a function to get its downstream call tree:
strata map run_check --root src
run_check(...) src/strata/cli/main/check.py:23
├── _parser(...) src/strata/cli/main/check.py:49
├── load_config(...) src/strata/config/core/main/load_config.py:15
│ ├── locate_config(...) src/strata/config/core/helpers/discovery.py:13 (depth limit)
│ ├── parse_config_source(...) src/strata/config/core/helpers/parse.py:14 (depth limit)
│ ├── validate_config(...) src/strata/config/core/helpers/validate.py:19 (depth limit)
│ └── build_config(...) src/strata/config/core/helpers/defaults.py:20 (depth limit)
├── discover_files(...) src/strata/discovery/core/main/discover_files.py:11
├── build_ruleset(...) src/strata/rules/catalog/main/build_ruleset.py:10
├── evaluate(...) src/strata/evaluation/core/main/evaluate.py:16
└── render(...) src/strata/reporting/core/main/render.py:12
Each node is one resolved call, shown with its function name and a path:line
location. Calls are listed in source order, and locations are repository-relative by
default so editors can make them clickable.
Selecting a symbol
The symbol argument accepts three forms:
| Form | Example | Use |
|---|
| Bare name | run_check | A uniquely named top-level function. |
| Dotted name | config.core.main.load_config | A module-qualified function. |
path::function | src/strata/cli/main/check.py::run_check | An exact file and function. |
If a bare name is ambiguous across the resolved roots, Strata asks you to use a
dotted or path::function selector rather than guessing.
Import roots
--root names a Python import root and may be repeated to map across several
independent package trees:
strata map service.run --root services --root libraries
When you do not pass --root, strata map uses your configured Strata roots if a
configuration is present, otherwise it infers src/, and otherwise falls back to
the repository root.
Options
| Option | Values | Default | Purpose |
|---|
--root | path (repeatable) | inferred | Python import roots to map. |
--depth | non-negative integer | 3 | Maximum call depth before truncation. |
--paths | relative, absolute, compact, none | relative | How locations are displayed. |
--color | auto, always, never | auto | ANSI color behavior. |
--direction | downstream | downstream | Direction of the walk. |
Path display modes trade detail for readability. compact keeps a leading segment
and the filename, which stays legible in deeply layered repositories:
strata map run_check --root src --depth 2 --paths compact
run_check(...) src/strata/…/main/check.py:23
├── _parser(...) src/strata/…/main/check.py:49
├── load_config(...) src/strata/…/main/load_config.py:15
│ ├── locate_config(...) src/strata/…/helpers/discovery.py:13 (depth limit)
│ └── ...
└── render(...) src/strata/…/main/render.py:12
Color is automatic for terminals, can be forced with --color, and respects the
NO_COLOR environment variable.
What the walk resolves
The current provider is a conservative pure-Python analysis of top-level project
functions. It resolves:
- same-module calls,
- absolute and relative direct imports,
- module aliases,
- namespace packages,
- calls across multiple import roots.
It does not guess dynamic dispatch. Calls made through a function parameter are
shown as unresolved seams rather than invented targets, and methods are omitted
rather than guessed. This keeps the map trustworthy: what it draws, it can stand
behind.
Markers
The tree marks three deterministic conditions so the output is stable and
unambiguous:
- depth limit: the branch was truncated at
--depth.
- cycle: a function reachable from itself; only the looping branch stops, and
siblings continue normally.
- unresolved: a dynamic call the provider will not guess.
Exit codes
| Code | Meaning |
|---|
0 | The tree was rendered. |
2 | The symbol could not be found, was ambiguous, or a file could not be parsed. |
An unknown symbol reports a clear error:
Unknown project function: does_not_exist
Not yet available
strata map is deliberately conservative today. The following are planned and not
part of current behavior: upstream (incoming-call) mapping, method and
type-aware resolution, JSON output, helper collapsing and layered rendering, and
docstring captions. This page documents only what the command does now.