Skip to content

fix: תיאור codekeeper_get_repo_file נחתך אצל הלקוח — פיצול לתיאורי פרמטרים + טסט תקרה - #3388

Merged
amirbiron merged 2 commits into
mainfrom
claude/inspiring-cerf-ud7n00
Sep 15, 2026
Merged

amirbiron merged 2 commits into
mainfrom
claude/inspiring-cerf-ud7n00

Conversation

@amirbiron

@amirbiron amirbiron commented Sep 15, 2026 •

Copy link
Copy Markdown
Owner

✨ תיאור קצר

התיאור של codekeeper_get_repo_file הגיע ל-2,482 תווים — פי 3.8 מהכלי השני בגודלו (652) ופי שמונה מהחציון (303) — ונמדד שהוא מגיע לסוכן חתוך באמצע המשפט על RST ועל symbol=. כלומר שני פיצ'רים עבדו ואף לקוח לא קרא עליהם, בדיוק מחלקת הכשל שהמשפטים האלה נכתבו כדי למנוע.

הפתרון הוא העברה ולא מחיקה: הפירוט על השפות עבר ל-Field(description=...) של הפרמטר outline, והפירוט על הסינון לזה של symbol. סך שלושת השדות גדל (2,711 מול 2,482) — אף לקח לא נמחק — ותיאור הכלי ירד ל-1,125.

📦 שינויים עיקריים

  • קוד (Backend)
  • בוט טלגרם
  • מסד נתונים/מיגרציות
  • תיעוד (docs/)
  • DevOps/CI/CD

פירוט:

  • mcp_server/server.py — שני קבועים חדשים, _OUTLINE_PARAM_DOC ו-_SYMBOL_PARAM_DOC, מחוברים לפרמטרים דרך Annotated[..., Field(description=...)]. תיאור הכלי מקוצר ל-1,125 ומפנה לשני הפרמטרים. _RANGE_DOC לא נגעתי בו — הוא משותף ל-codekeeper_get_file ו-docs/mcp-server.rst מחייב שהשניים יישארו סימטריים.
  • mcp_server/outline.py — הערת "מקור האמת" מעל _SCANNERS נוקבת עכשיו בתיאור הפרמטר outline ולא בתיאור הכלי.
  • tests/test_mcp_server_build.py — עשר assertions הועברו לשדה שבו הטקסט יושב עכשיו; שני טסטים חדשים; שלוש הרחבות כיסוי.
  • docs/ — הערה ב-mcp-server.rst שאומרת איפה הפירוט גר בקוד, וערך ב-whats-new.rst.

page/per_page — פיצ'ר בלי שומר

"and page/per_page walk long files" היה המשפט היחיד בתיאור שלא היה עליו אף טסט, ולכן הוא נשמט בטיוטה הראשונה של הפיצול בלי שאף בדיקה שמה לב. הוחזר עם assertion. זה לא שולי: OUTLINE_PER_PAGE_DEFAULT הוא 100, ולכן 486 הסימבולים שנמדדו על הקובץ הצפוף בקורפוס מתפרסים על חמישה עמודים — סוכן שלא יודע על page רואה עמוד אחד וחושב שראה הכול.

assertion הסדר

assert description.index('symbol="@media"') < description.index("500KB") הגנה על כך שהפילטר לא ייקרא כמדיניות גודל. אחרי הפיצול השניים אינם באותה מחרוזת כלל — הסכנה נמנעת מבנית והטענה לא הייתה יכולה לרוץ. הוחלפה בטסט שאוכף את שרשרת הגילוי: שתיאור הכלי מפנה לפרמטרים, ושהם באמת נושאים את הפירוט. הכשל המקורי ("פיצ'ר שאף אחד לא קורא לו הוא פיצ'ר שאינו קיים") חוזר אחרת אחרי הפיצול — סוכן שקורא רק את תיאור הכלי לא יֵדע ש-symbol= קיים.

