Skip to content

Replace exit_watch .then(async) with .map (DSK-130)#171

Merged
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-130-exit-watch-map
Jul 5, 2026
Merged

Replace exit_watch .then(async) with .map (DSK-130)#171
daisuke8000 merged 1 commit into
mainfrom
fix/dsk-130-exit-watch-map

Conversation

@daisuke8000

@daisuke8000 daisuke8000 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Switch exit_watch_message and exit_watch_level from .then(async) to .map for synchronous regex/level checks.

Test plan

  • cargo test -p rustern-core --lib pipeline::exit_watch
  • Local CodeRabbit review (0 findings)

Made with Cursor

Summary by CodeRabbit

  • Bug Fixes
    • 終了検知メッセージとレベル判定の処理を整理し、同じ条件でより安定して判定されるようになりました。
    • 既存の動作(メッセージ一致/レベル到達時の発火、出力内容)はそのまま維持されています。

Use synchronous map for exit-on-message and exit-on-level stages instead of per-item futures.

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: 9180d174-19e8-4f5b-839c-1a129f7b29fc

📥 Commits

Reviewing files that changed from the base of the PR and between fe1a1ca and 0fc811b.

📒 Files selected for processing (1)
  • crates/rustern-core/src/pipeline/exit_watch.rs

📝 Walkthrough

Walkthrough

exit_watch_message と exit_watch_level の実装が、then + async move によるストリーム処理から map による同期処理に変更されました。各要素ごとの state/patterns の clone 処理が削除され、同じクロージャ内で条件判定と state.fire() 呼び出しを同期的に行い、元要素をそのまま返す構造になりました。公開シグネチャ、ストリームのアイテム/エラー型、発火条件は変更されていません。

Changes

重大度 内容
Low then(async move)map への変更。ロジック・発火条件は同一で、無駄な非同期clone処理を排除した挙動最適化に留まる。async実行やK8s/セキュリティへの影響は確認されない。

Sequence Diagram(s)

省略(フロー変更が単純な同期化のため図解不要)

Possibly related issues

  • DSK-130: exit_watch_message / exit_watch_level の .then(async).map への同一のリファクタリングを扱っており、本PRの変更内容と直接一致する。
🚥 Pre-merge checks | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning Conventional Commitsの接頭辞がなく、要件の形式に合っていません。 refactor: exit_watch .then(async) を .map に置換 のように、72文字以内でConventional Commits形式にしてください。
Description check ⚠️ Warning 概要はありますが、テンプレート必須の「## 変更理由」がなく、構成も一致していません。 ## 概要## 変更理由 を追加し、変更目的と理由を日本語で埋めてください。

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

@daisuke8000
daisuke8000 merged commit a142ed4 into main Jul 5, 2026
3 checks passed
@daisuke8000
daisuke8000 deleted the fix/dsk-130-exit-watch-map branch July 5, 2026 08:53
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