Resolve the agent-product identity (which AI agent tool drives this binary —
e.g. claude-code, codex, opencode, gemini-cli) from the INNATE_AGENT
env var. The caller (MCP config / hook / shell) injects it; the binary cannot
know it otherwise. Returns None when unset/blank so the agent column stays
NULL (backward compatible). This is orthogonal to the access channel recorded
in usage_trace.source / episodic_log.event_source (mcp/cli/hook/…).
Trimmed and length-capped; intentionally not enum-constrained.
Lowercase hex encoding of a byte slice. Replaces the old format!("{:x}", …)
over a digest output: RustCrypto digest 0.11 returns hybrid_array::Array,
which no longer implements LowerHex.
In-place L2 normalisation. Zero vectors are left unchanged (all zeros).
Pre-normalising stored vectors lets vector search reduce cosine similarity
to a plain dot product in its O(N) inner loop.