Reduce pub visibility: hippocampus, subconscious internals

hippocampus: cursor navigation, transcript parsing, similarity
functions to pub(crate). counters::open() made private.

subconscious: all format_* prompts helpers to pub(super),
load_defs and keys_to_replay_items made private,
consolidate_full_with_progress made private.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-07 17:29:12 -04:00
parent 9737641c86
commit 1f873140ae
7 changed files with 20 additions and 20 deletions

View file

@ -25,7 +25,7 @@ pub fn consolidate_full(store: &mut Store) -> Result<(), String> {
consolidate_full_with_progress(store, &|_| {})
}
pub fn consolidate_full_with_progress(
fn consolidate_full_with_progress(
store: &mut Store,
on_progress: &dyn Fn(&str),
) -> Result<(), String> {

View file

@ -163,7 +163,7 @@ pub fn agents_dir() -> PathBuf {
}
/// Load all agent definitions.
pub fn load_defs() -> Vec<AgentDef> {
fn load_defs() -> Vec<AgentDef> {
let dir = agents_dir();
let Ok(entries) = std::fs::read_dir(&dir) else { return Vec::new() };
@ -814,7 +814,7 @@ pub fn run_agent(
}
/// Convert a list of keys to ReplayItems with priority and graph metrics.
pub fn keys_to_replay_items(
fn keys_to_replay_items(
store: &Store,
keys: &[String],
graph: &Graph,

View file

@ -23,7 +23,7 @@ pub struct AgentBatch {
pub node_keys: Vec<String>,
}
pub fn format_topology_header(graph: &Graph) -> String {
pub(super) fn format_topology_header(graph: &Graph) -> String {
let sigma = graph.small_world_sigma();
let alpha = graph.degree_power_law_exponent();
let gini = graph.degree_gini();
@ -66,7 +66,7 @@ pub fn format_topology_header(graph: &Graph) -> String {
n, e, graph.community_count(), sigma, alpha, gini, avg_cc, hub_list)
}
pub fn format_nodes_section(store: &Store, items: &[ReplayItem], graph: &Graph) -> String {
pub(super) fn format_nodes_section(store: &Store, items: &[ReplayItem], graph: &Graph) -> String {
let hub_thresh = graph.hub_threshold();
let mut out = String::new();
for item in items {
@ -139,7 +139,7 @@ pub fn format_nodes_section(store: &Store, items: &[ReplayItem], graph: &Graph)
out
}
pub fn format_health_section(store: &Store, graph: &Graph) -> String {
pub(super) fn format_health_section(store: &Store, graph: &Graph) -> String {
use crate::graph;
let health = graph::health_report(graph, store);
@ -195,7 +195,7 @@ pub fn format_health_section(store: &Store, graph: &Graph) -> String {
out
}
pub fn format_pairs_section(
pub(super) fn format_pairs_section(
pairs: &[(String, String, f32)],
store: &Store,
graph: &Graph,
@ -230,7 +230,7 @@ pub fn format_pairs_section(
out
}
pub fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, String) {
pub(super) fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, String) {
let mut candidates: Vec<(&str, &crate::store::Node)> = store.nodes.iter()
.filter(|(key, node)| {
if key.starts_with("_facts-") { return true; }
@ -293,7 +293,7 @@ pub fn format_rename_candidates(store: &Store, count: usize) -> (Vec<String>, St
}
/// Format specific target keys as rename candidates (for --target mode)
pub fn format_rename_targets(store: &Store, keys: &[String]) -> String {
pub(super) fn format_rename_targets(store: &Store, keys: &[String]) -> String {
let mut out = String::new();
out.push_str(&format!("## Nodes to rename ({} targets)\n\n", keys.len()));
@ -325,7 +325,7 @@ pub fn format_rename_targets(store: &Store, keys: &[String]) -> String {
}
/// Format a single node for split-plan prompt (phase 1)
pub fn format_split_plan_node(store: &Store, graph: &Graph, key: &str) -> String {
pub(super) fn format_split_plan_node(store: &Store, graph: &Graph, key: &str) -> String {
let communities = graph.communities();
let node = match store.nodes.get(key) {
Some(n) => n,