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/kata.rs | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) (limited to 'tests/kata.rs') diff --git a/tests/kata.rs b/tests/kata.rs index 29a6f29..79bf9d6 100644 --- a/tests/kata.rs +++ b/tests/kata.rs @@ -1,9 +1,3 @@ -//! The kata backend, tested the way every gated tier here is tested: the -//! logic runs for real on a machine with neither root nor `/dev/kvm`, and -//! only the live-orchestrator tier skips — with a printed note, never -//! silently absent (the convention `versions::vercmp_matches_the_system_oracle` -//! set). - mod common; use std::path::Path; @@ -88,14 +82,8 @@ fn the_live_kata_tier_is_recorded_not_silently_absent() { sbx.destroy().unwrap(); } -// --------------------------------------------------------------------------- -// agent-sandbox as a configuration, not a wish. -// -// `sandbox_backend = "kata"` used to fall through to loopback. The kind is -// `agent-sandbox` now, it parses, and it produces a Kata backend — so the path -// from a config file to the CR that would boot a VM is worth asserting end to -// end, starting from parsed JSON rather than a hand-built request. -// --------------------------------------------------------------------------- +// agent-sandbox as a configuration, not a wish: the path from a config file to +// the CR that would boot a VM, asserted end to end from parsed JSON. /// A config file as an operator would write it, parsed by the real loader. fn agent_sandbox_config() -> Config { @@ -176,11 +164,9 @@ fn a_loopback_config_never_becomes_agent_sandbox_or_vice_versa() { assert!(!id.contains("remote@"), "loopback must not report remote: {id}"); } -/// The seam's whole claim, tested as one thing: a real package built and -/// published through the kata lease path — a real `sandbox-agent` process, a -/// real nonce-matched rendezvous, real frames — with a VM being the only thing -/// this host cannot provide. If the lease path and the loopback path disagree -/// about anything, this is where it shows. +/// The seam's whole claim, tested as one thing: a real package built and published +/// through the kata lease path, with a VM being the only thing this host cannot +/// provide. #[test] fn a_fixture_builds_and_publishes_through_the_kata_lease_path() { let (env, _fx) = env_with_fixture("plain-make"); @@ -210,18 +196,15 @@ fn a_fixture_builds_and_publishes_through_the_kata_lease_path() { "the index must serve what the kata build produced: {world:?}" ); - // And it ran inside the leased sandbox: the agent streamed the build output - // over the wire into the same log file the SSE tail reads, and the shim saw - // exactly one makepkg. + // And it ran inside the leased sandbox: the agent streamed the build output over + // the wire into the same log file the SSE tail reads. let log = std::fs::read_to_string(env.cfg.build_log_path(&id)).unwrap(); assert!(log.contains("Making package"), "agent output must reach the log:\n{log}"); let shimlog = env.cfg.hooks.shim_dir.clone().unwrap(); assert_eq!(aur_build::shims::called_with(&shimlog, "makepkg", ""), 1); - // Deliberately no assertion that the sandbox is gone: the pipeline never - // calls `destroy`, and the design says the TTL is the guarantee and destroy - // is courtesy (wire.rs). The lease window bounds how long a box lives, not - // a teardown call — which is worth knowing, because it means a busy hub - // holds up to `steps x builds` sandboxes until their TTL bites. + // Deliberately no assertion that the sandbox is gone: the design says the TTL is + // the guarantee and destroy is courtesy (wire.rs). A busy hub holds up to + // `steps x builds` sandboxes until their TTL bites. } -- cgit v1.2.3