Skip to content

Feature/mcp v1.1#64

Open
LC43 wants to merge 78 commits into
devfrom
feature/mcp-v1
Open

Feature/mcp v1.1#64
LC43 wants to merge 78 commits into
devfrom
feature/mcp-v1

Conversation

@LC43

@LC43 LC43 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

No description provided.

LC43 added 15 commits July 8, 2026 10:40
Add get_config() to the Model interface and BaseModel implementation. Enables policy classes to read per-feature config sections for capability gating.
Replace ModelRestPolicy with McpPolicy for MCP-specific gating in AbilityRegistrar. Update MCP service with mcp_policy() lazy-loader.
Refactor ModelRestPolicy to resolve capabilities from per-feature config sections (config.meta.show_in_rest) instead of the old saltus_rest capabilities array. Health and models capabilities remain always-on when show_in_rest is not false. Drop per-model saltus_rest opt-in.
Update REST controller and MetaFieldProvider error messages to reference the new per-feature config section syntax (e.g. add show_in_rest under the duplicate section) instead of the old saltus_rest capabilities array.
Add 14 test cases for McpPolicy covering health bypass, model-type filtering, mcp_tools gating, show_in_mcp toggling. Update MCPFeatureTest and AbilityRegistrarTest to use config-section pattern.
Update DuplicateControllerTest, MetaControllerTest, ModelsControllerTest, ReorderControllerTest, RestServerTest, and SettingsControllerTest to use the new config-section pattern with show_in_rest in feature-level sections instead of the saltus_rest array.
Update MCP.md with config-section model, per-feature show_in_rest/show_in_mcp flags, and new model config examples. Sync CURRENT.md and ROADMAP.md.
Add McpPolicy line to Current Status. Bump test count from 236/655 to 250/669.
Add Working item for MCP/REST gating refactor. Add Recent Changes entry for McpPolicy config-section gating refactor.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the MCP and REST capability gating in the Saltus framework, transitioning from the legacy saltus_rest array to a per-feature configuration model under the config key. It introduces the McpPolicy class to handle MCP-specific gating and the MCPConfig utility class to make the MCP namespace, ability category, and prefix filterable. Additionally, REST controllers, tools, documentation, and tests have been updated to support these changes. Feedback is provided to improve robustness in MCPConfig::get_ability_category by merging filtered arrays with defaults to avoid undefined key warnings, and to correct an invalid @param annotation in McpPolicy::get_model.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/MCP/MCPConfig.php
Comment thread src/MCP/McpPolicy.php
LC43 added 5 commits July 8, 2026 18:21
Replace match expressions (PHP 8.0+) with associative array lookups in resolve_show_in_mcp and resolve_show_in_rest. Restores PHP 7.4 compatibility and reduces cyclomatic complexity below the PHPCS threshold of 10.
Add inline @var assertions for non-falsy-string and array shape return types that PHPStan cannot infer through apply_filters().
Add local @var non-falsy-string assertions in register_routes() methods so PHPStan can verify register_rest_route namespace parameter type.
@LC43

LC43 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@LC43

LC43 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors the MCP and REST capability gating by introducing the McpPolicy class and migrating ModelRestPolicy to a per-feature config-section model. It also introduces the MCPConfig utility class to make the MCP namespace, ability category, and ability prefix filterable. Review feedback highlights potential PHP warnings in McpPolicy and ModelRestPolicy when accessing nested array keys under $config['features'] directly. Additionally, improvements are suggested to defensively handle empty strings from the namespace filter in MCPConfig and to safely trim slashes when constructing routes in RestTool.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/MCP/McpPolicy.php Outdated
Comment thread src/Rest/ModelRestPolicy.php Outdated
Comment thread src/MCP/MCPConfig.php
Comment thread src/MCP/Tools/RestTool.php
LC43 added 30 commits July 21, 2026 09:32
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.

1 participant