Make frontier plan adoption canonical

This commit is contained in:
Meta Vens 2026-07-15 03:05:11 +01:00
commit f72228fe61
26 changed files with 2272 additions and 505 deletions

View file

@ -144,6 +144,8 @@ 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_PLAN_MIND_CONTEXT_CONTRACT;
pub use worker_launch::REPO_FRONTIER_PLAN_MIND_CONTEXT_SCHEMA_VERSION;
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;
@ -151,6 +153,7 @@ 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::RepoFrontierPlanMindContextProjection;
pub use worker_launch::RepoFrontierPlanningContextProjection;
pub use worker_launch::RepoFrontierProposalModelingContextProjection;
pub use worker_launch::RepoModelClaimRepairContextProjection;

View file

@ -38,6 +38,10 @@ 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";
pub const REPO_FRONTIER_PLAN_MIND_CONTEXT_SCHEMA_VERSION: &str =
"epiphany.worker.repo_frontier_plan_mind_context.v0";
pub const REPO_FRONTIER_PLAN_MIND_CONTEXT_CONTRACT: &str =
"epiphany.repo_frontier_plan_mind_context.v0";
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", tag = "documentKind")]
@ -95,6 +99,8 @@ pub struct EpiphanyRoleWorkerLaunchDocument {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub frontier_planning_context: Option<RepoFrontierPlanningContextProjection>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub frontier_plan_mind_context: Option<RepoFrontierPlanMindContextProjection>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub active_subgoal_id: Option<String>,
#[serde(default)]
pub active_subgoals: Vec<EpiphanySubgoal>,
@ -301,6 +307,32 @@ impl RepoFrontierPlanningContextProjection {
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RepoFrontierPlanMindContextProjection {
pub schema_version: String,
pub contract: String,
pub request: crate::RepoFrontierPlanMindRequest,
pub planning_request: crate::RepoFrontierPlanningRequest,
pub candidate: crate::RepoFrontierPlanCandidate,
}
impl RepoFrontierPlanMindContextProjection {
pub(crate) fn new(
request: &crate::RepoFrontierPlanMindRequest,
planning_request: &crate::RepoFrontierPlanningRequest,
candidate: &crate::RepoFrontierPlanCandidate,
) -> Self {
Self {
schema_version: REPO_FRONTIER_PLAN_MIND_CONTEXT_SCHEMA_VERSION.into(),
contract: REPO_FRONTIER_PLAN_MIND_CONTEXT_CONTRACT.into(),
request: request.clone(),
planning_request: planning_request.clone(),
candidate: candidate.clone(),
}
}
}
pub fn build_reorient_job_launch_request(
input: EpiphanyReorientLaunchRequestInput<'_>,
) -> EpiphanyJobLaunchRequest {
@ -344,6 +376,7 @@ pub fn build_reorient_job_launch_request(
proposal_modeling_request_id: None,
claim_repair_request_id: None,
frontier_planning_request_id: None,
frontier_plan_mind_request_id: None,
}
}