From 8cdfb21116892885a0bfa014ff0d7171f2761407 Mon Sep 17 00:00:00 2001 From: DTALEX66 Date: Sun, 9 Aug 2026 22:22:06 +0800 Subject: [PATCH 1/8] fix(ci): gate ci-verdict on semantic GatePlan IDs (AXW-003A) GatePlan emits semantic gate IDs (py-primary, static, lint, ...), not GitHub job names. The aggregator previously ran 'require test' against the job name, which GatePlan never emits, letting a required py-primary suite failure pass ci-verdict as green. Gate on the semantic IDs now: py-primary carries the OS/KB/integration test result, static and lint both arrive via the lint job. Not-required-but-failed coverage now includes test, py-compat and lint, and the windows-runtime-smoke job name is corrected. --- .github/workflows/ci.yml | 19 +++++++++++---- tests/test_ci_a0_gates.py | 49 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff99b78..54c7289 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -673,20 +673,29 @@ jobs: fi fi } - require test "$TEST_RESULT" - require py-compat "$COMPAT_RESULT" + # AXW-003A: gate on the GatePlan semantic IDs, not GitHub job names. + # GatePlan emits `py-primary` for the OS/KB/integration suite (its + # result arrives via the `test` job) and `static` for convention and + # architecture checks (carried by the `lint` job). Requiring the bare + # job name `test` would never match GatePlan and would let a required + # py-primary failure pass as green. + require py-primary "$TEST_RESULT" + require static "$LINT_RESULT" require lint "$LINT_RESULT" + require py-compat "$COMPAT_RESULT" require wheel-smoke "$WHEEL_RESULT" require browser-smoke "$BROWSER_RESULT" require windows-runtime "$WINDOWS_RESULT" require desktop-fast "$DESKTOP_FAST_RESULT" require desktop-build "$DESKTOP_BUILD_RESULT" require installer-lifecycle "$INSTALLER_RESULT" - # A not-required job that RAN and failed is still a failure. - for spec in "wheel-smoke:$WHEEL_RESULT" "browser-smoke:$BROWSER_RESULT" "windows-runtime:$WINDOWS_RESULT" "desktop-fast:$DESKTOP_FAST_RESULT" "desktop-build:$DESKTOP_BUILD_RESULT" "installer-lifecycle:$INSTALLER_RESULT"; do + # A not-required job that RAN and failed is still a failure. Use the + # job names (the only labels the `needs.*.result` are keyed by) but + # check them against their real job results. + for spec in "test:$TEST_RESULT" "py-compat:$COMPAT_RESULT" "lint:$LINT_RESULT" "wheel-smoke:$WHEEL_RESULT" "browser-smoke:$BROWSER_RESULT" "windows-runtime-smoke:$WINDOWS_RESULT" "desktop-fast:$DESKTOP_FAST_RESULT" "desktop-build:$DESKTOP_BUILD_RESULT" "installer-lifecycle:$INSTALLER_RESULT"; do name="${spec%%:*}"; result="${spec##*:}" if [ "$result" = "failure" ]; then - echo "gate '$name' failed even though not required" + echo "job '$name' failed even though its gate was not required" exit 1 fi done diff --git a/tests/test_ci_a0_gates.py b/tests/test_ci_a0_gates.py index e788b7e..17e1368 100644 --- a/tests/test_ci_a0_gates.py +++ b/tests/test_ci_a0_gates.py @@ -210,6 +210,55 @@ def test_ci_exposes_one_stable_a0_required_check() -> None: assert "ci-verdict: all required gates success" in workflow +def test_ci_verdict_requires_semantic_gate_ids_not_job_names() -> None: + """AXW-003A: the aggregator must gate on GatePlan semantic IDs, not the + GitHub job name. GatePlan emits `py-primary` for the OS/KB suite and + `static` for convention/architecture checks. A `require test` that matches + the job name instead of the gate ID can never fire, letting a required + `py-primary` failure slip through as a green ci-verdict. + """ + workflow = WORKFLOW.read_text(encoding="utf-8") + verdict = workflow.split("Validate required gates against GatePlan", 1)[1] + + # The aggregator must reference every required-conditional gate by its + # semantic GatePlan ID (the same string the classifier emits), not a bare + # GitHub job name. + for gate_id in ( + "py-primary", + "static", + "lint", + "py-compat", + "wheel-smoke", + "browser-smoke", + "windows-runtime", + "desktop-fast", + "desktop-build", + "installer-lifecycle", + ): + assert f"require {gate_id}" in verdict, f"ci-verdict missing require {gate_id}" + + # The job name `test` is not a GatePlan ID; requiring it is a no-op that + # would mask a required py-primary failure. Its presence is the AXW-003A bug. + assert "require test " not in verdict.replace("test ", "", 0).replace( + "py-primary", "" + ) or "require test " not in verdict + + +def test_ci_verdict_does_not_require_orphan_job_name_test() -> None: + """AXW-003A reverse regression: ci-verdict must never `require test` because + GatePlan never emits a `test` gate; `py-primary` is the semantic ID for the + OS/KB/integration suite. Requiring `test` (the GitHub job name) is dead code + that lets a required py-primary suite failure pass the aggregate. + """ + workflow = WORKFLOW.read_text(encoding="utf-8") + verdict = workflow.split("Validate required gates against GatePlan", 1)[1] + # The verdict body must not contain a `require test` invocation (job-name gate). + # It may mention `test` in the env var TEST_RESULT only, not as a require key. + assert "require test " not in verdict + # Sanity: the suite env var that carries the OS/KB test result is present. + assert "TEST_RESULT" in verdict + + def test_selective_heavy_jobs_gate_on_gateplan() -> None: workflow = WORKFLOW.read_text(encoding="utf-8") From 275bd904b5eb00fa02adee4d596cfa909a6c71fb Mon Sep 17 00:00:00 2001 From: DTALEX66 Date: Sun, 9 Aug 2026 22:22:11 +0800 Subject: [PATCH 2/8] feat(scripts): add Windows/PowerShell 7 doctor (AXW-007A) Detect Python, Node, Rust, PowerShell, Chinese and space-containing paths, port availability, console encoding and writable project-local directories. Emits sanitized structured JSON only (no absolute private paths, secrets or personal body text). Covered by six focused tests. --- scripts/doctor_windows.ps1 | 146 +++++++++++++++++++++++++++++++++++ tests/test_doctor_windows.py | 93 ++++++++++++++++++++++ 2 files changed, 239 insertions(+) create mode 100644 scripts/doctor_windows.ps1 create mode 100644 tests/test_doctor_windows.py diff --git a/scripts/doctor_windows.ps1 b/scripts/doctor_windows.ps1 new file mode 100644 index 0000000..eee771f --- /dev/null +++ b/scripts/doctor_windows.ps1 @@ -0,0 +1,146 @@ +#requires -Version 7.0 +<# + SYNOPSIS + Windows/PowerShell 7 doctor for Cognitive-Loop-OS (AXW-007A). + + DESCRIPTION + Detects the toolchain and Windows-environment prerequisites needed to run, + test, and package the project: Python, Node, Rust, PowerShell, Chinese and + space-containing paths, port availability, console encoding, and writable + directories. + + Output is strictly sanitized: it never prints secrets, tokens, cookies, + credentials, private paths outside the declared scope, or personal body + text. Only names, versions, availability booleans and path-layout facts are + emitted. All results are returned as structured JSON on stdout; warnings go + to stderr. + + OUTPUT + A single JSON object: + { + "schema_version": "axw.007a.v1", + "generated_at": "...", + "toolchain": { "python": {...}, "node": {...}, "rust": {...}, "powershell": {...} }, + "paths": { "space_in_path": bool, "non_ascii_in_path": bool, "project_root": "", ... }, + "ports": { "