refactor(intelligence): 旧スキル taxonomy を撤去し ADR-0016 基盤へ一本化#444
Conversation
ADR-0016 の「既存決定論パイプラインを本基盤へ段階移行」を完了。 旧辞書ベースのスキル抽出(skill_extractor / skill_taxonomy)を撤去し、 live 経路を skills.aggregate_skills(3層モデル)に一本化する。 - pipeline.aggregate_intelligence を detected_skills 受け取りに変更 - unique_skills は言語スキル(kind=language)の件数のみで算出 - デッドコード run_pipeline と extract_skills 依存を除去 - github_link_service: detected_skills を先に算出して渡す順序に変更 - skill_extractor.py / skill_taxonomy/(5ファイル)を削除 - dashboard: 統計カードのラベルを「スキル」→「言語」に変更 - test_github_link を新シグネチャのテストへ置換 - architecture.md / ADR-0016 改訂履歴を更新 API 契約(GitHubLinkResponse)は不変。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughRemoves the deterministic ChangesSkill Pipeline Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
backend/app/services/intelligence/pipeline.py (1)
2-9: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win「決定論的 / 純粋関数」という表現は今の実装とズレています。
IntelligenceResult.analyzed_atを内部でdatetime.now()から生成しているので、出力は時刻依存です。ここは「I/O なしの集計関数」に留めるか、純粋性を本当に担保したいなら時刻を呼び出し側から注入したほうがよいです。Also applies to: 33-44
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/app/services/intelligence/pipeline.py` around lines 2 - 9, The module docstring and aggregate flow in pipeline.py claim the intelligence pipeline is deterministic/pure, but IntelligenceResult.analyzed_at is currently derived from datetime.now(), making the output time-dependent. Update the implementation around the aggregation function and IntelligenceResult construction so analyzed_at is injected from the caller (or otherwise removed from this pure aggregation path), and revise the wording near the pipeline docstring/aggregate entrypoint to describe it as an I/O-free aggregation step rather than a pure function.backend/tests/test_github_link.py (1)
88-123: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win新しい
detected_skills受け渡しの疎通テストを 1 本だけ残したいです。今の追加分は
aggregate_intelligence単体の振る舞いは押さえていますが、この PR の主変更であるbackend/app/services/intelligence/github_link_service.pyでのaggregate_skills(...) -> aggregate_intelligence(...)の受け渡し自体は未カバーです。軽い mock ベースのrun_github_linkテストが 1 本あると、この配線変更の回帰を拾いやすいです。🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@backend/tests/test_github_link.py` around lines 88 - 123, Add one lightweight wiring test for the new detected_skills path: the current tests cover aggregate_intelligence behavior, but not the handoff from aggregate_skills(...) to aggregate_intelligence(...) inside run_github_link in github_link_service. Add a mock-based test around run_github_link that verifies detected skills returned by aggregate_skills are passed through to aggregate_intelligence, so this PR’s plumbing change is covered. Use the existing run_github_link and aggregate_intelligence symbols to keep the test focused on the integration point.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@backend/app/services/intelligence/pipeline.py`:
- Around line 2-9: The module docstring and aggregate flow in pipeline.py claim
the intelligence pipeline is deterministic/pure, but
IntelligenceResult.analyzed_at is currently derived from datetime.now(), making
the output time-dependent. Update the implementation around the aggregation
function and IntelligenceResult construction so analyzed_at is injected from the
caller (or otherwise removed from this pure aggregation path), and revise the
wording near the pipeline docstring/aggregate entrypoint to describe it as an
I/O-free aggregation step rather than a pure function.
In `@backend/tests/test_github_link.py`:
- Around line 88-123: Add one lightweight wiring test for the new
detected_skills path: the current tests cover aggregate_intelligence behavior,
but not the handoff from aggregate_skills(...) to aggregate_intelligence(...)
inside run_github_link in github_link_service. Add a mock-based test around
run_github_link that verifies detected skills returned by aggregate_skills are
passed through to aggregate_intelligence, so this PR’s plumbing change is
covered. Use the existing run_github_link and aggregate_intelligence symbols to
keep the test focused on the integration point.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: dd4415bc-2e62-4aa2-abc3-f0bd128cc5ad
📒 Files selected for processing (12)
.claude/rules/backend/architecture.mdbackend/app/services/intelligence/github_link_service.pybackend/app/services/intelligence/pipeline.pybackend/app/services/intelligence/skill_extractor.pybackend/app/services/intelligence/skill_taxonomy/__init__.pybackend/app/services/intelligence/skill_taxonomy/classifier.pybackend/app/services/intelligence/skill_taxonomy/keyword_map.pybackend/app/services/intelligence/skill_taxonomy/language_map.pybackend/app/services/intelligence/skill_taxonomy/topic_map.pybackend/tests/test_github_link.pydocs/adr/0016-github-skill-inference.mdweb/src/components/github-link/GitHubLinkDashboard.tsx
💤 Files with no reviewable changes (6)
- backend/app/services/intelligence/skill_taxonomy/keyword_map.py
- backend/app/services/intelligence/skill_taxonomy/topic_map.py
- backend/app/services/intelligence/skill_extractor.py
- backend/app/services/intelligence/skill_taxonomy/init.py
- backend/app/services/intelligence/skill_taxonomy/language_map.py
- backend/app/services/intelligence/skill_taxonomy/classifier.py
- pipeline.aggregate_intelligence の docstring から「純粋関数」表現を外し、 analyzed_at が実行時刻依存(厳密には非純粋)である旨を明記 - run_github_link で aggregate_skills → aggregate_intelligence へ detected_skills が渡る配線を検証する単体テストを追加 挙動・API 契約・シグネチャは不変。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
概要
ADR-0016「GitHub 連携によるスキル推論基盤」の残タスクのうち タスク2(旧パイプライン撤去) を対応。ADR ステータス冒頭の「既存決定論パイプラインを本基盤へ段階移行」を完了させる。
旧辞書ベースのスキル抽出経路(
skill_extractor.py+skill_taxonomy/)が新基盤(skills/aggregate_skills→github_skillsテーブル)と並走していた状態を解消し、live 経路を新基盤に一本化する。変更内容
pipeline.py:aggregate_intelligence(username, repos, detected_skills)に刷新unique_skillsは検出 Layer1 のうち 言語スキル(kind=language)の件数のみで算出(package は含めない)repos_analyzed = len(repos)/languagesは従来通り Linguist バイト数を横断合算run_pipelineとextract_skills依存を除去github_link_service.py:detected_skillsを先に算出 →aggregate_intelligenceへ渡す順序に変更skill_extractor.py+skill_taxonomy/(5ファイル, 計 482行)GitHubLinkDashboard.tsx: 統計カードのラベルを「スキル」→「言語」に変更(言語のみの件数と意味を一致)test_github_link.pyの旧extract_skills/run_pipelineテストをaggregate_intelligence新シグネチャのテストへ置換architecture.mdの live 経路図、ADR-0016 改訂履歴を更新判断事項
skill_extractor.py+skill_taxonomy/5ファイルGitHubLinkResponseは不変unique_skillsのまま(中身は言語件数)。リネームは契約変更+codegen+フロント波及になるため見送り、表示ラベル「言語」で意味を担保テスト
make cigreen(backend lint+test / web 365 tests / build)関連
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes