Skip to content

add skills - #21

Open
kpj2006 wants to merge 36 commits into
AOSSIE-Org:mainfrom
kpj2006:main
Open

add skills#21
kpj2006 wants to merge 36 commits into
AOSSIE-Org:mainfrom
kpj2006:main

Conversation

@kpj2006

@kpj2006 kpj2006 commented Jul 25, 2026

Copy link
Copy Markdown
Member

Addressed Issues:

Fixes #(issue number)

Screenshots/Recordings:

Additional Notes:

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • New Features

    • Added automatic repository routing with an “unmapped intent” clarification flow.
    • Enriched responses with relevant external link details when available.
    • Introduced automated daily/manual subtree synchronization.
    • Added a complete security policy document.
    • Added extensive guidance, templates, and reference materials for key skills/repositories (including a GSoC Proposal Assistant).
  • Improvements

    • Strengthened guardrails against prompt injection and off-topic/malicious requests.
    • Enhanced thread handling and improved missed-message recovery.
  • Documentation

    • Expanded and scored the best-practices checklist with evidence.
  • Tests

    • Added routing smoke-check and end-to-end routing test harnesses.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@kpj2006, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 31 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 1fce6fd1-a3c8-400a-91d7-301811999380

📥 Commits

Reviewing files that changed from the base of the PR and between 4e10b54 and fa78af7.

📒 Files selected for processing (4)
  • .github/workflows/checklist-score.yml
  • BestPracticesChecklist.md
  • bot.py
  • repo_router.py

Walkthrough

The pull request adds repository-aware routing, dynamic repository context loading, clarification handling, automated context synchronization, extensive project guidance, security reporting guidance, and updated best-practices records.

Changes

Repository-aware bot flow

Layer / File(s) Summary
Repository routing and context loading
repo_metadata.py, repo_router.py
Repository metadata, keyword matching, LLM classification, context loading, GitHub link enrichment, and clarification messaging are added.
Message routing and clarification flow
.clinerules, bot.py, scripts/*routing*
Message processing resolves repositories through multiple signals, handles unmapped queries, limits thread history, enriches prompts, and includes routing smoke tests.
Context synchronization automation
scripts/update_subtrees.py, .github/workflows/sync-subtrees.yml
Configured context files are downloaded, required files checked, stale files removed, and scheduled or manual runs commit repository updates.

Project context corpus

Layer / File(s) Summary
Project context documentation
repos/GSoC-Proposal-Assistant/**/*, repos/OrgExplorer/**/*, repos/SocialShareButton/**/*, repos/Template-Repo-Main/README.md
Architecture, operational, agent, setup, testing, deployment, README, proposal, and usage guidance is added across supported repositories.

Governance records

Layer / File(s) Summary
Security and checklist records
SECURITY.md, BestPracticesChecklist.md, checklist-status.json, .github/workflows/checklist-score.yml
Security reporting guidance, checklist evidence, status data, and score-table replacement automation are added or updated.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Contributor
  participant DiscordBot
  participant RepoRouter
  participant Ollama
  participant RepositoryContext
  Contributor->>DiscordBot: submit query
  DiscordBot->>RepoRouter: detect repository
  RepoRouter->>Ollama: classify ambiguous query
  Ollama-->>RepoRouter: repository name or none
  RepoRouter->>RepositoryContext: load matching context
  RepositoryContext-->>DiscordBot: repository context
  DiscordBot-->>Contributor: contextual response or clarification
Loading

Suggested labels: Python Lang, Documentation

Poem

A rabbit hops through repos bright,
Finds the right path by moonlit light.
Context blooms and threads align,
Guardrails keep each answer fine.
Syncing leaves the burrow neat.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is related to the change but too generic to convey the main additions or scope. Use a specific title that names the main change, e.g. adding repo skills and routing/clarification support.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

