From 035ef6c613626f94618dbd8e2f8ecc36bb8d0833 Mon Sep 17 00:00:00 2001 From: agra Date: Fri, 5 Jun 2026 21:18:08 +0300 Subject: [PATCH] fix(examples): 0712 sha256 streaming writes scratch to .sx-tmp not /tmp [FINAL-rem F2] Scratch file path violated the project rule 'scratch files go in .sx-tmp/, never /tmp'. Route the temp .bin through the repo-local, gitignored .sx-tmp/ dir, creating it at runtime via create_dir_all (mirroring 0713) so the test is self-contained on a clean checkout. Digest assertions and output are unchanged. --- examples/0712-modules-sha256-streaming.sx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/0712-modules-sha256-streaming.sx b/examples/0712-modules-sha256-streaming.sx index de01e41..4dadbe3 100644 --- a/examples/0712-modules-sha256-streaming.sx +++ b/examples/0712-modules-sha256-streaming.sx @@ -59,7 +59,8 @@ main :: () { check("split-on-boundary", stream_split(MSG, 64), PIN); // 64: exact block edge // sha256_file (streaming) must equal the in-memory digest. - path := "/tmp/sx_0712_stream.bin"; + if !create_dir_all(".sx-tmp") { print("mkdir: FAIL\n"); return; } + path := ".sx-tmp/sx_0712_stream.bin"; if !write_file(path, MSG) { print("file-write: FAIL\n"); return; } maybe := sha256_file(path);