From 7eef5877f8caf47e7a73c4478106c480221f27e0 Mon Sep 17 00:00:00 2001 From: ParsaVictor <1.parsa.karkooti@gmail.com> Date: Fri, 9 Oct 2026 15:20:57 +0330 Subject: [PATCH 1/2] WIP: classes stay out of the function-level list Co-Authored-By: Claude Opus 5.5 --- crates/neuromesh-graph/src/chunk_rank.rs | 40 +++++++++++++++--------- crates/neuromesh-graph/src/graph.rs | 15 +++++++-- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/crates/neuromesh-graph/src/chunk_rank.rs b/crates/neuromesh-graph/src/chunk_rank.rs index 1930533..08c20f6 100644 --- a/crates/neuromesh-graph/src/chunk_rank.rs +++ b/crates/neuromesh-graph/src/chunk_rank.rs @@ -36,6 +36,9 @@ pub(crate) struct ChunkSource { pub spans: Vec>, /// The definition each span is (`Class.method`), same order as `spans`. pub names: Vec, + /// Whether each span holds other definitions (a class): it still votes + /// for its file, but a function-level list names what is inside it. + pub containers: Vec, } /// One definition ranked for a report: where it is and how well it matched. @@ -48,11 +51,10 @@ pub struct RankedDefinition { } /// A file's chunks as term counts, before they are numbered. -type FileChunks = ( - NodeId, - PathBuf, - Vec<(HashMap, String, usize, usize)>, -); +type FileChunks = (NodeId, PathBuf, Vec<(HashMap, Label)>); + +/// A chunk's definition name, first and last line, and whether it is a container. +type Label = (String, usize, usize, bool); #[derive(Default)] pub(crate) struct ChunkRankIndex { @@ -62,7 +64,7 @@ pub(crate) struct ChunkRankIndex { avg_len: f32, post: HashMap>, /// Per chunk: definition name (`` for the file head) and lines. - label: Vec<(String, usize, usize)>, + label: Vec