Skip to main content

ainl_graph_extractor/
lib.rs

1//! Graph extractor task: bump semantic `recurrence_count` from retrieval deltas, then run persona evolution.
2//!
3//! **Alpha:** API may change before 1.0.
4//!
5//! Persona evolution rows use [`ainl_persona::EVOLUTION_TRAIT_NAME`] — import that constant from `ainl-persona`
6//! when matching evolution bundles; do not duplicate the string.
7//!
8//! **Note:** [`GraphExtractorTask::evolution_engine`] is the canonical in-process handle to
9//! [`ainl_persona::EvolutionEngine`]. **ainl-runtime** exposes the same engine for direct
10//! `ingest_signals` / `correction_tick` / `evolve` calls; this crate’s `run_pass` is one signal path, not the only one.
11//!
12//! ## `run_pass` and [`ExtractionReport`]
13//!
14//! [`GraphExtractorTask::run_pass`] returns an [`ExtractionReport`] (not `Result<_, _>`): semantic /
15//! pattern / persona phases record errors in **`extract_error`**, **`pattern_error`**, and
16//! **`persona_error`** respectively. Use [`ExtractionReport::has_errors`] before treating a pass as
17//! clean. ArmaraOS **`GraphMemoryWriter::run_persona_evolution_pass`** surfaces the same struct
18//! and logs warnings for populated error slots.
19
20mod extractor;
21mod persona_signals;
22mod recurrence;
23mod runner;
24mod turn_extract;
25
26pub use ainl_persona::{AXIS_EVOLUTION_SNAPSHOT, EVOLUTION_TRAIT_NAME};
27pub use extractor::{ExtractionReport, GraphExtractorTask};
28pub use persona_signals::{
29    extract_pass, extract_pass_collect, flush_episode_pattern_tags, ExtractPassCollected,
30    PersonaSignalExtractorState,
31};
32pub use recurrence::update_semantic_recurrence;
33pub use runner::run_extraction_pass;
34pub use ainl_semantic_tagger::{tag_tool_names, SemanticTag, TagNamespace};
35pub use turn_extract::{extract_turn_semantic_tags_for_memory, TurnVitals};