@github-actions github-actions Bot added no-issue-linked PR is not linked to any issue backend Changes to backend code ci-cd CI/CD pipeline changes configuration Configuration file changes documentation Changes to documentation files github-actions GitHub Actions workflow changes javascript JavaScript/TypeScript code changes python Python code changes size/XL Extra large PR (>500 lines changed) repeat-contributor PR from an external contributor who already had PRs merged needs-review labels Jul 25, 2026
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor
Messages
📖

⚠️ PR Template Check

These are non-blocking, but please fix:

  • Please replace the placeholder Fixes #(issue number) with the actual issue number (e.g. Fixes #42).

  • Some required checklist items are not completed:

  • My PR addresses a single issue

  • My code follows the project's code style

  • My changes generate no new warnings or errors

Generated by 🚫 dangerJS against fa78af7

@kpj2006

kpj2006 commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@CodeRabbit review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

kpj2006 and others added 8 commits July 26, 2026 19:43
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
scripts/update_subtrees.py (2)

55-121: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Function complexity flagged by static analysis.

Ruff reports 16 branches (>12) and 52 statements (>50) for sync_repo_context. Consider extracting the per-file download loop and the stale-file deletion pass into separate helper functions to improve readability and testability.

🤖 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 `@scripts/update_subtrees.py` around lines 55 - 121, Reduce the complexity of
sync_repo_context by extracting the per-file download and required-file/error
tracking logic into a helper, and extracting the stale local-file deletion pass
into another helper. Keep sync_repo_context responsible for setup,
orchestration, final required-file validation, and success reporting, while
preserving the existing download, cleanup, logging, and return behavior.

Source: Linters/SAST tools


77-114: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Deletion policy wipes locally-synced files on transient errors, not just confirmed upstream removal.

downloaded_files only gets an entry on HTTP 200. Any non-404 HTTP error or transport exception (Lines 92-101) also fails to add the file, and the deletion loop (Lines 103-114) then deletes that file locally because rel_p not in downloaded_files — even though the remote file wasn't actually removed, just temporarily unreachable. Deletion also runs before the failed_required check, so it happens even when the overall sync is later reported as failed. A single flaky fetch can therefore permanently drop a previously-good context file until the next successful sync of that specific file.

🐛 Proposed fix: only delete files confirmed removed upstream (404), not files that merely failed to (re)download this run
     headers = {"User-Agent": "SkillBot-Context-Sync"}
     downloaded_files = set()
+    confirmed_removed = set()
     failed_required = []
     http_errors = 0
     transport_errors = 0

     for rel_file in KNOWN_CONTEXT_FILES:
         raw_url = f"https://raw.githubusercontent.com/{owner}/{repo}/{ref}/{rel_file}"
         try:
             res = client.get(raw_url, headers=headers)
             if res.status_code == 200:
                 ...
                 downloaded_files.add(rel_file)
             elif res.status_code == 404:
                 logger.debug(f"File not found on remote (404): {rel_file} for {repo_name}")
+                confirmed_removed.add(rel_file)
                 if rel_file in REQUIRED_CONTEXT_FILES:
                     ...
             else:
                 ...
         except Exception as e:
             ...

-    # Deletion policy: remove local files absent from KNOWN_CONTEXT_FILES or not downloaded in current sync
+    # Deletion policy: remove local files no longer tracked, or confirmed removed upstream (404).
+    # Do NOT delete files that merely failed to download this run due to a transient HTTP/transport error.
     known_set = set(KNOWN_CONTEXT_FILES)
     if target_dir.exists():
         for p in list(target_dir.rglob("*")):
             if p.is_file():
                 rel_p = p.relative_to(target_dir).as_posix()
-                if rel_p not in known_set or rel_p not in downloaded_files:
+                if rel_p not in known_set or rel_p in confirmed_removed:
                     try:
                         p.unlink()
🤖 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 `@scripts/update_subtrees.py` around lines 77 - 114, Update the deletion policy
in the sync loop so local files are removed only when they are absent from
KNOWN_CONTEXT_FILES or their fetch returned a confirmed 404. Do not use
downloaded_files to determine deletion, and preserve local files after transient
HTTP errors or transport exceptions; ensure deletion does not occur for files
whose fetch failed without confirming upstream removal.
🤖 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.

