Expand description
The request feature vector (SPEC §9.2) — deterministic, versioned, privacy-preserving.
Features are the input to routing policy. They are extracted deterministically from a
request so that the same request always produces the same vector (a precondition for a
re-derivable audit trail), and they are privacy-preserving by construction: no raw
prompt text, only coarse buckets and salted hashes. The vector is versioned
(FEATURE_VERSION); a change to how any feature is computed bumps the version so old
traces remain interpretable.
Structs§
- Features
- The per-request feature vector (§9.2).
Enums§
- Task
Kind - Coarse task classification.
Otheris the safe default when classification is uncertain.
Constants§
- FEATURE_
VERSION - Version of the feature-extraction contract. Bump on any change to how a feature is
computed. Recorded per trace as
features@vN.
Functions§
- hour_
bucket - Hour-of-day bucket in UTC (
0..=23) for a timestamp — a routing feature (traffic varies by hour) that leaks nothing finer than the hour. - repo_
fingerprint - Salted, truncated fingerprint of a repository identity: the first 16 hex chars of
SHA-256(salt || 0x00 || repo). - token_
bucket - Bucket a token count into a coarse, privacy-preserving band:
floor(log2(n)), with0and1both mapping to bucket0.