Skip to content

Precompute dot_pointer for level_key (DSK-139)#180

Merged
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-139-dot-pointer-precompute
Jul 5, 2026
Merged

Precompute dot_pointer for level_key (DSK-139)#180
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-139-dot-pointer-precompute

Conversation

@daisuke8000

@daisuke8000 daisuke8000 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Precompute the serde JSON pointer when level_classify is constructed with a fixed --level-key.
  • Route Serde lookups through the cached pointer; keep the jaq dot-path walk unchanged.

Test plan

  • cargo test -p rustern-core --lib pipeline::level_classify

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • JSON のドットパス参照がより安定し、Serde で解析したデータからレベル情報を正しく取得しやすくなりました。
    • 一部のネストした値の参照で、より適切なパス解決を優先するようになりました。
    • レベル分類の既存動作は維持しつつ、入力形式の違いによる取得失敗を減らしました。

Build the dot-path JSON pointer once when level_classify is wired so
Serde-backed lines skip per-event pointer allocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e2f7b59b-4b56-4ddd-8e8e-ad982b92eb67

📥 Commits

Reviewing files that changed from the base of the PR and between 67623f8 and 0b76581.

📒 Files selected for processing (2)
  • crates/rustern-core/src/pipeline/level_classify.rs
  • crates/rustern-core/src/source/parsed_json.rs

📝 Walkthrough

Walkthrough

level_classifylevel_key から Serde JSON ポインタを事前計算し、level_str_at_dot_path_with_serde_pointer に渡すように変更された。ParsedJson には新メソッド level_str_at_dot_path_with_serde_pointer が追加され、既存の level_str_at_dot_path はこれに委譲する。ドットパス→JSONポインタ変換関数 dot_pointerjson_pointer_from_dot_path に改名され、可視性が pub(crate) に変更された。

Changes

ファイル 変更内容
crates/rustern-core/src/pipeline/level_classify.rs level_key から serde_level_pointer を事前計算し、レベル文字列取得呼び出しに渡すよう変更
crates/rustern-core/src/source/parsed_json.rs 新メソッド level_str_at_dot_path_with_serde_pointer 追加、dot_pointerjson_pointer_from_dot_path に改名・可視性変更

Sequence Diagram(s)

sequenceDiagram
  participant LevelClassify
  participant ParsedJson
  LevelClassify->>LevelClassify: json_pointer_from_dot_path(level_key)
  LevelClassify->>ParsedJson: level_str_at_dot_path_with_serde_pointer(key, pointer)
  alt pointerあり
    ParsedJson->>ParsedJson: Value::pointer(pointer)
  else pointerなし
    ParsedJson->>ParsedJson: json_pointer_from_dot_path(dot_path)して解決
  end
  ParsedJson-->>LevelClassify: レベル文字列 or None
Loading

関連する可能性のある課題

  • DSK-139: level_key のパス処理をポインタ事前計算方式に変更している点が一致
  • DSK-140: level_classify のドットパスレベル抽出最適化を直接扱っている点が一致

評価コメント: 重大度低。正しさの観点では、serde_pointer 未指定時のフォールバックが既存の json_pointer_from_dot_path 生成ロジックと同一であることを確認済みか要チェック。非同期処理・K8s・セキュリティへの影響なし。

🚥 Pre-merge checks | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning 内容は関連していますが、Conventional Commits の必須プレフィックスがなく要件未達です。 feat:/fix: などの Conventional Commits 形式にし、72文字以内で要点を具体化してください。
Description check ⚠️ Warning 概要とテストはありますが、テンプレート必須の「概要」「変更理由」セクションが不足しています。 テンプレート通りに「## 概要」「## 変更理由」を埋め、変更目的と理由を簡潔に追記してください。

Comment @coderabbitai help to get the list of available commands.

@daisuke8000
daisuke8000 merged commit 95d2ede into main Jul 5, 2026
3 checks passed
@daisuke8000
daisuke8000 deleted the fix/dsk-139-dot-pointer-precompute branch July 5, 2026 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant