Expand description
aver shape — module-shape presentation layer.
Stage 1 of issue #232 (0.23 “Shape”) split this file into two tiers:
- Recognition (
aver::analysis::shape) — per-fn facts walk, archetype classifier, call-graph SCC. Stable typed primitives. - Presentation (this module) —
ModuleShapevector +Kind+ verify report + histogram + Layer fingerprint distance + corpus walker + renderer +aver.toml [[shape.layer]]/[[shape.expected]]bridges. Everything the CLI / LSP / JSON consumers see.
The recognition primitives are re-exported below so existing
callers (and the research test) keep working through this module
during the transition; downstream stages will migrate them to
import directly from aver::analysis::shape.
Structs§
- Corpus
Summary - Per-Kind / per-Layer aggregate over a corpus.
- FnShape
- Histogram
- Layer
Fingerprint - Layer
Verdict - Module
Shape - Render
Options - Shape
Report - Verify
Report
Enums§
- ApiShape
- Bucket
- Five-bucket histogram a
Layerfingerprint is defined against. Mapped from the 14 archetype labels viaarchetype_to_bucket. - Corpus
Entry - Outcome of analyzing a single file inside a corpus walk. Files that fail typecheck or parse get the error attached instead of being silently skipped — the corpus view should show what’s broken.
- Entry
- Kind
- Layer
- Purity
- State
Shape - Type
Surface - Verify
Level
Functions§
- analyze_
dir - Walk a directory recursively and analyze every
.avfile.rootis also used as the defaultmodule_rootfor dep resolution — callers that want a different module root can pass it explicitly. - analyze_
path - analyze_
path_ with - Same as
analyze_pathbut lets the caller supply a custom layer fingerprint table + basis label (used by the CLI whenaver.tomlhas[[shape.layer]]overrides). - analyze_
source_ with - Analyze a source string directly, without touching the filesystem
for the entry file. Used by the LSP (editor buffer may differ from
on-disk content) and any future embedder that holds the program in
memory.
module_rootresolvesdepends [...];file_labelis the path string surfaced in the report’sfilefield;fallback_module_nameis used when the source has nomoduledeclaration. - archetype_
to_ bucket - builtin_
v0_ layer_ fingerprints - classify_
layer - Nearest fingerprint by Euclidean distance over bucket %.
Confidence is
(max_dist - chosen_dist) / max_dist, penalized by smalltotal_fns(< 5 fns flattens confidence regardless of fit). - derive_
kind - fingerprints_
from_ config - Built-in v0 fingerprints sourced from the casual single-author corpus measurement that landed on the tweet. Concrete numbers:
- render_
corpus_ json - render_
corpus_ text - render_
json - render_
text - summarize_
corpus