Skip to content

refactor(pipeline): split pipeline.ts (1658 lines) into per-surface modules #147

@liplus-lin-lay

Description

@liplus-lin-lay

観察

src/pipeline.ts が 1658 行に肥大化している。embedding pipeline / vector ID 生成 / ingest filter / hash utility / per-surface upsert (issue・doc・release・wiki・diff) など複数 surface が 1 ファイルに同居していて、Read / 修正の局所性が低い。

提案

機能別に per-surface モジュールに分割する。候補:

  • pipeline/embedding.ts (generateEmbedding, generateEmbeddingBatch, MAX_EMBEDDING_*)
  • pipeline/vector-id.ts (stableVectorId, vectorId, releaseVectorId, docVectorId, wikiDocVectorId, diffVectorId)
  • pipeline/ingest-filter.ts (isBotSender, isBodyTooShort, MIN_COMMENT_BODY_CHARS)
  • pipeline/hash.ts (computeBodyHash, prepareEmbeddingInput, base64UrlEncode)
  • pipeline/embed-issue.ts / embed-doc.ts / embed-release.ts (per-record upsert ロジック)

src/pipeline.ts は再エクスポートのみのバレルにする (consumer 側の import 修正を最小化)。

関連ファイル

  • src/pipeline.ts (split source)
  • src/webhook.ts, src/poller.ts (consumer — import 修正の可能性)
  • src/types.ts (型定義は変更なし想定)

優先度

低-中 — 実害なし、可読性 / 保守性向上目的。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement新機能・改善要望memoメモとして開始した状態。見出しは必要なものだけでよい

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions