← Context / specs
Chat Context-Awareness Architecture — three layers (workspace as context broker, slab-assembly contract, verb registry) that grow the in-app chat from prompt-only to surface-aware verb router
The agent-chat surface (`apps/chat/`) already has working scaffolding — Anthropic SDK in `services/prompt-runner/src/chat-turn.ts`, four cache-eligible system slabs assembled in `services/workspace/src/chat.ts`, three response modes (chat_answer / chat_propose / chat_invoke), the Svelte transcript + proposal-card surface. What makes it feel narrow is two design holes the v0.0.1 implementation deliberately left open: the verb roster is hand-written and prompt-only, and the context slab inlines `record_set_id` and nothing else. This spec defines the architecture for closing both — workspace as the single source of truth for *what the user is looking at right now and what client they're in*, a slab-assembly contract that names every dimension of context the chat can use, and a verb registry that derives the model's tool roster from `CAPABILITY_TO_SUBJECT` + per-verb args schemas rather than from a hand-edited prose block. The corpus-inbox `/inbox` verb (shipped 2026-06-08 as the first non-prompt verb) is the load-bearing demo: it works because the context slab now carries `active_client_id`, and it points at the seams the spec is here to formalize.