pub fn aggregate_candidate_data(
engine: &Engine,
index_store: &AsgIndexStore<'_>,
ledger_store: &AsgLedgerStore<'_>,
effect_store: &AsgEffectStore<'_>,
candidates: &[(f64, String)],
tokens: &[String],
recency: &HashMap<String, FileRecency>,
layer_overrides: &[(String, String)],
) -> CandidateAggregatesExpand description
Main candidate-scan pass. Iterates the ranked candidate list once, populating all six parallel accumulators:
by_layer— entry-point JSON grouped by classified layerdesign_invariants— Invariant ledger entries, deduped on summaryknown_hazards— Hazard ledger entriesvalidation_scenarios_ledger— ValidationScenario entries, dedupedeffects_summary— declared effects (low-signal suppressed unless sole)file_scores— per-file score row used by likely_edit_files
Plan M t-004 (1.0.98): lifted from CLI commands/prepare_change.rs and the MCP prepare_change handler. Both surfaces now call this directly, closing the Plan F TODO that flagged the duplication.