Adds IndexKey::MetricDeclaration handling: DeclareMetric/RemoveMetricDeclaration engine messages and a MetricDeclarations query, mirroring the pattern from ticket 001's param declarations. Params are derived from inline named capture groups on the metric's own regex for v1 (referencing existing ParamDeclarations is left for a future ticket). Validates the regex and every RegexToMetricPrimitiveMatcher's capture-group reference at declaration time, reporting all bad matchers at once. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XFUNZwCvz3kcod3352ZR2o