Archive completed model generations

This commit is contained in:
Meta Vens 2026-08-10 01:51:52 +01:00
commit c137e16ba5
8 changed files with 1262 additions and 115 deletions

View file

@ -13,10 +13,10 @@ use epiphany_core::{
load_resident_self_state, observe_process_instance, pending_resident_self_acks,
prepare_resident_self_launch, publish_resident_provider_readiness,
resident_prepared_launch_thread_id, resident_self_child_claim,
resident_self_local_provider_status, retain_coordinator_run_receipts,
retain_resident_self_lifecycles, settle_resident_self_exited_coordinator,
terminate_process_instance, validate_persona_feedback_store_separation,
validate_resident_self_store_separation,
resident_self_local_provider_status, retain_completed_model_sessions,
retain_coordinator_run_receipts, retain_resident_self_lifecycles,
settle_resident_self_exited_coordinator, terminate_process_instance,
validate_persona_feedback_store_separation, validate_resident_self_store_separation,
};
use serde_json::json;
use std::collections::{BTreeMap, BTreeSet};
@ -141,6 +141,11 @@ fn retain_runtime_receipts(args: &Args, state: &ResidentSelfState) -> Result<()>
&preserved,
&Utc::now().to_rfc3339(),
)?;
retain_completed_model_sessions(
&args.policy.runtime_store,
args.retained_completed_model_sessions,
&Utc::now().to_rfc3339(),
)?;
Ok(())
}
@ -449,6 +454,7 @@ struct Args {
provider_freshness_seconds: u64,
retained_closed_lifecycles: usize,
retained_coordinator_receipts: usize,
retained_completed_model_sessions: usize,
persona_feedback_source_store: PathBuf,
persona_feedback_store: PathBuf,
bifrost_feedback_trust_anchor: PathBuf,
@ -556,6 +562,9 @@ impl Args {
retained_coordinator_receipts: u64v("--retained-coordinator-receipts", 256)?
.try_into()
.context("--retained-coordinator-receipts exceeds platform size")?,
retained_completed_model_sessions: u64v("--retained-completed-model-sessions", 256)?
.try_into()
.context("--retained-completed-model-sessions exceeds platform size")?,
persona_feedback_source_store: path("--persona-feedback-source-store")?,
persona_feedback_store: path("--persona-feedback-store")?,
bifrost_feedback_trust_anchor: path("--bifrost-feedback-trust-anchor")?,

View file

@ -970,8 +970,11 @@ pub use repository_body_observer::*;
pub use repository_readiness::*;
pub use resident_readiness::*;
pub use resident_self::*;
pub use runtime_spine::ARCHIVED_RUNTIME_SESSION_SCHEMA_VERSION;
pub use runtime_spine::ARCHIVED_RUNTIME_SESSION_TYPE;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_SCHEMA_VERSION;
pub use runtime_spine::COORDINATOR_RUN_RECEIPT_TYPE;
pub use runtime_spine::EpiphanyArchivedRuntimeSession;
pub use runtime_spine::EpiphanyCoordinatorRunReceipt;
pub use runtime_spine::EpiphanyCoordinatorRunReceiptRetentionHead;
pub use runtime_spine::EpiphanyJobInterruptRequest;
@ -985,13 +988,13 @@ pub use runtime_spine::EpiphanyRuntimeJobResult;
pub use runtime_spine::EpiphanyRuntimeJobSnapshot;
pub use runtime_spine::EpiphanyRuntimeJobStatus;
pub use runtime_spine::EpiphanyRuntimeModelExecutionBinding;
pub use runtime_spine::EpiphanyRuntimeToolExecutionBinding;
pub use runtime_spine::EpiphanyRuntimeReorientWorkerResult;
pub use runtime_spine::EpiphanyRuntimeRoleWorkerResult;
pub use runtime_spine::EpiphanyRuntimeSession;
pub use runtime_spine::EpiphanyRuntimeSessionStatus;
pub use runtime_spine::EpiphanyRuntimeSpineStatus;
pub use runtime_spine::EpiphanyRuntimeSwarmBinding;
pub use runtime_spine::EpiphanyRuntimeToolExecutionBinding;
pub use runtime_spine::EpiphanyRuntimeWorkerLaunchRequest;
pub use runtime_spine::EpiphanyToolInvocationStatus;
pub use runtime_spine::PreparedRuntimeSpineHeartbeatJob;
@ -1002,8 +1005,6 @@ pub use runtime_spine::RUNTIME_JOB_RESULT_TYPE;
pub use runtime_spine::RUNTIME_JOB_TYPE;
pub use runtime_spine::RUNTIME_MODEL_EXECUTION_BINDING_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_MODEL_EXECUTION_BINDING_TYPE;
pub use runtime_spine::RUNTIME_TOOL_EXECUTION_BINDING_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_TOOL_EXECUTION_BINDING_TYPE;
pub use runtime_spine::RUNTIME_REORIENT_WORKER_RESULT_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_REORIENT_WORKER_RESULT_TYPE;
pub use runtime_spine::RUNTIME_ROLE_WORKER_RESULT_SCHEMA_VERSION;
@ -1012,6 +1013,8 @@ pub use runtime_spine::RUNTIME_SESSION_TYPE;
pub use runtime_spine::RUNTIME_SPINE_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_SWARM_BINDING_KEY;
pub use runtime_spine::RUNTIME_SWARM_BINDING_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_TOOL_EXECUTION_BINDING_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_TOOL_EXECUTION_BINDING_TYPE;
pub use runtime_spine::RUNTIME_WORKER_LAUNCH_REQUEST_SCHEMA_VERSION;
pub use runtime_spine::RUNTIME_WORKER_LAUNCH_REQUEST_TYPE;
pub use runtime_spine::RepoFrontierVerdictModelingLaunchAuthority;
@ -1029,6 +1032,7 @@ pub use runtime_spine::RuntimeTypedFulfillmentEvidence;
pub use runtime_spine::RuntimeTypedRequestRef;
pub use runtime_spine::amend_repo_frontier_execution;
pub use runtime_spine::append_runtime_event;
pub use runtime_spine::archive_completed_model_session;
pub use runtime_spine::bind_runtime_repository_domain;
pub use runtime_spine::bind_runtime_to_agent_memory_swarm;
pub use runtime_spine::canonical_repo_frontier_plan_candidate_id;
@ -1051,12 +1055,12 @@ pub use runtime_spine::ensure_runtime_session;
pub use runtime_spine::initialize_runtime_spine;
pub use runtime_spine::intake_user_repo_frontier_proposal;
pub use runtime_spine::migrate_legacy_repo_model_projection_obligation;
pub use runtime_spine::open_runtime_model_execution;
pub use runtime_spine::open_runtime_spine_heartbeat_job;
pub use runtime_spine::operator_repo_frontier_plan_review_is_current;
pub use runtime_spine::pending_repo_frontier_plan_reviews;
pub use runtime_spine::plan_runtime_spine_heartbeat_launch;
pub use runtime_spine::prepare_runtime_spine_heartbeat_job;
pub use runtime_spine::retain_coordinator_run_receipts;
pub use runtime_spine::promote_autonomous_direction_options_for_modeling;
pub use runtime_spine::put_continuity_recovery_receipt;
pub use runtime_spine::put_coordinator_run_receipt;
@ -1075,15 +1079,16 @@ pub use runtime_spine::put_repo_frontier_verification_request;
pub use runtime_spine::put_repo_frontier_work_proposal;
pub use runtime_spine::put_runtime_reorient_worker_result;
pub use runtime_spine::put_runtime_role_worker_result;
pub use runtime_spine::open_runtime_model_execution;
pub use runtime_spine::put_runtime_tool_execution_intent;
pub use runtime_spine::put_runtime_tool_execution_receipt;
pub use runtime_spine::put_soul_verdict_receipt;
pub use runtime_spine::put_substrate_gate_repo_access_grant_receipt;
pub use runtime_spine::relinquish_repo_frontier_hands_route;
pub use runtime_spine::replace_or_append_epiphany_job_binding;
pub use runtime_spine::runtime_continuity_recovery_receipt;
pub use runtime_spine::require_runtime_tool_execution_binding;
pub use runtime_spine::retain_completed_model_sessions;
pub use runtime_spine::retain_coordinator_run_receipts;
pub use runtime_spine::runtime_continuity_recovery_receipt;
pub use runtime_spine::runtime_current_repo_model;
pub use runtime_spine::runtime_eyes_evidence_packet;
pub use runtime_spine::runtime_hands_action_intent;

File diff suppressed because it is too large Load diff