שלוש הרחבות כיסוי

  • ה-escape ב-services.backup\_service נבדק עכשיו ישירות. עד כה הוא נבדק רק דרך symbol="backup_service" — טענה שעוברת גם על טקסט שאיבד את הלוכסן, כלומר בדיוק מה שקורה בהעתקה דרך שכבת escaping. הדוגמה הייתה הופכת לשקר שקט.
  • האיסור על "only the RST label targets" חל עכשיו על שלושת השדות ולא על אחד.
  • סריקת lines=[...] כוללת את תיאורי הפרמטרים, אחרת דוגמה שתיכתב שם לא הייתה נבדקת.

🧪 בדיקות

  • Unit
  • Integration
  • Manual

435 טסטים עוברים, אפס כשלים: test_mcp_server_build · test_mcp_analytics_privacy · test_mcp_outline · test_mcp_docs_handlers · test_mcp_repo_handlers. ruff ו-flake8 נקיים.

ארבע מוטציות — כל אחת מפילה את הטסט שאמור לתפוס אותה (הרצה ראשונה של אחת מהן החזירה ERROR ולא FAILED, כלומר ה-sed שבר תחביר במקום שהטסט יתפוס; חזרתי עליה נקי עם אימות ast.parse):

מוטציה הטסט שנפל
page/per_page ← pagination test_the_description_tells_the_agent_which_languages_have_a_map
Field של symbol ← מחרוזת ריקה test_the_description_says_symbol_works_on_the_non_python_names
אובדן ה-escape ב-backup\_service test_the_description_says_symbol_works_on_the_non_python_names
תיאור מעל 1,400 תווים test_no_tool_description_exceeds_the_truncation_budget

אומת מול הגרסאות המוצמדות ב-requirements/base.txt — mcp==1.28.1, pydantic==2.12.3, posthog==7.45.3. (התקנה ראשונה הביאה mcp 2.2.0; אימות מול גרסה שגויה היה חסר ערך, והוחלף.) דרך request_handlers[ListToolsRequest] עם ההזרקה האמיתית של PostHog פעילה: context הוזרק, get_more_tools נוסף, שני תיאורי הפרמטרים שרדו במלואם, והסכמה עוברת round-trip של JSON בית-בית — כולל {% block %}, <script>, @media וה-escape.

🧩 השפעות/סיכונים

⚠️ סיכון פתוח שצריך להכריע אחרי הדיפלוי. מה שנמדד הוא שהשרת שולח את תיאורי הפרמטרים במלואם — לא מה שלקוח מציג מהם. יש שתי תצפיות סותרות: בסביבה אחת תיאור הכלי נחתך סביב 2,000 תווים, ובסביבה אחרת כל 2,482 התווים הגיעו שלמים בזמן שתיאור פרמטר קוצר לכ-120 תווים בשורת סיכום. אם ההתנהגות השנייה היא הרווחת, הפיצול הזה אינו הפתרון והחלופה היא כלי אאוטליין נפרד, שם הטקסט חוזר להיות תיאור כלי. האזהרה הזאת כתובה במפורש מעל _TOOL_DESCRIPTION_MAX_CHARS ובהערה שמעל שני הקבועים, כדי שלא תיקרא כאן יותר ממה שנמדד.

האימות שחסר: לבקש מסוכן ב-Claude Code להדפיס מילולית את מה שהוא רואה עבור outline ו-symbol.

תופעת לוואי מוצהרת: $mcp_tool_description נמצא ברשימת ההיתר ב-analytics.py:133, ולכן המאפיין שנשלח ל-PostHog יתקצר — תיאורי הפרמטרים לא ייכללו בו. אין assert על תוכנו.

טסט התקרה — ממצא ששווה לשים לב אליו בריוויו: הוא רץ על _tool_manager.list_tools() ולא על mcp.list_tools(). AdminAwareFastMCP מסנן את כלי האדמין כשאין request context, ומחזיר 22 כלים מול 29 — ושבעת החסרים כוללים את codekeeper_get_repo_file עצמו. טסט על התצוגה המסוננת היה ירוק בלי לכסות את המקרה היחיד שהפיל אותנו.

📝 סוג שינוי

  • fix: תיקון באג

