Feature/mcp v1.1#64
Conversation
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.
There was a problem hiding this comment.
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.
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.
|
/gemini review |
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
|
/gemini review |
There was a problem hiding this comment.
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.
No description provided.