2026-01-25 01:31:03 -06:00
|
|
|
//! Ingest Tool
|
|
|
|
|
//!
|
|
|
|
|
//! Add new knowledge to memory.
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
//!
|
|
|
|
|
//! v1.5.0: Enhanced with same cognitive pipeline as smart_ingest:
|
|
|
|
|
//! Pre-ingest: importance scoring + intent detection
|
|
|
|
|
//! Post-ingest: synaptic tagging + novelty model update + hippocampal indexing
|
2026-01-25 01:31:03 -06:00
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
use chrono::Utc;
|
2026-01-25 01:31:03 -06:00
|
|
|
use serde::Deserialize;
|
|
|
|
|
use serde_json::Value;
|
|
|
|
|
use std::sync::Arc;
|
|
|
|
|
use tokio::sync::Mutex;
|
|
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
use crate::cognitive::CognitiveEngine;
|
|
|
|
|
use vestige_core::{
|
|
|
|
|
ContentType, ImportanceContext, ImportanceEvent, ImportanceEventType, IngestInput, Storage,
|
|
|
|
|
};
|
2026-01-25 01:31:03 -06:00
|
|
|
|
|
|
|
|
/// Input schema for ingest tool
|
|
|
|
|
pub fn schema() -> Value {
|
|
|
|
|
serde_json::json!({
|
|
|
|
|
"type": "object",
|
|
|
|
|
"properties": {
|
|
|
|
|
"content": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "The content to remember"
|
|
|
|
|
},
|
|
|
|
|
"node_type": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "Type of knowledge: fact, concept, event, person, place, note, pattern, decision",
|
|
|
|
|
"default": "fact"
|
|
|
|
|
},
|
|
|
|
|
"tags": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": { "type": "string" },
|
|
|
|
|
"description": "Tags for categorization"
|
|
|
|
|
},
|
|
|
|
|
"source": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": "Source or reference for this knowledge"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"required": ["content"]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, Deserialize)]
|
|
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
|
|
struct IngestArgs {
|
|
|
|
|
content: String,
|
|
|
|
|
node_type: Option<String>,
|
|
|
|
|
tags: Option<Vec<String>>,
|
|
|
|
|
source: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pub async fn execute(
|
|
|
|
|
storage: &Arc<Mutex<Storage>>,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
cognitive: &Arc<Mutex<CognitiveEngine>>,
|
2026-01-25 01:31:03 -06:00
|
|
|
args: Option<Value>,
|
|
|
|
|
) -> Result<Value, String> {
|
|
|
|
|
let args: IngestArgs = match args {
|
|
|
|
|
Some(v) => serde_json::from_value(v).map_err(|e| format!("Invalid arguments: {}", e))?,
|
|
|
|
|
None => return Err("Missing arguments".to_string()),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Validate content
|
|
|
|
|
if args.content.trim().is_empty() {
|
|
|
|
|
return Err("Content cannot be empty".to_string());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if args.content.len() > 1_000_000 {
|
|
|
|
|
return Err("Content too large (max 1MB)".to_string());
|
|
|
|
|
}
|
|
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
// ====================================================================
|
|
|
|
|
// COGNITIVE PRE-INGEST: importance scoring + intent detection
|
|
|
|
|
// ====================================================================
|
|
|
|
|
let mut importance_composite = 0.0_f64;
|
|
|
|
|
let mut tags = args.tags.unwrap_or_default();
|
|
|
|
|
let mut is_novel = false;
|
|
|
|
|
let mut embedding_strategy = String::new();
|
|
|
|
|
|
|
|
|
|
if let Ok(cog) = cognitive.try_lock() {
|
|
|
|
|
// Full 4-channel importance scoring
|
|
|
|
|
let context = ImportanceContext::current();
|
|
|
|
|
let importance = cog.importance_signals.compute_importance(&args.content, &context);
|
|
|
|
|
importance_composite = importance.composite;
|
|
|
|
|
|
|
|
|
|
// Standalone novelty check (dopaminergic signal)
|
|
|
|
|
let novelty_ctx = vestige_core::neuroscience::importance_signals::Context::default();
|
|
|
|
|
is_novel = cog.novelty_signal.is_novel(&args.content, &novelty_ctx);
|
|
|
|
|
|
|
|
|
|
// Intent detection → auto-tag
|
|
|
|
|
let intent_result = cog.intent_detector.detect_intent();
|
|
|
|
|
if intent_result.confidence > 0.5 {
|
|
|
|
|
let intent_tag = format!("intent:{:?}", intent_result.primary_intent);
|
|
|
|
|
let intent_tag = if intent_tag.len() > 50 {
|
|
|
|
|
format!("{}...", &intent_tag[..47])
|
|
|
|
|
} else {
|
|
|
|
|
intent_tag
|
|
|
|
|
};
|
|
|
|
|
tags.push(intent_tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Detect content type → select adaptive embedding strategy
|
|
|
|
|
let content_type = ContentType::detect(&args.content);
|
|
|
|
|
let strategy = cog.adaptive_embedder.select_strategy(&content_type);
|
|
|
|
|
embedding_strategy = format!("{:?}", strategy);
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-25 01:31:03 -06:00
|
|
|
let input = IngestInput {
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
content: args.content.clone(),
|
2026-01-25 01:31:03 -06:00
|
|
|
node_type: args.node_type.unwrap_or_else(|| "fact".to_string()),
|
|
|
|
|
source: args.source,
|
|
|
|
|
sentiment_score: 0.0,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
sentiment_magnitude: importance_composite,
|
|
|
|
|
tags,
|
2026-01-25 01:31:03 -06:00
|
|
|
valid_from: None,
|
|
|
|
|
valid_until: None,
|
|
|
|
|
};
|
|
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
// ====================================================================
|
|
|
|
|
// INGEST (storage lock)
|
|
|
|
|
// ====================================================================
|
|
|
|
|
let mut storage_guard = storage.lock().await;
|
2026-01-25 01:31:03 -06:00
|
|
|
|
2026-02-12 02:57:03 -06:00
|
|
|
// Route through smart_ingest when embeddings are available to prevent duplicates.
|
|
|
|
|
// Falls back to raw ingest only when embeddings aren't ready.
|
|
|
|
|
#[cfg(all(feature = "embeddings", feature = "vector-search"))]
|
|
|
|
|
{
|
|
|
|
|
let fallback_input = input.clone();
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
match storage_guard.smart_ingest(input) {
|
2026-02-12 02:57:03 -06:00
|
|
|
Ok(result) => {
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let node_id = result.node.id.clone();
|
|
|
|
|
let node_content = result.node.content.clone();
|
|
|
|
|
let node_type = result.node.node_type.clone();
|
|
|
|
|
let has_embedding = result.node.has_embedding.unwrap_or(false);
|
|
|
|
|
drop(storage_guard);
|
|
|
|
|
|
|
|
|
|
run_post_ingest(cognitive, &node_id, &node_content, &node_type, importance_composite);
|
|
|
|
|
|
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
|
|
|
Ok(serde_json::json!({
|
2026-02-12 02:57:03 -06:00
|
|
|
"success": true,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"nodeId": node_id,
|
2026-02-12 02:57:03 -06:00
|
|
|
"decision": result.decision,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"message": format!("Knowledge ingested successfully. Node ID: {} ({})", node_id, result.decision),
|
|
|
|
|
"hasEmbedding": has_embedding,
|
2026-02-12 02:57:03 -06:00
|
|
|
"similarity": result.similarity,
|
|
|
|
|
"reason": result.reason,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"isNovel": is_novel,
|
|
|
|
|
"embeddingStrategy": embedding_strategy,
|
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
|
|
|
}))
|
2026-02-12 02:57:03 -06:00
|
|
|
}
|
|
|
|
|
Err(_) => {
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let node = storage_guard.ingest(fallback_input).map_err(|e| e.to_string())?;
|
|
|
|
|
let node_id = node.id.clone();
|
|
|
|
|
let node_content = node.content.clone();
|
|
|
|
|
let node_type = node.node_type.clone();
|
|
|
|
|
let has_embedding = node.has_embedding.unwrap_or(false);
|
|
|
|
|
drop(storage_guard);
|
|
|
|
|
|
|
|
|
|
run_post_ingest(cognitive, &node_id, &node_content, &node_type, importance_composite);
|
|
|
|
|
|
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
|
|
|
Ok(serde_json::json!({
|
2026-02-12 02:57:03 -06:00
|
|
|
"success": true,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"nodeId": node_id,
|
2026-02-12 02:57:03 -06:00
|
|
|
"decision": "create",
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"message": format!("Knowledge ingested successfully. Node ID: {}", node_id),
|
|
|
|
|
"hasEmbedding": has_embedding,
|
|
|
|
|
"isNovel": is_novel,
|
|
|
|
|
"embeddingStrategy": embedding_strategy,
|
chore: license AGPL-3.0, zero clippy warnings, CHANGELOG through v1.6.0
License:
- Replace MIT/Apache-2.0 with AGPL-3.0-only across all crates and npm packages
- Replace LICENSE file with official GNU AGPL-3.0 text
- Remove LICENSE-MIT and LICENSE-APACHE
Code quality:
- Fix all 44 clippy warnings (zero remaining)
- Collapsible if statements, redundant closures, manual Option::map
- Remove duplicate #[allow(dead_code)] attributes in deprecated tool modules
- Add Default impl for CognitiveEngine
- Replace manual sort_by with sort_by_key
Documentation:
- Update CHANGELOG with v1.2.0, v1.3.0, v1.5.0, v1.6.0 entries
- Update README with v1.6.0 highlights and accurate stats (52K lines, 1100+ tests)
- Add fastembed-rs/ to .gitignore
- Add fastembed-rs to workspace exclude
1115 tests passing, zero warnings, RUSTFLAGS="-Dwarnings" clean.
2026-02-19 03:00:39 -06:00
|
|
|
}))
|
2026-02-12 02:57:03 -06:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Fallback for builds without embedding features
|
|
|
|
|
#[cfg(not(all(feature = "embeddings", feature = "vector-search")))]
|
|
|
|
|
{
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let node = storage_guard.ingest(input).map_err(|e| e.to_string())?;
|
|
|
|
|
let node_id = node.id.clone();
|
|
|
|
|
let node_content = node.content.clone();
|
|
|
|
|
let node_type = node.node_type.clone();
|
|
|
|
|
let has_embedding = node.has_embedding.unwrap_or(false);
|
|
|
|
|
drop(storage_guard);
|
|
|
|
|
|
|
|
|
|
run_post_ingest(cognitive, &node_id, &node_content, &node_type, importance_composite);
|
|
|
|
|
|
2026-02-12 02:57:03 -06:00
|
|
|
Ok(serde_json::json!({
|
|
|
|
|
"success": true,
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"nodeId": node_id,
|
2026-02-12 02:57:03 -06:00
|
|
|
"decision": "create",
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
"message": format!("Knowledge ingested successfully. Node ID: {}", node_id),
|
|
|
|
|
"hasEmbedding": has_embedding,
|
|
|
|
|
"isNovel": is_novel,
|
|
|
|
|
"embeddingStrategy": embedding_strategy,
|
2026-02-12 02:57:03 -06:00
|
|
|
}))
|
|
|
|
|
}
|
2026-01-25 01:31:03 -06:00
|
|
|
}
|
|
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
/// Cognitive post-ingest side effects: synaptic tagging, novelty update, hippocampal indexing.
|
|
|
|
|
fn run_post_ingest(
|
|
|
|
|
cognitive: &Arc<Mutex<CognitiveEngine>>,
|
|
|
|
|
node_id: &str,
|
|
|
|
|
content: &str,
|
|
|
|
|
node_type: &str,
|
|
|
|
|
importance_composite: f64,
|
|
|
|
|
) {
|
|
|
|
|
if let Ok(mut cog) = cognitive.try_lock() {
|
|
|
|
|
// Synaptic tagging for retroactive capture
|
|
|
|
|
if importance_composite > 0.3 {
|
|
|
|
|
cog.synaptic_tagging.tag_memory(node_id);
|
|
|
|
|
if importance_composite > 0.7 {
|
|
|
|
|
let event = ImportanceEvent::for_memory(node_id, ImportanceEventType::NoveltySpike);
|
|
|
|
|
let _capture = cog.synaptic_tagging.trigger_prp(event);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Update novelty model
|
|
|
|
|
cog.importance_signals.learn_content(content);
|
|
|
|
|
|
|
|
|
|
// Record in hippocampal index
|
|
|
|
|
let _ = cog.hippocampal_index.index_memory(
|
|
|
|
|
node_id,
|
|
|
|
|
content,
|
|
|
|
|
node_type,
|
|
|
|
|
Utc::now(),
|
|
|
|
|
None,
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// Cross-project pattern recording
|
|
|
|
|
cog.cross_project.record_project_memory(node_id, "default", None);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-25 01:31:03 -06:00
|
|
|
// ============================================================================
|
|
|
|
|
// TESTS
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
mod tests {
|
|
|
|
|
use super::*;
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
use crate::cognitive::CognitiveEngine;
|
2026-01-25 01:31:03 -06:00
|
|
|
use tempfile::TempDir;
|
|
|
|
|
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
fn test_cognitive() -> Arc<Mutex<CognitiveEngine>> {
|
|
|
|
|
Arc::new(Mutex::new(CognitiveEngine::new()))
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-25 01:31:03 -06:00
|
|
|
/// Create a test storage instance with a temporary database
|
|
|
|
|
async fn test_storage() -> (Arc<Mutex<Storage>>, TempDir) {
|
|
|
|
|
let dir = TempDir::new().unwrap();
|
|
|
|
|
let storage = Storage::new(Some(dir.path().join("test.db"))).unwrap();
|
|
|
|
|
(Arc::new(Mutex::new(storage)), dir)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// INPUT VALIDATION TESTS
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_empty_content_fails() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({ "content": "" });
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_err());
|
|
|
|
|
assert!(result.unwrap_err().contains("empty"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_whitespace_only_content_fails() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({ "content": " \n\t " });
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_err());
|
|
|
|
|
assert!(result.unwrap_err().contains("empty"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_missing_arguments_fails() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), None).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_err());
|
|
|
|
|
assert!(result.unwrap_err().contains("Missing arguments"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_missing_content_field_fails() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({ "node_type": "fact" });
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_err());
|
|
|
|
|
assert!(result.unwrap_err().contains("Invalid arguments"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// LARGE CONTENT TESTS
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_large_content_fails() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
// Create content larger than 1MB
|
|
|
|
|
let large_content = "x".repeat(1_000_001);
|
|
|
|
|
let args = serde_json::json!({ "content": large_content });
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_err());
|
|
|
|
|
assert!(result.unwrap_err().contains("too large"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_exactly_1mb_succeeds() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
// Create content exactly 1MB
|
|
|
|
|
let exact_content = "x".repeat(1_000_000);
|
|
|
|
|
let args = serde_json::json!({ "content": exact_content });
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// SUCCESSFUL INGEST TESTS
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_basic_content_succeeds() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "This is a test fact to remember."
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
let value = result.unwrap();
|
|
|
|
|
assert_eq!(value["success"], true);
|
|
|
|
|
assert!(value["nodeId"].is_string());
|
|
|
|
|
assert!(value["message"].as_str().unwrap().contains("successfully"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_with_node_type() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "Error handling should use Result<T, E> pattern.",
|
|
|
|
|
"node_type": "pattern"
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
let value = result.unwrap();
|
|
|
|
|
assert_eq!(value["success"], true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_with_tags() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "The Rust programming language emphasizes safety.",
|
|
|
|
|
"tags": ["rust", "programming", "safety"]
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
let value = result.unwrap();
|
|
|
|
|
assert_eq!(value["success"], true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_with_source() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "MCP protocol version 2024-11-05 is the current standard.",
|
|
|
|
|
"source": "https://modelcontextprotocol.io/spec"
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
let value = result.unwrap();
|
|
|
|
|
assert_eq!(value["success"], true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_with_all_optional_fields() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "Complex memory with all metadata.",
|
|
|
|
|
"node_type": "decision",
|
|
|
|
|
"tags": ["architecture", "design"],
|
|
|
|
|
"source": "team meeting notes"
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
let value = result.unwrap();
|
|
|
|
|
assert_eq!(value["success"], true);
|
|
|
|
|
assert!(value["nodeId"].is_string());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// NODE TYPE DEFAULTS
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
|
async fn test_ingest_default_node_type_is_fact() {
|
|
|
|
|
let (storage, _dir) = test_storage().await;
|
|
|
|
|
let args = serde_json::json!({
|
|
|
|
|
"content": "Default type test content."
|
|
|
|
|
});
|
feat: Vestige v1.5.0 — Cognitive Engine, memory dreaming, graph exploration, predictive retrieval
28-module CognitiveEngine with full neuroscience pipeline on every tool call.
FSRS-6 now fully automatic: periodic consolidation (6h timer + inline every
100 tool calls), real retrievability formula, episodic-to-semantic auto-merge,
cross-memory reinforcement, Park et al. triple retrieval scoring, ACT-R
base-level activation, personalized w20 optimization.
New tools (19 → 23):
- dream: memory consolidation via replay, discovers hidden connections
- explore_connections: graph traversal (chain, associations, bridges)
- predict: proactive retrieval based on context and activity patterns
- restore: memory restore from JSON backups
All existing tools upgraded with cognitive pre/post processing pipelines.
33 files changed, ~4,100 lines added.
2026-02-18 23:34:15 -06:00
|
|
|
let result = execute(&storage, &test_cognitive(), Some(args)).await;
|
2026-01-25 01:31:03 -06:00
|
|
|
assert!(result.is_ok());
|
|
|
|
|
|
|
|
|
|
// Verify node was created - the default type is "fact"
|
|
|
|
|
let node_id = result.unwrap()["nodeId"].as_str().unwrap().to_string();
|
|
|
|
|
let storage_lock = storage.lock().await;
|
|
|
|
|
let node = storage_lock.get_node(&node_id).unwrap().unwrap();
|
|
|
|
|
assert_eq!(node.node_type, "fact");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// SCHEMA TESTS
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_schema_has_required_fields() {
|
|
|
|
|
let schema_value = schema();
|
|
|
|
|
assert_eq!(schema_value["type"], "object");
|
|
|
|
|
assert!(schema_value["properties"]["content"].is_object());
|
|
|
|
|
assert!(schema_value["required"].as_array().unwrap().contains(&serde_json::json!("content")));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn test_schema_has_optional_fields() {
|
|
|
|
|
let schema_value = schema();
|
|
|
|
|
assert!(schema_value["properties"]["node_type"].is_object());
|
|
|
|
|
assert!(schema_value["properties"]["tags"].is_object());
|
|
|
|
|
assert!(schema_value["properties"]["source"].is_object());
|
|
|
|
|
}
|
|
|
|
|
}
|