nx_forge_rag.nx
buildroot/runtime/nx_forge_rag.nx
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
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
structs
| none |
consts
| 11 | const RG_MAGIC_1024: i64 = 1024 |
| 12 | const RG_MAGIC_1000000: i64 = 1000000 |
| 14 | const RG_SRCCAP: i64 = 4096 |
| 15 | const RG_TASKCAP: i64 = 16384 |
| 16 | const RG_PACKCAP: i64 = 262144 |
| 17 | const RG_KMAX: i64 = 8 |
functions
| 19 | func rg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 39 | func rg_wb(fd: i64, p: *u8, n: i64) -> i64 |
| 51 | func rg_ws(fd: i64, s: *u8) -> i64 |
| 58 | func rg_inject(fd: i64, name: *u8, pm: i64, rank: i64) -> i64 |
| 95 | func main(argc: i64, argv: *i64) -> i64 |