code wiki / hub / nx_nxsite_spec.nx

nx_nxsite_spec.nx

buildroot/runtime/hub/nx_nxsite_spec.nx

16406 B413 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_nxsite_spec.nx -- V-PROV-1: sealed NxSiteDeploymentSpec struct + sealed-enum kinds + per-field constants. Per NISHI_SITE_PROVISIONING_CHARTER §3: ONE sealed declarative spec drives all three frontends (CLI / UI / AI) -> one provisioner backend. This module defines the data model; parser (nx_nxsite_parse) reads .nxsite files; validator (nx_nxsite_validate) checks integrity; applier (nx_site_provisioner) executes. COMPOSES (per "avoid duplicate primitives"): nx_syscalls.sys_mmap (struct allocation) Reuses NxVHostTable + nx_pages_config conventions where applicable COMPOSED BY: hub/nx_nxsite_parse.nx (line-walker fills this struct from .nxsite text) hub/nx_nxsite_validate.nx (checks sealed-enum ranges + cross-section consistency) hub/nx_site_provisioner.nx (V-PROV-2; applies sealed spec to live substrate) V-PROV-1 SCOPE: - 9 sealed sections (per charter §3.2): site, dns, tls, content, auth, routes, rate_limit, telemetry, deploy - Sealed enum kinds for cert_kind, content_format, route_handler - String pool storage (caller-allocated; M4 buf-own) - Per-section sub-arrays (DNS records, routes, rate_limit buckets) Status: V-PROV-1. 2026-05-27.

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_nxsite_spec.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

122struct NxNspecDnsRecord
135struct NxNspecRoute
144struct NxNspecRateBucket
159struct NxSiteDeploymentSpec

consts

31const NX_NSPEC_OK: i64 = 0
32const NX_NSPEC_BAD_INPUT: i64 = 3500
33const NX_NSPEC_POOL_FULL: i64 = 3501
34const NX_NSPEC_TOO_MANY_RECORDS: i64 = 3502
35const NX_NSPEC_TOO_MANY_ROUTES: i64 = 3503
36const NX_NSPEC_TOO_MANY_BUCKETS: i64 = 3504
37const NX_NSPEC_VALUE_TOO_LONG: i64 = 3505
38const NX_NSPEC_BAD_ENUM: i64 = 3506
41const NX_NSPEC_STRING_POOL_CAP: i64 = 65536 // 64 KB packed string pool
42const NX_NSPEC_MAX_DNS_RECORDS: i64 = 64
43const NX_NSPEC_MAX_ROUTES: i64 = 32
44const NX_NSPEC_MAX_RATE_BUCKETS: i64 = 16
45const NX_NSPEC_MAX_FIELD_LEN: i64 = 1024 // per-value cap
46const NX_NSPEC_MAX_NAME_LEN: i64 = 255 // hostname per RFC 1035
47const NX_NSPEC_SPEC_VERSION: *u8 = "1.0.0" as *u8
48const NX_NSPEC_SPEC_VERSION_N: i64 = 5
51const NX_NSPEC_CERT_KIND_NONE: i64 = 0
52const NX_NSPEC_CERT_KIND_SOVEREIGN_SELF: i64 = 1 // sovereign self-signed
53const NX_NSPEC_CERT_KIND_SOVEREIGN_MINI_CA: i64 = 2 // sovereign operator-CA-issued (V+2)
54const NX_NSPEC_CERT_KIND_N: i64 = 3
64const NX_NSPEC_CONTENT_NONE: i64 = 0
65const NX_NSPEC_CONTENT_NISHI_PAGE_V1: i64 = 1
66const NX_NSPEC_CONTENT_STATIC_HTML: i64 = 2
67const NX_NSPEC_CONTENT_MIRROR_LAYER: i64 = 3
68const NX_NSPEC_CONTENT_N: i64 = 4
79const NX_NSPEC_ROUTE_NONE: i64 = 0
80const NX_NSPEC_ROUTE_STATIC: i64 = 1
81const NX_NSPEC_ROUTE_WIKI_DAEMON: i64 = 2
82const NX_NSPEC_ROUTE_SEARCH_HANDLER: i64 = 3
83const NX_NSPEC_ROUTE_ADMIN_PANEL: i64 = 4
84const NX_NSPEC_ROUTE_SITE_API: i64 = 5
85const NX_NSPEC_ROUTE_404: i64 = 6
86const NX_NSPEC_ROUTE_N: i64 = 7
100const NX_NSPEC_DNS_NONE: i64 = 0
101const NX_NSPEC_DNS_A: i64 = 1
102const NX_NSPEC_DNS_AAAA: i64 = 2
103const NX_NSPEC_DNS_MX: i64 = 3
104const NX_NSPEC_DNS_TXT: i64 = 4
105const NX_NSPEC_DNS_CNAME: i64 = 5
106const NX_NSPEC_DNS_NS: i64 = 6
107const NX_NSPEC_DNS_N: i64 = 7
132const NX_NSPEC_DNS_RECORD_BYTES: i64 = 56
141const NX_NSPEC_ROUTE_BYTES: i64 = 24
152const NX_NSPEC_RATE_BUCKET_BYTES: i64 = 40

functions

56func nx_nspec_cert_kind_name(k: i64) -> *u8
70func nx_nspec_content_format_name(f: i64) -> *u8
88func nx_nspec_route_handler_name(h: i64) -> *u8
109func nx_nspec_dns_kind_name(k: i64) -> *u8
241func nx_nxsite_spec_init(s: *NxSiteDeploymentSpec,
calls 1: sys_mmap
303func nx_nspec_pool_append(s: *NxSiteDeploymentSpec,
318func nx_nspec_dns_record_at(s: *NxSiteDeploymentSpec, i: i64) -> *NxNspecDnsRecord
325func nx_nspec_route_at(s: *NxSiteDeploymentSpec, i: i64) -> *NxNspecRoute
332func nx_nspec_rate_bucket_at(s: *NxSiteDeploymentSpec, i: i64) -> *NxNspecRateBucket
341func nx_nspec_dns_add(s: *NxSiteDeploymentSpec,
359func nx_nspec_route_add(s: *NxSiteDeploymentSpec,
373func nx_nspec_rate_add(s: *NxSiteDeploymentSpec,
393func nx_nspec_site_name(s: *NxSiteDeploymentSpec, out_ptr: *i64, out_n: *i64) -> i64
400func nx_nspec_dns_records_count(s: *NxSiteDeploymentSpec) -> i64
405func nx_nspec_routes_count(s: *NxSiteDeploymentSpec) -> i64
410func nx_nspec_rate_buckets_count(s: *NxSiteDeploymentSpec) -> i64