nx_pov_shift.nx
buildroot/runtime/nx_pov_shift.nx
about
nx_pov_shift.nx -- 3rd-person -> 1st-person POV transform.
Takes source text (post-HTML-strip, post-text-ingest) and emits
a variant where the chosen protagonist's pronouns shift to
first person. The OTHER characters' pronouns stay 3rd person.
Use case (from user):
"the story needs to happen like a literotica story from my pov
which i think may be both but the output has to go into a joy
caption and future nishi captioning machine for some systems
like z image, for audio like erotica that we can train to be
like an erotic novel via comping to s class"
So we emit TWO variants per source paragraph:
1. USER_AS_I -- protagonist pronouns become "I/me/my".
Reads as literotica narrator-as-reader.
2. COMPANION_AS_HER -- companion stays "she/her" so image-prompt
downstreams (z-image / JoyCaption / future
Nishi captioner) get a clean scene
description with the visible character
described in third person.
Both variants are emitted; the caller picks per downstream
(audio narration uses USER_AS_I, image prompt uses
COMPANION_AS_HER, video sub-system picks based on its prompt
schema).
Per cardinal feedback-build-intelligence-never-strip-features:
every replacement preserves SOURCE BYTE LENGTH AND ORDERING
outside of the substitution. No paragraph re-flow, no
punctuation normalization, no quotation-mark "smartening".
nx_safety_envelope:
intended_use: "Transform 3rd-person source text to 1st-
person POV for the chosen protagonist
gender, leaving other characters in 3rd
person. Emits user-as-I and companion-
as-her variants per source span."
sil_target: SIL2
asil_target: QM
dependencies 1 imports · 3 importers
imports: nx_syscalls.nx
imported by: nx_caption_emit.nxnx_caption_emit_test.nxnx_ingest_cli.nx
structs
| none |
consts
| 63 | const NX_POV_GENDER_UNKNOWN: i64 = 0 |
| 64 | const NX_POV_GENDER_HE: i64 = 1 // male protagonist -> "I" |
| 65 | const NX_POV_GENDER_SHE: i64 = 2 // female protagonist -> "I" |
| 66 | const NX_POV_GENDER_THEY: i64 = 3 // they/them protagonist -> "I" |
| 70 | const NX_POV_VARIANT_SOURCE: i64 = 0 // verbatim source |
| 71 | const NX_POV_VARIANT_USER_AS_I: i64 = 1 // protagonist -> I |
| 72 | const NX_POV_VARIANT_COMPANION_3RD: i64 = 2 // protagonist stays 3rd |
functions
| 76 | func nx_pov_load_u8(p: *u8, i: i64) -> i64 |
| 81 | func nx_pov_store_u8(p: *u8, i: i64, v: i64) called by 1: nx_pov_shift |
| 86 | func nx_pov_to_lower(c: i64) -> i64 called by 1: nx_pov_shift |
| 93 | func nx_pov_is_upper(c: i64) -> i64 called by 1: nx_pov_shift |
| 100 | func nx_pov_is_alnum(c: i64) -> i64 called by 1: nx_pov_shift |
| 124 | func nx_pov_replacement(gender: i64, src_word: *u8, src_len: i64, |
| 345 | func nx_pov_apply_case(out_byte: i64, was_upper: i64) -> i64 called by 1: nx_pov_shift |
| 360 | func nx_pov_shift(gender: i64, src: *u8, n: i64, |