Collapse family review projections
This commit is contained in:
parent
7758f0703c
commit
d0a317bd10
2 changed files with 28 additions and 61 deletions
|
|
@ -740,9 +740,11 @@ fn run_coordinator(args: &Args) -> Result<Value> {
|
|||
"reviewResearchResult" | "reviewModelingResult" | "reviewVerificationResult" => {
|
||||
let role_id = role_id_for_coordinator_action(&action)
|
||||
.ok_or_else(|| anyhow!("unsupported review action {action}"))?;
|
||||
let current_work = epiphany_core::project_current_work(&runtime_store)?;
|
||||
if role_id == "research"
|
||||
&& let Some(job_id) =
|
||||
epiphany_core::current_frontier_research_review_job_id(&runtime_store)?
|
||||
&& current_work.research.stage
|
||||
== epiphany_core::RepoFrontierResearchLifecycleStage::ResultReady
|
||||
&& let Some(job_id) = current_work.research.worker_job_id.as_deref()
|
||||
{
|
||||
let result =
|
||||
epiphany_core::runtime_role_worker_result(&runtime_store, &job_id)?
|
||||
|
|
@ -778,10 +780,10 @@ fn run_coordinator(args: &Args) -> Result<Value> {
|
|||
continue;
|
||||
}
|
||||
if role_id == "verification"
|
||||
&& let Some(job_id) =
|
||||
epiphany_core::current_frontier_verification_review_job_id(
|
||||
&runtime_store,
|
||||
)?
|
||||
&& let Some(job_id) = current_work
|
||||
.verification
|
||||
.as_ref()
|
||||
.and_then(|work| work.attempt.review_job_id())
|
||||
{
|
||||
let result =
|
||||
epiphany_core::runtime_role_worker_result(&runtime_store, &job_id)?
|
||||
|
|
@ -817,8 +819,10 @@ fn run_coordinator(args: &Args) -> Result<Value> {
|
|||
continue;
|
||||
}
|
||||
if role_id == "modeling"
|
||||
&& let Some(job_id) =
|
||||
epiphany_core::current_proposal_modeling_review_job_id(&runtime_store)?
|
||||
&& let Some(job_id) = current_work
|
||||
.proposal_modeling
|
||||
.as_ref()
|
||||
.and_then(|work| work.attempt.review_job_id())
|
||||
{
|
||||
let result =
|
||||
epiphany_core::runtime_role_worker_result(&runtime_store, &job_id)?
|
||||
|
|
@ -854,8 +858,10 @@ fn run_coordinator(args: &Args) -> Result<Value> {
|
|||
continue;
|
||||
}
|
||||
if role_id == "modeling"
|
||||
&& let Some(job_id) =
|
||||
epiphany_core::current_body_modeling_review_job_id(&runtime_store)?
|
||||
&& let Some(job_id) = current_work
|
||||
.body_modeling
|
||||
.as_ref()
|
||||
.and_then(|work| work.attempt.review_job_id())
|
||||
{
|
||||
let result =
|
||||
epiphany_core::runtime_role_worker_result(&runtime_store, &job_id)?
|
||||
|
|
@ -891,10 +897,10 @@ fn run_coordinator(args: &Args) -> Result<Value> {
|
|||
continue;
|
||||
}
|
||||
if role_id == "modeling"
|
||||
&& let Some(job_id) =
|
||||
epiphany_core::current_frontier_verdict_modeling_review_job_id(
|
||||
&runtime_store,
|
||||
)?
|
||||
&& let Some(job_id) = current_work
|
||||
.frontier_verdict_modeling
|
||||
.as_ref()
|
||||
.and_then(|work| work.attempt.review_job_id())
|
||||
{
|
||||
let result =
|
||||
epiphany_core::runtime_role_worker_result(&runtime_store, &job_id)?
|
||||
|
|
|
|||
|
|
@ -86,6 +86,14 @@ pub struct EpiphanyAgentPassAttemptProjection {
|
|||
pub job_id: Option<String>,
|
||||
}
|
||||
|
||||
impl EpiphanyAgentPassAttemptProjection {
|
||||
pub fn review_job_id(&self) -> Option<&str> {
|
||||
(self.action == EpiphanyAgentPassContinuationAction::Review)
|
||||
.then_some(self.job_id.as_deref())
|
||||
.flatten()
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
|
||||
#[cultcache(
|
||||
type = "epiphany.mind.agent_pass_admission_refusal.v1",
|
||||
|
|
@ -1049,53 +1057,6 @@ fn current_proposal_modeling_work(
|
|||
Ok(None)
|
||||
}
|
||||
|
||||
pub fn current_body_modeling_review_job_id(store_path: impl AsRef<Path>) -> Result<Option<String>> {
|
||||
Ok(crate::project_current_work(store_path)?
|
||||
.body_modeling
|
||||
.filter(|work| work.attempt.action == EpiphanyAgentPassContinuationAction::Review)
|
||||
.and_then(|work| work.attempt.job_id))
|
||||
}
|
||||
|
||||
pub fn current_proposal_modeling_review_job_id(
|
||||
store_path: impl AsRef<Path>,
|
||||
) -> Result<Option<String>> {
|
||||
Ok(project_current_work(store_path)?
|
||||
.proposal_modeling
|
||||
.filter(|work| work.attempt.action == EpiphanyAgentPassContinuationAction::Review)
|
||||
.and_then(|work| work.attempt.job_id))
|
||||
}
|
||||
|
||||
pub fn current_frontier_verdict_modeling_review_job_id(
|
||||
store_path: impl AsRef<Path>,
|
||||
) -> Result<Option<String>> {
|
||||
Ok(project_current_work(store_path)?
|
||||
.frontier_verdict_modeling
|
||||
.filter(|work| work.attempt.action == EpiphanyAgentPassContinuationAction::Review)
|
||||
.and_then(|work| work.attempt.job_id))
|
||||
}
|
||||
|
||||
pub fn current_frontier_research_review_job_id(
|
||||
store_path: impl AsRef<Path>,
|
||||
) -> Result<Option<String>> {
|
||||
let mut cache = crate::runtime_spine_cache(store_path)?;
|
||||
cache.pull_all_backing_stores()?;
|
||||
let lifecycle = crate::runtime_spine::repo_frontier_research_lifecycle(&cache)?;
|
||||
Ok(
|
||||
(lifecycle.stage == crate::RepoFrontierResearchLifecycleStage::ResultReady)
|
||||
.then_some(lifecycle.worker_job_id)
|
||||
.flatten(),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn current_frontier_verification_review_job_id(
|
||||
store_path: impl AsRef<Path>,
|
||||
) -> Result<Option<String>> {
|
||||
Ok(project_current_work(store_path)?
|
||||
.verification
|
||||
.filter(|work| work.attempt.action == EpiphanyAgentPassContinuationAction::Review)
|
||||
.and_then(|work| work.attempt.job_id))
|
||||
}
|
||||
|
||||
pub(crate) fn frontier_planning_attempt_ordinal(request_id: &str, job_id: &str) -> Result<usize> {
|
||||
let prefix = format!("frontier-planning-{request_id}-attempt-");
|
||||
job_id
|
||||
|
|
|
|||
Reference in a new issue