Problem. resolveTargets (src/toolLayer.ts:187) powers the app filter across get_logs, get_logs_around, diagnose, get_network, export_har, export_bundle, etc. Its matching logic — exact-id first, substring/label fallback, case-insensitivity, throw-on-no-match — is non-trivial but is only exercised indirectly through the full cockpit selftest (a ~30s offscreen-Electron spin-up).
Proposed. Extract/expose resolveTargets enough to unit-test it and add test/toolLayer.test.ts (bun test) covering: exact match wins over substring, substring + case-insensitive fallback, no-match behavior, and undefined app → undefined. Fast regression coverage without the Electron suite.
Affected: src/toolLayer.ts:187, new test/toolLayer.test.ts.
Filed from the weekly repo audit.
Problem.
resolveTargets(src/toolLayer.ts:187) powers theappfilter acrossget_logs,get_logs_around,diagnose,get_network,export_har,export_bundle, etc. Its matching logic — exact-id first, substring/label fallback, case-insensitivity, throw-on-no-match — is non-trivial but is only exercised indirectly through the full cockpit selftest (a ~30s offscreen-Electron spin-up).Proposed. Extract/expose
resolveTargetsenough to unit-test it and addtest/toolLayer.test.ts(bun test) covering: exact match wins over substring, substring + case-insensitive fallback, no-match behavior, and undefinedapp→ undefined. Fast regression coverage without the Electron suite.Affected:
src/toolLayer.ts:187, newtest/toolLayer.test.ts.Filed from the weekly repo audit.