Delete fixed routing and retention cargo
This commit is contained in:
parent
61238cfdb2
commit
ffd91c20e9
5 changed files with 27 additions and 33 deletions
|
|
@ -135,11 +135,7 @@ fn require_resident_git(executable: &str) -> Result<()> {
|
|||
|
||||
fn maintain_resident_runtime(args: &Args, state: &ResidentSelfState) -> Result<()> {
|
||||
retain_runtime_receipts(args, state)?;
|
||||
retain_resident_self_lifecycles(
|
||||
&args.state_store,
|
||||
args.retained_closed_lifecycles,
|
||||
Utc::now().timestamp_millis().max(0) as u64,
|
||||
)?;
|
||||
retain_resident_self_lifecycles(&args.state_store, args.retained_closed_lifecycles)?;
|
||||
retain_runtime_worker_attempts(args)?;
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ pub const EYES_SOURCE_LOOKUP_RECEIPT_TYPE: &str = "epiphany.eyes.source_lookup_r
|
|||
pub const EYES_EVIDENCE_PACKET_TYPE: &str = "epiphany.eyes.evidence_packet";
|
||||
pub const EYES_SOURCE_LOOKUP_RECEIPT_SCHEMA_VERSION: &str =
|
||||
"epiphany.eyes.source_lookup_receipt.v0";
|
||||
pub const EYES_EVIDENCE_PACKET_SCHEMA_VERSION: &str = "epiphany.eyes.evidence_packet.v1";
|
||||
pub const EYES_EVIDENCE_PACKET_SCHEMA_VERSION: &str = "epiphany.eyes.evidence_packet.v2";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
|
|
@ -58,26 +58,24 @@ pub struct EyesEvidencePacket {
|
|||
#[cultcache(key = 3)]
|
||||
pub source_job_id: String,
|
||||
#[cultcache(key = 4)]
|
||||
pub source_role_id: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub evidence_ids: Vec<String>,
|
||||
#[cultcache(key = 6)]
|
||||
#[cultcache(key = 5)]
|
||||
pub observation_ids: Vec<String>,
|
||||
#[cultcache(key = 7)]
|
||||
#[cultcache(key = 6)]
|
||||
pub source_refs: Vec<String>,
|
||||
#[cultcache(key = 8)]
|
||||
#[cultcache(key = 7)]
|
||||
pub summary: String,
|
||||
#[cultcache(key = 9)]
|
||||
#[cultcache(key = 8)]
|
||||
pub uncertainty: String,
|
||||
#[cultcache(key = 10)]
|
||||
#[cultcache(key = 9)]
|
||||
pub emitted_at: String,
|
||||
#[cultcache(key = 11)]
|
||||
#[cultcache(key = 10)]
|
||||
pub contract: String,
|
||||
#[cultcache(key = 12, default)]
|
||||
#[cultcache(key = 11, default)]
|
||||
pub source_lookup_receipt_ids: Vec<String>,
|
||||
#[cultcache(key = 13)]
|
||||
#[cultcache(key = 12)]
|
||||
pub research_request_id: String,
|
||||
#[cultcache(key = 14)]
|
||||
#[cultcache(key = 13)]
|
||||
pub decision_context_id: String,
|
||||
}
|
||||
|
||||
|
|
@ -129,7 +127,6 @@ pub fn eyes_evidence_packet_from_research_finding(
|
|||
packet_id,
|
||||
source_result_id: finding.runtime_result_id.clone().unwrap_or_default(),
|
||||
source_job_id: finding.runtime_job_id.clone().unwrap_or_default(),
|
||||
source_role_id: "research".to_string(),
|
||||
evidence_ids,
|
||||
observation_ids,
|
||||
source_refs,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ pub const PERSONA_CONVERSATION_RETENTION_PLAN_SCHEMA_VERSION: &str =
|
|||
pub struct PersonaSocialMention {
|
||||
pub id: String,
|
||||
pub target_role_id: String,
|
||||
pub target_agent_id: String,
|
||||
pub source_surface: String,
|
||||
pub channel_id: String,
|
||||
pub message_id: String,
|
||||
|
|
@ -146,7 +145,7 @@ pub struct PersonaTurnBlockedEvidence {
|
|||
pub bridge_receipt_sha256: Option<String>,
|
||||
}
|
||||
|
||||
pub const PERSONA_SOCIAL_MENTION_TYPE: &str = "epiphany.persona.social_mention.v1";
|
||||
pub const PERSONA_SOCIAL_MENTION_TYPE: &str = "epiphany.persona.social_mention.v2";
|
||||
pub const PERSONA_SOCIAL_TURN_REQUEST_TYPE: &str = "epiphany.persona.turn_request.v1";
|
||||
pub const PERSONA_SOCIAL_TURN_TERMINAL_TYPE: &str = "epiphany.persona.turn_terminal.v1";
|
||||
pub const PERSONA_SOCIAL_RETENTION_HEAD_TYPE: &str = "epiphany.persona.retention_head.v1";
|
||||
|
|
@ -175,7 +174,7 @@ pub struct PersonaSocialQueueMentionOptions {
|
|||
|
||||
#[derive(Clone, Debug, PartialEq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.persona.social_mention.v1",
|
||||
type = "epiphany.persona.social_mention.v2",
|
||||
schema = "PersonaSocialMentionDocument"
|
||||
)]
|
||||
pub struct PersonaSocialMentionDocument {
|
||||
|
|
@ -234,6 +233,11 @@ pub fn persona_social_cache(store_path: impl AsRef<Path>) -> Result<CultCache> {
|
|||
register_persona_social_types(&mut cache)?;
|
||||
let mut identities = HashSet::new();
|
||||
for envelope in SingleFileMessagePackBackingStore::new(store_path.as_ref()).pull_all()? {
|
||||
if envelope.r#type == "epiphany.persona.social_mention.v1" {
|
||||
return Err(anyhow!(
|
||||
"Persona social store contains an obsolete writable mention epoch"
|
||||
));
|
||||
}
|
||||
if !is_persona_social_type(&envelope.r#type) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -289,7 +293,6 @@ pub fn queue_persona_social_mention(
|
|||
mention: PersonaSocialMention {
|
||||
id: mention_id.clone(),
|
||||
target_role_id: options.target_role_id.clone(),
|
||||
target_agent_id: "epiphany.Persona".into(),
|
||||
source_surface: options.source_surface,
|
||||
channel_id: options.channel_id,
|
||||
message_id: options.message_id,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use std::collections::{BTreeSet, HashSet};
|
|||
use std::path::{Path, PathBuf};
|
||||
|
||||
pub const RESIDENT_SELF_STATE_KEY: &str = "resident-self";
|
||||
pub const RESIDENT_SELF_STATE_SCHEMA_VERSION: &str = "epiphany.resident_self.state.v2";
|
||||
pub const RESIDENT_SELF_STATE_SCHEMA_VERSION: &str = "epiphany.resident_self.state.v3";
|
||||
pub const RESIDENT_SELF_PRESSURE_SCHEMA_VERSION: &str = "epiphany.resident_self.pressure.v0";
|
||||
pub const RESIDENT_SELF_COORDINATOR_CONTINUATION_PRESSURE_KIND: &str =
|
||||
"coordinator-internal-continuation";
|
||||
|
|
@ -24,7 +24,7 @@ pub const RESIDENT_SELF_TERMINAL_RECEIPT_SCHEMA_VERSION: &str =
|
|||
"epiphany.resident_self.terminal_receipt.v1";
|
||||
pub const RESIDENT_SELF_CHILD_CLAIM_SCHEMA_VERSION: &str = "epiphany.resident_self.child_claim.v0";
|
||||
pub const RESIDENT_SELF_RETENTION_HEAD_SCHEMA_VERSION: &str =
|
||||
"epiphany.resident_self.retention_head.v0";
|
||||
"epiphany.resident_self.retention_head.v1";
|
||||
pub const RESIDENT_SELF_RETENTION_HEAD_KEY: &str = "resident-self-retention";
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
|
|
@ -239,7 +239,7 @@ pub struct ResidentSelfChildClaim {
|
|||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.resident_self.retention_head.v0",
|
||||
type = "epiphany.resident_self.retention_head.v1",
|
||||
schema = "ResidentSelfRetentionHead"
|
||||
)]
|
||||
pub struct ResidentSelfRetentionHead {
|
||||
|
|
@ -253,9 +253,7 @@ pub struct ResidentSelfRetentionHead {
|
|||
pub retired_envelope_count: u64,
|
||||
#[cultcache(key = 4)]
|
||||
pub retired_chain_digest: String,
|
||||
#[cultcache(key = 5)]
|
||||
pub retained_at_millis: u64,
|
||||
#[cultcache(key = 6, default)]
|
||||
#[cultcache(key = 5, default)]
|
||||
pub private_state_exposed: bool,
|
||||
}
|
||||
|
||||
|
|
@ -766,7 +764,9 @@ fn state_cache(path: &Path) -> Result<CultCache> {
|
|||
for envelope in SingleFileMessagePackBackingStore::new(path).pull_all()? {
|
||||
if matches!(
|
||||
envelope.r#type.as_str(),
|
||||
"epiphany.resident_self.heartbeat_grant.v0" | "epiphany.resident_self.terminal_ack.v0"
|
||||
"epiphany.resident_self.heartbeat_grant.v0"
|
||||
| "epiphany.resident_self.terminal_ack.v0"
|
||||
| "epiphany.resident_self.retention_head.v0"
|
||||
) {
|
||||
return Err(anyhow!(
|
||||
"resident Self store contains a pre-cut heartbeat lifecycle document"
|
||||
|
|
@ -2529,7 +2529,6 @@ pub fn resident_self_terminal_receipts(path: &Path) -> Result<Vec<ResidentSelfTe
|
|||
pub fn retain_resident_self_lifecycles(
|
||||
path: &Path,
|
||||
retain_closed: usize,
|
||||
now_millis: u64,
|
||||
) -> Result<Option<ResidentSelfRetentionHead>> {
|
||||
let cache = state_cache(path)?;
|
||||
let state = cache
|
||||
|
|
@ -2671,7 +2670,6 @@ pub fn retain_resident_self_lifecycles(
|
|||
head.retired_envelope_count + deletions.len() as u64
|
||||
}),
|
||||
retired_chain_digest: digest_parts(digest_inputs),
|
||||
retained_at_millis: now_millis,
|
||||
private_state_exposed: false,
|
||||
};
|
||||
let (replacement, _) = cache.prepare_entry(RESIDENT_SELF_RETENTION_HEAD_KEY, &head)?;
|
||||
|
|
@ -2715,7 +2713,7 @@ mod pressure_replay_tests {
|
|||
let store = temp.path().join("resident.cc");
|
||||
let cache = state_cache(&store)?;
|
||||
let mut state = ResidentSelfState::default();
|
||||
state.schema_version = "epiphany.resident_self.state.v1".into();
|
||||
state.schema_version = "epiphany.resident_self.state.v2".into();
|
||||
SingleFileMessagePackBackingStore::new(&store)
|
||||
.push(&cache.prepare_entry(RESIDENT_SELF_STATE_KEY, &state)?.0)?;
|
||||
let before = std::fs::read(&store)?;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ pub const COORDINATOR_RUN_RECEIPT_TYPE: &str = "epiphany.coordinator_run_receipt
|
|||
pub const RUNTIME_IDENTITY_KEY: &str = "self";
|
||||
pub const RUNTIME_SWARM_BINDING_KEY: &str = "runtime-swarm-binding";
|
||||
pub const RUNTIME_SWARM_BINDING_SCHEMA_VERSION: &str = "epiphany.runtime.swarm_binding.v1";
|
||||
pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v26";
|
||||
pub const RUNTIME_SPINE_SCHEMA_VERSION: &str = "epiphany.runtime_spine.v27";
|
||||
pub const EPIPHANY_RUNTIME_ROOT_SESSION_ID: &str = "epiphany-main";
|
||||
pub const RUNTIME_MODEL_EXECUTION_BINDING_SCHEMA_VERSION: &str =
|
||||
"epiphany.runtime.model_execution_binding.v0";
|
||||
|
|
|
|||
Reference in a new issue