code wiki / (root) / nx_writehub_score.nx

nx_writehub_score.nx

buildroot/runtime/nx_writehub_score.nx

4001 B67 linesdepth 2pulls 4 transitivereach 3 importersview sourcekind librarytopic writehub
docsdependenciesstructsconstsfunctions

about

nx_writehub_score.nx -- WRITING HUB shared LIB: the immune-scoring core, extracted from nx_writehub_loop so the loop AND the self-improvement conductor share ONE scorer (consolidation -- no duplicated scoring logic, per the operator's no-dup doctrine). Pure composition of nx_writecraft (readability) + nx_writestyle (adverb/passive/ weak/hard-sentence) -> a composite quality permil + the worst-dimension directive. No main, no I/O beyond scratch mmap, so any organ can import it. Thresholds are heuristic consts here (move to a writehub_rubric data store next, per nx_writestyle's own "consts -> DATA" note). license_tier: ORIGINAL module: nishi-core.writehub.score

dependencies 2 imports · 3 importers

nx_writestyle.nx nx_syscalls.nx nx_writehub_score.nx nx_writehub_conductor.nx nx_writehub_loop.nx nx_writer_serve.nx

imports: nx_writestyle.nxnx_syscalls.nx

imported by: nx_writehub_conductor.nxnx_writehub_loop.nxnx_writer_serve.nx

structs

none

consts

10const WHL_ADVERB_TGT: i64 = 15 // adverbs per 1000 words tolerated before penalty
11const WHL_PASSIVE_TGT: i64 = 10 // passive constructions per 1000 words tolerated
12const WHL_WEAK_TGT: i64 = 8 // weak qualifiers per 1000 words tolerated
13const WHL_ADVERB_W: i64 = 6 // penalty permil per (rate-over-target)/10
14const WHL_PASSIVE_W: i64 = 10
15const WHL_WEAK_W: i64 = 8
16const WHL_HARD_W: i64 = 300 // penalty permil at 100% hard sentences
17const WHL_READ_W: i64 = 80 // flat penalty when grade exceeds the band
18const WHL_FK_MAX: i64 = 12000 // FK grade x1000 ceiling (grade ~12); above = too dense
19const WHL_KEEP: i64 = 700 // composite permil at/above which a draft is KEPT

functions

24func whl_eval(t: *u8, n: i64, rep: *i64) -> i64
60func whl_directive(worst: i64) -> *u8