nx_ingest_cli.nx
buildroot/runtime/nx_ingest_cli.nx
about
nx_ingest_cli.nx -- CLI driver for the paste-HTML -> POV-caption pipeline.
Reads raw HTML from stdin (up to 256 KiB), runs the full Tier 0-5
ingestion stack, and writes the POV-shifted Literotica caption to
stdout. Exit code 0 on success.
Usage (under qemu-riscv64-static):
cat chapter.html | qemu-riscv64-static _offc/nx_ingest_cli.elf
Or via the bench wrapper:
bench/nx_ingest_cli.sh path/to/chapter.html
Workflow today (TLS-blocked):
1. Browser -> open the source page (literotica chapter, nhentai
gallery, fanfiction.net chapter, anywhere)
2. Ctrl+U to view source, save as .html OR copy-paste into a
file
3. Pipe that file into this CLI
4. POV-shifted first-person caption arrives on stdout
Workflow once TLS unblocks (SHA-256 fix):
1. The same CLI accepts a URL arg
2. Internally calls nx_media_fetch URL transport
3. Same pipeline
Per cardinal feedback-user-owns-every-bit: this is a one-shot
process, no background daemon, no auto-cataloging without
caller opt-in. Output goes to stdout; the user redirects.
nx_safety_envelope:
intended_use: "CLI adapter that runs paste-HTML through
the full ingestion + caption pipeline,
emitting POV-shifted output to stdout."
sil_target: SIL2
asil_target: QM
dal_target: DAL C
iec_62304_class: NONE
evidence: [no_floating_point,
dependencies 14 imports · 0 importers
diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_media_pool.nxnx_storybeat.nxnx_storydb.nxnx_html_extract.nxnx_text_ingest.nxnx_term_registry.nxnx_term_extract.nxnx_term_cooccur.nxnx_arc_anchor.nxnx_scene_index.nxnx_pov_shift.nxnx_caption_emit.nxnx_content_guard.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
| 65 | const NX_MAGIC_4096: i64 = 4096 |
| 67 | const NX_INGEST_INPUT_CAP: i64 = 262144 // 256 KiB |
| 68 | const NX_INGEST_OUTPUT_CAP: i64 = 524288 // 512 KiB |
| 71 | const NX_INGEST_DEFAULT_GENDER: i64 = 1 // NX_POV_GENDER_HE |
| 74 | const NX_INGEST_DEFAULT_FORMAT: i64 = 2 // NX_CAP_FORMAT_LITEROTICA |
functions
| 76 | func nx_ingest_read_stdin(buf: *u8, cap: i64) -> i64 |
| 99 | func nx_ingest_write_stdout(buf: *u8, n: i64) -> i64 |
| 119 | func nx_ingest_log(s: *u8, n: i64) -> i64 |
| 123 | func main() -> i64 |