Inline comments:
In @.github/workflows/checklist-score.yml:
- Around line 130-136: Update the regex in the checklist content replacement
around formatted_table and new_content so its end lookahead targets a standalone
line containing only the horizontal rule, rather than the first --- within the
table separator row. Preserve the existing auto-update anchor and regenerate the
checklist to remove the duplicated malformed block.

In @.github/workflows/sync-subtrees.yml:
- Around line 25-27: Replace the literal <verified-full-commit-sha> placeholder
in the actions/setup-python step of the sync workflow with the full, verified
commit SHA for the intended setup-python v5 release, preserving the existing
python-version configuration.

---

Outside diff comments:
In `@scripts/update_subtrees.py`:
- Around line 55-121: Reduce the complexity of sync_repo_context by extracting
the per-file download and required-file/error tracking logic into a helper, and
extracting the stale local-file deletion pass into another helper. Keep
sync_repo_context responsible for setup, orchestration, final required-file
validation, and success reporting, while preserving the existing download,
cleanup, logging, and return behavior.
- Around line 77-114: Update the deletion policy in the sync loop so local files
are removed only when they are absent from KNOWN_CONTEXT_FILES or their fetch
returned a confirmed 404. Do not use downloaded_files to determine deletion, and
preserve local files after transient HTTP errors or transport exceptions; ensure
deletion does not occur for files whose fetch failed without confirming upstream
removal.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aadf0967-31d9-4500-b1e1-1689618be7ae

📥 Commits

Reviewing files that changed from the base of the PR and between 166e408 and 5604e6a.

📒 Files selected for processing (9)
  • .github/workflows/checklist-score.yml
  • .github/workflows/sync-subtrees.yml
  • BestPracticesChecklist.md
  • checklist-status.json
  • repo_metadata.py
  • repo_router.py
  • scripts/routing_smoke_check.py
  • scripts/test_bot_routing.py
  • scripts/update_subtrees.py

Comment thread .github/workflows/checklist-score.yml
Comment thread .github/workflows/sync-subtrees.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
repos/SocialShareButton/README.md (2)

137-145: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Don’t require React Router in the Create React App example.

This snippet imports useLocation and destructures from it even though the example says users without React Router can omit it. Copying this block in a project that only uses react-router route updates or plain window.location changes will fail on module import / hook resolution. Add a complete non-router variant using window.location.pathname/window.location.href, or split the examples into separate React Router and no-router cases.

🤖 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 `@repos/SocialShareButton/README.md` around lines 137 - 145, The Create React
App example in the Header component currently requires React Router despite
documenting it as optional. Split the example into router and non-router
variants, ensuring the non-router version removes the useLocation import and
uses window.location.pathname and window.location.href for route and share-link
updates.

145-171: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Synchronize against the complete client-side URL. All three examples observe only the pathname, so query-only navigation leaves stale share URLs.

  • repos/SocialShareButton/README.md#L145-L171: track React Router search/hash or the complete location.
  • repos/SocialShareButton/README.md#L228-L275: include useSearchParams() in the Next App Router effect.
  • repos/SocialShareButton/README.md#L334-L381: depend on Next Pages Router router.asPath.
🤖 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 `@repos/SocialShareButton/README.md` around lines 145 - 171, Update all three
README examples to resynchronize share options on complete client-side URL
changes: in the React Router example
(repos/SocialShareButton/README.md:145-171), track search and hash or the
complete location; in the Next App Router example
(repos/SocialShareButton/README.md:228-275), include useSearchParams() in the
effect dependencies; and in the Next Pages Router example
(repos/SocialShareButton/README.md:334-381), depend on router.asPath.
♻️ Duplicate comments (1)
bot.py (1)

421-449: 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Slow external I/O now runs inside the global ollama_lock, serializing unrelated requests.

