Typed validation failure surfaced by RequestValidator entry
points. Carries the offending field name and a reason string
matching the existing bail! shape so the wire-side error
messages remain byte-equal to the pre-#966 surface.
v0.7.x (issue #1175) — the canonical vendor-neutral substrate
default for source on AI-NHI-minted rows. Use this constant at
every substrate write site that previously hardcoded "claude".
Normalize a namespace input to the canonical form accepted by
validate_namespace. Not called by write paths (would lowercase
existing flat namespaces and break their lookup keys); instead exposed
as a helper that callers opt into, and used by Task 1.5+ when accepting
user-typed hierarchical paths.
Shape-only validation for an agent identifier — the pre-#977
behaviour, separated so internal callers that legitimately need to
load/generate keypairs with reserved-sentinel labels (e.g. the
daemon’s own self-signing keypair under
crate::identity::keypair::DAEMON_KEYPAIR_LABEL) can opt into
the looser check.
Validate a [GovernancePolicy] (Task 1.8). Closed-set tag checks are
already handled by serde on deserialization; this adds semantic bounds:
consensus quorum must be ≥ 1, Agent references must pass
validate_agent_id, and the policy as a whole must not use
GovernanceLevel::Approve without a meaningful approver.
Validate a visibility scope against the closed VALID_SCOPES set
(Task 1.5). Enforced on write paths that accept an explicit scope
parameter. Memories with no scope metadata are treated as private
by the query layer without needing explicit validation here.
Validate update fields (only validates present fields).
Note: expires_at allows past dates in updates for programmatic TTL management
and GC testing — only format is validated, not chronological ordering.