phase29ak(p3): remove pattern8 static box filter from single_planner

This commit is contained in:
2025-12-29 15:00:51 +09:00
parent 9a686cd510
commit 655b968fb4
6 changed files with 72 additions and 20 deletions

View File

@ -43,10 +43,11 @@ pub(super) fn try_build_domain_plan(ctx: &LoopPatternContext) -> Result<Option<D
}
let planner_hit = try_take_planner(&planner_opt, rule_id);
let allow_pattern8 = !ctx.in_static_box;
let (plan_opt, log_none) = if planner_hit.is_some() {
(planner_hit, false)
} else {
(fallback_extract(ctx, rule_id)?, true)
(fallback_extract(ctx, rule_id, allow_pattern8)?, true)
};
let promotion_tag = if matches!(rule_id, PlanRuleId::Pattern2)
@ -65,21 +66,6 @@ pub(super) fn try_build_domain_plan(ctx: &LoopPatternContext) -> Result<Option<D
}
if let Some(domain_plan) = plan_opt {
// Phase 286 P3: Pattern8 static box filtering
// Plan extractors are pure (no builder access), so we filter here.
if matches!(rule_id, PlanRuleId::Pattern8) && ctx.in_static_box {
if ctx.debug {
trace::trace().debug(
"route/plan",
&format!(
"{} extracted but rejected: static box context (fallback to legacy)",
name
),
);
}
continue;
}
let log_msg = format!("route=plan strategy=extract pattern={}", name);
trace::trace().pattern("route", &log_msg, true);
return Ok(Some(domain_plan));
@ -116,6 +102,7 @@ fn try_take_planner(planner_opt: &Option<DomainPlan>, kind: PlanRuleId) -> Optio
fn fallback_extract(
ctx: &LoopPatternContext,
kind: PlanRuleId,
allow_pattern8: bool,
) -> Result<Option<DomainPlan>, String> {
match kind {
PlanRuleId::Pattern1 => extractors::pattern1::extract_pattern1_plan(ctx.condition, ctx.body),
@ -137,7 +124,12 @@ fn fallback_extract(
ctx.body,
&[],
),
PlanRuleId::Pattern8 => extractors::pattern8::extract_pattern8_plan(ctx.condition, ctx.body),
PlanRuleId::Pattern8 => {
if !allow_pattern8 {
return Ok(None);
}
extractors::pattern8::extract_pattern8_plan(ctx.condition, ctx.body)
}
PlanRuleId::Pattern9 => extractors::pattern9::extract_pattern9_plan(ctx.condition, ctx.body),
}
}