extract_and_fetch_external_links (sequential HTTP calls, 10s timeout each) and load_repo_context (synchronous multi-file disk reads — already flagged in a prior review as blocking-I/O-on-the-event-loop, still unaddressed at this new call site) both execute here while the entire async with ollama_lock: block is held. Since this lock exists to serialize Ollama access, any contributor's GitHub-link-heavy or slow-context message now stalls every other thread's message processing across the whole bot, not just its own Ollama call.

♻️ Suggested restructure: build prompt/context before acquiring the lock
-    async with ollama_lock:
-        ...
-        try:
-            if is_in_thread:
-                full_prompt = await _build_conversation_context(thread, author, cleaned_query, message)
-            else:
-                full_prompt = cleaned_query
-            external_link_info = await extract_and_fetch_external_links(f"{cleaned_query}\n{full_prompt}")
-            combined_query_text = f"{cleaned_query} {full_prompt} {external_link_info}"
-            repo_context = load_repo_context(mapped_repo, combined_query_text)
-            ...
-            response_text, used_fallback = await generate_ollama_response(full_prompt, repo_context)
+    if is_in_thread:
+        full_prompt = await _build_conversation_context(thread, author, cleaned_query, message)
+    else:
+        full_prompt = cleaned_query
+    external_link_info = await extract_and_fetch_external_links(f"{cleaned_query}\n{full_prompt}")
+    combined_query_text = f"{cleaned_query} {full_prompt} {external_link_info}"
+    repo_context = await asyncio.to_thread(load_repo_context, mapped_repo, combined_query_text)
+    ...
+    async with ollama_lock:
+        response_text, used_fallback = await generate_ollama_response(full_prompt, repo_context)
🤖 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 `@bot.py` around lines 421 - 449, Move external-link fetching and
repository-context loading out of the global ollama_lock scope, before acquiring
the lock, while preserving the existing prompt enrichment and context assembly
behavior. Update the surrounding flow containing
extract_and_fetch_external_links, load_repo_context, and
generate_ollama_response so only the Ollama generation call remains protected by
ollama_lock; ensure synchronous load_repo_context does not block the event loop
by using the project’s established async/offloading pattern.
🤖 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.

Inline comments:
In `@repo_router.py`:
- Around line 319-341: Update extract_and_fetch_external_links to cap the number
of eligible GitHub pull-request/issue URLs and fetch the capped set concurrently
rather than awaiting each URL sequentially. Preserve URL normalization and
deduplication, retain only successful fetch results, and join them in a stable
input order.
- Around line 274-317: Update fetch_github_link_info to read the optional
GITHUB_TOKEN configuration and include it as a Bearer Authorization header on
the GitHub API request when present. Preserve the existing headers and
unauthenticated behavior when the token is unset, and avoid exposing the token
in logs.

---

Outside diff comments:
In `@repos/SocialShareButton/README.md`:
- Around line 137-145: The Create React App example in the Header component
currently requires React Router despite documenting it as optional. Split the
example into router and non-router variants, ensuring the non-router version
removes the useLocation import and uses window.location.pathname and
window.location.href for route and share-link updates.
- Around line 145-171: Update all three README examples to resynchronize share
options on complete client-side URL changes: in the React Router example
(repos/SocialShareButton/README.md:145-171), track search and hash or the
complete location; in the Next App Router example
(repos/SocialShareButton/README.md:228-275), include useSearchParams() in the
effect dependencies; and in the Next Pages Router example
(repos/SocialShareButton/README.md:334-381), depend on router.asPath.

---

Duplicate comments:
In `@bot.py`:
- Around line 421-449: Move external-link fetching and repository-context
loading out of the global ollama_lock scope, before acquiring the lock, while
preserving the existing prompt enrichment and context assembly behavior. Update
the surrounding flow containing extract_and_fetch_external_links,
load_repo_context, and generate_ollama_response so only the Ollama generation
call remains protected by ollama_lock; ensure synchronous load_repo_context does
not block the event loop by using the project’s established async/offloading
pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 9e80b9da-084b-4a18-95a2-35499c0a06de

📥 Commits

