code wiki / (root) / nx_caption_emit.nx

nx_caption_emit.nx

buildroot/runtime/nx_caption_emit.nx

12515 B338 linesdepth 7pulls 10 transitivereach 2 importersview sourcekind librarytopic caption
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_storybeat.nx nx_storydb.nx nx_media_pool.nx nx_scene_index.nx nx_pov_shift.nx nx_caption_emit.nx nx_caption_emit_test.nx nx_ingest_cli.nx

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

59const NX_MAGIC_8192: i64 = 8192
63const NX_CAP_FORMAT_UNKNOWN: i64 = 0
64const NX_CAP_FORMAT_JOYCAPTION: i64 = 1
65const NX_CAP_FORMAT_LITEROTICA: i64 = 2
66const NX_CAP_FORMAT_PROMPT_TEXT: i64 = 3
67const NX_CAP_FORMAT_AUDIO_TTS: i64 = 4
68const NX_CAP_FORMAT_RAW_JSON: i64 = 5
72const NX_CAP_OK: i64 = 0
73const NX_CAP_BAD_CAND: i64 = -1
74const NX_CAP_BAD_BEAT: i64 = -2
75const NX_CAP_OUTPUT_FULL: i64 = -3
76const NX_CAP_UNKNOWN_FORMAT: i64 = -4

functions

80func nx_cap_load_u8(p: *u8, i: i64) -> i64
85func nx_cap_store_u8(p: *u8, i: i64, v: i64)
90func nx_cap_append_byte(dst: *u8, pos: *i64, cap: i64, b: i64)
97func nx_cap_append_lit(dst: *u8, pos: *i64, cap: i64, s: *u8)
109func nx_cap_append_range(dst: *u8, pos: *i64, cap: i64,
126func nx_cap_append_int(dst: *u8, pos: *i64, cap: i64, v: i64)
154func nx_cap_load_span(db: *StoryDb, cand: *SceneCandidate,
171func nx_caption_emit_literotica(db: *StoryDb, cand: *SceneCandidate,
198func nx_caption_emit_joycaption(db: *StoryDb, cand: *SceneCandidate,
217func nx_caption_emit_prompt_text(db: *StoryDb, cand: *SceneCandidate,
234func nx_caption_emit_audio_tts(db: *StoryDb, cand: *SceneCandidate,
242func nx_caption_emit_raw_json(db: *StoryDb, cand: *SceneCandidate,
316func nx_caption_emit(format: i64, db: *StoryDb, idx: *SceneIndex,