Bind frontier planning launches atomically
This commit is contained in:
parent
de3414c8c0
commit
6cbe47313c
13 changed files with 675 additions and 27 deletions
|
|
@ -144,11 +144,14 @@ pub use worker_launch::EpiphanyReorientWorkerLaunchDocument;
|
|||
pub use worker_launch::EpiphanyRoleWorkerLaunchDocument;
|
||||
pub use worker_launch::EpiphanyWorkerLaunchDocument;
|
||||
pub use worker_launch::REORIENT_WORKER_OUTPUT_CONTRACT_ID;
|
||||
pub use worker_launch::REPO_FRONTIER_PLANNING_CONTEXT_CONTRACT;
|
||||
pub use worker_launch::REPO_FRONTIER_PLANNING_CONTEXT_SCHEMA_VERSION;
|
||||
pub use worker_launch::REPO_FRONTIER_PROPOSAL_MODELING_CONTEXT_CONTRACT;
|
||||
pub use worker_launch::REPO_FRONTIER_PROPOSAL_MODELING_CONTEXT_SCHEMA_VERSION;
|
||||
pub use worker_launch::REPO_MODEL_CLAIM_REPAIR_CONTEXT_CONTRACT;
|
||||
pub use worker_launch::REPO_MODEL_CLAIM_REPAIR_CONTEXT_SCHEMA_VERSION;
|
||||
pub use worker_launch::ROLE_WORKER_OUTPUT_CONTRACT_ID;
|
||||
pub use worker_launch::RepoFrontierPlanningContextProjection;
|
||||
pub use worker_launch::RepoFrontierProposalModelingContextProjection;
|
||||
pub use worker_launch::RepoModelClaimRepairContextProjection;
|
||||
pub use worker_launch::build_reorient_job_launch_request;
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ pub const REPO_MODEL_CLAIM_REPAIR_CONTEXT_SCHEMA_VERSION: &str =
|
|||
"epiphany.worker.repo_model_claim_repair_context.v0";
|
||||
pub const REPO_MODEL_CLAIM_REPAIR_CONTEXT_CONTRACT: &str =
|
||||
"epiphany.repo_model_claim_repair_context.v0";
|
||||
pub const REPO_FRONTIER_PLANNING_CONTEXT_SCHEMA_VERSION: &str =
|
||||
"epiphany.worker.repo_frontier_planning_context.v0";
|
||||
pub const REPO_FRONTIER_PLANNING_CONTEXT_CONTRACT: &str =
|
||||
"epiphany.repo_frontier_planning_context.v0";
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase", tag = "documentKind")]
|
||||
|
|
@ -89,6 +93,8 @@ pub struct EpiphanyRoleWorkerLaunchDocument {
|
|||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub claim_repair_context: Option<RepoModelClaimRepairContextProjection>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub frontier_planning_context: Option<RepoFrontierPlanningContextProjection>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub active_subgoal_id: Option<String>,
|
||||
#[serde(default)]
|
||||
pub active_subgoals: Vec<EpiphanySubgoal>,
|
||||
|
|
@ -256,6 +262,45 @@ impl RepoModelClaimRepairContextProjection {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RepoFrontierPlanningContextProjection {
|
||||
pub schema_version: String,
|
||||
pub contract: String,
|
||||
pub request_id: String,
|
||||
pub model_revision: u64,
|
||||
pub model_hash: String,
|
||||
pub admission_receipt_id: String,
|
||||
pub frontier_item_id: String,
|
||||
pub frontier_item_hash: String,
|
||||
pub selected_organ: String,
|
||||
#[serde(default)]
|
||||
pub source_scope: Vec<String>,
|
||||
pub requested_at: String,
|
||||
pub runtime_id: String,
|
||||
pub thread_id: String,
|
||||
}
|
||||
|
||||
impl RepoFrontierPlanningContextProjection {
|
||||
pub(crate) fn from_request(request: &crate::RepoFrontierPlanningRequest) -> Self {
|
||||
Self {
|
||||
schema_version: REPO_FRONTIER_PLANNING_CONTEXT_SCHEMA_VERSION.into(),
|
||||
contract: REPO_FRONTIER_PLANNING_CONTEXT_CONTRACT.into(),
|
||||
request_id: request.request_id.clone(),
|
||||
model_revision: request.model_revision,
|
||||
model_hash: request.model_hash.clone(),
|
||||
admission_receipt_id: request.admission_receipt_id.clone(),
|
||||
frontier_item_id: request.frontier_item_id.clone(),
|
||||
frontier_item_hash: request.frontier_item_hash.clone(),
|
||||
selected_organ: request.selected_organ.clone(),
|
||||
source_scope: request.source_scope.clone(),
|
||||
requested_at: request.requested_at.clone(),
|
||||
runtime_id: request.runtime_id.clone(),
|
||||
thread_id: request.thread_id.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_reorient_job_launch_request(
|
||||
input: EpiphanyReorientLaunchRequestInput<'_>,
|
||||
) -> EpiphanyJobLaunchRequest {
|
||||
|
|
@ -298,6 +343,7 @@ pub fn build_reorient_job_launch_request(
|
|||
max_runtime_seconds: input.max_runtime_seconds,
|
||||
proposal_modeling_request_id: None,
|
||||
claim_repair_request_id: None,
|
||||
frontier_planning_request_id: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue