3 Commits

Author SHA1 Message Date
f15905b350 feat: add output truncation guard and method-level decompilation
Large types (e.g., 15.5M chars of IL from CyBGElaborator) crashed MCP
clients. Two fixes:

1. decompile_assembly now truncates output exceeding max_output_chars
   (default 100K), saves the full output to a temp file, and returns
   a preview with recovery instructions. Set max_output_chars=0 to
   disable.

2. New decompile_method tool extracts individual methods from a type.
   IL mode uses ECMA-335 .method/end-of-method delimiters. C# mode
   uses signature matching with brace-depth counting. Handles
   overloads automatically.

New module: il_parser.py with extract_il_method() and
extract_csharp_method() functions, keeping parsing logic separate
from server.py.
2026-03-02 17:19:42 -07:00
3c21b9d640 test: fix test compatibility with security and architecture changes
- Add bypass_path_validation fixture for tests using mock paths
- Update find_ilspycmd_path references to use mcilspy.utils
- Fix wrapper fixture patches in timeout tests
- Update assertions for new output formats (pagination, etc.)
- Mark all taskmaster domains as merged in status.json

All 165 tests passing.
2026-02-08 11:47:14 -07:00
70c4a4a39a test: comprehensive test suite for mcilspy MCP server
Add complete test coverage for the mcilspy package:

- T7: Create TestAssembly.dll fixture with known types/members
- T1: Integration tests using real assembly (metadata reader + ILSpy wrapper)
- T2: MCP tool tests with mocked wrapper for each @mcp.tool()
- T3: Error path tests for regex, file not found, invalid assemblies
- T4: Concurrency tests with asyncio.gather() for parallel operations
- T5: Docstring coverage tests using AST introspection
- T6: Timeout behavior tests for 5-minute subprocess timeout

Test summary:
- 147 tests passing
- 14 skipped (ilspycmd-dependent integration tests)
- 73% code coverage
- All ruff linting checks pass
2026-02-08 11:40:57 -07:00