Skip to content

feat(ingest): index issue comments, PR reviews, PR inline comments for memory DB #106

Description

@liplus-lin-lay

目的

github-rag-mcp を Lin/Lay の記憶 DB として機能させるため、判断履歴の主要容器であるコメント系を ingest 対象に追加する。現状 issue/PR body + commit + release + docs しか入っておらず、コメント欄での判断履歴 (Master の指摘、AI 応答、セルフレビュー now/later/accepted 分類) が retrieval から欠落している。

前提 (検証済み 2026-04-23)

  • liplus-rag-mcp GitHub App の permission は Issues Read-only (related comments 含む) / Pull requests Read-only (related comments 含む) を grant 済。許可面は揃っている。
  • 現状の ingest パイプライン (src/webhook.ts / src/pipeline.ts / src/poller.ts) は issue / pull_request / release / push のみ処理。issue_comment / pull_request_review / pull_request_review_comment のハンドラなし。
  • 直前の v0.8.0 で tool surface を search_issues 1 つに統合済み。追加する type 値は search_issues の type enum 拡張で透過的にアクセス可能。

制約

ingest 対象と type 分類

イベント 新規 type 値 内容
issue_comment (issues + PRs 両方の top-level コメント) issue_comment comment body
pull_request_review (submitted / edited / dismissed) pr_review review body (approve / request_changes / comment)
pull_request_review_comment (created / edited / deleted) pr_review_comment 行単位のインライン diff コメント

bot フィルタ (必須)

  • sender.login が /\[bot\]$/ に match する場合は ingest しない (例: cloudflare-workers-and-pages[bot], github-actions[bot], dependabot[bot], liplus-rag-mcp[bot])
  • フィルタは webhook ハンドラ側と poller 側の両方で適用

最小文字数

  • comment body が 10 文字未満 (trim 後) の場合はスキップ。絵文字のみ / LGTM 単独 / +1 等のノイズ排除

pipeline.ts 拡張

  • 新規関数: ingestIssueComment(...), ingestPRReview(...), ingestPRReviewComment(...)
  • 各関数で bodyHash による変更検知 + 無変化スキップ
  • embedding 入力 = author\n\n + comment/review body (top-level の context のため author を prefix)
  • IssueStore に新 key space (comment:{repo}:{id}, review:{repo}:{id}, review_comment:{repo}:{id})
  • Vectorize メタデータに既存スキーマと互換性のある形で type 追加

webhook.ts 拡張

  • eventType switch に 3 ケース追加 (issue_comment / pull_request_review / pull_request_review_comment)
  • action フィルタ: deleted の場合は IssueStore からの削除 + Vectorize 削除 (レコード消失の伝播)

poller.ts 拡張 (backfill)

  • 既存の recent issues/PRs/releases/commits poll に加え、recent-activity window 内の comments backfill
  • API 呼び出し最適化: /issues/{N}/comments は issue ごとに 1 回 / /pulls/{N}/reviews / /pulls/{N}/comments も PR ごとに 1 回
  • ratelimit 配慮: POLL_REPOS の件数 × 最近 N 件の issue/PR 分の API 呼び出しが増える。必要なら per-repo 件数で cap

search_issues の type enum 拡張

  • 既存: "issue" / "pull_request" / "release" / "doc" / "diff" / "all"
  • 追加: "issue_comment" / "pr_review" / "pr_review_comment"
  • "all" は全 type を含む semantics のまま維持

GitHub App webhook 購読 (merge 後の手動設定)

  • GitHub App liplus-rag-mcp の "Subscribe to events" で以下 3 つを有効化必要:
    • Issue comment
    • Pull request review
    • Pull request review comment
  • これは Master がダッシュボードで有効化する設定変更。コード側では対応ロジックだけ用意する。

Docs 更新

  • README.md / README.ja.md の search_issues パラメータ表で type enum を新 3 値含む形に更新
  • 新 type 値の説明と使用例を追記

Target files

  • src/webhook.ts — 3 ケース追加
  • src/poller.ts — backfill 3 経路追加
  • src/pipeline.ts — ingest 関数 3 つ + bot フィルタ helper
  • src/types.ts — 新レコード型定義
  • src/store.ts — key space 追加 (必要に応じて)
  • src/mcp.ts — search_issues の type enum 拡張
  • README.md / README.ja.md — type 表更新

範囲

minor (新しい ingest type = user/system observable な新機能)

リリース後の手動ステップ

merge 後、Master が GitHub App ダッシュボード (https://github.com/settings/apps/liplus-rag-mcp/permissions) の "Subscribe to events" で以下を有効化:

  • Issue comment ✓
  • Pull request review ✓
  • Pull request review comment ✓

poller の next tick で既存 comments は backfill される (hourly cron trigger)。webhook による realtime ingest は購読設定後から効く。

関連

  • 判断記録候補: 本件 merge 後に docs/f.-*.md として判断記録化を検討 (Li+ 記憶 DB の前提設計がここで固まる)
  • 前段: PR #105 (v0.8.0、tool surface 1 化)

Activity

  1. added this to the milestone on Apr 23, 2026
  2. added
    enhancement新機能・改善要望
    ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能
    specLi+の挙動に影響する仕様・ポリシー・定義
    on Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancement新機能・改善要望ready本文が実装開始できる形まで収束している状態。ただし更新は継続可能specLi+の挙動に影響する仕様・ポリシー・定義

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions