* test(managed-agent): add the FG13c Hook owner-restart fault gates (#14449)
* test(managed-agent): tighten the FG13c hook fault gates after audit
* test(managed-agent): address the FG13c review findings
* test(managed-agent): settle the FG13c harness-kill hook after a Turn cancel
* test(managed-agent): address the FG13c review census
* test(managed-agent): reconcile the FG13c hook before the terminal wait
* test(managed-agent): tighten the FG13c fresh-prompt reconcile after audit
* test(managed-agent): drop the stale SIGTERM claim from the FG13c fixture
* test(managed-agent): settle the FG13c Harness-kill Hook via the Harness status route
The public prompt cannot trigger reconciliation: the control plane's
active-Turn gate answers 409 in insertTurnCommand before any Harness
dispatch, and the cancelled Turn never leaves CANCELLING. Re-attach the
Session to the replacement Harness with the passive recovery load and
read the operation through the authenticated hooks/operations route,
which asks the record's original runtimeSessionId and settles it from
the receipt the worker still holds.
* test(managed-agent): pin the FG13c kill window and the settled owner
The Harness-kill cell could pass without proving anything if the Hook
had already allowed before the kill: the old Harness would have settled
the record and the status read would see a terminal one. Hold longer and
refuse to kill while an allow is already on disk. Assert after
settlement that the binding still names the same worker and generation,
which is what the design claims.
* test(managed-agent): reuse the replacement attachment instead of forcing a load
A Session the coordinator already attached is resident with a Hook-pending
Turn, so a second passive load of it is refused with takeover_unsupported;
the forced call sat outside the wait and exited the cell before the status
route could run. Probe the status route first, reuse whatever attachment
serves it, and ask for a passive re-attach only on 404, at most once a
second.
* test(managed-agent): keep a refused re-attach inside the wait
untilAsserted retries an AssertionError, not a RuntimeException, so a
takeover_unsupported refusal would still have exited the cell. Swallow it
at the call site and report the message on the assertion instead.
* test(managed-agent): send the Harness contract headers on the Hook status probe
Every /session route runs the hosted-harness contract middleware, so the
status probe needs X-Qwen-Harness-Protocol-Version and the boot id of the
process it is talking to. The identity now carries both from the attachment
ref, and a stale generation counts as an attachment that cannot serve the
route, like a missing Session.
---------
Co-authored-by: 易良 <1204183885@qq.com>