code wiki / (root) / nx_forge_rag.nx

nx_forge_rag.nx

buildroot/runtime/nx_forge_rag.nx

8389 B229 linesdepth 8pulls 13 transitivereach 0 importersview sourcekind tooltopic forge
docsdependenciesstructsconstsfunctions

about

nx_forge_rag.nx v2 (TOP-K) -- augment the coding pack with the TOP-K semantically-retrieved verified organs as exemplars (was top-1; eats the noisy-top-1 debt: a single soft-margin hit can miss, k hits are robust). Reuses nx_code_index internals (ci_embed + ci_store_load + ci_cos_pm) for a k-best scan WITHOUT editing the gated retriever; injects each hit's source. ADDITIVE (does NOT touch fc_emit). Path from basename: runtime/<name> then runtime/_hdl_build/<name>. Own rg_* file helpers. usage: nx_forge_rag augment <taskfile> <basepack> <store> <port> <k> <outpack> license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_code_index.nx nx_lib_std.nx nx_syscalls.nx nx_forge_rag.nx

imports: nx_code_index.nxnx_lib_std.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ci_ws sys_exit std_streq std_atoi sys_mmap rg_read sys_openat_rd sys_read sys_close ci_embed ci_build_body fc_json_esc_bytes ci_post_embed sys_socket nx_http_client_sockaddr_ip nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll nx_http_client_build_reque nx_dec_emit_u63 _drain sys_read ↻ ci_parse_vec ci_find std_slen ci_store_load sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ ci_cos_pm ci_isqrt sys_openat_wr rg_wb sys_write

structs

none

consts

11const RG_MAGIC_1024: i64 = 1024
12const RG_MAGIC_1000000: i64 = 1000000
14const RG_SRCCAP: i64 = 4096
15const RG_TASKCAP: i64 = 16384
16const RG_PACKCAP: i64 = 262144
17const RG_KMAX: i64 = 8

functions

19func rg_read(path: *u8, buf: *u8, cap: i64) -> i64
39func rg_wb(fd: i64, p: *u8, n: i64) -> i64
called by 3: rg_wsrg_injectmain calls 1: sys_write
51func rg_ws(fd: i64, s: *u8) -> i64
called by 1: rg_inject calls 2: std_slenrg_wb
58func rg_inject(fd: i64, name: *u8, pm: i64, rank: i64) -> i64
95func main(argc: i64, argv: *i64) -> i64