Reviewing files that changed from the base of the PR and between 5604e6a and ddb2771.

📒 Files selected for processing (8)
  • bot.py
  • repo_router.py
  • repos/GSoC-Proposal-Assistant/README.md
  • repos/OrgExplorer/.agent/info/operational-data.md
  • repos/OrgExplorer/.agent/instructions/testing.md
  • repos/SocialShareButton/.agent/instructions/setup.md
  • repos/SocialShareButton/AGENTS.md
  • repos/SocialShareButton/README.md

Comment thread repo_router.py
Comment thread repo_router.py
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR has merge conflicts.

Please resolve the merge conflicts before review.

Your PR will only be reviewed by a maintainer after all conflicts have been resolved.

📺 Watch this video to understand why conflicts occur and how to resolve them:
https://www.youtube.com/watch?v=Sqsz1-o7nXk

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
BestPracticesChecklist.md (1)

28-37: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Fix the score-table replacement boundary.

The generated section currently contains duplicated rows and a malformed table separator. In .github/workflows/checklist-score.yml, the replacement regex matches the first --- substring inside the Markdown table separator instead of the standalone --- delimiter, so each workflow run preserves stale table fragments.

Use a full-line delimiter and rerun the workflow to regenerate this file.

Suggested workflow fix
-              r'(?<=<!-- Auto-updated by checklist-score\.yml workflow — do not edit manually -->).*?(?=---)',
+              r'(?<=<!-- Auto-updated by checklist-score\.yml workflow — do not edit manually -->).*?(?=^---\s*$)',
               formatted_table,
               content,
-              flags=re.DOTALL
+              flags=re.DOTALL | re.MULTILINE

Also applies to: 48-55

🤖 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 `@BestPracticesChecklist.md` around lines 28 - 37, Update the score-table
replacement regex in the workflow’s generated-section handling to match
standalone full-line `---` delimiters rather than the first substring within a
Markdown table separator. Regenerate BestPracticesChecklist.md by rerunning the
workflow so duplicated rows and malformed separators are removed.
🤖 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.

Outside diff comments:
In `@BestPracticesChecklist.md`:
- Around line 28-37: Update the score-table replacement regex in the workflow’s
generated-section handling to match standalone full-line `---` delimiters rather
than the first substring within a Markdown table separator. Regenerate
BestPracticesChecklist.md by rerunning the workflow so duplicated rows and
malformed separators are removed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d3da18f2-060d-4207-a518-85d03bcbeb72

📥 Commits

Reviewing files that changed from the base of the PR and between ddb2771 and 4224599.

📒 Files selected for processing (2)
  • BestPracticesChecklist.md
  • checklist-status.json

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
bot.py (1)

46-46: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Restore sufficient repository-routing history.

Limiting recovery context to four messages can miss a repository mentioned five or more messages earlier. The subsequent LLM classifier receives only cleaned_query, so valid threads may be incorrectly routed to clarification. Preserve the previous window or use a targeted lookup of the thread’s earlier repository-bearing messages.

🤖 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 `@bot.py` at line 46, Increase THREAD_HISTORY_LIMIT to restore the previous
recovery window, or implement targeted retrieval of earlier repository-bearing
messages before classification. Ensure the classifier receives sufficient thread
history to identify repositories mentioned more than four messages earlier while
preserving existing routing behavior.
♻️ Duplicate comments (1)
bot.py (1)

341-344: 🩺 Stability & Availability | 🟠 Major

Duplicate: serialize every Ollama invocation.

ollama_lock is acquired only at Line 411, so both repository-classifier calls and the clarification generate_ollama_response call can execute concurrently against the local Ollama instance. Route all Ollama calls through a shared locking helper.

Also applies to: 362-365, 393-393

🤖 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 `@bot.py` around lines 341 - 344, Serialize all Ollama interactions through the
shared ollama_lock rather than acquiring it only at the later call site. Update
the repository-classifier invocations of classify_repo_with_llm and the
clarification generate_ollama_response call to use a common locking helper,
preserving their existing arguments and results while ensuring no Ollama calls
run concurrently.
🤖 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.

