nx_caption_emit.nx
buildroot/runtime/nx_caption_emit.nx
about
nx_caption_emit.nx -- caption-format output for downstream consumers.
Takes POV-shifted beats from the ingestion stack and emits them
in formats suitable for the downstream prompt / narration /
generation systems the user named:
- JoyCaption (today)
- future Nishi captioning machine
- z-image (image generation)
- audio narration / erotic-novel TTS (Qwen-class)
- video (Qwen / LTX / others, schema TBD)
- GIFs (TBD)
Output formats provided here:
CAP_FORMAT_JOYCAPTION -- single paragraph per scene, scene-
description voice, dense imagery,
3rd-person on visible characters
CAP_FORMAT_LITEROTICA -- 1st person narrative (user-as-I)
preserving source phrasing
CAP_FORMAT_PROMPT_TEXT -- comma-separated tag-style image prompt
CAP_FORMAT_AUDIO_TTS -- 1st-person narrative with explicit
paragraph breaks, optimized for TTS
rhythm (ellipses + commas preserved)
CAP_FORMAT_RAW_JSON -- structured emit for the future Nishi
captioner that can pick its own
stencil from scene metadata
Per cardinal feedback-build-intelligence-never-strip-features:
every emission preserves the source text bytes outside of
format-specific separators / metadata. No re-summarization, no
content reduction.
nx_safety_envelope:
intended_use: "Render POV-shifted beats from a SceneCandidate
into downstream prompt / narration / generation
formats."
sil_target: SIL2
asil_target: QM
dal_target: DAL C
iec_62304_class: NONE
dependencies 6 imports · 2 importers
imports: nx_syscalls.nxnx_storybeat.nxnx_storydb.nxnx_media_pool.nxnx_scene_index.nxnx_pov_shift.nx
imported by: nx_caption_emit_test.nxnx_ingest_cli.nx
structs
| none |
consts
| 59 | const NX_MAGIC_8192: i64 = 8192 |
| 63 | const NX_CAP_FORMAT_UNKNOWN: i64 = 0 |
| 64 | const NX_CAP_FORMAT_JOYCAPTION: i64 = 1 |
| 65 | const NX_CAP_FORMAT_LITEROTICA: i64 = 2 |
| 66 | const NX_CAP_FORMAT_PROMPT_TEXT: i64 = 3 |
| 67 | const NX_CAP_FORMAT_AUDIO_TTS: i64 = 4 |
| 68 | const NX_CAP_FORMAT_RAW_JSON: i64 = 5 |
| 72 | const NX_CAP_OK: i64 = 0 |
| 73 | const NX_CAP_BAD_CAND: i64 = -1 |
| 74 | const NX_CAP_BAD_BEAT: i64 = -2 |
| 75 | const NX_CAP_OUTPUT_FULL: i64 = -3 |
| 76 | const NX_CAP_UNKNOWN_FORMAT: i64 = -4 |
functions
| 80 | func nx_cap_load_u8(p: *u8, i: i64) -> i64 |
| 85 | func nx_cap_store_u8(p: *u8, i: i64, v: i64) |
| 90 | func nx_cap_append_byte(dst: *u8, pos: *i64, cap: i64, b: i64) called by 4: nx_cap_append_litnx_cap_append_rangenx_cap_append_intnx_caption_emit_raw_json calls 1: nx_cap_store_u8 |
| 97 | func nx_cap_append_lit(dst: *u8, pos: *i64, cap: i64, s: *u8) |
| 109 | func nx_cap_append_range(dst: *u8, pos: *i64, cap: i64, |
| 126 | func nx_cap_append_int(dst: *u8, pos: *i64, cap: i64, v: i64) called by 1: nx_caption_emit_raw_json calls 4: nx_cap_append_bytesys_mmapnx_cap_store_u8nx_cap_load_u8 |
| 154 | func nx_cap_load_span(db: *StoryDb, cand: *SceneCandidate, |
| 171 | func nx_caption_emit_literotica(db: *StoryDb, cand: *SceneCandidate, |
| 198 | func nx_caption_emit_joycaption(db: *StoryDb, cand: *SceneCandidate, |
| 217 | func nx_caption_emit_prompt_text(db: *StoryDb, cand: *SceneCandidate, |
| 234 | func nx_caption_emit_audio_tts(db: *StoryDb, cand: *SceneCandidate, |
| 242 | func nx_caption_emit_raw_json(db: *StoryDb, cand: *SceneCandidate, |
| 316 | func nx_caption_emit(format: i64, db: *StoryDb, idx: *SceneIndex, |