Expand description
Weighted focus map (stage 4): the composite attention score per review unit
plus the no-skip labels, confidence flags, and escape hatch. Public so the
schema-emit binary can derive the FocusMap types.
Weighted focus map (stage 4): a COMPOSITE attention score per review unit
that ranks where scarce reviewer attention goes.
A 40-file diff becomes a handful of review-here pieces plus an enumerable
not-prioritized remainder. The free tier RANKS but NEVER says “skip” (safe
explicit-skip is paid, runtime-backed only); each unit carries a human
reason; a per-unit confidence flag protects dynamically-wired / re-export-heavy
code from a silent static-reachability de-prioritization; and the
deprioritized escape-hatch list makes EVERY de-prioritized piece reachable.
§The composite score (deterministic, no runtime input)
score = fan_io + security_taint + risk_zone + change_shape, an integer sum
(no floats, matching the partition + order engine’s determinism posture) of four deterministic signals,
each derived from data the brief already retains:
- fan-in / fan-out (graph blast): from engine-owned focus fact helpers.
- security taint touch: a source -> sink taint trace touches the unit
(reuse
SecurityFinding.trace). Built as a pure function of a security- finding slice; the brief path carries an EMPTY slice today (security is the opt-infallow securitycommand, not the bare dead-code analysis), so this contributes 0 until a future epic threads a security pass. The seam is wired and tested; no taint engine runs here. - risk zone: boundary / public-API / security-sensitive.
- change shape: new export / widened visibility / signature change (the coordination-gap proxy, ADR-001 syntactic).
§The runtime layer (paid, built)
When FocusInputs::runtime is Some (the paid --runtime-coverage path),
a hot file adds an invocation-bucketed runtime component to its score so it
amplifies the blast and outranks an otherwise-equal cold unit, and a unit the
runtime proves cold AND that carries no deterministic signal earns the SAFE
explicit-skip label (FocusLabel::Skip). When runtime is None (free
mode) the layer contributes nothing: the runtime component is 0, no unit
can reach the Skip arm, and the output is byte-identical to the no-runtime baseline. The free
tier ranks but never skips; safe-skip is runtime-backed only.
Structs§
- Boundary
Zone File - A boundary-zone signal for a unit: the unit’s file introduced a new cross-zone
edge (it is the
from_fileof an introduced boundary edge). - Focus
Inputs - Everything the focus extractor needs, gathered from the assembled brief data. All path-spaces are root-relative + forward-slashed (the brief’s canonical space), so signal joins are byte-exact.
- Focus
Map - The weighted focus map: the ranked
review-hereunits plus the FULLdeprioritizedescape-hatch list, so nothing is hidden. - Focus
Score - The composite attention score, with the deterministic component sub-scores kept on the wire so the runtime layer adds its weight without recomputing the signals.
- Focus
Unit - One review unit on the focus map: its file, composite score, label, human reason, and any confidence flags.
- Runtime
Focus - Per-file runtime evidence for the paid weighting layer, built from the
runtime-coverage health report at the brief path.
Nonein free mode; when present it adds the runtime score component and enables the safe explicit-skip label. The two lists are disjoint by construction (a hot file is never cold). - Runtime
HotFile - A runtime-hot file: a changed file with a runtime hot path, paired with the file’s peak invocation count (the max over the file’s hot functions).
Enums§
- Confidence
Flag - A per-unit confidence flag. The EXACT panel-decided strings: a dynamically- wired or re-export-heavy unit carries one so its static-reachability signal is not trusted as complete (the anti-silent-de-prioritization guard). The flag NEVER lowers the score; it is advisory provenance.
- Focus
Label - The focus label for a review unit.
Skipis the SAFE explicit-skip label and is runtime-backed ONLY: it is producible solely on the paid runtime path and solely for a unit runtime-proves cold with zero risk signals. Free mode (no runtime evidence) emits onlyReviewHere/NotPrioritized, neverSkip(the build-focus-map labeller cannot reach theSkiparm without runtime input), so the free-tier “rank but never skip” stance holds by construction.
Functions§
- build_
focus_ map - Build the weighted focus map from the assembled brief inputs: score each unit,
label it (
review-here/not-prioritized, NEVERskip), attach the reason and confidence flags, then partition into the rankedreview_herelist and the FULLdeprioritizedescape-hatch list.