Beagle SCM
JS-107: uri.make/escape/unescape silently truncate results at 2047 bytes
Proposed by the 2026-07-07 jab multi-agent review; confirmed by both skeptic verifiers. The URI leaves compose into 4096-byte buffers but return through a 2048-byte scratch clamp, handing the caller a corrupt URI instead of a NOROOM throw. Root cause is one of the divergent helpers tracked by JS-108.
Input
Context
- JABCuriMake/JABCuriEsc/JABCuriUnesc compose into
u8 out[4096] and succeed up to 4096 bytes, then JABCSliceStr clamps: char tmp[2048]; if (n >= sizeof(tmp)) n = sizeof(tmp)-1; (jab uri.cpp:12-17).
- Escaping can triple length (2048-byte input -> up to 4096 escaped in JABCuriEsc's in2048/out4096), so 2048-4095-byte results are returned truncated with no error.
- This is the copy-into-fixed-scratch anti-pattern the norms flag (meta/abc.mkd "Don't copy if you can pass the slice").
Goals
- Repro first: a >2047-byte URI through uri.make/escape round-trips intact or throws NOROOM — never truncates silently.
- Fix via the shared length-aware helper of JS-108 (or size dynamically here if that lands later).
Constraints
- Coordinate with JS-108 to avoid fixing the clamp twice.
WIP
TODOs