Skip to main content

ijima_core/
mining.rs

1// Copyright (C) 2026 Industrial Algebra
2// SPDX-License-Identifier: Apache-2.0
3
4//! The mining review queue (ADR M2, M3).
5//!
6//! PendingReview extractions stage here, per namespace, before promotion to
7//! the memory palace. This keeps the palace (`store_memory`) clean of
8//! unreviewed entries. An operator with `mining:review` lists pending
9//! extractions, then accepts (→ promote to palace) or rejects (→ drop).
10
11use crate::{Memory, MemoryId};
12
13/// A staged extraction awaiting operator review.
14#[derive(Debug, Clone, PartialEq)]
15#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
16pub struct QueuedExtraction {
17    /// Stable id within the queue (e.g. `q_<ulid>`).
18    pub id: String,
19    /// The proposed memory (MemorySource::Mined).
20    pub memory: Memory,
21    /// Extraction confidence (0.0–1.0); determined Auto/PendingReview routing
22    /// and gives the reviewer context. Not stored on the promoted Memory.
23    pub confidence: f32,
24    /// The session the extraction was mined from (provenance for the reviewer).
25    pub source_session_id: String,
26    /// Epoch-secs string when the extraction was enqueued.
27    pub queued_at: String,
28}
29
30/// Outcome of accepting a queued extraction: the promoted memory's id.
31#[derive(Debug, Clone, PartialEq, Eq)]
32#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
33pub struct AcceptedExtraction {
34    /// The memory id now living in the palace.
35    pub memory_id: MemoryId,
36}