Repository navigation
fix(query): drop unused device_id parameter from leak_detection template - #92
Merged
Merged
Conversation
The leak_detection template advertised a device_id parameter, but the SQL body only references min_size and the executor-injected device_block_table. QueryService and QueryExecutor resolve the target device from explicit --device, focus, or the first discovered device before rendering, so any params.device_id was a no-op leaked through CLI, Python API, and MCP template metadata. - Remove parameters.device_id from leak_detection.yaml. - Sync the en/zh querying.md parameter lists. - Add regression assertions that the template exposes only min_size and that CLI/MCP template-info agree on that surface. Fixes #90
codeasier
force-pushed
the
fix/issue-90-leak-detection-device-id
branch
from
August 8, 2026 15:12
d22925e to
ba7bad9
Compare
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.
Fixes #90
Problem
leak_detectionadvertised adevice_idparameter in its YAML, but thetemplate SQL only references
min_sizeand the executor-injecteddevice_block_table.QueryService._resolve_device_id()andQueryExecutor.render()both resolve the target device from explicit--device, focus, or the first discovered device before rendering, soparams.device_idwas a no-op that the CLI, Python API, and MCP allleaked through template metadata.
Repro
Fix
parameters.device_idfromsrc/pt_snap_cli/query/templates/business/leak_detection.yaml.docs/en/querying.mdanddocs/zh/querying.md.tests/test_contract_cli_mcp.pyplus a registry regression intests/query/test_registry.pyasserting thatleak_detectiononlyexposes
min_size.Device selection continues to flow through
--device,SnapshotAnalyzer.device_id, and focus precedence (verified by theexisting
test_query_execution_contract_matches_cli_and_mcp_semantics).Verification
pytest— 587 passed, 1 xfailed.ruff check .— clean.black --check .— clean.