// Package connector_inbound_routing provides the L0 substrate for
// pack-declared connector inbound routing.
//
// # Substrate ownership
//
// This package is the single source of truth for:
//   - The RouteResolver interface and NoopRouteResolver (consumed by the
//     connector-inbound Worker, which accepts the interface for testing).
//   - DBRouteResolver: the production implementation backed by
//     _System_ConnectorInboundRoute rows.
//   - loadConnectorInboundRouteFlowName: the unexported helper that issues
//     the JOIN+hash-drift SQL query. Only DBRouteResolver.ResolveFlow calls it.
//   - ErrRouteNotDeclared: the sentinel error returned when no active,
//     hash-stable pack owns a route for the given (namespace, eventKind).
//
// # Install lifecycle
//
// Pack manifest component kind "connector_inbound_route" is handled by
// ConnectorInboundRouteComponent in backend/internal/controlplane/packs/.
// That component writes rows to _System_ConnectorInboundRoute at install time
// and soft-deletes stale rows at sweep time.
//
// # Read path
//
// DBRouteResolver.ResolveFlow is the only authoritative read path for routing
// decisions. It enforces:
//   - pack must be Status='active' (not installing, removing, or deleted)
//   - pack PackInstallId must be non-empty (backfill applied)
//   - AppliedPayloadHash == DesiredPayloadHash (no in-flight apply)
//   - route row IsDeleted=0
//
// This matches the "single atomic JOIN" pattern established by
// IsCapabilityDeclaredByConnectorPack (installed_pack_helpers.go) and
// mandated by the IANTHEREAL gate-merge round-3 BLOCK that motivated
// hash-drift safety.
package connector_inbound_routing