✅ צ'קליסט

  • הקוד עוקב אחרי הסגנון (ruff + flake8 נקיים)
  • בדיקות רצות ועוברות
  • תיעוד עודכן
  • אין סודות/מפתחות בקוד
  • אין מחיקות מסוכנות
  • הודעת הקומיט תואמת Conventional Commits
  • עיינתי במסמכי אתר התיעוד — נתיב: docs/mcp-server.rst | המשפט: "הסיומות הנתמכות הן .py ו-.pyi לפייתון…"

סטיות מהתוכנית, לשקיפות: התוכנית ציינה ארבעה מקומות לעדכון ב-docs/mcp-server.rst ואת mcp_server/README.md שורות 50 ו-84. בפועל בדקתי ומצאתי שאין שם אף טענה על מבנה התיאור — רק על התנהגות, וההתנהגות לא זזה. לכן הוספתי שם רק הערה אחת שאומרת איפה הפירוט גר בקוד, ולא נגעתי ב-README.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TbDVRRR8NxB8FtttvLpc1M


Generated by Claude Code

Review in cubic

Summary by Sourcery

Keep MCP tool guidance discoverable by moving detailed file, outline, symbol, and query documentation into parameter descriptions while enforcing a safe tool-description length.

Bug Fixes:

  • Prevent MCP clients from losing repository-file outline and symbol-filter guidance by moving the detailed documentation into the corresponding parameter descriptions.
  • Move the file-query details into the query parameter description to keep the tool description within the client truncation budget.

Enhancements:

  • Add a tool-description size budget and verify that tool descriptions point to parameters carrying detailed guidance.
  • Expand documentation assertions to cover pagination, supported suffixes, symbol matching and escaping, cross-field content rules, and parameter discovery.

Documentation:

  • Document where outline and symbol parameter details are defined and record the change in the release notes.

Tests:

  • Update MCP schema and description tests for parameter-level documentation and add coverage for description size limits and parameter-detail discoverability.

…טליין ו-symbol= — לא הגיע לסוכן

התיאור הגיע ל-2,482 תווים: פי 3.8 מהכלי השני בגודלו (652) ופי שמונה
מהחציון (303). נמדד שהוא מגיע לסוכן חתוך באמצע המשפט על RST ועל
symbol=, כלומר שני פיצ'רים עבדו ואף לקוח לא קרא עליהם — בדיוק מחלקת
הכשל שהמשפטים האלה נכתבו כדי למנוע.

**העברה ולא מחיקה.** כל משפט בתיאור נולד מבאג אמיתי ויש עליו טסט, ולכן
הפירוט על השפות עבר ל-Field(description=...) של הפרמטר outline והפירוט
על הסינון לזה של symbol — שניהם יושבים ב-inputSchema ואינם מתחרים על
תקציב התיאור. סך שלושת השדות גדל (2,711 מול 2,482), כלומר אף לקח לא
נמחק; תיאור הכלי ירד ל-1,125.

**טסט תקרה על כל 29 הכלים**, כי זו מחלקת בעיה ולא מופע. הוא רץ על
_tool_manager.list_tools() ולא על mcp.list_tools(): האחרון מסנן את כלי
האדמין ומחזיר 22, ושבעת החסרים כוללים את codekeeper_get_repo_file עצמו
— טסט על התצוגה המסוננת היה ירוק בלי לכסות את המקרה היחיד שהפיל אותנו.

**page/per_page היה הפיצ'ר היחיד בתיאור בלי אף טסט**, ולכן נשמט בטיוטה
הראשונה של הפיצול בלי שאף בדיקה שמה לב. הוחזר עם טסט: עמוד ראשון
שנראה כמו כל המפה הוא כשל שקט, כי OUTLINE_PER_PAGE_DEFAULT הוא 100
ו-486 הסימבולים שנמדדו על הקובץ הצפוף בקורפוס הם חמישה עמודים.

assertion הסדר (symbol="@media" לפני 500KB) איבדה משמעות — השניים אינם
באותה מחרוזת והסכנה נמנעת מבנית — והוחלפה בטסט שאוכף את שרשרת הגילוי:
שתיאור הכלי מפנה לפרמטרים, ושהם באמת נושאים את הפירוט.

