Beagle SCM
JS-108: five divergent copies of the u8-slice-to-JS-string helper
Proposed by the 2026-07-07 jab multi-agent review; confirmed by both skeptic verifiers. The same slice->JSString conversion is reimplemented five ways with different truncation caps and OOM behavior; the divergence already bit as JS-107.
Input
Context
- Copies: uri.cpp:12 JABCSliceStr (2048 stack, silent truncate), io.cpp:615 JABCSliceStr (PAGESIZE stack, silent truncate; io.cpp:24 fwd-decl notes it "mirrors uri.cpp's"), pack.hpp:31 JABCStrOf (malloc, undefined on OOM), ulog.hpp:109-137 inline memcpy dance, codec.cpp:104-181 inline memcpy dance.
- Every copy double-copies (slice -> NUL scratch -> JSC internal copy) where a length-explicit constructor needs one.
- Owner norms flag duplicated helpers; the caps/OOM behavior have already diverged.
Goals
- One length-explicit
JABCStrOfSlice(ctx, u8cs) in JABC.hpp/utf8.cpp that fails loudly (throw, never truncate); delete the five copies.
Constraints
- Fixes JS-107 by construction; behavior change is truncate->throw — audit callers that relied on clamping (none should).
WIP
TODOs