Function bodies 2,528 total
test_gate_reinforce function · rust · L115-L118 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_reinforce() {
assert_eq!(gate(0.95), GatingAction::Reinforce);
assert_eq!(gate(0.92), GatingAction::Reinforce);
}test_gate_reinforce function · rust · L115-L118 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_reinforce() {
assert_eq!(gate(0.95), GatingAction::Reinforce);
assert_eq!(gate(0.92), GatingAction::Reinforce);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}Same scanner, your repo: https://repobility.com — Repobility
test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_update function · rust · L121-L124 (4 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_update() {
assert_eq!(gate(0.85), GatingAction::Update);
assert_eq!(gate(0.75), GatingAction::Update);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}Repobility — the code-quality scanner for AI-generated software · https://repobility.com
test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_gate_create function · rust · L127-L131 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_gate_create() {
assert_eq!(gate(0.74), GatingAction::Create);
assert_eq!(gate(0.5), GatingAction::Create);
assert_eq!(gate(0.0), GatingAction::Create);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}Powered by Repobility — scan your code at https://repobility.com
test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_insufficient_data function · rust · L136-L140 (5 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_insufficient_data() {
let (r, u) = adaptive_thresholds_zscore(&[0.5, 0.6]);
assert!((r - PRED_ERROR_REINFORCE).abs() < 0.001);
assert!((u - PRED_ERROR_UPDATE).abs() < 0.001);
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}Provenance: Repobility (https://repobility.com) — every score reproducible from /scan/
test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_high_similarity_corpus function · rust · L143-L149 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_high_similarity_corpus() {
// All recent very similar → μ high, σ small → thresholds rise
let recent = vec![0.90, 0.88, 0.92, 0.89, 0.91, 0.90, 0.88];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r > 0.90, "high corpus → high reinforce: {r}");
assert!(u > 0.85, "high corpus → high update: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}Same scanner, your repo: https://repobility.com — Repobility
test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_diverse_corpus function · rust · L152-L158 (7 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_diverse_corpus() {
// Diverse observations → μ moderate, σ large → wider CREATE zone
let recent = vec![0.1, 0.3, 0.5, 0.7, 0.9, 0.2, 0.4];
let (r, u) = adaptive_thresholds_zscore(&recent);
assert!(r < 0.98, "diverse → reinforce not maxed: {r}");
assert!(u < 0.85, "diverse → update reasonable: {u}");
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}Repobility — the code-quality scanner for AI-generated software · https://repobility.com
test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}test_zscore_novel_in_uniform function · rust · L161-L166 (6 LOC)rust/src/cognitive/prediction_error.rs
fn test_zscore_novel_in_uniform() {
// Uniform high corpus → low similarity is truly novel
let recent = vec![0.85, 0.88, 0.87, 0.86, 0.89, 0.90, 0.85];
let action = adaptive_gate(0.5, &recent);
assert_eq!(action, GatingAction::Create);
}