code wiki / _hdl_build / nx_capability_catalog.nx

nx_capability_catalog.nx source

↩ module page · 49 lines · 2361 B

1// nx_capability_catalog.nx -- a QUERYABLE catalog so the team (and Claude) LOOK UP a capability instead 2// of re-discovering it by grepping (operator: "we shouldn't have to FIND things, we should have 3// DOCUMENTED capabilities"). The human-readable index is knowledge/CAPABILITY_CATALOG.md; this is the 4// machine-checkable side: given a NEED, does the team have it, and is the catalog HONEST about what is 5// NOT built? Composes with the Librarian (doc integrity) + Auditor (sovereignty). license_tier: ORIGINAL 6 7import "nx_syscalls.nx" 8 9// need codes (each maps to a documented module in CAPABILITY_CATALOG.md) 10const CAT_FETCH: i64 = 1 // nx_browse_text 11const CAT_HTTPS: i64 = 2 // nx_https_get 12const CAT_SERVE: i64 = 3 // nx_http_server 13const CAT_SSH: i64 = 4 // nx_ssh_lib 14const CAT_FILEPUT: i64 = 5 // nx_ssh_put (sovereign, no scp) 15const CAT_DEPLOY: i64 = 6 // nx_deploy (with rollback) 16const CAT_SEARCH: i64 = 7 // nx_library_search / nx_bm25 / nx_ppmi_svd 17const CAT_SYNTH: i64 = 8 // nx_boolsynth4 18const CAT_SVD: i64 = 9 // nx_power_iter 19const CAT_WEBBUILD: i64 = 10 // nx_web_builder 20const CAT_JUDGE: i64 = 11 // nx_referee 21const CAT_AUDIT: i64 = 12 // nx_auditor 22const CAT_DNS: i64 = 13 // nx_dns_resolve_a_record 23const CAT_CRAWL: i64 = 14 // nx_crawl_* 24// honestly NOT built (so a lookup returns NO instead of sending someone grepping for it): 25const CAT_FILEGET: i64 = 15 // SSH file-GET -- only PUT exists 26const CAT_EMBED_LEARNED: i64 = 16 // learned embeddings -- the LLM-gap (PPMI is the sovereign proxy) 27 28const CAT_N: i64 = 16 29 30// does the team HAVE this capability? (documented = answerable without archaeology) 31func cat_have(need: i64) -> i64 { 32 if need == CAT_FILEGET { return 0 } 33 if need == CAT_EMBED_LEARNED { return 0 } 34 if need >= 1 { if need <= 14 { return 1 } } 35 return 0 36} 37 38// coverage over a need-set: how many the team has. 39func cat_coverage(needs: *i64, n: i64) -> i64 { 40 var c: i64 = 0; var i: i64 = 0 41 while i < n { if cat_have(needs[i]) == 1 { c = c + 1 } i = i + 1 } 42 return c 43} 44 45// is the catalog HONEST -- i.e. does it admit the things it does NOT have? (so lookups never mislead) 46func cat_admits_gaps() -> i64 { 47 if cat_have(CAT_FILEGET) == 0 { if cat_have(CAT_EMBED_LEARNED) == 0 { return 1 } } 48 return 0 49}