nx_emit.nx
buildroot/runtime/nx_emit.nx
about
nx_emit.nx -- WRITING arc, rung W-ING-4: turn extracted scene DATA into the two
strings the downstream consumers actually want:
em_image_prompt -> a bare comma-tag prompt for IMAGE-GEN ("mira, garden, dusk")
em_companion_ctx -> a labeled context line for the COMPANION LLM
("present: mira | desc: garden, dusk | dialogue: 1")
Both are deterministic assemblies over (a) the roster names present in the scene
and (b) the descriptor-lexicon terms present in the scene -- reusing the
WHOLE-WORD counter from nx_ingest (DRY). CONTENT-AGNOSTIC: the operator's lane
supplies the real roster + lexicon (incl. outfit/MPL + register terms); the
engine emits the prompt/context identically for any register. It never invents
a tag -- only what is present in the text appears (proven by the empty-scene
neg-control in the gate).
Pure integer, NO syscalls. Caller owns dst (>= a few hundred bytes is ample).
license_tier: ORIGINAL
module: nishi-core.write.emit
depends: nishi-core.write.ingest
capability: WRITE_PROMPT_EMIT
dependencies 2 imports · 2 importers
imports: nx_ingest.nxnx_ingest_scene.nx
imported by: nx_emit_gate.nxnx_write_run.nx
structs
| none |
consts
| none |
functions
| 25 | func em_append(dst: *u8, dlen: i64, src: *u8) -> i64 |
| 34 | func em_append_at(dst: *u8, dlen: i64, terms: *u8, off: i64) -> i64 |
| 43 | func em_append_num(dst: *u8, dlen: i64, v: i64) -> i64 called by 1: em_companion_ctx |
| 60 | func em_append_present(dst: *u8, dlen: i64, t: *u8, a: i64, b: i64, terms: *u8, nterms: i64, lead: i64) -> i64 |
| 77 | func em_image_prompt(t: *u8, a: i64, b: i64, roster: *u8, nnames: i64, dterms: *u8, ndterms: i64, dst: *u8) -> i64 |
| 89 | func em_image_prompt_focus(t: *u8, a: i64, b: i64, roster: *u8, nnames: i64, focus: i64, dterms: *u8, ndterms: i64, dst: *u8) -> i64 |
| 115 | func em_companion_ctx(t: *u8, a: i64, b: i64, roster: *u8, nnames: i64, dterms: *u8, ndterms: i64, dst: *u8) -> i64 |