mirror of
https://github.com/nearai/ironclaw.git
synced 2026-09-03 08:06:01 +08:00
fix(suggestions): type the run-profile id instead of a hand-mirrored literal
RunProfileId::suggestion_generation() joins ::scheduled_trigger() as a typed constructor; the loop-layer and product-layer crates each held their own "suggestion_generation" &str literal kept in sync only by an integration test (PR review, chatgpt-codex-connector/henrypark133). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -316,6 +316,10 @@ impl RunProfileId {
|
||||
Self::from_trusted_static("scheduled_trigger")
|
||||
}
|
||||
|
||||
pub fn suggestion_generation() -> Self {
|
||||
Self::from_trusted_static("suggestion_generation")
|
||||
}
|
||||
|
||||
pub fn is_interactive_default(&self) -> bool {
|
||||
self == &Self::interactive_default()
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ pub const SCHEDULED_TRIGGER_CAPABILITY_SURFACE_PROFILE_ID: &str = "scheduled_tri
|
||||
/// Capability-surface profile id for the suggestion-generation loop (#7038).
|
||||
/// Its policy shape is declared in [`BESPOKE_SURFACE_POLICY_SHAPES`] below.
|
||||
pub const SUGGESTION_GENERATION_CAPABILITY_SURFACE_PROFILE_ID: &str = "suggestion_generation";
|
||||
/// `RunProfileId` string for the suggestion-generation loop (#7038).
|
||||
pub const SUGGESTION_GENERATION_RUN_PROFILE_ID: &str = "suggestion_generation";
|
||||
|
||||
/// How a capability-surface profile reshapes the run's one resolved policy.
|
||||
///
|
||||
@@ -361,10 +359,8 @@ pub fn suggestion_generation_planned_profile_definition()
|
||||
-> Result<RunProfileDefinition, RunProfileRegistryError> {
|
||||
let descriptor = planned_driver_descriptor()
|
||||
.map_err(|reason| RunProfileRegistryError::InvalidProfile { reason })?;
|
||||
let profile_id = RunProfileId::new(SUGGESTION_GENERATION_RUN_PROFILE_ID)
|
||||
.map_err(|reason| RunProfileRegistryError::InvalidProfile { reason })?;
|
||||
planned_like_profile_definition(
|
||||
profile_id,
|
||||
RunProfileId::suggestion_generation(),
|
||||
descriptor,
|
||||
SUGGESTION_GENERATION_CAPABILITY_SURFACE_PROFILE_ID,
|
||||
)
|
||||
|
||||
@@ -1732,17 +1732,16 @@ mod tests {
|
||||
}
|
||||
|
||||
async fn suggestion_generation_run_context() -> LoopRunContext {
|
||||
use crate::planned_driver_factory::{
|
||||
SUGGESTION_GENERATION_RUN_PROFILE_ID, default_planned_run_profile_resolver,
|
||||
};
|
||||
use ironclaw_turns::RunProfileRequest;
|
||||
use crate::planned_driver_factory::default_planned_run_profile_resolver;
|
||||
use ironclaw_turns::{RunProfileId, RunProfileRequest};
|
||||
|
||||
let resolver =
|
||||
default_planned_run_profile_resolver().expect("planned resolver should build");
|
||||
let resolved = resolver
|
||||
.resolve_run_profile(
|
||||
RunProfileResolutionRequest::interactive_default().with_requested_run_profile(
|
||||
RunProfileRequest::new(SUGGESTION_GENERATION_RUN_PROFILE_ID).unwrap(),
|
||||
RunProfileRequest::new(RunProfileId::suggestion_generation().as_str())
|
||||
.unwrap(),
|
||||
),
|
||||
)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user