spec: add terminfo & capability layer specification
Adds specs/terminfo-spec.md defining the shared capability layer:
- One shared WebAssembly.Memory with three tenants (terminfo region,
renderer heap, input heap); both instances receive explicit region
pointers plus a capability struct pointer. Split-module builds must
link with disjoint static footprints (TINV-7).
- A fixed-layout TermInfo struct: generation counter, max_colors,
capability flag bits, probe-confirmation bits, and a theme group
(OSC 10/11/12 foreground/background/cursor).
- Progressive enhancement (TINV-5): a conservative xterm-256color
baseline owned by the terminfo module, raised only by positive
evidence with precedence baseline < terminfo entry < environment
(COLORTERM) < probe response. This deliberately supersedes the
renderer's historical unconditional truecolor emission.
- Sans-IO probe (TINV-6): a query batch (OSC 10/11/12, kitty OSC 21
color, kitty OSC 22 pointer shape, XTGETTCAP RGB;Tc, DECRQM 2026,
kitty keyboard, kitty graphics) fenced by DA1, with responses
recognized by the input parser during normal scans. queryTermInfo()
is the single blessed entry point; every environmental dependency
(env, terminfo bytes, streams, timeout) is injectable.
Updates input-spec.md: the terminfo option becomes the TermInfo handle;
new normative section 6 covers key_* trie loading and query-response
recognition (responses are consumed silently and never leak into
events); terminfo parsing leaves the deferred list.
Updates renderer-spec.md: new section 7.6 (capability-gated emission)
specifies the color-encoding ladder (truecolor / 256 / 16), bce-gated
erase, the mode-2026 synchronized-output frame wrap, and
generation-triggered full redraw; INV-7 and section 11.2 are amended so
the shared capability layer and the frame-scoped sync wrap cannot be
read as violating renderer/input independence or the no-terminal-state
boundary.
References: OSC 8 spec (egmontkob gist), kitty color-stack and
pointer-shapes protocols, Ghostty synchronized-output guidance.