* fix(ghidra): cancel an active request without closing the session
Cancelling the request Ghidra is working on closed the whole session, so the next call paid for a restore or a full re-import and session annotations were lost.
The bridge now reads its connection on a second thread that only cancels the Ghidra TaskMonitor of the request a cancel frame names; requests still run one at a time. For an active read, REA writes that frame and waits up to two seconds for the request's reply. When it arrives, the call returns a cancellation and the session, its annotations and the queued requests stay. Edits are not interrupted, and a read that is not answered in time closes the session as before.
Refs #14832, #8223, #5340
* feat(ghidra): bound the cancel grace with a launch control
REA_GHIDRA_CANCEL_GRACE_MS replaces the fixed 2 s wait for the bridge to
answer a cancelled read before the session is closed. Default 2000 ms,
floor 100 ms, maximum 60000 ms.
The value is parsed when REA starts and fixed for a session when its
request queue is constructed. It is a restart-only launch control in the
numeric limit registry, not a runtime analysis setting, so the MCP tool
catalog is unchanged.
The session limitation states the applied value and its source, and the
failure of requests queued behind an expired grace names the control,
value, source and range. An invalid value is reported by doctor and
registration validation and refuses a Ghidra session.
The hang_tools client cases inject the 100 ms floor instead of waiting
out the default grace.
* fix(ghidra): keep capability limitations from claiming the default cancel grace
Capability descriptors are built once without a session, so they stated the 2000 ms default as the applied value even when REA_GHIDRA_CANCEL_GRACE_MS was set at launch. They now name the control and its default; session limitations still state the value applied.
* refactor(ghidra): drop the redundant pre-decompile cancellation check
DecompInterface.decompileFunction already returns a DISPOSED_ON_CANCEL result for a monitor cancelled before it starts, which the existing isCancelled() check reports as decompile_cancelled.
* test(ghidra): expect session limitations from the session owner in MCP parity
The parity check compared session Evidence with capability limitations. Since capability descriptors no longer state an applied cancel grace, the expectation is derived from ghidraSessionCommonLimitations with the grace this harness applies.