Design 36: the plugin's session-start and Stop hooks beside the guard (ADR 0489, ADR 0490)

Delivered in mesh-catalog#420 on 2026-10-21; the design said the guard was the plugin's only hook.
This commit is contained in:
jochen
2026-10-21 19:27:33 +02:00
parent a214776696
commit 302ab2856a
@@ -157,6 +157,16 @@ does the job, or with the rule that a missing tool is created in its owning modu
managed directory, so a session cannot change it, judges with the machines and replaced commands the module
last asked of the controller, and records every refusal and every operator's override in the module's state.
**The wait list and the Stop hook** (ADR 0489, ADR 0490). Beside the guard the plugin carries two more of the
module's own commands as hooks. At every session start the session-start hook prints the session's id and every
open wait on the machine by the name it is kept under, with the call that takes a name back after a /clear (which
gives a session a new id). At every stop the Stop hook reads the session's waits, which `claude_code_wait` keeps
in the module's state under the session's name (who@node) and mirrors into the agent's home, and refuses the stop
while a wait is within its bound and nothing follows it, or past its bound and not yet told to the operator; it
lets the stop through silently when there are no waits, says so on the screen when the list cannot be read, and
refuses the same stop at most three times. Like the guard, both hooks ship in the plugin only: the hook
registration tools still refuse every hook (issue 340).
## 4. The mesh MCP server
> **Revised 2026-10-03, building it.** The vendor's managed-settings key for tool servers refuses any