From e757979f1a2afdbe7146066345bb9acd19d3b151 Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:09:59 +0000 Subject: comments: say why, not what MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath. --- tests/live.rs | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'tests/live.rs') diff --git a/tests/live.rs b/tests/live.rs index 16b68c5..da0f7ec 100644 --- a/tests/live.rs +++ b/tests/live.rs @@ -1,7 +1,3 @@ -//! The live surfaces: the SSE log tail and the htmx-refreshed builds table -//! (§13). The budget matters here — the whole point of "htmx and thirty lines of -//! glue" is that a reviewer can audit everything the browser runs. - mod common; use std::io::Read; @@ -51,9 +47,8 @@ fn the_log_stream_delivers_bytes_as_they_are_appended_and_then_ends() { std::fs::create_dir_all(log.parent().unwrap()).unwrap(); std::fs::write(&log, "==> step materialize\n").unwrap(); - // A producer appends while the stream is open, then finishes the build. If - // the endpoint buffered its response, everything would arrive only after the - // build ended and the "live" claim would be false. + // A producer appends while the stream is open, then finishes the build. If the + // endpoint buffered its response the "live" claim would be false. let db = web.env.db.clone(); let id2 = id.clone(); let log2 = log.clone(); @@ -101,20 +96,17 @@ fn the_builds_table_refreshes_via_htmx_and_still_works_without_js() { let web = Web::attach(env, fx); let base = web.url("/builds"); - // One queued build so the table has a row: the empty state is a paragraph, - // and asserting on it would prove nothing about server rendering. + // One queued build so the table has a row. queued(&web.env, "plain-make"); let page = ureq::get(&base).call().unwrap().into_string().unwrap(); // The refresh is an attribute on the table, not a script we wrote. assert!(page.contains("hx-trigger=\"every 3s\""), "no htmx refresh: {}", &page[..400.min(page.len())]); assert!(page.contains("hx-get=\"/builds?fragment=1\""), "the refresh has no target"); assert!(page.contains("