From 0a374fd27db5df34c11171a6e4dfe4abeeb43be9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sat, 9 May 2026 13:12:42 -0700 Subject: [PATCH] feat(editor): add --summary flag to --audit-watertight-wob MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Parity with the WOM-side --audit-watertight --summary added last batch. Same one-line rollup format for CI dashboards: watertight-wob: PASS (1 buildings, 0 failure(s)) [/tmp/migtest, weld 0.001000] watertight-wob: FAIL (12 buildings, 4 failure(s)) [/tmp/zone, weld 0.001000] Format: "watertight-wob: ( buildings, failure(s)) [, weld ]". Exit code unchanged — failure count capped at 255. Both --audit-watertight (WOM) and --audit-watertight-wob (WOB) now offer the same trio of output modes: verbose (default), --json (machine-readable), --summary (one-line CI rollup). --- tools/editor/cli_audits.cpp | 11 +++++++++++ tools/editor/cli_help.cpp | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/editor/cli_audits.cpp b/tools/editor/cli_audits.cpp index bddee72c..559d3c1f 100644 --- a/tools/editor/cli_audits.cpp +++ b/tools/editor/cli_audits.cpp @@ -495,10 +495,13 @@ int handleAuditWatertightWob(int& i, int argc, char** argv) { // intentional portal openings between them. std::string root = argv[++i]; bool jsonOut = false; + bool summary = false; float weldEps = 1e-4f; while (i + 1 < argc && argv[i + 1][0] == '-') { if (std::strcmp(argv[i + 1], "--json") == 0) { jsonOut = true; ++i; + } else if (std::strcmp(argv[i + 1], "--summary") == 0) { + summary = true; ++i; } else if (std::strcmp(argv[i + 1], "--weld") == 0 && i + 2 < argc) { try { weldEps = std::stof(argv[i + 2]); } catch (...) {} i += 2; @@ -557,6 +560,14 @@ int handleAuditWatertightWob(int& i, int argc, char** argv) { std::printf("%s\n", j.dump(2).c_str()); return std::min(failCount, 255); } + if (summary) { + std::printf("watertight-wob: %s (%zu buildings, %d failure(s)) " + "[%s, weld %.6f]\n", + failCount == 0 ? "PASS" : "FAIL", + rows.size(), failCount, + root.c_str(), weldEps); + return std::min(failCount, 255); + } std::printf("Watertight WOB audit: %s (weld eps %.6f)\n", root.c_str(), weldEps); if (rows.empty()) { diff --git a/tools/editor/cli_help.cpp b/tools/editor/cli_help.cpp index 5735a6fd..3f8af045 100644 --- a/tools/editor/cli_help.cpp +++ b/tools/editor/cli_help.cpp @@ -593,8 +593,8 @@ void printUsage(const char* argv0) { std::printf(" Walk every .wom + .wob under zoneDir, weld each independently, append to one shared WOC\n"); std::printf(" --audit-watertight [--weld ] [--json] [--summary]\n"); std::printf(" Walk every .wom under root, run welded watertight check; --summary prints a one-line rollup\n"); - std::printf(" --audit-watertight-wob [--weld ] [--json]\n"); - std::printf(" Walk every .wob, check that EVERY group is closed (per-group weld) — interior rooms must be solid\n"); + std::printf(" --audit-watertight-wob [--weld ] [--json] [--summary]\n"); + std::printf(" Walk every .wob, check that EVERY group is closed (per-group weld); --summary prints one-line rollup\n"); std::printf(" --import-obj [wom-base]\n"); std::printf(" Convert a Wavefront OBJ back into WOM (round-trips with --export-obj)\n"); std::printf(" --export-wob-obj [out.obj]\n");