Add fixed Eyes research lane
This commit is contained in:
parent
18751933e0
commit
2b3b446489
31 changed files with 593 additions and 57 deletions
|
|
@ -1,6 +1,7 @@
|
|||
use epiphany_core::EPIPHANY_IMAGINATION_OWNER_ROLE;
|
||||
use epiphany_core::EPIPHANY_IMAGINATION_ROLE_BINDING_ID;
|
||||
use epiphany_core::EPIPHANY_MODELING_ROLE_BINDING_ID;
|
||||
use epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
|
||||
use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
|
||||
use epiphany_core::EPIPHANY_REORIENT_OWNER_ROLE;
|
||||
use epiphany_core::EPIPHANY_VERIFICATION_ROLE_BINDING_ID;
|
||||
|
|
@ -122,6 +123,18 @@ pub async fn derive_epiphany_coordinator_status(
|
|||
} else {
|
||||
(CoreEpiphanyCoordinatorRoleResultStatus::MissingState, None)
|
||||
};
|
||||
let (research_result_status, research_finding) = if let Some(state) = state {
|
||||
let snapshot = load_core_epiphany_role_result_snapshot(
|
||||
state,
|
||||
runtime_store_path,
|
||||
EpiphanyRoleResultRoleId::Research,
|
||||
EPIPHANY_RESEARCH_ROLE_BINDING_ID,
|
||||
)
|
||||
.await;
|
||||
(snapshot.status, snapshot.finding)
|
||||
} else {
|
||||
(CoreEpiphanyCoordinatorRoleResultStatus::MissingState, None)
|
||||
};
|
||||
let (verification_result_status, verification_finding) = if let Some(state) = state {
|
||||
let snapshot = load_core_epiphany_role_result_snapshot(
|
||||
state,
|
||||
|
|
@ -136,6 +149,7 @@ pub async fn derive_epiphany_coordinator_status(
|
|||
};
|
||||
let finding_signals = derive_coordinator_finding_signals(
|
||||
state,
|
||||
research_finding.as_ref(),
|
||||
modeling_finding.as_ref(),
|
||||
verification_finding.as_ref(),
|
||||
reorient_finding,
|
||||
|
|
@ -149,9 +163,13 @@ pub async fn derive_epiphany_coordinator_status(
|
|||
reorient_action: reorient_decision
|
||||
.map(|decision| decision.action)
|
||||
.unwrap_or(CoreEpiphanyReorientAction::Resume),
|
||||
research_result_status,
|
||||
modeling_result_status,
|
||||
verification_result_status,
|
||||
reorient_result_status,
|
||||
research_result_accepted: finding_signals.research_result_accepted,
|
||||
research_result_reviewable: finding_signals.research_result_reviewable,
|
||||
modeling_result_requests_regather: finding_signals.modeling_result_requests_regather,
|
||||
modeling_result_accepted: finding_signals.modeling_result_accepted,
|
||||
modeling_result_reviewable: finding_signals.modeling_result_reviewable,
|
||||
modeling_result_accepted_after_verification: finding_signals
|
||||
|
|
@ -363,10 +381,12 @@ pub fn map_epiphany_roles(
|
|||
reorient_result_status: result_status,
|
||||
reorient_job: reorient_job.map(map_core_role_board_job),
|
||||
imagination_binding_id: EPIPHANY_IMAGINATION_ROLE_BINDING_ID.to_string(),
|
||||
research_binding_id: EPIPHANY_RESEARCH_ROLE_BINDING_ID.to_string(),
|
||||
modeling_binding_id: EPIPHANY_MODELING_ROLE_BINDING_ID.to_string(),
|
||||
verification_binding_id: EPIPHANY_VERIFICATION_ROLE_BINDING_ID.to_string(),
|
||||
reorient_owner_role: EPIPHANY_REORIENT_OWNER_ROLE.to_string(),
|
||||
imagination_owner_role: EPIPHANY_IMAGINATION_OWNER_ROLE.to_string(),
|
||||
research_owner_role: epiphany_core::EPIPHANY_RESEARCH_OWNER_ROLE.to_string(),
|
||||
});
|
||||
|
||||
EpiphanyRoleBoardStatus { roles, source_jobs }
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ fn protocol_coordinator_source_signals(
|
|||
should_prepare_compaction: signals.should_prepare_compaction,
|
||||
reorient_action: protocol_reorient_action(signals.reorient_action),
|
||||
crrc_action: protocol_crrc_action(signals.crrc_action),
|
||||
research_result_status: protocol_role_result_status(signals.research_result_status),
|
||||
modeling_result_status: protocol_role_result_status(signals.modeling_result_status),
|
||||
verification_result_status: protocol_role_result_status(signals.verification_result_status),
|
||||
reorient_result_status: protocol_reorient_result_status(signals.reorient_result_status),
|
||||
|
|
@ -139,6 +140,7 @@ fn protocol_coordinator_role_id(role_id: CoreEpiphanyCoordinatorRoleId) -> Threa
|
|||
match role_id {
|
||||
CoreEpiphanyCoordinatorRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
|
||||
CoreEpiphanyCoordinatorRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
|
||||
CoreEpiphanyCoordinatorRoleId::Research => ThreadEpiphanyRoleId::Research,
|
||||
CoreEpiphanyCoordinatorRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
|
||||
CoreEpiphanyCoordinatorRoleId::Verification => ThreadEpiphanyRoleId::Verification,
|
||||
CoreEpiphanyCoordinatorRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,
|
||||
|
|
@ -187,6 +189,12 @@ fn protocol_coordinator_action(
|
|||
CoreEpiphanyCoordinatorAction::RegatherManually => {
|
||||
ThreadEpiphanyCoordinatorAction::RegatherManually
|
||||
}
|
||||
CoreEpiphanyCoordinatorAction::LaunchResearch => {
|
||||
ThreadEpiphanyCoordinatorAction::LaunchResearch
|
||||
}
|
||||
CoreEpiphanyCoordinatorAction::ReviewResearchResult => {
|
||||
ThreadEpiphanyCoordinatorAction::ReviewResearchResult
|
||||
}
|
||||
CoreEpiphanyCoordinatorAction::LaunchModeling => {
|
||||
ThreadEpiphanyCoordinatorAction::LaunchModeling
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ pub use epiphany_core::EPIPHANY_IMAGINATION_OWNER_ROLE;
|
|||
pub use epiphany_core::EPIPHANY_IMAGINATION_ROLE_BINDING_ID;
|
||||
pub use epiphany_core::EPIPHANY_MODELING_OWNER_ROLE;
|
||||
pub use epiphany_core::EPIPHANY_MODELING_ROLE_BINDING_ID;
|
||||
pub use epiphany_core::EPIPHANY_RESEARCH_OWNER_ROLE;
|
||||
pub use epiphany_core::EPIPHANY_RESEARCH_ROLE_BINDING_ID;
|
||||
pub use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
|
||||
pub use epiphany_core::EPIPHANY_REORIENT_OWNER_ROLE;
|
||||
pub use epiphany_core::EPIPHANY_VERIFICATION_OWNER_ROLE;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,17 @@ pub fn build_role_acceptance_update(
|
|||
}
|
||||
patch
|
||||
}
|
||||
EpiphanyRoleResultRoleId::Research => {
|
||||
let patch = parse_core_role_finding_state_patch(finding)?;
|
||||
let patch_errors = epiphany_core::research_role_state_patch_policy_errors(&patch);
|
||||
if !patch_errors.is_empty() {
|
||||
return Err(format!(
|
||||
"research role state patch is not acceptable: {}",
|
||||
patch_errors.join("; ")
|
||||
));
|
||||
}
|
||||
patch
|
||||
}
|
||||
EpiphanyRoleResultRoleId::Verification => EpiphanyRoleStatePatchDocument::default(),
|
||||
EpiphanyRoleResultRoleId::Implementation | EpiphanyRoleResultRoleId::Reorientation => {
|
||||
return Err(format!(
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ pub fn protocol_role_id_to_core(role_id: ThreadEpiphanyRoleId) -> EpiphanyRoleRe
|
|||
match role_id {
|
||||
ThreadEpiphanyRoleId::Implementation => EpiphanyRoleResultRoleId::Implementation,
|
||||
ThreadEpiphanyRoleId::Imagination => EpiphanyRoleResultRoleId::Imagination,
|
||||
ThreadEpiphanyRoleId::Research => EpiphanyRoleResultRoleId::Research,
|
||||
ThreadEpiphanyRoleId::Modeling => EpiphanyRoleResultRoleId::Modeling,
|
||||
ThreadEpiphanyRoleId::Verification => EpiphanyRoleResultRoleId::Verification,
|
||||
ThreadEpiphanyRoleId::Reorientation => EpiphanyRoleResultRoleId::Reorientation,
|
||||
|
|
@ -247,6 +248,7 @@ pub fn protocol_role_id_from_core(role_id: EpiphanyRoleResultRoleId) -> ThreadEp
|
|||
match role_id {
|
||||
EpiphanyRoleResultRoleId::Implementation => ThreadEpiphanyRoleId::Implementation,
|
||||
EpiphanyRoleResultRoleId::Imagination => ThreadEpiphanyRoleId::Imagination,
|
||||
EpiphanyRoleResultRoleId::Research => ThreadEpiphanyRoleId::Research,
|
||||
EpiphanyRoleResultRoleId::Modeling => ThreadEpiphanyRoleId::Modeling,
|
||||
EpiphanyRoleResultRoleId::Verification => ThreadEpiphanyRoleId::Verification,
|
||||
EpiphanyRoleResultRoleId::Reorientation => ThreadEpiphanyRoleId::Reorientation,
|
||||
|
|
|
|||
Reference in a new issue