נוספו: בדיקת ה-escape ב-services.backup\_service (עד כה נבדק רק דרך
symbol="backup_service", שעובר גם על טקסט שאיבד את הלוכסן), האיסור על
"only the RST label targets" חל על שלושת השדות, וסריקת lines=[...]
כוללת את תיאורי הפרמטרים כדי שהכיסוי לא ייפול בשקט.

אומת מול הגרסאות המוצמדות (mcp==1.28.1, pydantic==2.12.3,
posthog==7.45.3): התיאורים נשלחים במלואם ב-inputSchema עם ריצת בקרה
שבלי Field השדה חוזר None; הזרקת context של PostHog אינה דורסת אותם;
ארבע מוטציות מפילות את הטסטים המתאימים. מה שלא נמדד הוא מה שלקוח
**מציג** מהם — ראו האזהרה ב-_TOOL_DESCRIPTION_MAX_CHARS.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbDVRRR8NxB8FtttvLpc1M
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai sourcery-ai 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.

Sorry @amirbiron, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 5 days and 11 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

This PR prevents client truncation from hiding codekeeper_get_repo_file capabilities by relocating detailed outline and symbol documentation into MCP input-schema parameter descriptions, preserving discoverability through a concise tool-level pointer, and strengthening tests around content placement, escaping, pagination, and a global description-length budget. Review the explicitly documented remaining risk that some clients may truncate parameter descriptions as well; server-side schema preservation alone does not confirm client presentation.

File-Level Changes

Change Details Files
Moved detailed outline and symbol guidance from the tool description into parameter-level schema descriptions while preserving the full documentation.
  • Added _OUTLINE_PARAM_DOC and _SYMBOL_PARAM_DOC and attached them with Annotated/Field(description=...).
  • Shortened codekeeper_get_repo_file’s tool description to retain the key behavior and direct agents to the relevant parameters.
  • Kept pagination, supported suffixes, language-specific behavior, filtering semantics, RST examples, and escaping details covered.
mcp_server/server.py
mcp_server/outline.py
Updated documentation and source-of-truth comments to reflect that detailed guidance now lives on the parameters.
  • Adjusted the _SCANNERS documentation to point to the outline parameter description.
  • Added documentation notes and a whats-new entry describing the relocation and its rationale.
mcp_server/outline.py
docs/mcp-server.rst
docs/whats-new.rst
Reworked description-focused tests to validate the new schema locations and prevent regressions in discoverability and wording.
  • Moved language, symbol, suffix, pagination, and escaping assertions to the corresponding parameter descriptions.
  • Added a test that requires the tool description to point to both detailed parameter descriptions.
  • Expanded validation across tool and parameter fields, including forbidden RST wording and lines=[...] scans.
tests/test_mcp_server_build.py
Added a global tool-description length guard against client-side truncation.
  • Introduced a 1,400-character budget for tool descriptions.
  • Checked all tools through the unfiltered tool manager listing so the affected repository-file tool is included.
tests/test_mcp_server_build.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Warning

Review limit reached

Next included review available in 28 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: fd735757-4688-4acb-a7a1-852ce52c1445

📥 Commits

Reviewing files that changed from the base of the PR and between f796e99 and b9d8e61.

📒 Files selected for processing (5)
  • docs/mcp-server.rst
  • docs/whats-new.rst
  • mcp_server/server.py
  • tests/test_mcp_file_query.py
  • tests/test_mcp_server_build.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: d931d6ef-0832-41fe-ae25-e132f7aa7856

📥 Commits

Reviewing files that changed from the base of the PR and between aa7135a and f796e99.

📒 Files selected for processing (5)
  • docs/mcp-server.rst
  • docs/whats-new.rst
  • mcp_server/outline.py
  • mcp_server/server.py
  • tests/test_mcp_server_build.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

הכלי codekeeper_get_repo_file מעביר פירוט על outline ו־symbol לתיאורי הפרמטרים ב־inputSchema. תיאור הכלי קוצר. הבדיקות והתיעוד עודכנו בהתאם.

