From 7a43e4eb3be5a551b312a330ce04ddec0a2b8afa Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 7 May 2026 20:26:17 -0700 Subject: [PATCH] feat(editor): --audit-project also runs items schema + spawn placement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extended the composite project audit from 4 sub-checks to 6, adding the two new gates: - validate-project-items (items.json schema across zones) - audit-project-spawns (spawn Z within 5y of terrain) Sub-checks now ordered cheapest → most expensive so a fast failure surfaces before the slow ones run: format validation runs in milliseconds, but spawn-placement audit requires loading every WHM tile and casting rays. Single-command release-readiness gate: a green --audit-project now means format-clean + open-only + items-clean + refs-resolve + content-sane + spawns-grounded. --- tools/editor/main.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/tools/editor/main.cpp b/tools/editor/main.cpp index 00359fea..60e14319 100644 --- a/tools/editor/main.cpp +++ b/tools/editor/main.cpp @@ -8674,11 +8674,14 @@ int main(int argc, char* argv[]) { // overall result. Designed to be the only command CI needs // to run before --pack-wcp. // - // Sub-checks: + // Sub-checks (ordered cheapest→most expensive so a fast + // failure surfaces before the slow ones run): // 1. validate-project (per-format integrity) // 2. validate-project-open-only (no proprietary leaks) - // 3. check-project-refs (every model/NPC ref resolves) - // 4. check-project-content (sane field values) + // 3. validate-project-items (items.json schema) + // 4. check-project-refs (every model/NPC ref resolves) + // 5. check-project-content (sane field values) + // 6. audit-project-spawns (spawn Z near terrain) std::string projectDir = argv[++i]; namespace fs = std::filesystem; if (!fs::exists(projectDir) || !fs::is_directory(projectDir)) { @@ -8705,10 +8708,12 @@ int main(int argc, char* argv[]) { }; struct Step { const char* name; const char* flag; int rc; }; std::vector steps = { - {"format validation ", "--validate-project", 0}, - {"open-only release gate ", "--validate-project-open-only", 0}, - {"reference integrity ", "--check-project-refs", 0}, - {"content field sanity ", "--check-project-content", 0}, + {"format validation ", "--validate-project", 0}, + {"open-only release gate ", "--validate-project-open-only", 0}, + {"items schema ", "--validate-project-items", 0}, + {"reference integrity ", "--check-project-refs", 0}, + {"content field sanity ", "--check-project-content", 0}, + {"spawn placement ", "--audit-project-spawns", 0}, }; int totalFailed = 0; std::printf("audit-project: %s\n\n", projectDir.c_str());