Delete callerless helper APIs
This commit is contained in:
parent
d15404c57b
commit
5a0479446e
4 changed files with 0 additions and 90 deletions
|
|
@ -13,35 +13,6 @@ pub const EPIPHANY_VERIFICATION_OWNER_ROLE: &str = "epiphany-verifier";
|
|||
pub const EPIPHANY_REORIENT_LAUNCH_BINDING_ID: &str = "reorient-worker";
|
||||
pub const EPIPHANY_REORIENT_OWNER_ROLE: &str = "epiphany-reorient";
|
||||
|
||||
pub fn epiphany_role_binding_id(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
|
||||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_ROLE_BINDING_ID),
|
||||
EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_ROLE_BINDING_ID),
|
||||
EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_ROLE_BINDING_ID),
|
||||
EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_ROLE_BINDING_ID),
|
||||
EpiphanyRoleResultRoleId::Implementation => Err(
|
||||
"implementation is owned by the main coding agent; no role specialist launch template exists"
|
||||
.to_string(),
|
||||
),
|
||||
EpiphanyRoleResultRoleId::Reorientation => Err(
|
||||
"reorientation uses epiphany.coordinator.reorient.launch and epiphany.coordinator.reorient.result.read"
|
||||
.to_string(),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn epiphany_role_owner(role_id: EpiphanyRoleResultRoleId) -> Result<&'static str, String> {
|
||||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Imagination => Ok(EPIPHANY_IMAGINATION_OWNER_ROLE),
|
||||
EpiphanyRoleResultRoleId::Research => Ok(EPIPHANY_RESEARCH_OWNER_ROLE),
|
||||
EpiphanyRoleResultRoleId::Modeling => Ok(EPIPHANY_MODELING_OWNER_ROLE),
|
||||
EpiphanyRoleResultRoleId::Verification => Ok(EPIPHANY_VERIFICATION_OWNER_ROLE),
|
||||
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => {
|
||||
Err(epiphany_role_binding_id(role_id).unwrap_err())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn epiphany_role_label(role_id: EpiphanyRoleResultRoleId) -> &'static str {
|
||||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Implementation => "implementation",
|
||||
|
|
@ -760,17 +731,3 @@ pub fn epiphany_reorient_launch_output_schema() -> serde_json::Value {
|
|||
"additionalProperties": true
|
||||
})
|
||||
}
|
||||
|
||||
pub fn unique_strings(values: impl IntoIterator<Item = String>) -> Vec<String> {
|
||||
let mut unique = Vec::new();
|
||||
extend_unique_strings(&mut unique, values);
|
||||
unique
|
||||
}
|
||||
|
||||
fn extend_unique_strings(target: &mut Vec<String>, values: impl IntoIterator<Item = String>) {
|
||||
for value in values {
|
||||
if !target.iter().any(|existing| existing == &value) {
|
||||
target.push(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,11 +71,8 @@ pub use agent_launch::epiphany_frontier_verdict_modeling_output_schema;
|
|||
pub use agent_launch::epiphany_imagination_consideration_output_schema;
|
||||
pub use agent_launch::epiphany_proposal_modeling_output_schema;
|
||||
pub use agent_launch::epiphany_reorient_launch_output_schema;
|
||||
pub use agent_launch::epiphany_role_binding_id;
|
||||
pub use agent_launch::epiphany_role_label;
|
||||
pub use agent_launch::epiphany_role_launch_output_schema;
|
||||
pub use agent_launch::epiphany_role_owner;
|
||||
pub use agent_launch::unique_strings;
|
||||
pub use atlas::*;
|
||||
pub use causal_work_identity::*;
|
||||
pub use continuity_gateway::*;
|
||||
|
|
@ -347,7 +344,6 @@ pub use state_ledger::add_state_branch;
|
|||
pub use state_ledger::append_state_evidence;
|
||||
pub use state_ledger::close_state_branch;
|
||||
pub use state_ledger::load_state_ledger;
|
||||
pub use state_ledger::state_ledger_status;
|
||||
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
|
||||
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE;
|
||||
pub use substrate_gate::SubstrateGateRepoAccessGrantReceipt;
|
||||
|
|
|
|||
|
|
@ -2333,20 +2333,6 @@ pub fn validate_resident_self_prepared_objective(
|
|||
))
|
||||
}
|
||||
|
||||
pub fn validate_resident_self_coordinator_receipt(
|
||||
lease: &ResidentSelfTurnLease,
|
||||
coordinator: &crate::EpiphanyCoordinatorRunReceipt,
|
||||
) -> Result<()> {
|
||||
validate_resident_self_coordinator_receipt_binding(lease, coordinator)?;
|
||||
if !matches!(
|
||||
coordinator.status.as_str(),
|
||||
"planned" | "needsReview" | "completed"
|
||||
) {
|
||||
return Err(anyhow!("coordinator terminal receipt is not successful"));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn validate_resident_self_coordinator_receipt_binding(
|
||||
lease: &ResidentSelfTurnLease,
|
||||
coordinator: &crate::EpiphanyCoordinatorRunReceipt,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ use serde::Serialize;
|
|||
use serde_json::Value;
|
||||
use std::path::Path;
|
||||
|
||||
pub const STATE_LEDGER_STORE_TYPE: &str = "epiphany.state_ledger";
|
||||
pub const STATE_LEDGER_KEY: &str = "default";
|
||||
pub const STATE_LEDGER_SCHEMA_VERSION: &str = "epiphany.state_ledger.v0";
|
||||
|
||||
|
|
@ -43,34 +42,6 @@ pub struct EpiphanyLedgerEvidenceRecord {
|
|||
pub branch: Option<String>,
|
||||
}
|
||||
|
||||
pub fn state_ledger_status(store_path: impl AsRef<Path>) -> Result<Value> {
|
||||
let store_path = store_path.as_ref();
|
||||
if !store_path.exists() {
|
||||
return Ok(serde_json::json!({
|
||||
"ok": false,
|
||||
"present": false,
|
||||
"store": store_path,
|
||||
"entryType": STATE_LEDGER_STORE_TYPE,
|
||||
}));
|
||||
}
|
||||
let entry = load_state_ledger(store_path)?;
|
||||
let active = entry
|
||||
.branches
|
||||
.iter()
|
||||
.filter(|branch| branch.status == "active")
|
||||
.count();
|
||||
Ok(serde_json::json!({
|
||||
"ok": true,
|
||||
"present": true,
|
||||
"store": store_path,
|
||||
"entryType": STATE_LEDGER_STORE_TYPE,
|
||||
"branches": entry.branches.len(),
|
||||
"activeBranches": active,
|
||||
"evidence": entry.evidence.len(),
|
||||
"latestEvidence": entry.evidence.iter().rev().take(8).collect::<Vec<_>>(),
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn load_state_ledger(store_path: impl AsRef<Path>) -> Result<EpiphanyStateLedgerEntry> {
|
||||
let store_path = store_path.as_ref();
|
||||
let mut cache = state_ledger_cache(store_path)?;
|
||||
|
|
|
|||
Reference in a new issue