Archived
--expert-profile read its file with no size cap -- any file, gigabytes, appended into memory before a single check -- parsed the text with the unbounded parser, and took n_trunk_layers through int32. That last one is the quiet one: the loader refuses "this profile is for another model" by comparing the file's layer count with the live model's, and a value that wraps past 2^32 lands on exactly the number the comparison asks for. The read now caps at 64 MiB while appending -- past it, nothing further is grown and the file is refused by name -- the parse is the container helper (parse_container) like every other file input, and n_trunk_layers is read as int64 and range-checked before it reaches the comparison. An xstats_test case pins the loader's three refusals -- wrapped trunk count, negative count, oversized contract -- and the tmp-symlink refusal of the previous commit: the planted symlink survives untouched and the profile file still lands.