Document the tag-visibility vs application-gate split for MCP tools#2162
Merged
Trecek merged 4 commits intoMay 7, 2026
Merged
Conversation
…erences The test read the entire file via read_text(), so assertions matched anywhere in the file instead of only in the module docstring. Now extracts just the docstring via re.match, consistent with the sibling test in test_claude_md_structure.py. Also moves `import re` to module level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- test_test_check_has_require_enabled_exception_comment now verifies _require_enabled appears in a comment line (# prefix), not just anywhere in the decorator region - server/CLAUDE.md Anomaly 2: list all four tags (kitchen, kitchen-core, headless, autoskillit) matching tools_workspace.py decorator - Extract _SERVER_DIR constant to eliminate 3x duplicated path construction in test_claude_md_structure.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eduplicate stale-count check Replace fragile re.match(r'^"""...') with ast.get_docstring() in test_server_docstring_references_registry_constants — immune to future-imports or other lines prepended before the docstring. Remove test_server_init_docstring_no_stale_tool_count from test_claude_md_structure.py — the stale-count assertion is already covered by the more comprehensive test in test_layer_enforcement.py. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Trecek
added a commit
that referenced
this pull request
May 8, 2026
…2162) ## Summary Documents the two independent enforcement mechanisms for MCP tool gating in the server package: 1. Tag-visibility layer (FastMCP): tools with `kitchen` tag are hidden at startup, revealed by `open_kitchen` 2. Application-gate layer (Python): tools call `_require_enabled()` internally, which checks `ctx.gate.enabled` The changes add a "Tool Gating Architecture" section to `src/autoskillit/server/CLAUDE.md` with a matrix explaining the different tool categories, update the `server/__init__.py` docstring, and add an inline comment on `test_check` explaining why it skips `_require_enabled()`. ## Requirements - `server/CLAUDE.md` contains the gating architecture section with the matrix - `server/__init__.py` docstring no longer contains stale tool counts - `test_check` has an inline comment explaining why it skips `_require_enabled()` - An agent asked "which tools require the kitchen to be open?" can answer correctly from CLAUDE.md alone without reading every tool implementation ## Conflict Resolution Decisions The following files had merge conflicts that were automatically resolved. (None) Closes #2049 ## Implementation Plan Plan file: `(plan file not available at expected path)` 🤖 Generated with [Claude Code](https://claude.com/claude-code) via AutoSkillit <!-- autoskillit:pipeline-signature steps=prepare_pr,run_arch_lenses,compose_pr,annotate_pr_diff,review_pr --> ## Token Usage Summary | Step | Model | count | uncached | output | cache_read | peak_ctx | turns | cache_write | time | |------|-------|-------|----------|--------|------------|----------|-------|-------------|------| | plan | claude-opus-4-6 | 1 | 85 | 18.4k | 1.8M | 89.4k | 120 | 76.2k | 9m 41s | | verify | claude-sonnet-4-6 | 1 | 39 | 7.1k | 487.5k | 59.0k | 95 | 45.5k | 5m 29s | | implement* | MiniMax-M2.7-highspeed | 1 | 245.7k | 5.1k | 413.8k | 29.8k | 37 | 16.2k | 1m 50s | | fix | claude-opus-4-6 | 1 | 46 | 4.8k | 719.7k | 53.2k | 33 | 40.2k | 4m 20s | | prepare_pr* | MiniMax-M2.7-highspeed | 1 | 153.0k | 4.7k | 502.9k | 29.7k | 43 | 27.2k | 1m 52s | | compose_pr* | MiniMax-M2.7-highspeed | 1 | 35.5k | 1.1k | 175.6k | 29.7k | 13 | 14.8k | 35s | | **Total** | | | 434.4k | 41.0k | 4.1M | 89.4k | | 220.1k | 23m 50s | \* *Step used a non-Anthropic provider; caching behavior may differ.* ## Token Efficiency | Step | LoC Changed | cache_read/LoC | cache_write/LoC | output/LoC | |------|-------------|----------------|-----------------|------------| | plan | 0 | — | — | — | | verify | 0 | — | — | — | | implement | 135 | 3064.9 | 119.7 | 37.4 | | fix | 26 | 27680.2 | 1545.4 | 183.7 | | prepare_pr | 0 | — | — | — | | compose_pr | 0 | — | — | — | | **Total** | **161** | 25483.8 | 1366.9 | 254.9 | ## Model Usage Breakdown | Model | steps | uncached | output | cache_read | cache_write | time | |-------|-------|----------|--------|------------|-------------|------| | claude-opus-4-6 | 2 | 131 | 23.1k | 2.5M | 116.4k | 14m 2s | | claude-sonnet-4-6 | 1 | 39 | 7.1k | 487.5k | 45.5k | 5m 29s | | MiniMax-M2.7-highspeed | 3 | 434.2k | 10.8k | 1.1M | 58.2k | 4m 18s | --------- Co-authored-by: Trecek <trecektalon@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Documents the two independent enforcement mechanisms for MCP tool gating in the server package:
kitchentag are hidden at startup, revealed byopen_kitchen_require_enabled()internally, which checksctx.gate.enabledThe changes add a "Tool Gating Architecture" section to
src/autoskillit/server/CLAUDE.mdwith a matrix explaining the different tool categories, update theserver/__init__.pydocstring, and add an inline comment ontest_checkexplaining why it skips_require_enabled().Requirements
server/CLAUDE.mdcontains the gating architecture section with the matrixserver/__init__.pydocstring no longer contains stale tool countstest_checkhas an inline comment explaining why it skips_require_enabled()Conflict Resolution Decisions
The following files had merge conflicts that were automatically resolved.
(None)
Closes #2049
Implementation Plan
Plan file:
(plan file not available at expected path)🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown