phase29aj(p0): expose planner outcome facts for strict observability
This commit is contained in:
@ -17,7 +17,7 @@ Goal: promotion hint が付与されている事実を stable tag で固定し
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### Step 1: タグ出力を追加(planner採用時のみ)
|
||||
### Step 1: タグ出力を追加(planner outcome 参照)
|
||||
|
||||
ファイル:
|
||||
- `src/mir/builder/control_flow/plan/single_planner/rules.rs`
|
||||
@ -25,10 +25,13 @@ Goal: promotion hint が付与されている事実を stable tag で固定し
|
||||
実装位置:
|
||||
- `try_build_domain_plan()` の `if let Some(domain_plan) = plan_opt { ... }` 直前付近
|
||||
|
||||
補足:
|
||||
- planner outcome は `build_plan_with_facts()` の結果を使い、facts 直抽出はしない
|
||||
|
||||
ガード条件(全部満たすときだけ出す):
|
||||
- `entry.kind` が `RuleKind::Pattern2`
|
||||
- `crate::config::env::joinir_strict_enabled()` が true
|
||||
- `Pattern2LoopBodyLocalFacts` が取れる(planner 由来の promotion か、facts 直抽出)
|
||||
- `crate::config::env::joinir_dev::strict_enabled()` が true
|
||||
- `build_plan_with_facts()` の outcome から `Pattern2LoopBodyLocalFacts` が取れる
|
||||
|
||||
出力するタグ(stderr 推奨、1行固定):
|
||||
- TrimSeg: `[plan/pattern2/promotion_hint:TrimSeg]`
|
||||
@ -36,6 +39,7 @@ Goal: promotion hint が付与されている事実を stable tag で固定し
|
||||
|
||||
注意:
|
||||
- `trace::trace()` は `filter_noise()` で落ちるので `eprintln!` を使う
|
||||
- facts 直抽出は禁止(planner outcome だけを参照する)
|
||||
|
||||
### Step 2: integration smoke をタグ検証に昇格
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ Goal: pattern 名による分岐を外部APIから消し、Facts(事実)→
|
||||
|
||||
- 指示書: `docs/development/current/main/phases/phase-29ai/P15-OBSERVE-PATTERN2-PROMOTION_HINT-INSTRUCTIONS.md`
|
||||
- ねらい: strict/dev のときだけ promotion hint を安定タグで観測できるようにする(挙動不変)
|
||||
- 完了: LoopBodyLocal facts が取れたときに `[plan/pattern2/promotion_hint:{TrimSeg|DigitPos}]` を出力し、2 本をタグ検証に昇格
|
||||
- 完了: planner outcome から LoopBodyLocal facts を参照して `[plan/pattern2/promotion_hint:{TrimSeg|DigitPos}]` を出力し、2 本をタグ検証に昇格
|
||||
- 検証: `cargo build --release` / `./tools/smokes/v2/run.sh --profile quick` / `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
|
||||
|
||||
## Verification (SSOT)
|
||||
|
||||
@ -0,0 +1,93 @@
|
||||
# Phase 29aj P0: PlannerOutcome(Facts+Plan)SSOT
|
||||
|
||||
Date: 2025-12-29
|
||||
Status: Ready for execution
|
||||
Scope: planner API 拡張(互換維持)+ single_planner の観測を outcome SSOT に統一
|
||||
Goal: facts の直抽出を撤去し、strict/dev 観測が planner outcome の facts に依存する状態へ
|
||||
|
||||
## Objective
|
||||
|
||||
- single_planner が観測タグのために facts を再スキャンする状態をやめる
|
||||
- planner が plan が None でも facts を返せるようにし、観測 SSOT を planner に固定する
|
||||
- 既定挙動・エラー文字列は不変(strict/dev の観測タグのみ対象)
|
||||
|
||||
## Non-goals
|
||||
|
||||
- Pattern2 LoopBodyLocal を planner 経路で実際に lowering する(P1 以降)
|
||||
- 新しい env var 追加
|
||||
- タグ文字列の変更(`[plan/pattern2/promotion_hint:{TrimSeg|DigitPos}]` 維持)
|
||||
|
||||
## Target Architecture
|
||||
|
||||
- planner API 追加(互換維持)
|
||||
- 既存: `build_plan(condition, body) -> Result<Option<DomainPlan>, Freeze>`
|
||||
- 追加: `build_plan_with_facts(condition, body) -> Result<PlanBuildOutcome, Freeze>`
|
||||
- single_planner は `build_plan_with_facts()` を 1 回だけ呼び、観測は outcome.facts 参照のみ
|
||||
|
||||
## PlanBuildOutcome(新設)
|
||||
|
||||
推奨ファイル:
|
||||
- `src/mir/builder/control_flow/plan/planner/outcome.rs`
|
||||
|
||||
構造(例):
|
||||
- `facts: Option<CanonicalLoopFacts>`
|
||||
- `plan: Option<DomainPlan>`
|
||||
- `chosen_rule: Option<&'static str>`(任意。未使用なら None)
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### Step 1: planner outcome の追加(互換維持)
|
||||
|
||||
Files:
|
||||
- `src/mir/builder/control_flow/plan/planner/mod.rs`
|
||||
- `src/mir/builder/control_flow/plan/planner/outcome.rs`
|
||||
|
||||
やること:
|
||||
- PlanBuildOutcome を追加
|
||||
- `build_plan_with_facts()` 実装:
|
||||
1. `try_build_loop_facts(condition, body)?`
|
||||
2. `canonicalize_loop_facts(facts)` → outcome.facts に格納
|
||||
3. `build_plan_from_facts(canonical)` → outcome.plan に格納
|
||||
- 既存 `build_plan()` は互換用に `build_plan_with_facts().map(|o| o.plan)` へ委譲
|
||||
|
||||
注意:
|
||||
- plan が None でも facts は Some になり得る(観測のために重要)
|
||||
|
||||
### Step 2: single_planner を outcome SSOT に統一
|
||||
|
||||
Files:
|
||||
- `src/mir/builder/control_flow/plan/single_planner/rules.rs`
|
||||
|
||||
やること:
|
||||
- planner 呼び出しを `build_plan_with_facts()` に置換し memoize 維持
|
||||
- P15 で入った facts 直抽出を撤去
|
||||
- タグ判定は outcome.facts のみ参照
|
||||
|
||||
### Step 3: smoke は現状維持
|
||||
|
||||
Files:
|
||||
- `tools/smokes/v2/profiles/integration/apps/phase29ab_pattern2_loopbodylocal_seg_min_vm.sh`
|
||||
- `tools/smokes/v2/profiles/integration/apps/phase29ab_pattern2_loopbodylocal_min_vm.sh`
|
||||
|
||||
やること:
|
||||
- 変更なし(タグ必須のまま PASS すること)
|
||||
|
||||
### Step 4: docs / CURRENT_TASK 更新
|
||||
|
||||
Files:
|
||||
- `docs/development/current/main/phases/phase-29ai/README.md`(P15 の観測が planner outcome 参照になったこと)
|
||||
- `docs/development/current/main/phases/phase-29ai/P15-...INSTRUCTIONS.md`(facts直抽出禁止の追記)
|
||||
- `docs/development/current/main/10-Now.md`
|
||||
- `docs/development/current/main/30-Backlog.md`
|
||||
- `CURRENT_TASK.md`
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- `cargo build --release`
|
||||
- `./tools/smokes/v2/run.sh --profile quick`(154/154 PASS)
|
||||
- `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh` PASS
|
||||
- single_planner に facts 直抽出が残っていない
|
||||
|
||||
## Commit
|
||||
|
||||
- `git add -A && git commit -m "phase29aj(p0): expose planner outcome facts for strict observability"`
|
||||
16
docs/development/current/main/phases/phase-29aj/README.md
Normal file
16
docs/development/current/main/phases/phase-29aj/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Phase 29aj: PlannerOutcome observability SSOT
|
||||
|
||||
Goal: planner の facts/plan を 1 本の outcome に集約し、観測の SSOT を planner 側に固定する(仕様不変)。
|
||||
|
||||
## P0: PlannerOutcome(Facts+Plan)SSOT
|
||||
|
||||
- 指示書: `docs/development/current/main/phases/phase-29aj/P0-PLANNER-OUTCOME-SSOT-INSTRUCTIONS.md`
|
||||
- ねらい: single_planner の観測が planner outcome の facts だけに依存する状態へ統一
|
||||
- 完了: build_plan_with_facts を追加し、single_planner のタグ出力は outcome.facts 参照に収束
|
||||
- 検証: `cargo build --release` / `./tools/smokes/v2/run.sh --profile quick` / `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
|
||||
|
||||
## Verification (SSOT)
|
||||
|
||||
- `cargo build --release`
|
||||
- `./tools/smokes/v2/run.sh --profile quick`
|
||||
- `./tools/smokes/v2/profiles/integration/joinir/phase29ae_regression_pack_vm.sh`
|
||||
Reference in New Issue
Block a user