pub fn resolve_explicit_namespace(
params: &Value,
default_namespace: &str,
) -> Result<Namespace, RuntimeError>Expand description
Resolve and validate a caller-supplied namespace argument the same way
on every MCP ingress path.
- Absent
namespacekey → parsedefault_namespace. - Present
namespace: "<string>"→ parse the caller’s value. - Present non-string
namespace(null, number, bool, array, object) → fail closed withRuntimeError::InvalidInput. ADR-018 requires this: a malformed explicit value must never be silently coerced to the default namespace.
This is the single chokepoint both VerbRegistry::dispatch (single-backend
and JSON-form ingress) and the multi-backend coordinator intercept
(dispatch_via_coordinator_inner in khive-mcp) call into, so no ingress
path can bypass the fail-closed rule by routing around dispatch.