/** * Hash-aware anchor PromQL builder for the cross-pillar primitives * (`metrics_that_moved`, `rank_by_shape_similarity`). * * Both tools accept a pattern anchor as either its Symbol Message NAME * (used as the `message_pattern` PromQL label value) OR its 11-char * `pattern_hash` / `tenx_hash`. Chains driven by `top_patterns` / * `pattern_detail` typically carry the hash forward, NOT the name — * so if these tools only knew how to select on `message_pattern`, the * anchor query would return zero series and the chain would error * with `anchor_not_found`. * * The detection is shape-only: 11 chars, base64url alphabet (RFC 4648, * matching `tenxHash()` output in `pattern-hash.ts`). A match selects on * `LABELS.hash`; anything else selects on `LABELS.pattern`. */ /** * Canonical regex for a `tenx_hash` value. Mirrors the output shape of * `tenxHash()` in `pattern-hash.ts`: base64url-encoded 8-byte xxHash64 * is always exactly 11 characters from the base64url alphabet * (`A-Z a-z 0-9 - _`). No padding. */ export declare const PATTERN_HASH_REGEX: RegExp; /** Returns true when `s` looks like a `pattern_hash` (11-char base64url). */ export declare function looksLikePatternHash(s: string): boolean; /** * Build the anchor `sum(rate(...))` PromQL for a `log10x_pattern`-typed * anchor. Detects hash-shape input and switches the selector label * (`LABELS.hash` vs `LABELS.pattern`) accordingly. * * @param anchor Anchor identity — symbol_message name OR pattern_hash. * @param metricsEnv Environment label value (from `resolveMetricsEnv`). * @param rangeSec Rate window in seconds (already widened by caller). */ export declare function buildPatternAnchorRateQuery(anchor: string, metricsEnv: string, rangeSec: number): string;