Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
63 lines
2.2 KiB
Rust
63 lines
2.2 KiB
Rust
//! 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
|
|
}
|