diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5614ca708..280b13a0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,8 @@ jobs: permissions: contents: read outputs: + # Human-approved Windows-first fork release; other branches retain full native policy. + platform_scope: ${{ github.repository == '9holy/webcodex' && github.event_name == 'push' && github.ref == 'refs/heads/release/v0.5.10' && 'windows' || 'all' }} needs_windows: ${{ steps.classify.outputs.needs_windows }} needs_windows_core: ${{ steps.classify.outputs.needs_windows_core }} needs_windows_runner: ${{ steps.classify.outputs.needs_windows_runner }} @@ -638,7 +640,7 @@ jobs: test-macos-core: needs: changes - if: needs.changes.outputs.needs_macos == 'true' + if: needs.changes.outputs.platform_scope != 'windows' && needs.changes.outputs.needs_macos == 'true' # Daily macOS coverage uses Apple Silicon. Intel is intentionally reserved for # explicit/release-time extended-native validation. strategy: @@ -687,7 +689,7 @@ jobs: test-macos-desktop: needs: changes - if: needs.changes.outputs.needs_macos_desktop == 'true' + if: needs.changes.outputs.platform_scope != 'windows' && needs.changes.outputs.needs_macos_desktop == 'true' # Keep the common Apple-Silicon Desktop package validation path-aware. The # corresponding Intel DMG build/smoke lives in extended-native CI. strategy: @@ -829,8 +831,8 @@ jobs: env: CONTRACT_RESULT: ${{ needs.contract.result }} CHANGES_RESULT: ${{ needs.changes.result }} - NEEDS_CORE: ${{ needs.changes.outputs.needs_macos }} - NEEDS_DESKTOP: ${{ needs.changes.outputs.needs_macos_desktop }} + NEEDS_CORE: ${{ needs.changes.outputs.platform_scope != 'windows' && needs.changes.outputs.needs_macos == 'true' }} + NEEDS_DESKTOP: ${{ needs.changes.outputs.platform_scope != 'windows' && needs.changes.outputs.needs_macos_desktop == 'true' }} CORE_RESULT: ${{ needs.test-macos-core.result }} DESKTOP_RESULT: ${{ needs.test-macos-desktop.result }} run: | diff --git a/.github/workflows/extended-native.yml b/.github/workflows/extended-native.yml index 54f1bc21a..7f8f500e5 100644 --- a/.github/workflows/extended-native.yml +++ b/.github/workflows/extended-native.yml @@ -9,12 +9,23 @@ on: description: Exact 40-character source commit to validate required: true type: string + platform_scope: + description: Reviewed delivery scope; omitted scope retains all native platforms + required: false + default: all + type: string workflow_dispatch: inputs: source_sha: description: Exact 40-character source commit to validate required: true type: string + platform_scope: + description: Explicit delivery scope to validate + required: false + default: all + type: choice + options: [all, windows] # Expensive/scarce native architectures live here instead of ordinary PR/main CI. # Release readiness calls this workflow for the exact pre-tag source, while maintainers @@ -38,9 +49,11 @@ jobs: shell: bash env: SOURCE_SHA: ${{ inputs.source_sha }} + PLATFORM_SCOPE: ${{ inputs.platform_scope }} run: | set -euo pipefail [[ "$SOURCE_SHA" =~ ^[0-9a-f]{40}$ ]] + case "$PLATFORM_SCOPE" in all|windows) ;; *) exit 2 ;; esac linux-arm64: needs: source @@ -72,6 +85,7 @@ jobs: macos-intel: needs: source + if: inputs.platform_scope != 'windows' runs-on: macos-15-intel timeout-minutes: 90 steps: @@ -352,15 +366,21 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - name: Require all extended native lanes + - name: Require selected extended native lanes shell: bash env: SOURCE_RESULT: ${{ needs.source.result }} LINUX_ARM64_RESULT: ${{ needs.linux-arm64.result }} MACOS_INTEL_RESULT: ${{ needs.macos-intel.result }} WINDOWS_ARM64_RESULT: ${{ needs.windows-arm64.result }} + PLATFORM_SCOPE: ${{ inputs.platform_scope }} run: | set -euo pipefail - for result in "$SOURCE_RESULT" "$LINUX_ARM64_RESULT" "$MACOS_INTEL_RESULT" "$WINDOWS_ARM64_RESULT"; do + for result in "$SOURCE_RESULT" "$LINUX_ARM64_RESULT" "$WINDOWS_ARM64_RESULT"; do test "$result" = success done + case "$PLATFORM_SCOPE" in + all) test "$MACOS_INTEL_RESULT" = success ;; + windows) test "$MACOS_INTEL_RESULT" = skipped ;; + *) exit 2 ;; + esac diff --git a/.github/workflows/release-readiness.yml b/.github/workflows/release-readiness.yml index 9d28385e2..21e9c632b 100644 --- a/.github/workflows/release-readiness.yml +++ b/.github/workflows/release-readiness.yml @@ -60,6 +60,9 @@ jobs: ci-proof: runs-on: ubuntu-latest timeout-minutes: 5 + outputs: + # Scope is fixed by reviewed source policy, never inferred from failed jobs. + platform_scope: ${{ github.repository == '9holy/webcodex' && github.ref == 'refs/heads/release/v0.5.10' && 'windows' || 'all' }} steps: - name: Fence exact source and immutable evidence shell: bash @@ -179,6 +182,7 @@ jobs: uses: ./.github/workflows/extended-native.yml with: source_sha: ${{ inputs.source_sha || github.sha }} + platform_scope: ${{ needs.ci-proof.outputs.platform_scope }} e2e: needs: ci-proof diff --git a/docs/agent/release-process.md b/docs/agent/release-process.md index 3a1d75c6f..cbe3bc28f 100644 --- a/docs/agent/release-process.md +++ b/docs/agent/release-process.md @@ -84,6 +84,16 @@ results (if any), and any deferred checks. ### GitHub-only fork distributions +The explicitly approved `9holy/webcodex` `v0.5.10` first delivery is Windows +x64/ARM64 only. Its exact release-branch push CI and source-evidence workflow +omit macOS lanes by this reviewed delivery policy; all Windows and shared +checks must still succeed. Other branches and repositories keep the full native +policy. The formal build and public verification use `platform_scope=windows`, +including all eleven Windows assets and five installation scenarios per +architecture. Keep the previous full-platform `latest`. Missing Linux/macOS +packages will ship in a subsequent full-platform version, without replacing +this release's immutable manifests, checksums or installer bytes. + An explicitly requested fork distribution can use `preflight --github-only --repo ` and the low-level readiness, build, collect, and draft verification commands. This selects the publication destination; it does not diff --git a/scripts/tests/test_ci_aggregate_cancellation.py b/scripts/tests/test_ci_aggregate_cancellation.py index f915ce050..cda044458 100644 --- a/scripts/tests/test_ci_aggregate_cancellation.py +++ b/scripts/tests/test_ci_aggregate_cancellation.py @@ -18,12 +18,12 @@ AGGREGATES = ("test", "test-macos", "test-windows", "test-native") -def aggregate(name: str) -> tuple[str, dict[str, str], str]: - body = job((ROOT / ".github/workflows/ci.yml").read_text(), name) +def aggregate(name: str, workflow: str = "ci.yml") -> tuple[str, dict[str, str], str]: + body = job((ROOT / ".github/workflows" / workflow).read_text(), name) guard = re.search(r"^ if: (.+)$", body, re.MULTILINE) if guard is None: raise AssertionError(f"{name}: missing scheduler guard") - env = dict(re.findall(r"^ ([A-Z_]+): \$\{\{ (needs\.[^\n]+) \}\}$", body, re.MULTILINE)) + env = dict(re.findall(r"^ ([A-Z0-9_]+): \$\{\{ (needs\.[^\n]+) \}\}$", body, re.MULTILINE)) script = re.search(r"^ run: \|\n((?: [^\n]*\n|\n)+)", body, re.MULTILINE) if script is None: raise AssertionError(f"{name}: missing aggregate script") @@ -42,8 +42,8 @@ def test_workflow_cancellation_guard_is_independent_of_child_results(self) -> No self.assertGreaterEqual(len(env), 4) self.assertNotIn("continue-on-error:", job((ROOT / ".github/workflows/ci.yml").read_text(), name)) - def run_gate(self, name: str, overrides: dict[str, str]) -> subprocess.CompletedProcess[str]: - _, fields, script = aggregate(name) + def run_gate(self, name: str, overrides: dict[str, str], workflow: str = "ci.yml") -> subprocess.CompletedProcess[str]: + _, fields, script = aggregate(name, workflow) env = os.environ.copy() env.update({key: "true" if key.startswith("NEEDS_") else "success" for key in fields}) env.update(overrides) @@ -74,6 +74,26 @@ def test_only_policy_optional_lanes_may_be_skipped(self) -> None: for result in ("failure", "cancelled", "success"): self.assertNotEqual(self.run_gate(name, {f"NEEDS_{lane}": "false", f"{lane}_RESULT": result}).returncode, 0) + def test_windows_delivery_requires_both_macos_lanes_to_be_intentionally_skipped(self) -> None: + selected = {"NEEDS_CORE": "false", "NEEDS_DESKTOP": "false", + "CORE_RESULT": "skipped", "DESKTOP_RESULT": "skipped"} + self.assertEqual(self.run_gate("test-macos", selected).returncode, 0) + for lane in ("CORE_RESULT", "DESKTOP_RESULT"): + for result in ("failure", "cancelled", "success"): + with self.subTest(lane=lane, result=result): + self.assertNotEqual(self.run_gate("test-macos", {**selected, lane: result}).returncode, 0) + + def test_extended_native_scope_preserves_required_selected_and_shared_lanes(self) -> None: + for scope in ("all", "windows", "unknown"): + selected = {"PLATFORM_SCOPE": scope, + "MACOS_INTEL_RESULT": "skipped" if scope == "windows" else "success"} + self.assertEqual(self.run_gate("summary", selected, "extended-native.yml").returncode == 0, + scope != "unknown") + for lane in ("SOURCE_RESULT", "LINUX_ARM64_RESULT", "WINDOWS_ARM64_RESULT", "MACOS_INTEL_RESULT"): + for result in ("failure", "cancelled"): + with self.subTest(scope=scope, lane=lane, result=result): + self.assertNotEqual(self.run_gate("summary", {**selected, lane: result}, "extended-native.yml").returncode, 0) + if __name__ == "__main__": unittest.main() diff --git a/scripts/tests/test_ci_contract_ownership.py b/scripts/tests/test_ci_contract_ownership.py index 68d653f50..3a2231155 100644 --- a/scripts/tests/test_ci_contract_ownership.py +++ b/scripts/tests/test_ci_contract_ownership.py @@ -15,6 +15,23 @@ def job(text: str, name: str) -> str: class ContractOwnershipTests(unittest.TestCase): + def test_windows_first_policy_is_fixed_to_the_approved_fork_release_source(self) -> None: + ci = (ROOT / ".github/workflows/ci.yml").read_text() + changes = job(ci, "changes") + self.assertIn("github.repository == '9holy/webcodex' && github.event_name == 'push' && " + "github.ref == 'refs/heads/release/v0.5.10' && 'windows' || 'all'", changes) + for lane in ("test-macos-core", "test-macos-desktop"): + self.assertIn("if: needs.changes.outputs.platform_scope != 'windows' && ", job(ci, lane)) + for lane in ("test-windows-core", "test-windows-runner", "test-windows-package", "test-windows-desktop"): + self.assertNotIn("platform_scope", job(ci, lane)) + macos_gate = job(ci, "test-macos") + for field in ("NEEDS_CORE", "NEEDS_DESKTOP"): + self.assertRegex(macos_gate, field + r": \$\{\{ needs.changes.outputs.platform_scope != 'windows' && ") + readiness = (ROOT / ".github/workflows/release-readiness.yml").read_text() + self.assertIn("github.repository == '9holy/webcodex' && " + "github.ref == 'refs/heads/release/v0.5.10' && 'windows' || 'all'", job(readiness, "ci-proof")) + self.assertIn("platform_scope: ${{ needs.ci-proof.outputs.platform_scope }}", job(readiness, "extended-native")) + def test_native_ssh_runs_before_packaging_without_losing_installer_gates(self) -> None: lane = job((ROOT / ".github/workflows/ci.yml").read_text(), "test-windows-desktop") names = re.findall(r"(?m)^ - name: (.+)$", lane) diff --git a/scripts/tests/test_release_readiness.py b/scripts/tests/test_release_readiness.py index 2a9cbd6b0..f5f7aa654 100644 --- a/scripts/tests/test_release_readiness.py +++ b/scripts/tests/test_release_readiness.py @@ -801,7 +801,8 @@ def test_ci_native_lane_conditions_are_classifier_driven(self) -> None: block = workflow[start:end] with self.subTest(job=job_name): self.assertIn("needs: changes", block) - self.assertIn(f"if: needs.changes.outputs.{output_name} == 'true'", block) + delivery_scope = "needs.changes.outputs.platform_scope != 'windows' && " if job_name.startswith("test-macos-") else "" + self.assertIn(f"if: {delivery_scope}needs.changes.outputs.{output_name} == 'true'", block) for aggregate in ("test", "test-macos", "test-windows", "test-native"): start = workflow.index(f" {aggregate}:\n")