Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
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>
This commit is contained in:
50
akode-rs/ext/guardian-reviewer/src/context_mode.rs
Normal file
50
akode-rs/ext/guardian-reviewer/src/context_mode.rs
Normal file
@@ -0,0 +1,50 @@
|
||||
//! Reviewer policy carried by each history snapshot.
|
||||
//! Independent review retains its own transcript; other modes select checkpoint compatibility.
|
||||
|
||||
use akode_extension_api::ConversationHistorySnapshot;
|
||||
use akode_history::ResponseItemEnvelope;
|
||||
|
||||
/// Selects checkpoint-based, legacy, or independent reviewer history.
|
||||
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum GuardianContextMode {
|
||||
Legacy,
|
||||
/// Thread-owned authorization with a transcript independent of parent compaction.
|
||||
Independent,
|
||||
#[default]
|
||||
ThreadOwned,
|
||||
}
|
||||
|
||||
impl GuardianContextMode {
|
||||
/// Stable, bounded label for the context actually selected for a review.
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Legacy => "legacy",
|
||||
Self::Independent => "independent",
|
||||
Self::ThreadOwned => "thread_owned",
|
||||
}
|
||||
}
|
||||
|
||||
/// Read reviewer policy from the same snapshot as its evidence, including delayed reviews.
|
||||
pub fn from_history(history: &dyn ConversationHistorySnapshot) -> Self {
|
||||
if history.uses_independent_review_history() {
|
||||
Self::Independent
|
||||
} else if history.uses_parent_context_for_review() {
|
||||
Self::ThreadOwned
|
||||
} else {
|
||||
Self::Legacy
|
||||
}
|
||||
}
|
||||
|
||||
pub fn for_checkpoint(
|
||||
items: &[ResponseItemEnvelope],
|
||||
reviewer_compaction_hash: Option<&str>,
|
||||
) -> Self {
|
||||
if akode_history::CompactionCheckpoint::latest(items)
|
||||
.is_none_or(|checkpoint| checkpoint.is_compatible_with(reviewer_compaction_hash))
|
||||
{
|
||||
Self::ThreadOwned
|
||||
} else {
|
||||
Self::Legacy
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user