test(trace): check snapshot budgets of the trace and the live tool event
ACP editors render a file change from the live tool event's trace snapshots. Two pure rules decide what they get, and the end-to-end cases reached them only through a real kernel editing a 1300-line file: - trace_snapshots_test drives albedo_trace.Trace.finish over generated files (missing, binary, not UTF-8, text in one-, two- and four-byte characters at 7 B, 60 KB, 100 KB, 128 KiB and 128 KiB + 1): unreadable sides are `unavailable` with a reason, unchanged files are omitted, and snapshots follow write order until the next pair would pass 256 KiB, after which no change carries one. Planted and caught: the budget never marked spent (a later small file fills the gap), each pair checked alone against the budget, a file of exactly 128 KiB refused. - tool_event_test encodes events.Tool with generated arguments, results sized to land within two bytes of the budget, and traces of multibyte and escape-heavy snapshots: the event is inline exactly when the arguments fit 64 KiB and the encoded document fits 64 KiB plus the encoded snapshot texts (at most 256 KiB more); otherwise arguments, result and trace are all null and a reference is set. Planted and caught: no snapshot allowance, an uncapped allowance, snapshots measured in raw bytes instead of encoded JSON.