Changes

תיאורי פרמטרים בכלי MCP

Layer / File(s) Summary
סכמת הפרמטרים ותיאור הכלי
mcp_server/server.py, mcp_server/outline.py, docs/mcp-server.rst
נוספו תיאורי Field מלאים עבור outline ו־symbol. תיאור הכלי מפנה אליהם. ברירות המחדל וההתנהגות נשמרו. תיעוד המקור עודכן.
בדיקות ותיעוד גרסה
tests/test_mcp_server_build.py, docs/whats-new.rst
הבדיקות מאמתות את תיאורי הפרמטרים, ההפניות אליהם ותקרת אורך של 1,400 תווים לתיאורי כלים. יומן השינויים מתאר את העדכונים.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f796e

The tool metadata change is ready to merge; no concrete current-head risk was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (2 skipped: 2 u…
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.
Title check ✅ Passed הכותרת קצרה, ברורה ומתארת במדויק את התיקון המרכזי: פיצול תיאור codekeeper_get_repo_file והוספת טסט תקרה למניעת חיתוך.
Description check ✅ Passed התיאור מלא ברובו. הוא כולל את הבעיה, הפתרון, השינויים בקוד ובתיעוד, הבדיקות, הסיכונים והאימות מול גרסאות תלויות. הוא גם מציין במפורש את הסיכון שעדיין לא אומת בצד הלקוח. חסרים סימון מפורש של כל ה-Requi…
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch claude/inspiring-cerf-ud7n00
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/inspiring-cerf-ud7n00

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

תיאור קצר פוגש סכימה ברורה
outline ו־symbol מקבלים במה
הבדיקות שומרות על כל כלל
Claude Code כתב שינוי יעיל ומדויק
CodeKeeper forever 💫

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

**הקונפליקטים היו סמיכות ולא חפיפה.** ב-mcp_server/server.py שני הצדדים
הוסיפו בלוק חדש מיד אחרי _RANGE_DOC — אני _OUTLINE_PARAM_DOC ו-
_SYMBOL_PARAM_DOC, ו-main את _build_query_doc — ואין ביניהם הגיון משותף,
אז שתי התוספות נשארו. ב-docs/whats-new.rst שני ערכים תחת אותו תאריך,
ושניהם נשארו. _RANGE_DOC לא נגע.

**והממצא שגדול מהקונפליקט: טסט התקרה תפס כלי שני, יומיים אחרי שנכתב.**
‏#3385 הוסיף query ל-codekeeper_get_file עם תיאור בן 1,376 תווים שצורף
לתיאור הכלי, והביא אותו מ-349 ל-1,726 — מעל הסף. זה בדיוק מה שהופך את
התקרה ממופע בודד למחלקת בעיה, ולכן התרופה זהה ולא חריגה: _QUERY_DOC עבר
ל-Field(description=...) של query, ותיאור הכלי ירד ל-464 עם משפט שמפנה
לפרמטר. מנגנון השתלת הקבועים ב-_build_query_doc נשמר כמו שהוא, ולכן
test_the_tool_description_takes_its_ceilings_from_the_constants לא נגע.

**השוואה שיטתית משפט-משפט מול הנוסח הישן, בשני הכלים**, העלתה שהפסוקית
"symbol= filters on that full name" נשמטה בסבב הקודם. היא נושאת מידע —
הסינון על השם המנוקד השלם ולא על החלק האחרון, ולכן symbol="method" מוצא
גם Class.method — והוחזרה. אחרי התיקון: אפס מושגים אבודים בשני הכלים.

**ומבחן מוטציה מצא assertion שלא הייתה מסוגלת ליפול:** הבדיקה שהכלי מפנה
ל-query נוסחה כ-"query" in description, והיא עברה גם אחרי מחיקת ההפניה —
כי התיאור נושא ממילא את הדוגמה query="...". הוחלפה בבדיקה על ההפניה לשם
הפרמטר, והמוטציה נתפסת עכשיו.

test_the_tool_schema_declares_the_new_parameters_compatibly דרש ש-query
יהיה בעל אותה צורה בדיוק כמו file_name, ו-description שבר את ההשוואה.
נמדד שההפרש היחיד הוא המפתח description: anyOf ו-default זהים בית-בית
ו-required הוא None. כלומר תאימות הטיפוס והאופציונליות — שתי הטענות של
הטסט — נשארות נאכפות, ו-description הוחרג באותו היגיון שבו title כבר
מוחרג: תצוגה ולא חוזה.

אימות: כל הסוויטות של ה-MCP ירוקות, ruff ו-flake8 נקיים על הקבצים
שהשתנו, אף כלי אינו מעל 1,400 (הגבוה הוא get_repo_file ב-1,125), ושלוש
מוטציות מפילות את הטסטים המתאימים — Field ריק של query, הסרת ההפניה,
ותיאור מעל התקרה.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbDVRRR8NxB8FtttvLpc1M
@github-actions

Copy link
Copy Markdown
Contributor

🧯 Dangerous deletes guard report

Policy: see .cursorrules — dangerous deletions are blocked unless wrapped safely.

Summary:

  • Flagged findings (blocking): 0
    0
  • Excluded matches (not blocking): 15
  • Total matches (all files): 129

Flagged findings (file:line:snippet):
(none)

Excluded matches (by path pattern)
./webapp/static/js/md_preview.bundle.js.map:4:  "sourcesContent": ["// Markdown-it plugin to render GitHub-style task lists; see\n//\n// https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments\n// https://github.com/blog/1825-t … [truncated]
./docs/DOCUMENTATION_GUIDE.md:453:rm -rf _build
./docs/Makefile:24:	rm -rf $(BUILDDIR)
./Dockerfile:42:    rm -rf /var/lib/apt/lists/*
./Dockerfile:121:    rm -rf /var/lib/apt/lists/*
./node_modules/katex/package.json:153:    "build": "rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c --failAfterWarnings && webpack && node update-sri.js package dist/README.md",
./node_modules/katex/src/fonts/Makefile:139:	rm -rf pfa ff otf ttf woff woff2
./node_modules/mermaid/dist/mermaid.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values for tr … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm/chunk-2M32CCKP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence d … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequen … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.esm.min/chunk-4HFYJGYH.mjs:1:var r={name:"mermaid",version:"11.12.0",description:"Markdown-ish syntax for generating flowcharts, mindmaps, sequence diagrams, class diagrams, gantt charts, git graph … [truncated]
./node_modules/mermaid/dist/chunks/mermaid.core/chunk-KS23V3DP.mjs.map:4:  "sourcesContent": ["{\n  \"name\": \"mermaid\",\n  \"version\": \"11.12.0\",\n  \"description\": \"Markdown-ish syntax for generating flowcharts, mindmaps, sequence  … [truncated]
./node_modules/mermaid/dist/mermaid.min.js:1524:`,"getStyles"),c1e=RQe});var h1e={};dr(h1e,{diagram:()=>NQe});var NQe,f1e=N(()=>{"use strict";$ge();a1e();l1e();u1e();NQe={parser:Fge,db:n1e,renderer:o1e,styles:c1e}});var m1e,g1e=N(()=>{"use  … [truncated]
./node_modules/mermaid/dist/mermaid.min.js.map:4:  "sourcesContent": ["/**\n* Default values for dimensions\n*/\nconst defaultIconDimensions = Object.freeze({\n\tleft: 0,\n\ttop: 0,\n\twidth: 16,\n\theight: 16\n});\n/**\n* Default values fo … [truncated]
./README.md:842:find . -name "__pycache__" -exec rm -rf {} +

@sourcery-ai sourcery-ai 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.

Sourcery assessment

Approved.

Copy link
Copy Markdown
Owner Author

סבב 2 — יישוב קונפליקטים, ו-codekeeper_get_file שהטסט תפס

main התקדם בשלושה קומיטים והענף הפך ל-conflicted. יושב ונדחף ב-b9d8e61. הקונפליקטים היו סמיכות ולא חפיפה: ב-server.py שני הצדדים הוסיפו בלוק חדש מיד אחרי _RANGE_DOC — אני _OUTLINE_PARAM_DOC/_SYMBOL_PARAM_DOC, main את _build_query_doc — ואין ביניהם הגיון משותף, אז שתי התוספות נשארו. ב-whats-new.rst שני ערכים תחת אותו תאריך, ושניהם נשארו. _RANGE_DOC לא נגע.

הממצא שגדול מהקונפליקט

טסט התקרה תפס כלי שני, יומיים אחרי שנכתב. #3385 הוסיף query ל-codekeeper_get_file עם _QUERY_DOC בן 1,376 תווים שצורף לתיאור הכלי, והביא אותו מ-349 ל-1,726 — מעל הסף, כלומר סופו נחתך אצל הלקוח.

זה בדיוק מה שהופך את התקרה ממופע בודד למחלקת בעיה, ולכן התרופה זהה ולא חריגה: _QUERY_DOC עבר ל-Field(description=...) של query, ותיאור הכלי ירד ל-464 עם משפט שמפנה לפרמטר. מנגנון השתלת הקבועים ב-_build_query_doc נשמר כמו שהוא, ולכן test_the_tool_description_takes_its_ceilings_from_the_constants לא נגע.

כלי לפני אחרי
codekeeper_get_repo_file 2,482 1,125 + outline 1,011 + symbol 591
codekeeper_get_file 1,726 464 + query 1,376

אף כלי אינו מעל 1,400.

שני דברים שהאימות השיטתי מצא

(1) פסוקית שנשמטה בסבב הקודם. ההשוואה משפט-משפט מול הנוסח הישן — שנעשתה הפעם על שני הכלים — העלתה ש-symbol= filters on that **full name** נעלם. הוא נושא מידע: הסינון הוא על השם המנוקד השלם ולא על החלק האחרון שלו, ולכן symbol="method" מוצא גם Class.method. הוחזר. אחרי התיקון: אפס מושגים אבודים בשני הכלים.

(2) assertion שלא הייתה מסוגלת ליפול. הבדיקה שהכלי מפנה ל-query נוסחה כ-"query" in description — והמוטציה שמחקה את ההפניה עברה אותה בשקט, כי התיאור נושא ממילא את הדוגמה query="...". היא הוחלפה בבדיקה על ההפניה לשם הפרמטר, והמוטציה נתפסת עכשיו. זה בדיוק מה שמבחן מוטציה קיים בשבילו.

טסט של main שנדרש התאמה

test_the_tool_schema_declares_the_new_parameters_compatibly דרש ש-query יהיה בעל אותה צורה בדיוק כמו file_name, ו-description שבר את ההשוואה. נמדד שההפרש היחיד הוא המפתח description: anyOf (מחרוזת או null) ו-default זהים בית-בית, ו-required בסכימה הוא None. כלומר שתי הטענות של הטסט — תאימות הטיפוס והאופציונליות — נשארות נאכפות. description הוחרג באותו היגיון שבו title כבר מוחרג שם: תצוגה ולא חוזה, ולקוח קיים אינו נשבר ממנו. הנימוק והמדידה כתובים בדוקסטרינג.

אימות

כל סוויטות ה-MCP ירוקות (כולל test_mcp_file_query.py החדש), ruff ו-flake8 נקיים על הקבצים שהשתנו. שלוש מוטציות מפילות את הטסטים המתאימים: Field ריק של query, הסרת ההפניה, ותיאור מעל התקרה.

הסיכון הפתוח מהסבב הראשון עומד בעינו — מה שנמדד הוא שהשרת שולח את תיאורי הפרמטרים במלואם, לא מה שלקוח מציג מהם. האימות שחסר: לבקש מסוכן ב-Claude Code להדפיס מילולית מה הוא רואה עבור outline, symbol ו-query.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

⏱️ Performance report

(No performance test durations collected. Mark tests with @pytest.mark.performance.)

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation has been built successfully!

To view locally:

  1. Download the artifacts
  2. Extract the zip file
  3. Open index.html in your browser

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@amirbiron
amirbiron merged commit a9c673c into main Sep 15, 2026
30 checks passed
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.

2 participants