From 5bea997fa63dc77357bd941d88a3dc6ef1bbace0 Mon Sep 17 00:00:00 2001 From: MediaCrawler User Date: Tue, 30 Jun 2026 22:04:27 +0800 Subject: [PATCH] Remove Lite release packages --- .github/workflows/release.yml | 131 +----------------- docs/LITE_RELEASES.md | 37 ----- docs/PACKAGING.md | 16 +-- docs/RELEASE_NOTES_v0.4.17.md | 151 +++++++++++++++++++++ package.json | 10 +- scripts/check_lite_release_assets.mjs | 78 ----------- scripts/check_no_lite_release_assets.mjs | 47 +++++++ scripts/check_release_notes_i18n.mjs | 9 ++ scripts/write_lite_builder_config.mjs | 48 ------- tests/goagent-brand-contract.test.mjs | 3 +- tests/lite-release-contract.test.mjs | 49 ------- tests/no-lite-release-contract.test.mjs | 58 ++++++++ tests/release-notes-i18n-contract.test.mjs | 14 ++ tests/sprint4-release-contract.test.mjs | 2 - 14 files changed, 287 insertions(+), 366 deletions(-) delete mode 100644 docs/LITE_RELEASES.md create mode 100644 docs/RELEASE_NOTES_v0.4.17.md delete mode 100644 scripts/check_lite_release_assets.mjs create mode 100644 scripts/check_no_lite_release_assets.mjs delete mode 100644 scripts/write_lite_builder_config.mjs delete mode 100644 tests/lite-release-contract.test.mjs create mode 100644 tests/no-lite-release-contract.test.mjs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ff1f4a..0de2d46 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -406,126 +406,6 @@ jobs: release/**/*.yml if-no-files-found: error - package-lite: - name: Package Lite ${{ matrix.name }} - needs: - - release-preflight - - prepare-tts-assets - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - include: - - name: macOS - os: macos-latest - command: pnpm dist:lite:mac - - name: Windows - os: windows-latest - command: pnpm dist:lite:win - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.30.3 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: pnpm - - - name: Setup Python for Kokoro zh G2P - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - - name: Install Kokoro zh G2P Python dependencies - run: python -m pip install -r scripts/requirements-tts.txt - - - name: Typecheck - run: pnpm typecheck - - - name: Download Kokoro TTS assets - uses: actions/download-artifact@v4 - with: - name: GoAgent-Kokoro-zh-CN - path: data/tts/kokoro/zh-CN - - - name: Validate Kokoro TTS assets - shell: bash - env: - GOAGENT_TTS_ASSETS_STRICT: "1" - GOAGENT_TTS_SMOKE_STRICT: "1" - GOAGENT_TTS_PYTHON: python - run: | - pnpm check:tts-assets - pnpm smoke:tts - - - name: Package Lite desktop app - shell: bash - env: - CSC_LINK: ${{ secrets.CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }} - WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} - CSC_IDENTITY_AUTO_DISCOVERY: ${{ secrets.CSC_LINK != '' && 'true' || 'false' }} - APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }} - APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} - APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} - APPLE_KEYCHAIN: ${{ secrets.APPLE_KEYCHAIN }} - APPLE_KEYCHAIN_PROFILE: ${{ secrets.APPLE_KEYCHAIN_PROFILE }} - run: | - for name in \ - CSC_LINK \ - CSC_KEY_PASSWORD \ - WIN_CSC_LINK \ - WIN_CSC_KEY_PASSWORD \ - APPLE_API_KEY \ - APPLE_API_KEY_ID \ - APPLE_API_ISSUER \ - APPLE_ID \ - APPLE_APP_SPECIFIC_PASSWORD \ - APPLE_TEAM_ID \ - APPLE_KEYCHAIN \ - APPLE_KEYCHAIN_PROFILE - do - if [[ -z "${!name:-}" ]]; then - unset "${name}" - fi - done - if [[ "${RUNNER_OS}" == "macOS" && -z "${CSC_LINK:-}" ]]; then - export CSC_IDENTITY_AUTO_DISCOVERY=false - fi - ${{ matrix.command }} - - - name: Smoke Lite packaged Windows app - if: runner.os == 'Windows' - run: node scripts/smoke_windows_packaged_app.mjs --mode=lite --allow-missing-katago - - - name: Upload Lite packaged artifacts - uses: actions/upload-artifact@v4 - with: - name: GoAgent-Lite-${{ matrix.name }} - path: | - release/**/*-lite.AppImage - release/**/*-lite.deb - release/**/*-lite.dmg - release/**/*-lite.exe - release/**/*-lite-portable.zip - release/**/*-lite.tar.gz - release/**/*.yml - if-no-files-found: error - package-nvidia-windows: name: Package Windows NVIDIA needs: @@ -721,10 +601,9 @@ jobs: needs: - release-preflight - package - - package-lite - package-nvidia-windows runs-on: ubuntu-latest - if: always() && needs.release-preflight.outputs.can-package == 'true' && needs.release-preflight.outputs.can-package-nvidia == 'true' && needs.package.result == 'success' && needs.package-lite.result == 'success' && needs.package-nvidia-windows.result == 'success' && startsWith(github.ref, 'refs/tags/') + if: always() && needs.release-preflight.outputs.can-package == 'true' && needs.release-preflight.outputs.can-package-nvidia == 'true' && needs.package.result == 'success' && needs.package-nvidia-windows.result == 'success' && startsWith(github.ref, 'refs/tags/') steps: - name: Checkout release notes @@ -743,10 +622,6 @@ jobs: files=( artifacts/**/GoAgent-*-mac-arm64.dmg artifacts/**/GoAgent-*-mac-x64.dmg - artifacts/**/GoAgent-*-mac-arm64-lite.dmg - artifacts/**/GoAgent-*-mac-x64-lite.dmg - artifacts/**/GoAgent-*-win-x64-lite-portable.zip - artifacts/**/GoAgent-*-win-x64-lite.exe artifacts/**/GoAgent-*-win-x64-portable.zip artifacts/**/GoAgent-*-win-x64.exe artifacts/**/GoAgent-*-win-x64-nvidia-portable.7z* @@ -766,10 +641,6 @@ jobs: files: | artifacts/**/GoAgent-*-mac-arm64.dmg artifacts/**/GoAgent-*-mac-x64.dmg - artifacts/**/GoAgent-*-mac-arm64-lite.dmg - artifacts/**/GoAgent-*-mac-x64-lite.dmg - artifacts/**/GoAgent-*-win-x64-lite-portable.zip - artifacts/**/GoAgent-*-win-x64-lite.exe artifacts/**/GoAgent-*-win-x64-portable.zip artifacts/**/GoAgent-*-win-x64.exe artifacts/**/GoAgent-*-win-x64-nvidia-portable.7z* diff --git a/docs/LITE_RELEASES.md b/docs/LITE_RELEASES.md deleted file mode 100644 index 3383e3d..0000000 --- a/docs/LITE_RELEASES.md +++ /dev/null @@ -1,37 +0,0 @@ -# GoAgent Lite packages - -GoAgent publishes two desktop package families: - -- **Lite**: smaller installers for first-time users. Lite packages include the app, local knowledge base, settings UI, and bundled Kokoro Chinese TTS, but do not bundle KataGo binaries or large KataGo model files. -- **Full / NVIDIA**: offline-first packages that already include KataGo assets. These are larger, but work with fewer first-run downloads. - -## Expected Lite artifact names - -```text -GoAgent--mac-arm64-lite.dmg -GoAgent--mac-x64-lite.dmg -GoAgent--win-x64-lite.exe -GoAgent--win-x64-lite-portable.zip -``` - -## First-run behavior - -Lite packages intentionally start with KataGo marked as not ready. The Settings page should guide users to choose an official KataGo model and apply it. - -On Windows x64, applying a model also downloads and installs the official OpenCL runtime package when no local KataGo binary is available. This keeps the download small while preserving the one-click setup path. - -On macOS, users can use the bundled Full package, an existing system KataGo install, or a future platform runtime installer path. The Lite package still includes the manifest and model downloader so the UI can explain exactly which resource is missing. - -## Release workflow contract - -The release workflow builds Lite packages in a separate `package-lite` job. This job does not run the heavy KataGo asset preparation steps and should not add `data/katago/bin` or `data/katago/models` to `extraResources`. - -Use: - -```bash -pnpm check:lite-release-assets -pnpm dist:lite:win -pnpm dist:lite:mac -``` - -The generated temporary Electron Builder config is written to `.release/electron-builder-lite.json`, which is ignored by Git. diff --git a/docs/PACKAGING.md b/docs/PACKAGING.md index aac5550..bdcf430 100644 --- a/docs/PACKAGING.md +++ b/docs/PACKAGING.md @@ -29,10 +29,11 @@ The workflow builds on native runners: - macOS: DMG and ZIP. - Windows: x64 NSIS installer and x64 portable ZIP. -- Lite: smaller macOS and Windows packages without bundled KataGo binaries or model files. - Windows NVIDIA: x64 NSIS installer and x64 portable 7z archive with a dedicated NVIDIA KataGo runtime directory. - Linux: AppImage, DEB, and tar.gz. +GoAgent no longer publishes Lite packages. Public releases should only expose full Standard packages and the Windows NVIDIA edition so users do not accidentally download a package that starts without a bundled KataGo runtime. + Windows ARM64 is not supported in `v0.2.0-beta.1`. ## KataGo Runtime @@ -66,19 +67,6 @@ GoAgent--win-x64-nvidia-portable.7z.003 This keeps the NVIDIA package honest: it is not the standard Windows package with a new filename. -## Lite Packages - -The release workflow also builds: - -```text -GoAgent--mac-arm64-lite.dmg -GoAgent--mac-x64-lite.dmg -GoAgent--win-x64-lite.exe -GoAgent--win-x64-lite-portable.zip -``` - -Lite packages keep the app, local knowledge base, settings UI, and bundled Chinese Kokoro TTS, but intentionally do not bundle `data/katago/bin` or `data/katago/models`. This keeps the first download much smaller. On Windows x64, applying an official model from Settings also installs the OpenCL KataGo runtime if no local engine exists. - ## Signing The public workflow currently disables automatic code-signing discovery. Before distributing widely: diff --git a/docs/RELEASE_NOTES_v0.4.17.md b/docs/RELEASE_NOTES_v0.4.17.md new file mode 100644 index 0000000..5810a83 --- /dev/null +++ b/docs/RELEASE_NOTES_v0.4.17.md @@ -0,0 +1,151 @@ +# GoAgent v0.4.17 + +GoAgent v0.4.17 is a user-download hardening release. It removes the smaller package family from public releases and keeps only full Standard packages plus the Windows NVIDIA edition, so users are guided toward downloads that already include the required KataGo runtime path. + +QQ 群:1030632742,欢迎一起交流、提建议、完善 GoAgent。 + +## v0.4 系列延续能力 + +This release keeps the broader v0.4 foundation: grounded shape recognition engine, local pattern matcher, knowledge source-policy gates, optimized move-range review, quality checks and eval gates, Real Eval / engine silver fixture gate, KataGo engine pool telemetry, Release artifact smoke, student level, student age, teacher persona style settings with evidence boundary, teacher sessions, selective PR #6 integration, Tool-first Agent runtime, Kokoro selected-provider TTS with offline synthesis, Windows OpenCL runtime bundle, KataGo OpenCL adjacent runtime files, GPU vendor OpenCL drivers, and the community contribution path from layiku and wimi321. + +## 中文 + +### 下载前先选版本 + +| 平台 / 场景 | 推荐下载 | +| --- | --- | +| macOS Apple Silicon(M 系列) | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 安装版,普通用户推荐 | GoAgent-0.4.17-win-x64.exe | +| Windows x64 免安装版 | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA 专版安装版 | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA 专版免安装包 | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| 校验文件 | SHA256SUMS.txt | + +### 本版重点 + +- 公开发布页只保留完整 Standard 包和 Windows NVIDIA 专版,避免用户误下缺少内置 KataGo 的包。 +- Release workflow 不再构建或上传较小但不完整的包线。 +- 发布前继续启动 Windows Standard 和 Windows NVIDIA 包做 packaged smoke,确认下载包能进入应用并读取 KataGo 资源。 +- NVIDIA 免安装包继续保留重复 KataGo 检查、solid 7z 压缩和体积预算。 + +## 繁體中文 + +### 下載前先選版本 + +| 平台 / 使用情境 | 建議下載 | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 安裝版 | GoAgent-0.4.17-win-x64.exe | +| Windows x64 免安裝版 | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA 專版 | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA 免安裝包 | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| 校驗檔 | SHA256SUMS.txt | + +### 本版重點 + +- 發布頁只保留完整 Standard 包與 Windows NVIDIA 專版,降低使用者選錯下載項的機率。 +- Release workflow 不再產生或上傳較小但不完整的包線。 +- Windows Standard 與 Windows NVIDIA 包仍會在上傳前 smoke 啟動並檢查 KataGo 資源。 + +## English + +### Pick the right package before downloading + +| Platform / use case | Recommended download | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.17-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable package | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### Highlights + +- Public releases now expose only complete Standard packages and the Windows NVIDIA edition. +- The release workflow no longer builds or uploads the smaller incomplete package family. +- Windows Standard and Windows NVIDIA packaged-app smoke checks still run before upload. +- NVIDIA portable packages keep duplicate KataGo checks, solid 7z compression, and the release size budget. + +## 日本語 + +### ダウンロード前に選ぶもの + +| 環境 | 推奨ファイル | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 インストーラー | GoAgent-0.4.17-win-x64.exe | +| Windows x64 ポータブル ZIP | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA 版 | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA ポータブル | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| チェックサム | SHA256SUMS.txt | + +### 主な変更 + +- 公開リリースでは、完全な Standard パッケージと Windows NVIDIA 版だけを案内します。 +- 小さいが KataGo 実行環境を同梱しないパッケージ系統はビルドおよびアップロードしません。 +- Windows Standard / NVIDIA の packaged smoke はアップロード前に継続します。 + +## 한국어 + +### 다운로드 전 선택 + +| 환경 | 권장 다운로드 | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 설치 프로그램 | GoAgent-0.4.17-win-x64.exe | +| Windows x64 포터블 ZIP | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA 설치 프로그램 | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA 포터블 | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| 체크섬 | SHA256SUMS.txt | + +### 이번 버전 + +- 공개 릴리스에는 완전한 Standard 패키지와 Windows NVIDIA 에디션만 제공합니다. +- 더 작지만 KataGo 실행 환경이 포함되지 않는 패키지 계열은 더 이상 빌드하거나 업로드하지 않습니다. +- Windows Standard / NVIDIA smoke 검사는 계속 실행됩니다. + +## ภาษาไทย + +### เลือกไฟล์ก่อนดาวน์โหลด + +| แพลตฟอร์ม | ไฟล์ที่แนะนำ | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.17-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### จุดสำคัญของรุ่นนี้ + +- หน้า release แสดงเฉพาะแพ็กเกจ Standard แบบครบถ้วนและ Windows NVIDIA edition +- workflow จะไม่ build หรือ upload ชุดแพ็กเกจขนาดเล็กที่ไม่มี KataGo runtime ในตัว +- Windows Standard / NVIDIA packaged smoke ยังคงทำงานก่อนอัปโหลด + +## Tiếng Việt + +### Chọn gói tải xuống + +| Nền tảng | Gói khuyến nghị | +| --- | --- | +| macOS Apple Silicon | GoAgent-0.4.17-mac-arm64.dmg | +| macOS Intel | GoAgent-0.4.17-mac-x64.dmg | +| Windows x64 installer | GoAgent-0.4.17-win-x64.exe | +| Windows x64 portable ZIP | GoAgent-0.4.17-win-x64-portable.zip | +| Windows x64 NVIDIA installer | GoAgent-0.4.17-win-x64-nvidia.exe | +| Windows x64 NVIDIA portable | GoAgent-0.4.17-win-x64-nvidia-portable.7z.001 and all following split parts | +| Checksums | SHA256SUMS.txt | + +### Điểm mới + +- Trang release chỉ hiển thị gói Standard đầy đủ và Windows NVIDIA edition. +- Workflow không còn build hoặc upload dòng gói nhỏ không kèm KataGo runtime. +- Windows Standard / NVIDIA packaged smoke vẫn chạy trước khi upload. diff --git a/package.json b/package.json index 139de6e..fbef460 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "goagent", - "version": "0.4.16", + "version": "0.4.17", "description": "Agentic AI teacher for Go / Weiqi / Baduk, powered by KataGo and multimodal LLMs.", "main": "out/main/index.js", "type": "module", @@ -57,10 +57,6 @@ "dist:mac": "pnpm build && electron-builder --mac --publish never", "dist:win": "pnpm build && electron-builder --win --publish never", "dist:linux": "pnpm build && electron-builder --linux --publish never", - "write:lite-builder-config": "node scripts/write_lite_builder_config.mjs", - "dist:lite:mac": "pnpm build && pnpm write:lite-builder-config && electron-builder --config .release/electron-builder-lite.json --mac --publish never", - "dist:lite:win": "pnpm build && pnpm write:lite-builder-config && electron-builder --config .release/electron-builder-lite.json --win --publish never", - "dist:lite:linux": "pnpm build && pnpm write:lite-builder-config && electron-builder --config .release/electron-builder-lite.json --linux --publish never", "dist:local:mac": "pnpm prepare:zhizi-b28 && pnpm dist:mac", "dist:local:win": "pnpm prepare:zhizi-b28 && pnpm dist:win", "dist:local:linux": "pnpm prepare:zhizi-b28 && pnpm dist:linux", @@ -70,10 +66,10 @@ "prepare:zhizi-b28": "node scripts/download_zhizi_b28.mjs", "check:katago-assets": "node scripts/check_katago_assets.mjs --mode=dev", "check:katago-assets:release": "node scripts/check_katago_assets.mjs --mode=release", - "check:lite-release-assets": "node scripts/check_lite_release_assets.mjs", + "check:no-lite-release-assets": "node scripts/check_no_lite_release_assets.mjs", "check:nvidia-release-assets": "node scripts/check_nvidia_release_assets.mjs", "check:release-notes-i18n": "node scripts/check_release_notes_i18n.mjs", - "check:release-quality": "pnpm check:teacher-quality && pnpm check:lite-release-assets && pnpm check:nvidia-release-assets && pnpm check:release-notes-i18n && pnpm check:tts-assets && pnpm smoke:tts && pnpm smoke:release-artifacts", + "check:release-quality": "pnpm check:teacher-quality && pnpm check:no-lite-release-assets && pnpm check:nvidia-release-assets && pnpm check:release-notes-i18n && pnpm check:tts-assets && pnpm smoke:tts && pnpm smoke:release-artifacts", "check:p0-beta": "node scripts/p0_beta_acceptance.mjs", "check:artifacts": "node scripts/package_artifact_smoke.mjs --mode=dev", "smoke:teacher-llm": "pnpm build && node scripts/teacher_llm_smoke.mjs", diff --git a/scripts/check_lite_release_assets.mjs b/scripts/check_lite_release_assets.mjs deleted file mode 100644 index 1926db2..0000000 --- a/scripts/check_lite_release_assets.mjs +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env node -import { existsSync, readFileSync, rmSync } from 'node:fs' -import { join } from 'node:path' -import { spawnSync } from 'node:child_process' - -const root = process.cwd() -const workflow = readFileSync(join(root, '.github', 'workflows', 'release.yml'), 'utf8') -const packageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) -const writer = readFileSync(join(root, 'scripts', 'write_lite_builder_config.mjs'), 'utf8') - -const requiredScripts = [ - 'write:lite-builder-config', - 'dist:lite:mac', - 'dist:lite:win', - 'check:lite-release-assets' -] -const requiredWorkflowFragments = [ - 'package-lite:', - 'Package Lite', - 'pnpm dist:lite:mac', - 'pnpm dist:lite:win', - 'GoAgent-*-mac-arm64-lite.dmg', - 'GoAgent-*-mac-x64-lite.dmg', - 'GoAgent-*-win-x64-lite.exe', - 'GoAgent-*-win-x64-lite-portable.zip' -] -const requiredWriterFragments = [ - '${productName}-${version}-${os}-${arch}-lite.${ext}', - '${productName}-${version}-${os}-${arch}-lite-portable.${ext}', - 'data/knowledge', - 'data/katago', - 'manifest.json', - '!kokoro/zh-CN/onnx/model_int8.onnx' -] - -const failures = [] -for (const scriptName of requiredScripts) { - if (!packageJson.scripts?.[scriptName]) failures.push(`package.json missing script: ${scriptName}`) -} -for (const fragment of requiredWorkflowFragments) { - if (!workflow.includes(fragment)) failures.push(`release workflow missing: ${fragment}`) -} -for (const fragment of requiredWriterFragments) { - if (!writer.includes(fragment)) failures.push(`lite builder writer missing: ${fragment}`) -} - -const generatedPath = join(root, '.release', 'electron-builder-lite.json') -rmSync(generatedPath, { force: true }) -const result = spawnSync(process.execPath, ['scripts/write_lite_builder_config.mjs'], { - cwd: root, - encoding: 'utf8' -}) -if (result.status !== 0) { - failures.push(`lite builder config generation failed: ${result.stderr || result.stdout}`) -} else if (!existsSync(generatedPath)) { - failures.push('lite builder config was not written') -} else { - const config = JSON.parse(readFileSync(generatedPath, 'utf8')) - const resources = JSON.stringify(config.extraResources ?? []) - if (!resources.includes('data/knowledge')) failures.push('lite config must include local knowledge data') - if (!resources.includes('manifest.json')) failures.push('lite config must include KataGo manifest') - if (resources.includes('data/katago/bin') || resources.includes('data/katago/models')) { - failures.push('lite config must not bundle KataGo binaries or models') - } - if (config.artifactName !== '${productName}-${version}-${os}-${arch}-lite.${ext}') { - failures.push('lite config has unexpected artifactName') - } - if (config.win?.artifactName !== '${productName}-${version}-${os}-${arch}-lite-portable.${ext}') { - failures.push('lite config has unexpected Windows portable artifactName') - } -} - -if (failures.length > 0) { - for (const failure of failures) console.error(`[check-lite-release-assets] ${failure}`) - process.exit(1) -} - -console.log('[check-lite-release-assets] lite release packaging contract OK') diff --git a/scripts/check_no_lite_release_assets.mjs b/scripts/check_no_lite_release_assets.mjs new file mode 100644 index 0000000..011a486 --- /dev/null +++ b/scripts/check_no_lite_release_assets.mjs @@ -0,0 +1,47 @@ +#!/usr/bin/env node +import { existsSync, readFileSync } from 'node:fs' +import { join } from 'node:path' + +const root = process.cwd() +const packageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) +const workflow = readFileSync(join(root, '.github', 'workflows', 'release.yml'), 'utf8') +const packaging = readFileSync(join(root, 'docs', 'PACKAGING.md'), 'utf8') +const notesPath = join(root, 'docs', `RELEASE_NOTES_v${packageJson.version}.md`) +const notes = existsSync(notesPath) ? readFileSync(notesPath, 'utf8') : '' + +const failures = [] +const forbiddenFragments = [ + 'package-lite', + 'Package Lite', + 'GoAgent-Lite', + 'dist:lite', + 'write:lite-builder-config', + 'check:lite-release-assets', + 'electron-builder-lite', + 'win-x64-lite', + 'mac-arm64-lite', + 'mac-x64-lite', + '-lite-portable' +] + +const scriptNames = Object.keys(packageJson.scripts ?? {}) +for (const name of scriptNames) { + if (/(^|:)lite(:|$)/i.test(name)) failures.push(`package.json must not expose Lite script: ${name}`) +} + +const scriptText = JSON.stringify(packageJson.scripts ?? {}) +for (const fragment of forbiddenFragments) { + if (scriptText.includes(fragment)) failures.push(`package.json scripts still mention Lite release fragment: ${fragment}`) + if (workflow.includes(fragment)) failures.push(`release workflow still mentions Lite release fragment: ${fragment}`) + if (packaging.includes(fragment)) failures.push(`docs/PACKAGING.md still mentions Lite artifact fragment: ${fragment}`) + if (notes.includes(fragment)) failures.push(`${notesPath} still mentions Lite artifact fragment: ${fragment}`) +} + +if (!notes) failures.push(`missing release notes for v${packageJson.version}`) + +if (failures.length > 0) { + for (const failure of failures) console.error(`[check-no-lite-release-assets] ${failure}`) + process.exit(1) +} + +console.log('[check-no-lite-release-assets] release packaging no longer exposes Lite artifacts') diff --git a/scripts/check_release_notes_i18n.mjs b/scripts/check_release_notes_i18n.mjs index 7c80370..60e1753 100644 --- a/scripts/check_release_notes_i18n.mjs +++ b/scripts/check_release_notes_i18n.mjs @@ -31,6 +31,12 @@ const requiredAssets = [ `GoAgent-${version}-win-x64-nvidia-portable.7z.001`, 'SHA256SUMS.txt' ] +const forbiddenAssets = [ + `GoAgent-${version}-mac-arm64-lite.dmg`, + `GoAgent-${version}-mac-x64-lite.dmg`, + `GoAgent-${version}-win-x64-lite.exe`, + `GoAgent-${version}-win-x64-lite-portable.zip` +] const requiredTopics = [ 'grounded shape recognition engine', 'local pattern matcher', @@ -62,6 +68,9 @@ for (const section of requiredSections) { for (const asset of requiredAssets) { if (!body.includes(asset)) failures.push(`missing asset mention: ${asset}`) } +for (const asset of forbiddenAssets) { + if (body.includes(asset)) failures.push(`release notes must not advertise retired Lite asset: ${asset}`) +} for (const topic of requiredTopics) { if (!body.toLowerCase().includes(topic.toLowerCase())) failures.push(`missing release topic: ${topic}`) } diff --git a/scripts/write_lite_builder_config.mjs b/scripts/write_lite_builder_config.mjs deleted file mode 100644 index 33038cc..0000000 --- a/scripts/write_lite_builder_config.mjs +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env node -import { mkdirSync, readFileSync, writeFileSync } from 'node:fs' -import { dirname, join } from 'node:path' - -const root = process.cwd() -const packageJson = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')) -const baseBuild = packageJson.build - -if (!baseBuild) { - throw new Error('package.json is missing build configuration') -} - -const liteBuild = structuredClone(baseBuild) - -liteBuild.artifactName = '${productName}-${version}-${os}-${arch}-lite.${ext}' -liteBuild.extraResources = [ - { - from: 'data/knowledge', - to: 'data/knowledge', - filter: ['**/*'] - }, - { - from: 'data/katago', - to: 'data/katago', - filter: ['manifest.json', 'README.md'] - }, - { - from: 'data/tts', - to: 'data/tts', - filter: ['**/*', '!kokoro/zh-CN/onnx/model_int8.onnx'] - } -] -liteBuild.asarUnpack = [] - -liteBuild.win = { - ...(liteBuild.win ?? {}), - artifactName: '${productName}-${version}-${os}-${arch}-lite-portable.${ext}' -} - -liteBuild.nsis = { - ...(liteBuild.nsis ?? {}), - artifactName: '${productName}-${version}-${os}-${arch}-lite.${ext}' -} - -const outputPath = join(root, '.release', 'electron-builder-lite.json') -mkdirSync(dirname(outputPath), { recursive: true }) -writeFileSync(outputPath, `${JSON.stringify(liteBuild, null, 2)}\n`, 'utf8') -console.log(`[lite-builder] wrote ${outputPath}`) diff --git a/tests/goagent-brand-contract.test.mjs b/tests/goagent-brand-contract.test.mjs index 5888397..26c3360 100644 --- a/tests/goagent-brand-contract.test.mjs +++ b/tests/goagent-brand-contract.test.mjs @@ -1,6 +1,6 @@ import assert from 'node:assert/strict' import { execFileSync } from 'node:child_process' -import { readFileSync } from 'node:fs' +import { existsSync, readFileSync } from 'node:fs' import { join } from 'node:path' import test from 'node:test' @@ -15,6 +15,7 @@ function trackedTextFiles() { .toString('utf8') .split('\0') .filter(Boolean) + .filter((file) => existsSync(join(root, file))) .filter((file) => { const body = readFileSync(join(root, file)) return !body.includes(0) diff --git a/tests/lite-release-contract.test.mjs b/tests/lite-release-contract.test.mjs deleted file mode 100644 index 3c11453..0000000 --- a/tests/lite-release-contract.test.mjs +++ /dev/null @@ -1,49 +0,0 @@ -import assert from 'node:assert/strict' -import { existsSync, readFileSync, rmSync } from 'node:fs' -import { spawnSync } from 'node:child_process' -import { join } from 'node:path' -import test from 'node:test' - -const root = process.cwd() - -function read(relativePath) { - return readFileSync(join(root, relativePath), 'utf8') -} - -test('lite release packaging is wired without bundled KataGo binaries or models', () => { - const packageJson = JSON.parse(read('package.json')) - assert.match(packageJson.scripts['dist:lite:mac'], /electron-builder --config \.release\/electron-builder-lite\.json --mac/) - assert.match(packageJson.scripts['dist:lite:win'], /electron-builder --config \.release\/electron-builder-lite\.json --win/) - assert.match(packageJson.scripts['check:release-quality'], /check:lite-release-assets/) - - const writer = read('scripts/write_lite_builder_config.mjs') - assert.match(writer, /data\/knowledge/) - assert.match(writer, /manifest\.json/) - assert.match(writer, /\$\{productName\}-\$\{version\}-\$\{os\}-\$\{arch\}-lite\.\$\{ext\}/) - assert.match(writer, /\$\{productName\}-\$\{version\}-\$\{os\}-\$\{arch\}-lite-portable\.\$\{ext\}/) - - const generatedPath = join(root, '.release', 'electron-builder-lite.json') - rmSync(generatedPath, { force: true }) - const result = spawnSync(process.execPath, ['scripts/write_lite_builder_config.mjs'], { cwd: root, encoding: 'utf8' }) - assert.equal(result.status, 0, result.stderr) - assert.ok(existsSync(generatedPath), 'lite config should be generated') - const config = JSON.parse(readFileSync(generatedPath, 'utf8')) - const resources = JSON.stringify(config.extraResources) - assert.match(resources, /data\/knowledge/) - assert.match(resources, /data\/katago/) - assert.match(resources, /manifest\.json/) - assert.doesNotMatch(resources, /data\/katago\/bin/) - assert.doesNotMatch(resources, /data\/katago\/models/) -}) - -test('release workflow publishes lite artifacts next to full packages', () => { - const workflow = read('.github/workflows/release.yml') - assert.match(workflow, /package-lite:/) - assert.match(workflow, /pnpm dist:lite:mac/) - assert.match(workflow, /pnpm dist:lite:win/) - assert.match(workflow, /GoAgent-\*-mac-arm64-lite\.dmg/) - assert.match(workflow, /GoAgent-\*-mac-x64-lite\.dmg/) - assert.match(workflow, /GoAgent-\*-win-x64-lite\.exe/) - assert.match(workflow, /GoAgent-\*-win-x64-lite-portable\.zip/) - assert.match(workflow, /needs\.package-lite\.result == 'success'/) -}) diff --git a/tests/no-lite-release-contract.test.mjs b/tests/no-lite-release-contract.test.mjs new file mode 100644 index 0000000..1d20bcf --- /dev/null +++ b/tests/no-lite-release-contract.test.mjs @@ -0,0 +1,58 @@ +import assert from 'node:assert/strict' +import { existsSync, readFileSync } from 'node:fs' +import { join } from 'node:path' +import test from 'node:test' + +const root = process.cwd() + +function read(relativePath) { + return readFileSync(join(root, relativePath), 'utf8') +} + +test('package scripts no longer expose Lite release builds', () => { + const packageJson = JSON.parse(read('package.json')) + const scripts = packageJson.scripts ?? {} + assert.equal(scripts['write:lite-builder-config'], undefined) + assert.equal(scripts['dist:lite:mac'], undefined) + assert.equal(scripts['dist:lite:win'], undefined) + assert.equal(scripts['dist:lite:linux'], undefined) + assert.equal(scripts['check:lite-release-assets'], undefined) + assert.equal(scripts['check:no-lite-release-assets'], 'node scripts/check_no_lite_release_assets.mjs') + assert.match(scripts['check:release-quality'], /check:no-lite-release-assets/) + assert.doesNotMatch(scripts['check:release-quality'], /check:lite-release-assets/) +}) + +test('release workflow publishes only full Standard and NVIDIA packages', () => { + const workflow = read('.github/workflows/release.yml') + assert.doesNotMatch(workflow, /package-lite:/) + assert.doesNotMatch(workflow, /Package Lite/) + assert.doesNotMatch(workflow, /pnpm dist:lite/) + assert.doesNotMatch(workflow, /GoAgent-Lite/) + assert.doesNotMatch(workflow, /GoAgent-\*-mac-arm64-lite\.dmg/) + assert.doesNotMatch(workflow, /GoAgent-\*-mac-x64-lite\.dmg/) + assert.doesNotMatch(workflow, /GoAgent-\*-win-x64-lite\.exe/) + assert.doesNotMatch(workflow, /GoAgent-\*-win-x64-lite-portable\.zip/) + assert.doesNotMatch(workflow, /needs\.package-lite/) + + assert.match(workflow, /GoAgent-\*-mac-arm64\.dmg/) + assert.match(workflow, /GoAgent-\*-mac-x64\.dmg/) + assert.match(workflow, /GoAgent-\*-win-x64\.exe/) + assert.match(workflow, /GoAgent-\*-win-x64-portable\.zip/) + assert.match(workflow, /GoAgent-\*-win-x64-nvidia\.exe/) + assert.match(workflow, /GoAgent-\*-win-x64-nvidia-portable\.7z\*/) +}) + +test('Lite release helper scripts and docs were removed', () => { + assert.equal(existsSync(join(root, 'scripts', 'write_lite_builder_config.mjs')), false) + assert.equal(existsSync(join(root, 'scripts', 'check_lite_release_assets.mjs')), false) + assert.equal(existsSync(join(root, 'docs', 'LITE_RELEASES.md')), false) +}) + +test('current release notes do not advertise Lite packages', () => { + const packageJson = JSON.parse(read('package.json')) + const notes = read(`docs/RELEASE_NOTES_v${packageJson.version}.md`) + assert.doesNotMatch(notes, /lite/i) + assert.doesNotMatch(notes, /win-x64-lite/) + assert.doesNotMatch(notes, /mac-arm64-lite/) + assert.doesNotMatch(notes, /mac-x64-lite/) +}) diff --git a/tests/release-notes-i18n-contract.test.mjs b/tests/release-notes-i18n-contract.test.mjs index ef6e85b..c395dc8 100644 --- a/tests/release-notes-i18n-contract.test.mjs +++ b/tests/release-notes-i18n-contract.test.mjs @@ -15,10 +15,24 @@ test('release notes include multilingual download guidance', () => { test('release notes list standard and NVIDIA artifacts', () => { for (const asset of [ + `GoAgent-${packageJson.version}-mac-arm64.dmg`, + `GoAgent-${packageJson.version}-mac-x64.dmg`, `GoAgent-${packageJson.version}-win-x64-portable.zip`, `GoAgent-${packageJson.version}-win-x64.exe`, + `GoAgent-${packageJson.version}-win-x64-nvidia.exe`, `GoAgent-${packageJson.version}-win-x64-nvidia-portable.7z.001` ]) { assert.ok(notes.includes(asset), `missing ${asset}`) } }) + +test('release notes do not list retired Lite artifacts', () => { + for (const asset of [ + `GoAgent-${packageJson.version}-mac-arm64-lite.dmg`, + `GoAgent-${packageJson.version}-mac-x64-lite.dmg`, + `GoAgent-${packageJson.version}-win-x64-lite.exe`, + `GoAgent-${packageJson.version}-win-x64-lite-portable.zip` + ]) { + assert.equal(notes.includes(asset), false, `must not advertise ${asset}`) + } +}) diff --git a/tests/sprint4-release-contract.test.mjs b/tests/sprint4-release-contract.test.mjs index 1966481..516e206 100644 --- a/tests/sprint4-release-contract.test.mjs +++ b/tests/sprint4-release-contract.test.mjs @@ -59,8 +59,6 @@ test('Windows release workflow smoke-starts packaged apps before upload', () => assert.equal(packageJson.scripts['smoke:windows-packaged'], 'node scripts/smoke_windows_packaged_app.mjs') assert.match(workflow, /Smoke packaged Windows app/) assert.match(workflow, /smoke_windows_packaged_app\.mjs --mode=full --require-katago/) - assert.match(workflow, /Smoke Lite packaged Windows app/) - assert.match(workflow, /smoke_windows_packaged_app\.mjs --mode=lite --allow-missing-katago/) assert.match(workflow, /Smoke NVIDIA packaged Windows app/) assert.match(workflow, /smoke_windows_packaged_app\.mjs --mode=nvidia --require-katago/) assert.match(smoke, /window\.goagent\.getDiagnostics\(\)/)