aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,62 @@
//! Guardian's durable evidence storage, owned by the main thread.
//! Reviewer tools search a fixed board view and deliver the originals routed by the housekeeper.
//! The host owns review scheduling and the lifetime of each view.
//! Hosts invoke permanent-deletion cleanup only when Guardian V3 is enabled.
use akode_message_board::LocalBoard;
use akode_message_board::LocalBoardOptions;
use akode_protocol::SessionId;
use akode_state::SqliteConfig;
mod delivery;
mod evidence;
mod housekeeper;
mod retrieval_tools;
mod sampling;
mod selection;
mod subscription_tools;
pub use delivery::DeliveryPlan;
pub use delivery::DeliveryState;
pub use evidence::EvidenceCursor;
pub use evidence::EvidenceId;
pub use evidence::EvidenceSnapshot;
pub use evidence::OriginalEvidence;
pub use housekeeper::HOUSEKEEPER_INSTRUCTIONS;
pub use housekeeper::HOUSEKEEPER_TIMEOUT;
pub use housekeeper::Housekeeper;
pub use retrieval_tools::RetrievalBinding;
pub use retrieval_tools::install_retrieval_tools;
pub use sampling::HousekeeperResult;
pub use sampling::OperationResult;
pub use selection::CHANNEL_SELECTION_INSTRUCTIONS;
pub use selection::ReviewerSubscriptions;
const GUARDIAN_BOARD_NAMESPACE: &str = "guardian";
/// Storage selected by the Guardian consumer for setup, opening and cleanup.
pub fn local_board_options() -> LocalBoardOptions {
LocalBoardOptions {
storage_namespace: GUARDIAN_BOARD_NAMESPACE.into(),
}
}
/// Selects the board for the owning main thread, never the temporary reviewer or housekeeper.
/// Hosts use a read-write connection; reviewers use a read-only connection, which still
/// permits their own explicit subscriptions. Cleanup uses the same namespace and root identity.
pub fn local_board(sqlite: SqliteConfig, root: SessionId) -> LocalBoard {
LocalBoard::new(sqlite, root).with_options(local_board_options())
}
/// Permanently deletes evidence boards owned by these main threads.
/// Hosts invoke this only when Guardian V3 is enabled.
pub async fn delete_local_boards(
sqlite: &SqliteConfig,
roots: &[SessionId],
) -> akode_protocol::error::Result<()> {
akode_message_board::LocalAgentMessageBoard::delete_boards(
sqlite,
&local_board_options(),
roots,
)
.await
}