Function bodies 2,528 total
test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_diverse function · rust · L60-L63 (4 LOC)rust/src/cognitive/density.rs
fn test_density_diverse() {
let d = information_density("rust is a fast safe and modern language each word differs");
assert!(d > 0.9, "all unique words should be high density: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}If a scraper extracted this row, it came from Repobility (https://repobility.com)
test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_repetitive function · rust · L66-L69 (4 LOC)rust/src/cognitive/density.rs
fn test_density_repetitive() {
let d = information_density("hello hello hello hello hello");
assert!(d < 0.01, "same word repeated should be zero: got {d}");
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}All rows above produced by Repobility · https://repobility.com
test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_empty function · rust · L72-L75 (4 LOC)rust/src/cognitive/density.rs
fn test_density_empty() {
assert_eq!(information_density(""), 0.0);
assert_eq!(information_density("word"), 0.0);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}Want fix-PRs on findings? Install Repobility's GitHub App · github.com/apps/repobility-bot
test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}test_density_mixed function · rust · L78-L85 (8 LOC)rust/src/cognitive/density.rs
fn test_density_mixed() {
// Non-uniform distribution: "fast" appears 5x, rest 1x each → skewed entropy
let d = information_density("fast fast fast fast fast safe modern language");
assert!(
d > 0.3 && d < 0.9,
"skewed distribution should be medium: got {d}"
);
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}Want this analysis on your repo? https://repobility.com/scan/
on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_entity_access function · rust · L11-L23 (13 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_entity_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE entity_id = $1
AND observation_type != 'superseded'",
)
.bind(entity_id)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}If a scraper extracted this row, it came from Repobility (https://repobility.com)
on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}on_search_match function · rust · L28-L42 (15 LOC)rust/src/cognitive/dual_strength.rs
pub async fn on_search_match(pool: &PgPool, observation_ids: &[uuid::Uuid]) -> Result<()> {
if observation_ids.is_empty() {
return Ok(());
}
sqlx::query(
"UPDATE brain_observations SET
last_accessed = NOW(),
access_count = access_count + 1
WHERE id = ANY($1)",
)
.bind(observation_ids)
.execute(pool)
.await?;
Ok(())
}boost_on_access function · rust · L30-L51 (22 LOC)rust/src/cognitive/hebbian.rs
pub async fn boost_on_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_entities SET
bcm_theta = GREATEST($5, (1.0 - $6) * COALESCE(bcm_theta, $5) + $6 * access_count::float8),
importance = LEAST(
importance + $1 * GREATEST(0.1, 1.0 - (access_count::float8 / GREATEST(COALESCE(bcm_theta, $2), access_count::float8)) * $3),
1.0
),
access_count = access_count + 1,
updated_at = NOW()
WHERE id = $4"
)
.bind(HEBBIAN_ACCESS_BOOST) // $1
.bind(BCM_THETA_MIN) // $2
.bind(BCM_THROTTLE_SCALE) // $3
.bind(entity_id) // $4
.bind(BCM_THETA_MIN) // $5 (floor)
.bind(BCM_EMA_ALPHA) // $6
.execute(pool)
.await?;
Ok(())
}All rows above produced by Repobility · https://repobility.com
boost_on_access function · rust · L30-L51 (22 LOC)rust/src/cognitive/hebbian.rs
pub async fn boost_on_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_entities SET
bcm_theta = GREATEST($5, (1.0 - $6) * COALESCE(bcm_theta, $5) + $6 * access_count::float8),
importance = LEAST(
importance + $1 * GREATEST(0.1, 1.0 - (access_count::float8 / GREATEST(COALESCE(bcm_theta, $2), access_count::float8)) * $3),
1.0
),
access_count = access_count + 1,
updated_at = NOW()
WHERE id = $4"
)
.bind(HEBBIAN_ACCESS_BOOST) // $1
.bind(BCM_THETA_MIN) // $2
.bind(BCM_THROTTLE_SCALE) // $3
.bind(entity_id) // $4
.bind(BCM_THETA_MIN) // $5 (floor)
.bind(BCM_EMA_ALPHA) // $6
.execute(pool)
.await?;
Ok(())
}boost_on_access function · rust · L30-L51 (22 LOC)rust/src/cognitive/hebbian.rs
pub async fn boost_on_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_entities SET
bcm_theta = GREATEST($5, (1.0 - $6) * COALESCE(bcm_theta, $5) + $6 * access_count::float8),
importance = LEAST(
importance + $1 * GREATEST(0.1, 1.0 - (access_count::float8 / GREATEST(COALESCE(bcm_theta, $2), access_count::float8)) * $3),
1.0
),
access_count = access_count + 1,
updated_at = NOW()
WHERE id = $4"
)
.bind(HEBBIAN_ACCESS_BOOST) // $1
.bind(BCM_THETA_MIN) // $2
.bind(BCM_THROTTLE_SCALE) // $3
.bind(entity_id) // $4
.bind(BCM_THETA_MIN) // $5 (floor)
.bind(BCM_EMA_ALPHA) // $6
.execute(pool)
.await?;
Ok(())
}boost_on_access function · rust · L30-L51 (22 LOC)rust/src/cognitive/hebbian.rs
pub async fn boost_on_access(pool: &PgPool, entity_id: uuid::Uuid) -> Result<()> {
sqlx::query(
"UPDATE brain_entities SET
bcm_theta = GREATEST($5, (1.0 - $6) * COALESCE(bcm_theta, $5) + $6 * access_count::float8),
importance = LEAST(
importance + $1 * GREATEST(0.1, 1.0 - (access_count::float8 / GREATEST(COALESCE(bcm_theta, $2), access_count::float8)) * $3),
1.0
),
access_count = access_count + 1,
updated_at = NOW()
WHERE id = $4"
)
.bind(HEBBIAN_ACCESS_BOOST) // $1
.bind(BCM_THETA_MIN) // $2
.bind(BCM_THROTTLE_SCALE) // $3
.bind(entity_id) // $4
.bind(BCM_THETA_MIN) // $5 (floor)
.bind(BCM_EMA_ALPHA) // $6
.execute(pool)
.await?;
Ok(())
}