Replace exposed layer graph assembly with opaque declarations, checked substitutions, and lifetime-aware compilation. Preserve deep replacement, ordered startup, and Effect-owned resource lifetimes; migrate callers and verify source and published package contracts.
Move existing Session list and message queries into SessionStore. Preserve public response wrapping, Session existence checks, pagination, ordering, and typed message decoding errors.
Separate ID-bound Session policy from host routing. Bind Inbox and Location preparation dependencies at construction, preserve admission and execution semantics, and cover the extracted ownership contracts directly.
Run user shell commands concurrently with model execution, retain their output in one shell entry, and admit non-waking completion messages. Share result capture and notification formatting across shell callers.
- V2 tool execute hooks: add `ctx.tool.execute.before/after` plugin API,
core ToolHooks service, and registry wiring so hosted/local tool calls
run registered before/after hooks; provider-executed calls are excluded.
- Session synthetic endpoint: add `POST /api/session/:sessionID/synthetic`
with text/description/metadata plus regenerated Promise/Effect/JS client
surfaces.
- SessionInstructions service: read tool discovers nearby AGENTS.md walking
up to the Location root (exclusive) and injects them as durable synthetic
instructions, with lazy history dedup of prior claims.
- to-llm-message: stop forwarding synthetic message metadata to the model so
bookkeeping annotations stay model-hidden.
- schema changelog entry for synthetic metadata and the metadata leak fix.