nx_librarian_review.nx
buildroot/runtime/nx_librarian_review.nx
about
nx_librarian_review.nx -- ORCHESTRATION rung 1: the LIBRARIAN auto-reviews the RESEARCHER's ingested
material and flags what is "not up to scruff" -- WITHOUT the operator having to ask. This is the first
two-teams-in-conjunction workstream (operator 2026-07-10: "the researcher could work with the librarian
without me having to be explicit to review our already ingested material and callout to the librarian if
its not up to scruff ... true orchestration like an orchestra").
RACI for the REVIEW-INGESTED-MATERIAL workstream (recorded on the seg-store, not asserted):
Responsible = librarian (runs the review) Accountable = librarian
Consulted = researcher (owns the material) Informed = operator + critic
The librarian's quality bar per doc (mechanically checked, integer-only):
(1) FOUNDATIONED -- a signed credential exists (knowledge/foundation/cred/<name>.nxpc1). #1 trust gate.
(2) SUBSTANTIVE -- byte length >= a data-driven floor (empty/stub docs are not knowledge).
(3) NOT-TRUNCATED -- length < the CID read cap (a doc AT the cap was truncated before content-address).
A doc failing any -> NOT-UP-TO-SCRUFF, logged + counted, and the handoff record carries the flag count so
the researcher (Consulted) is auto-informed to re-fetch/deepen. Read-only over the library; writes only the
review log + one seg-store handoff record. Composes nothing it shouldn't (DRY). license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_seg_store.nx
imported by: nx_librarian_review_gate.nx
structs
| none |
consts
| 19 | const LR_MAGIC_65536: i64 = 65536 |
| 21 | const LR_LIBDIR: *u8 = "knowledge/library" |
| 22 | const LR_CREDDIR: *u8 = "knowledge/foundation/cred" |
| 23 | const LR_LOG: *u8 = "knowledge/status/librarian_review.log" |
| 24 | const LR_STORE: *u8 = "knowledge/store/orchestration-" |
| 25 | const LR_MINBYTES: i64 = 200 // data-driven substantive floor |
| 26 | const LR_CIDCAP: i64 = 262143 // the ingest_foundation read cap (>= this => truncated) |
functions
| 28 | func lr_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 29 | func lr_cat(dst: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} dst[o]=0 as u8; return o } |
| 30 | func lr_w(fd: i64, s: *u8) -> i64 { sys_write(fd, s, lr_slen(s)); return 0 } |
| 31 | func lr_wn(fd: i64, v0: i64) -> i64 |
| 37 | func lr_ends(name: *u8, suf: *u8) -> i64 |
| 42 | func lr_fsize(path: *u8) -> i64 |
| 46 | func lr_exists(path: *u8) -> i64 |
| 52 | func lr_one(name: *u8, counts: *i64, logfd: i64) -> i64 |
| 71 | func lr_handoff(reviewed: i64, scruff: i64, flagged: i64) -> i64 |
| 90 | func lr_run(counts: *i64) -> i64 |