Skip to content

Document the tag-visibility vs application-gate split for MCP tools#2162

Merged
Trecek merged 4 commits into
developfrom
document-the-tag-visibility-vs-application-gate-split-for-mc/2049
May 7, 2026
Merged

Document the tag-visibility vs application-gate split for MCP tools#2162
Trecek merged 4 commits into
developfrom
document-the-tag-visibility-vs-application-gate-split-for-mc/2049

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 7, 2026

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 via AutoSkillit

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

Trecek and others added 4 commits May 7, 2026 08:24
…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 Trecek added this pull request to the merge queue May 7, 2026
Merged via the queue into develop with commit 915eb62 May 7, 2026
2 checks passed
@Trecek Trecek deleted the document-the-tag-visibility-vs-application-gate-split-for-mc/2049 branch May 7, 2026 16:36
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>
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