Skip to content

MCP tools fixes#253

Merged
AivanF merged 2 commits into
mainfrom
aivan/dev-1690-MCP-tools-fixes
Jul 24, 2026
Merged

MCP tools fixes#253
AivanF merged 2 commits into
mainfrom
aivan/dev-1690-MCP-tools-fixes

Conversation

@AivanF

@AivanF AivanF commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Compact inspections now include full text for measures and aggregations (when available) in both JSON and Markdown, while keeping full-text behavior suppressed for columns.
    • Entity resolution now accepts hyphens within datasource identifier segments (e.g., UUID-like formats).
  • Bug Fixes

    • Corrected compact output rendering rules so measure/aggregation “full text” is no longer omitted.
  • Documentation

    • Updated inspection output wording from “Sample Data” to “Data Profile”.
  • Tests

    • Updated and expanded unit/integration tests to match the new compact text and “Data Profile” section label, including hyphenated identifier cases.

@AivanF
AivanF requested a review from whimo July 24, 2026 10:31
@linear

linear Bot commented Jul 24, 2026

Copy link
Copy Markdown

DEV-1690

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4b866323-72c0-4ac9-a673-4523e8b49197

📥 Commits

Reviewing files that changed from the base of the PR and between 3c04ce3 and 62653dc.

📒 Files selected for processing (4)
  • slayer/inspect/model_render.py
  • tests/integration/test_mcp_inspect.py
  • tests/test_inspect.py
  • tests/test_mcp_server.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_inspect.py

📝 Walkthrough

Walkthrough

The changes update compact inspect output so measures and aggregations retain full text, rename model inspection sample sections to “Data Profile,” and relax entity-reference validation to accept hyphens within identifier segments.

Changes

Inspect rendering

Layer / File(s) Summary
Compact leaf text rendering
slayer/inspect/service.py, tests/test_inspect.py
Compact JSON and Markdown include full text for measures and aggregations but omit it for columns; contract and parameterized tests verify the behavior.
Data Profile section labels
slayer/inspect/model_render.py, tests/integration/test_mcp_inspect.py, tests/test_inspect.py, tests/test_mcp_server.py
Model inspection success and error output rename sample-data headings and SQL labels to “Data Profile,” with related section-gating expectations updated.

Entity resolution

Layer / File(s) Summary
Hyphenated identifier segments
slayer/memories/resolver.py, tests/test_entity_resolution.py
Entity-reference segments accept hyphens while preserving the leading-character rule, with coverage for hyphenated datasource segments.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: whimo, zmeigorynych

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title is too generic to convey the specific MCP inspect and entity-resolution changes in this PR. Rename it to describe the main change, such as fixing MCP inspect rendering and entity resolution behavior.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch aivan/dev-1690-MCP-tools-fixes

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

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

🧹 Nitpick comments (3)
slayer/memories/resolver.py (1)

298-302: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use keyword arguments for the regex call.

Line 302 passes multiple arguments positionally, contrary to the Python guideline. Prefer re.fullmatch(pattern=..., string=s) here; it preserves the intended validation and avoids relying on anchors.

Suggested change
-    if not all(re.match(r"^[a-zA-Z_][\w-]*$", s) for s in segments):
+    if not all(
+        re.fullmatch(pattern=r"[a-zA-Z_][\w-]*", string=s)
+        for s in segments
+    ):
🤖 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 `@slayer/memories/resolver.py` around lines 298 - 302, Update the segment
validation in the resolver to use re.fullmatch with explicit pattern and string
keyword arguments instead of re.match with anchored positional arguments.
Preserve the existing identifier rules, including leading letters or underscores
and subsequent word characters or hyphens.

Source: Coding guidelines

tests/test_entity_resolution.py (2)

320-330: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Exercise a registered hyphenated datasource.

This test only proves that an unknown hyphenated segment bypasses the validation error. Add a fixture with a real hyphenated datasource and assert canonical resolution, or the datasource-specific missing-model error, so the intended lookup path is covered.

🤖 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 `@tests/test_entity_resolution.py` around lines 320 - 330, Extend
test_hyphenated_datasource_segment_accepted with a registered datasource fixture
whose name contains a hyphen, then resolve that datasource using the existing
entity-resolution setup. Assert either the canonical resolved entity or the
datasource-specific missing-model error, ensuring the request reaches datasource
lookup rather than only avoiding the invalid identifier segment error.

320-330: 📐 Maintainability & Code Quality | 🔵 Trivial

Run poetry run ruff check slayer/ tests/ before merge and fix any reported issues.

🤖 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 `@tests/test_entity_resolution.py` around lines 320 - 330, Run ruff against the
slayer/ and tests/ directories and resolve every reported issue, including any
violations in test_hyphenated_datasource_segment_accepted, while preserving the
test’s intended entity-resolution behavior.

Source: Coding guidelines

🤖 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 `@slayer/memories/resolver.py`:
- Around line 298-302: Update the segment validation in the resolver to use
re.fullmatch with explicit pattern and string keyword arguments instead of
re.match with anchored positional arguments. Preserve the existing identifier
rules, including leading letters or underscores and subsequent word characters
or hyphens.

In `@tests/test_entity_resolution.py`:
- Around line 320-330: Extend test_hyphenated_datasource_segment_accepted with a
registered datasource fixture whose name contains a hyphen, then resolve that
datasource using the existing entity-resolution setup. Assert either the
canonical resolved entity or the datasource-specific missing-model error,
ensuring the request reaches datasource lookup rather than only avoiding the
invalid identifier segment error.
- Around line 320-330: Run ruff against the slayer/ and tests/ directories and
resolve every reported issue, including any violations in
test_hyphenated_datasource_segment_accepted, while preserving the test’s
intended entity-resolution behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4cc3373b-7512-42b9-a920-b968b0b73dd9

📥 Commits

Reviewing files that changed from the base of the PR and between 83e7039 and 3c04ce3.

📒 Files selected for processing (4)
  • slayer/inspect/service.py
  • slayer/memories/resolver.py
  • tests/test_entity_resolution.py
  • tests/test_inspect.py

@sonarqubecloud

Copy link
Copy Markdown

@AivanF
AivanF merged commit 98c7d7b into main Jul 24, 2026
6 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