ingest: unify transduce_prose/transduce_structured into one transduce() #117
Reference in New Issue
Block a user
Delete Branch "feat/transduce-unify"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
transduce()is now the single mechanism: one function, no content-type branch. It splits on"\n\n"as a universal boundary check, falls back to fixed 4096-char windows if none is found, and wires the same generic edges (contains/precedes/headingsection_of) regardless of what's inside a chunk. Dedup is the existingfind_existing_by_contentpath, applied uniformly.transduce_structuredJSON dataset/records/feature-node interpretation is deleted outright — a JSON file is now chunked and deduped like anything else, no pre-computed structure.transduce()chunks it exactly like it chunks anything else. Zero semantic understanding of audio (or any payload) is claimed or built here — meaning is expected to emerge later from Neuron's own existing mechanisms (embedding, spreading activation, dedup) acting on this real geometry over time.fs_size,fs_read_b64_chunkinel_runtime.c/.h) because El strings are NUL-unsafe under strlen-based ops andfs_read()silently truncates at the first embedded NUL — routine in real binary/audio bytes.ingest_filenow comparesfs_read()'s string length against a realfs_size()byte count; on mismatch it rebuilds the payload as base64-encoded fixed 3072-byte windows read directly off disk (binary-safe in C, verbatim), joined with the same"\n\n"markertransduce()'s boundary scan already looks for. This is a mechanical fidelity fix, not content interpretation —transduce()never learns a fallback happened.INGEST_KINDkeeps existing only as an acquisition-mechanism selector (dir/file/url/llm/stream — which RPC to use to fetch bytes), not a content-type flag. The redundant"structured"value is removed.ingest_dirdrops its file-extension filter for the same reason.ingest_*entry points are unchanged in name and role.ingest_streamwas never wired to either old function (it builds its own turn-nodes directly), so it's untouched.Verification
elc+ the modifiedel_runtime.c/engram_*.c— built and booted an actual sandbox engram off this exact source (nsbx create --branch origin/dev).will_clean.wav, 304288 bytes, and a 12288-byte real prefix slice): exact expected node/edge counts both times (101 nodes/199 edges full file; 5 nodes/7 edges for the slice — matchesceil(bytes/3072)+1nodes,2n-1edges), with real, verbatim base64 content confirmed decoding back to the actual WAV header bytes.Known gap (disclosed, not papered over)
End-to-end server-confirmed persistence (a real before/after
/api/statsdelta, and a fetched node by id) for the audio/prose/JSON cases was not obtained this session. Every local nsbx sandbox tried (two stock pre-#109 binaries hitting the known O(N·D) brute-force scan bug, then a fresh #109/HNSW binary built from currentdev) took minutes-to-indefinitely-long on the final/api/load-mergewrite's embedding step and hit the client's 60s HTTP timeout, even for a 5-node write. Confirmed as real (if slow) forward progress via growing WAL file size, not a hang. The code's own pre-existing honesty gate correctly refused to report success in every case ("load-merge failed: ..."+"nothing below this manifold was confirmed persisted by the server") rather than silently claiming a false success. This is an environment/infrastructure characteristic tonight, not a defect introduced by this change — the engram server binary itself is untouched here.Test plan
INGEST_KIND=file INGEST_ARG=<audio file> ingest/build/ingestand capture a real before/after/api/statsdelta/api/nodes/<id>and confirm real, non-empty base64 content{"dataset":...,"records":[...]}-shaped JSON fixture to confirm no regression on either case now flowing through the same unified path