code wiki / _hdl_build / nx_shard_registry.nx

nx_shard_registry.nx

buildroot/runtime/_hdl_build/nx_shard_registry.nx

4477 B86 linesdepth 3pulls 3 transitivereach 13 importersview sourcekind librarytopic shard
docsdependenciesstructsconstsfunctions

about

nx_shard_registry.nx -- the SSOT reader for the Nishi SHARDED ecosystem (CAP-SHARD-REGISTRY). Industry best-practice for managing many shards/tenants = ONE control plane over a REGISTRY of data planes (AWS Organizations' account tree, k8s fleet's cluster registry, a SaaS tenant catalog: "onboard a tenant = write a row to the registry"). This reads knowledge/hosting/shards.conf -- one row per shard = the JOIN the ecosystem lacked (domain x service x port x identity x roles x health, today scattered across ~8 confs). The control plane (nx_mgmt_api /api/shards) enumerates + ADDRESSES every shard by shard-id, and per-shard AUTH (realm) + per-shard RBAC (roles_path) become DATA not code -- which is exactly how one canonical realm scopes authority per shard WITHOUT the rejected dual-realm hack. Composes the shipped slk_* TSV parsers (nx_site_lock_lib). Add a shard = a row + reload, no recompile. row: shard_id <TAB> domain <TAB> service <TAB> port <TAB> realm <TAB> keys <TAB> store <TAB> roles_path <TAB> health_flow license_tier: ORIGINAL

dependencies 1 imports · 4 importers

nx_site_lock_lib.nx nx_shard_registry.nx nx_shard_governance_gate.nx nx_shard_rbac_gate.nx nx_shard_registry_gate.nx nx_shard_view.nx

imports: nx_site_lock_lib.nx

imported by: nx_shard_governance_gate.nxnx_shard_rbac_gate.nxnx_shard_registry_gate.nxnx_shard_view.nx

structs

none

consts

13const SR_F_ID: i64 = 0 // shard-id -- the PRIMARY KEY the control plane targets (e.g. andelinwest-portal)
14const SR_F_DOMAIN: i64 = 1
15const SR_F_SERVICE: i64 = 2
16const SR_F_PORT: i64 = 3
17const SR_F_REALM: i64 = 4 // the shard's OPAQUE realm (canonical for control-plane shards; own realm for tenant silos)
18const SR_F_KEYS: i64 = 5
19const SR_F_STORE: i64 = 6
20const SR_F_ROLES: i64 = 7 // the per-shard roles file -- THE per-shard-RBAC crux (ag_uid_to_level's 4th arg)
21const SR_F_HEALTH: i64 = 8 // the functional health flow name (funcchecks.conf) for real round-trip truth

functions

24func sr_count(reg: *u8, n: i64) -> i64
35func sr_field_at(reg: *u8, ls: i64, le: i64, f: i64, out: *u8, cap: i64) -> i64
called by 2: sr_roles_ofsv_kv calls 1: slk_field
47func sr_field_int(reg: *u8, ls: i64, le: i64, f: i64) -> i64
55func sr_find_by_id(reg: *u8, n: i64, id: *u8, idlen: i64, out_le: *i64) -> i64
73func sr_roles_of(reg: *u8, n: i64, id: *u8, idlen: i64, out: *u8, cap: i64) -> i64
81func sr_port_of(reg: *u8, n: i64, id: *u8, idlen: i64) -> i64
called by 1: main calls 2: sr_find_by_idsr_field_int