Outside diff comments:
In `@bot.py`:
- Line 46: Increase THREAD_HISTORY_LIMIT to restore the previous recovery
window, or implement targeted retrieval of earlier repository-bearing messages
before classification. Ensure the classifier receives sufficient thread history
to identify repositories mentioned more than four messages earlier while
preserving existing routing behavior.

---

Duplicate comments:
In `@bot.py`:
- Around line 341-344: Serialize all Ollama interactions through the shared
ollama_lock rather than acquiring it only at the later call site. Update the
repository-classifier invocations of classify_repo_with_llm and the
clarification generate_ollama_response call to use a common locking helper,
preserving their existing arguments and results while ensuring no Ollama calls
run concurrently.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 32dd14d8-7348-4181-aa41-4f4d96b58842

📥 Commits

Reviewing files that changed from the base of the PR and between 4224599 and 0ee651a.

📒 Files selected for processing (1)
  • bot.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
BestPracticesChecklist.md (1)

120-124: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not claim historical response rates from policy notes alone.

These notes assert that most or all reports received responses during the last 2–12 months, but provide no dated, auditable evidence. Link anonymized historical records or leave these criteria unchecked. This repeats the previously raised response-evidence gap.

🤖 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 `@BestPracticesChecklist.md` around lines 120 - 124, Remove the unsupported
checked status for report_responses and enhancement_responses in
BestPracticesChecklist.md, or add links to dated, anonymized records that
audibly substantiate the claimed historical response rates; do not rely on the
self-certification notes alone.
🤖 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.

Inline comments:
In `@BestPracticesChecklist.md`:
- Around line 36-46: Update the score-table replacement logic in the checklist
scoring workflow to terminate only on a standalone horizontal-rule line,
preventing duplicate or malformed table output. Then regenerate
BestPracticesChecklist.md through the workflow or its generator, without
manually editing the generated score section.

In `@bot.py`:
- Around line 291-338: Guard every Ollama request with ollama_lock: wrap both
classify_repo_with_llm calls in _resolve_repo, including the thread and channel
branches, and wrap the fallback generate_ollama_response call in process_message
for unmapped-repo clarification. Keep the existing mapped-repo response locking
and classification behavior unchanged.
- Around line 297-306: The repository-resolution flow duplicates
conversation-context construction when keyword detection falls back to thread
history. Update _resolve_repo to return the context produced by
_build_conversation_context, and have process_message reuse that returned value
when constructing full_prompt instead of invoking _build_conversation_context
again; preserve the existing behavior for paths that do not build context.

In `@repo_router.py`:
- Around line 325-342: Add the missing asyncio import in repo_router.py so the
GitHub link enrichment block can resolve asyncio.gather when processing URLs
collected by the GitHub link handling flow.

---

Outside diff comments:
In `@BestPracticesChecklist.md`:
- Around line 120-124: Remove the unsupported checked status for
report_responses and enhancement_responses in BestPracticesChecklist.md, or add
links to dated, anonymized records that audibly substantiate the claimed
historical response rates; do not rely on the self-certification notes alone.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3151d91e-a4b2-430a-a5ea-a5699813e44e

📥 Commits

Reviewing files that changed from the base of the PR and between 4224599 and 4e10b54.

📒 Files selected for processing (6)
  • BestPracticesChecklist.md
  • bot.py
  • checklist-status.json
  • repo_metadata.py
  • repo_router.py
  • scripts/test_bot_routing.py

Comment thread BestPracticesChecklist.md Outdated
Comment thread bot.py
Comment thread bot.py
Comment thread repo_router.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Changes to backend code ci-cd CI/CD pipeline changes configuration Configuration file changes documentation Changes to documentation files github-actions GitHub Actions workflow changes javascript JavaScript/TypeScript code changes needs-review no-issue-linked PR is not linked to any issue python Python code changes repeat-contributor PR from an external contributor who already had PRs merged size/XL Extra large PR (>500 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant