code wiki / (root) / nx_writehub_census.nx

nx_writehub_census.nx source

↩ module page · 125 lines · 16320 B

1// nx_writehub_census.nx -- the MEASURED, HONEST census for the WRITING HUB (operator 2026-06-30: a sovereign 2// text spine for ALL systems -- erotica->novel->fiction->non-fiction, companion (Elara), D&D, image-gen sync, 3// system-data growth -- "growing on its own and autonomously improving", matching Google's Alpha series and 4// going s-class-exceed). Grounded in the sovereign researcher (knowledge/fetched/write_*.raw, 37 sources banked 5// over TLS-1.3 this session) + 4 verified recon sweeps. It does NOT wave: a capability is HAVE only when a real 6// GREEN gate log OR a real organ/service file on disk proves it (liar-kill: no evidence -> GAP, never claimed); 7// it LEADS WITH THE GAPS = the roadmap. The verdict is an honest permil "where are we" + an explicit "where to 8// go". Yardsticks (never dependencies): autonovel (full pipeline), Agents-Room (multi-agent narrative, DeepMind), 9// our own orch-story (the non-sovereign 5-agent prose->image hub). license_tier: ORIGINAL expect_exit: 0 10import "nx_syscalls.nx" 11 12func c_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 13func c_num(v: i64) -> i64 { 14 let bb: *u8 = sys_mmap(28); var m: i64 = v 15 let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } 16 while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 17 var i: i64 = 0; while i < k { bb[i] = t[k - 1 - i]; i = i + 1 } sys_write(1, bb, k); return 0 18} 19func c_lognum(fd: i64, v: i64) -> i64 { 20 let db: *u8 = sys_mmap(28); var m: i64 = v; var k: i64 = 0; if m == 0 { db[0] = 48 as u8; k = 1 } 21 while m > 0 { db[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } 22 let rv: *u8 = sys_mmap(28); var x: i64 = 0; while x < k { rv[x] = db[k - 1 - x]; x = x + 1 } sys_write(fd, rv, k); return 0 23} 24func c_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } 25 26// evidence A: a gate log that contains the literal GREEN. 27func c_contains_green(path: *u8) -> i64 { 28 let szp: *i64 = sys_mmap(16) as *i64 29 let buf: *u8 = sys_read_file(path, szp) 30 if (buf as i64) == 0 { return 0 } 31 let n: i64 = szp[0]; let ndl: *u8 = "GREEN" as *u8; let nl: i64 = 5 32 var i: i64 = 0 33 while i + nl <= n { var j: i64 = 0; var hit: i64 = 1; while j < nl { if buf[i + j] != ndl[j] { hit = 0; j = nl } else { j = j + 1 } } if hit == 1 { return 1 } i = i + 1 } 34 return 0 35} 36// evidence B: a file (organ / service / banked source) exists and is openable. Lightweight (no full read -- 37// safe for the 390MB data-vault DBs): open + close only. 38func c_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } 39 40func c_have(ok: i64, dim: *u8, why: *u8) -> i64 { 41 if ok == 1 { c_puts(" [HAVE] " as *u8) } else { c_puts(" [GAP!] " as *u8) } 42 c_puts(dim); c_puts(" <- " as *u8); c_puts(why); c_puts("\n" as *u8) 43 return ok 44} 45func c_gap(dim: *u8, why: *u8) -> i64 { c_puts(" [GAP!] " as *u8); c_puts(dim); c_puts(" <- " as *u8); c_puts(why); c_puts("\n" as *u8); return 0 } 46 47func main() -> i64 { 48 c_puts("=== NISHI WRITING-HUB CENSUS (measured vs the autonomous-writing frontier; honest -- gaps first; no false-green) ===\n" as *u8) 49 c_puts("yardsticks: autonovel (full pipeline) | Agents-Room (DeepMind multi-agent narrative) | our orch-story (non-sovereign 5-agent hub)\n" as *u8) 50 51 var have: i64 = 0 52 let total: i64 = 38 53 54 c_puts("-- SUBSTRATE WE HAVE (each credited ONLY on a real GREEN gate or an on-disk organ/service) --\n" as *u8) 55 // -- sovereign craft / immune system / loop (nishi-write arc, gated) -- 56 have = have + c_have(c_contains_green("knowledge/status/writestyle_gate.log" as *u8), "mechanical prose immune-system: readability + adverb/passive/weak/dialogue-ratio signals" as *u8, "writestyle_gate.log + writecraft_gate.log GREEN (nx_writestyle/nx_writecraft)" as *u8) 57 have = have + c_have(c_contains_green("knowledge/status/continuity_gate.log" as *u8), "continuity / contradiction detector (a char-attribute changing across scenes = conflict)" as *u8, "continuity_gate.log GREEN (nx_continuity_gate + nx_conflict)" as *u8) 58 have = have + c_have(c_contains_green("knowledge/status/ingest_gate.log" as *u8), "scene + character-presence ingestion (prose -> structured beats)" as *u8, "ingest_gate.log GREEN (nx_ingest)" as *u8) 59 have = have + c_have(c_exists("runtime/nx_tone.nx" as *u8), "voice fingerprint + drift (match-your-own-voice scoring)" as *u8, "runtime/nx_tone.nx (tn_fingerprint/tn_drift)" as *u8) 60 have = have + c_have(c_exists("runtime/nx_writer_run.nx" as *u8), "register routing + NON-BYPASSABLE SFW/explicit governance SEAM (explicit pinned to local lane)" as *u8, "runtime/nx_writer_run.nx (md_seam_audit, hard gate) + nx_register" as *u8) 61 have = have + c_have(c_contains_green("knowledge/status/write_exceed_gate.log" as *u8), "MEASURED writing-exceed bench vs Hemingway/Grammarly/ProWritingAid (+5 unique caps)" as *u8, "write_exceed_gate.log GREEN 10/10 (nx_write_exceed_gate)" as *u8) 62 have = have + c_have(c_exists("runtime/nx_emit.nx" as *u8), "writer SEAM: per-scene IMG: (image prompt) + CTX: (companion ctx) + SFW/EXPLICIT/REFUSE route" as *u8, "runtime/nx_emit.nx (em_image_prompt_focus, em_companion_ctx) + nx_write_run" as *u8) 63 have = have + c_have(c_exists("runtime/nx_loop.nx" as *u8), "generic keep/discard eval-loop engine (settle + anneal/tabu/ILS/GA) = the autoresearch primitive" as *u8, "runtime/nx_loop.nx + simulated-annealing/tabu/GA gates" as *u8) 64 // -- research / fact substrate -- 65 have = have + c_have(c_exists("knowledge/fetched/write_repo_autonovel.raw" as *u8), "sovereign TLS-1.3 research + ingest (37 writing/companion/D&D/image sources banked this session)" as *u8, "knowledge/fetched/write_repo_autonovel.raw + 36 more banked this session (nx_writehub_research_fetch, TLS-1.3, all HTTP 200)" as *u8) 66 have = have + c_have(c_exists("runtime/nx_research_corroborate.nx" as *u8), "corroboration + citation substrate (multi-source confidence -> CONFIRMED/SINGLE/NONE)" as *u8, "runtime/nx_research_corroborate.nx + nx_citation_registry" as *u8) 67 // -- production tail -- 68 have = have + c_have(c_contains_green("knowledge/status/image_e2e_gate.log" as *u8), "image generation (sovereign DPM++ diffusion + SVG cover) -- for illustration/manga" as *u8, "image_e2e_gate.log GREEN (nx_diffusion_loop, nx_cover_gen)" as *u8) 69 have = have + c_have(c_contains_green("knowledge/status/phoneme_synth_gate.log" as *u8), "text-to-speech / narration (audiobook path: formant synth + cloned-voice reading)" as *u8, "phoneme_synth_gate.log + voice_read_gate.log GREEN (nx_phoneme_synth, nx_voice_read)" as *u8) 70 have = have + c_have(c_exists("runtime/nx_nishipages_serve.nx" as *u8), "publishing / sovereign web distribution (serve + provision + hub)" as *u8, "runtime/nx_nishipages_serve.nx + hub/site provision organs" as *u8) 71 // -- LOCAL AI services + data model (the operator's local stack the hub plugs into) -- 72 have = have + c_have(c_exists("../../companion/backend/characters/elara.yaml" as *u8), "LOCAL companion persona + persistent memory (Elara: system_prompt/personality/appearance/voice)" as *u8, "companion/backend/characters/elara.yaml + data-vault/characters.db" as *u8) 73 have = have + c_have(c_exists("../../elder-ai-platform/services/gen-llm/app.py" as *u8), "LOCAL LLM generation SEAT (gen-llm over sd-server/Qwen -- no cloud) = the prose engine the seam routes to" as *u8, "elder-ai-platform/services/gen-llm/app.py (POST /chat)" as *u8) 74 have = have + c_have(c_exists("../../elder-ai-platform/services/gen-img/app.py" as *u8), "LOCAL image model (Z-Image via gen-img/sd-server) -- the pluggable image seat to drive" as *u8, "elder-ai-platform/services/gen-img/app.py (POST /generate)" as *u8) 75 have = have + c_have(c_exists("../../elder-ai-platform/data-vault/content.db" as *u8), "structured creative DATA model: outfits(905)/locations(361)/poses(1564) + zimage_sentence bridge" as *u8, "elder-ai-platform/data-vault/content.db (392 tables, uniform _key/prompt_fragment/enabled pattern)" as *u8) 76 have = have + c_have(c_exists("../../elder-ai-platform/data-vault/config.db" as *u8), "data-driven config store (thresholds/rules/prompt-fragments -- no magic numbers)" as *u8, "elder-ai-platform/data-vault/config.db + svc-config:8423" as *u8) 77 // -- self-growth engine (the loop must wire into this, not fork) -- 78 have = have + c_have(c_exists("runtime/_hdl_build/nx_autonomous_expand_gate.nx" as *u8), "autonomous capability-EXPANSION loop (resource-aware grow-to-S-class)" as *u8, "runtime/_hdl_build/nx_autonomous_expand_gate.nx + nx_llm_wired_expand" as *u8) 79 have = have + c_have(c_exists("runtime/_hdl_build/nx_nsga2_gate.nx" as *u8), "evolutionary search (NSGA-II) -- the AlphaEvolve-class propose/score/select substrate" as *u8, "runtime/_hdl_build/nx_nsga2_gate.nx" as *u8) 80 have = have + c_have(c_exists("runtime/_hdl_build/nx_ecosystem_maturity_rollup.nx" as *u8), "ecosystem maturity rollup + autonomy-growth monitor (track the climb honestly)" as *u8, "nx_ecosystem_maturity_rollup.nx + nx_autonomy_growth_monitor.nx" as *u8) 81 82 have = have + c_have(c_exists("runtime/nx_writehub_seat.nx" as *u8), "sovereign SEAT-WIRE organ (writer -> local seats via JSON POST; 127.0.0.1-only = seam by construction)" as *u8, "runtime/nx_writehub_seat.nx (compiles; correctly probes gen-llm:11434 + gen-img:7861; live round-trip pending stack-up)" as *u8) 83 have = have + c_have(c_contains_green("knowledge/status/writehub_loop.log" as *u8), "autonomous IMMUNE-SCORED keep/discard loop (scores prose -> KEEP or REVISE + a named directive)" as *u8, "writehub_loop.log GREEN (nx_writehub_loop: weak->REVISE 463permil, clean->KEEP 1000permil)" as *u8) 84 have = have + c_have(c_contains_green("knowledge/status/writehub_factcheck.log" as *u8), "GROUNDED fact-check for non-fiction (claim vs banked corpus, INDEPENDENCE-aware, cited sources) = field gap CLOSED" as *u8, "writehub_factcheck.log GREEN (nx_writehub_factcheck: supported->CONFIRMED 3 classes+citations, unsupported->UNSUPPORTED; composes nx_research_corroborate)" as *u8) 85 have = have + c_have(c_exists("runtime/nx_writehub_grow.nx" as *u8), "system-data GROWTH organ (builds ADDITIVE add-outfit requests w/ zimage_sentence image-bridge + keyword aliases)" as *u8, "runtime/nx_writehub_grow.nx (proven: staged a valid additive outfit; live POST to svc-content pending stack)" as *u8) 86 have = have + c_have(c_contains_green("knowledge/status/writehub_quality.log" as *u8), "SELF-IMPROVEMENT conductor (propose->score->SELECT winner->MONOTONIC ratchet) = the hub's writing grows on its own" as *u8, "writehub_quality.log GREEN (nx_writehub_conductor: selected the 1000 winner, ratcheted record 0->1000; shares nx_writehub_score with the loop)" as *u8) 87 c_puts("-- WHERE WE NEED TO GO (the Writing-Hub roadmap -- named work, NOT claimed) --\n" as *u8) 88 c_gap("LIVE generation round-trip (prove the seat end-to-end)" as *u8, "the seat WIRE is BUILT (nx_writehub_seat compiles+probes gen-llm:11434 + gen-img:7861); the platform seats are DOWN this session -- bring the stack up to prove live prose/image generation" as *u8) 89 c_gap("writer -> image-gen HTTP wire (POST IMG: -> gen-img:7861/generate)" as *u8, "em_image_prompt_focus synthesizes the prompt; the HTTP POST to the local image seat is absent" as *u8) 90 c_gap("couple the autonomy loop to the LIVE seat (regenerate-until-KEEP cycle)" as *u8, "the loop is PROVEN sovereignly (nx_writehub_loop GREEN: weak->REVISE, clean->KEEP); the full propose->score->REGENERATE cycle needs the live seat to close" as *u8) 91 c_gap("semantic prose JUDGE / reward model (coherence/voice/emotional-impact)" as *u8, "only mechanical + deterministic scoring today; a model-scored judge (the self-improvement REWARD) is absent" as *u8) 92 c_gap("adversarial reader-panel / multi-persona beta-reader" as *u8, "nx_critic does adversarial grading for SCIENTIFIC claims, not prose; no reader-panel/adversarial-editor for fiction" as *u8) 93 c_gap("semantic-ENTAILMENT fact-check (beyond keyword-grounding)" as *u8, "the keyword-grounding rung is DONE (nx_writehub_factcheck GREEN, independence-aware, cited); full semantic entailment (does the source TEXT actually assert the claim) is the next rung" as *u8) 94 c_gap("COMPANION mode in .nx (Elara persona + memory on the writing core)" as *u8, "persona/memory/seat all exist as services; a sovereign .nx companion organ binding them is absent" as *u8) 95 c_gap("D&D / interactive-fiction GAME-MASTER mode" as *u8, "rpg.db carries quest/NPC/lore graphs; the state+rules+improv GM loop on the writing core is absent" as *u8) 96 c_gap("LIVE data-growth round-trip (bring svc-content:8300 up)" as *u8, "nx_writehub_grow is BUILT+proven (staged a valid additive add-outfit w/ zimage_sentence bridge); live POST needs svc-content up; also fix the locations add-endpoint base_prompt-vs-prompt_fragment column bug" as *u8) 97 c_gap("the unified WRITING-HUB surface (binds all modes + all systems)" as *u8, "writer organs exist but no hub binds them to the live seats/data/self-growth; absent by name" as *u8) 98 c_gap("couple the conductor's PROPOSE step to the live seat (variations)" as *u8, "the select-winner + MONOTONIC-ratchet mechanics are PROVEN (nx_writehub_conductor GREEN, writehub_best.txt ratchets); wiring the seat's variations as the proposals is the live step -> then it grows fully on its own into nsga2/expand/maturity" as *u8) 99 c_gap("long-form COHERENT generation + recurrent memory" as *u8, "the SOTA still degrades on long-form; a RecurrentGPT-style short+long memory over the seat for novel-length coherence is absent" as *u8) 100 101 let permil: i64 = (have * 1000) / total 102 c_puts("----\n HAVE=" as *u8); c_num(have); c_puts("/" as *u8); c_num(total); c_puts(" permil=" as *u8); c_num(permil); c_puts("\n" as *u8) 103 c_puts(" HONEST VERDICT: the SUBSTRATE is strong and mostly on disk -- a sovereign craft+immune+loop+research stack\n" as *u8) 104 c_puts(" (writecraft/writestyle/continuity/tone/ingest/emit + write_exceed bench + the keep/discard loop engine + TLS\n" as *u8) 105 c_puts(" ingest), PLUS the operator's LOCAL AI seats (gen-llm prose, gen-img Z-Image), a 392-table creative data model\n" as *u8) 106 c_puts(" with the zimage_sentence writer<->image bridge, and the ecosystem self-growth engine (expand/nsga2/maturity).\n" as *u8) 107 c_puts(" We MEASURABLY EXCEED writing-ASSISTANT tools (Hemingway/Grammarly/PWA, write_exceed +5). But we are NOT there on\n" as *u8) 108 c_puts(" the AUTONOMOUS-WRITING frontier: the parts are not yet ASSEMBLED into a self-improving hub. The gap is INTEGRATION\n" as *u8) 109 c_puts(" + AUTONOMY + two model-scored holes (the prose-generation seat-wire and the semantic judge/reward). NEXT = R1 wire\n" as *u8) 110 c_puts(" the seat (writer->gen-llm + writer->gen-img) -> R2 wrap the immune-scored keep/discard loop -> R3 companion/D&D\n" as *u8) 111 c_puts(" modes + data-growth -> R4 the judge/reward -> R5 close the self-improvement loop into expand/nsga2/maturity.\n" as *u8) 112 113 let lg: i64 = sys_openat_append("knowledge/status/writehub_census.log" as *u8, 0x1a4) 114 if lg >= 0 { 115 c_w(lg, "WRITEHUB-CENSUS have=" as *u8); c_lognum(lg, have); c_w(lg, "/" as *u8); c_lognum(lg, total) 116 c_w(lg, " permil=" as *u8); c_lognum(lg, permil); c_w(lg, " verdict=MEASURED-HONEST (substrate HAVE: craft+immune+loop+research+local-seats+data+self-growth; GAP: seat-wire+autonomy-loop+judge+companion/dnd/data-growth+hub+self-improve)\n" as *u8) 117 sys_close(lg) 118 } 119 // GREEN iff the measurement ran honestly with the core evidence really present (the write-craft bench + the ingest) -- 120 // NOT a claim of done. A missing core gate caps to RED so we never wave. 121 if c_contains_green("knowledge/status/write_exceed_gate.log" as *u8) == 1 { 122 c_puts("WRITEHUB-CENSUS GREEN (honest measurement ran; HAVE dims gate/file-backed; gaps named, not waved)\n" as *u8); sys_exit(0); return 0 123 } 124 c_puts("WRITEHUB-CENSUS RED (core write-craft evidence missing -- run nx_write_exceed_gate first; do not wave)\n" as *u8); sys_exit(1); return 1 125}