Release v2.0.0
CI / Windows baseline (push) Canceled after 0s

This commit is contained in:
2026-09-10 20:59:52 +03:00
parent 9c987df6e9
commit efda8eb98f
142 changed files with 68308 additions and 9333 deletions
+19 -3
View File
@@ -22,18 +22,30 @@ src/styles/app.css global/component CSS
src-tauri/src/models.rs Rust domain models
src-tauri/src/validation.rs input normalization/validation
src-tauri/src/storage.rs JSON config/state storage
src-tauri/src/migration.rs versioned storage adoption/migration
src-tauri/src/activity.rs activity log
src-tauri/src/subscription.rs subscription fetch/parse
src-tauri/src/component_detection.rs component status detection
src-tauri/src/component_catalog.rs pinned offline package catalog
src-tauri/src/component_inventory.rs exact native SCM/process/registry inventory
src-tauri/src/component_detection.rs component status mapping
src-tauri/src/component_packages.rs bundled/cache package plans
src-tauri/src/component_cutover.rs durable legacy cutover/rollback/cleanup
src-tauri/src/privileged_jobs.rs sealed one-shot elevation records
src-tauri/src/privileged_runtime.rs fixed native privileged actions
src-tauri/src/proxifyre_runtime.rs native ProxiFyre lifecycle
src-tauri/src/singbox_runtime.rs native sing-box lifecycle
src-tauri/src/adapters/* ProxiFyre/sing-box/proxy router adapters
src-tauri/src/commands.rs Tauri command layer, currently too large
src-tauri/tests/* Rust tests
scripts/*.ps1 Windows install/control scripts
scripts/*.ps1 build/release/QA tooling only
```
## Source of truth
- Persistent app config/state: `C:\ProgramData\ProxyWarden\config` and `state`.
- `config\components.json` is legacy migration input only; live component truth comes from native inventory and verified receipts.
- Current managed roots: `C:\Program Files\ProxyWarden\components\ProxiFyre` and `...\sing-box`.
- Offline baseline: packaged component catalog; verified downloaded cache: `C:\ProgramData\ProxyWarden\packages`.
- Generated artifacts: `C:\ProgramData\ProxyWarden\generated`.
- Frontend state is not source of truth. It should represent backend state and pending UI edits.
- Component detection/runtime status should come from backend, not guessed in UI.
@@ -45,13 +57,17 @@ scripts/*.ps1 Windows install/control scripts
3. Inspect the relevant source files listed above.
4. Determine whether the change crosses the Tauri boundary. If yes, update both Rust DTO/command and TypeScript wrapper/types.
5. Determine whether the change touches secrets, service control, generated configs, process execution, filesystem deletion, or network fetch. If yes, apply security checklist.
6. Prefer small, isolated changes over broad rewrites.
6. If the change touches install/service/elevation, trace `privileged_jobs.rs`/`privileged_runtime.rs` and the native component runtime. Do not introduce PowerShell runtime fallback.
7. If the change touches packaging or release tooling, run `scripts/check-runtime-powershell-boundary.ps1 -CheckOnly`.
8. Prefer small, isolated changes over broad rewrites.
## Do not
- Do not treat `App.tsx` or `commands.rs` as the correct permanent architecture just because they currently contain lots of logic.
- Do not introduce a second storage system.
- Do not move service/install logic into frontend.
- Do not treat legacy `components.json`, fuzzy paths, or service name alone as ownership proof.
- Do not add `.ps1`, `powershell.exe`, `pwsh`, or generated script text to production Rust/Tauri/NSIS paths.
- Do not claim Windows service/elevation behavior is verified unless it was actually tested on Windows.
## Output expectations
+46 -71
View File
@@ -2,7 +2,7 @@
## Когда использовать
Используй этот skill при добавлении CI, release scripts, build fixes, test changes, dependency updates, packaging changes или перед финальным отчетом по крупной задаче.
Используй этот skill при изменениях CI, release scripts, tests, dependencies, Tauri/NSIS packaging, offline component catalog или перед финальным отчётом по крупной задаче.
## Minimal local checks
@@ -10,109 +10,84 @@ Frontend:
```powershell
npm ci
npm run format:check
npm run lint
npm run typecheck
npm test -- --run
npm run build
```
Rust:
```powershell
cd src-tauri
Push-Location src-tauri
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
Pop-Location
```
Tauri:
Tauri/build/release boundaries:
```powershell
npm run tauri -- info
npm run tauri -- build
& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
& .\scripts\update-component-bundle.ps1 -PlanOnly
& .\scripts\update-component-bundle.ps1 -CheckOnly
& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
& .\scripts\prepare-release.ps1 -PlanOnly -SkipBuild
```
PowerShell plan-only:
```powershell
& .\scripts\install-control-app.ps1 -PlanOnly
& .\scripts\install-proxyfier.ps1 -PlanOnly
& .\scripts\install-singbox.ps1 -PlanOnly
```
`PlanOnly`/`CheckOnly` должны возвращать structured JSON с `changed: false` и не менять repo, ProgramData, services или network state.
## Interaction smoke for UI motion
Build, lint, and unit tests do not validate motion or pointer behavior. For any hover, disclosure, stagger, or hit-target change, verify:
Build, lint и unit tests не проверяют motion/geometry. Для hover, disclosure, stagger или hit-target изменений проверь first/repeated/rapid toggle, keyboard focus, loading/long labels, `prefers-reduced-motion`, desktop и narrow window. Если visual smoke не выполнен, так и напиши.
- first open and first close;
- repeated and rapid toggle;
- hover and click before, during, and after transition;
- keyboard focus and hidden-control tab order;
- loading and longest localized labels;
- `prefers-reduced-motion`;
- desktop and narrow window geometry.
## CI contract
Use a controlled mock or preview state when backend status is difficult to reproduce. If no visual interaction smoke is possible, report that evidence as missing and do not claim the motion task is complete.
Windows baseline должен включать:
## CI recommendation
- frontend format/lint/typecheck/tests/build;
- Rust fmt/clippy/all-target tests;
- Tauri environment check;
- runtime PowerShell boundary check;
- offline bundle PlanOnly + CheckOnly;
- Windows audit PlanOnly;
- release preparation PlanOnly with build skipped.
Add GitHub Actions with at least:
- frontend build on Windows and Ubuntu if practical;
- Rust fmt/clippy/test;
- PowerShell syntax/plan-only smoke on Windows;
- Tauri build on Windows for release branches/tags;
- artifact upload only for trusted release workflow.
CI не изображает реальную SCM/UAC/driver проверку. Artifact upload и tag/publish допустимы только в отдельном trusted release workflow после принятой VM evidence.
## Dependency updates
When changing dependencies:
- Update lockfiles.
- Check Tauri v2 compatibility.
- Avoid adding large UI/runtime dependencies for tiny tasks.
- Avoid adding shell/process libraries that bypass existing backend boundaries.
- Note why dependency is needed.
- Обновить lockfiles.
- Проверить Tauri v2 и Windows x64 compatibility.
- Не добавлять dependency, если stdlib/native API или уже установленный crate решает задачу.
- Не добавлять shell/process library, возвращающую production PowerShell path.
- Объяснить, зачем dependency нужна и какой owner её вызывает.
## Release hygiene
Before release:
Перед release candidate:
- Verify app version in `package.json` and Tauri config if applicable.
- Verify icons/assets size.
- Verify CSP and capabilities.
- Verify no raw secrets/test URLs in repo.
- Verify installer scripts with `-PlanOnly`.
- Verify clean install on Windows VM.
- Verify external SOCKS5 flow.
- Verify local sing-box subscription flow.
- Verify uninstall/safe cleanup behavior.
- версии совпадают в `package.json`, `package-lock.json`, `src-tauri/tauri.conf.json` и `src-tauri/Cargo.toml`;
- packaged component catalog, asset hashes, licenses и `THIRD_PARTY_NOTICES.md` согласованы;
- installer содержит consolidated offline component bundle и WebView2 Offline Installer;
- runtime PowerShell checker проходит, bundled cleanup script отсутствует;
- NSIS hook разделяет verify-only upgrade и full managed uninstall;
- fresh offline VM, legacy upgrade/rollback, foreign service refusal, UAC cancel, uninstall/reboot и реальные routing flows записаны в evidence;
- tag/publish выполняются только для того же проверенного commit.
## Final report format
Установка Control App не должна скрыто install/start/update routing-компоненты. Payloads могут быть в installer, но component mutation остаётся отдельным user action.
```text
Changed:
- ...
## Финальный отчёт
Verified:
- npm run build
- cargo test
Разделить:
Not verified:
- Windows elevated install/uninstall, because ...
- `Проверено`: точные команды и результаты;
- `Не проверено`: Windows VM/UAC/SCM/driver/installer gaps;
- `Риски`: только конкретные release blockers.
Risks:
- ...
```
Не писать «все тесты проходят», если весь релевантный набор действительно не запускался.
Do not write “all tests pass” unless all listed relevant tests actually ran. Humanity has enough fictional dashboards.
## Как отчитываться
Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
Минимум для нетривиальной задачи:
- короткая сводка;
- таблица файлов `Файл / Что изменилось / Зачем`;
- важные места без пересказа каждой строки;
- что проверено;
- что не проверено;
- конкретные риски.
Перед ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
@@ -2,93 +2,73 @@
## Когда использовать
Используй этот skill при изменениях в `scripts/*.ps1`, ProxiFyre install/start/stop/uninstall, sing-box service control, UAC/admin checks, helper/elevation boundary, component detection.
Используй этот skill при изменениях ProxiFyre/sing-box install/start/stop/update/uninstall, UAC/admin boundary, native inventory, NSIS upgrade/uninstall или build/release/QA PowerShell scripts.
## Цель
Сохранять service/install operations явными, безопасными и проверяемыми. Пользователь должен понимать, что приложение собирается менять в системе. Компьютер пользователя — не песочница для творческих экспериментов агента, как ни печально.
Сохранять системные операции явными, native и проверяемыми. Production runtime не зависит от PowerShell; Rust владеет Windows SCM, registry, process, filesystem, package verification и UAC flow.
## Инварианты
## Runtime-инварианты
- Install/start/stop/uninstall are explicit user actions.
- `apply` must not silently install/uninstall/start/stop components unless that behavior is clearly designed and surfaced.
- `-PlanOnly` scripts must be side-effect-free.
- PowerShell output intended for UI/backend must be structured JSON.
- Service detection must distinguish managed service from fuzzy candidate.
- Never relax safe-path checks to make uninstall easier.
- Install/start/stop/update/uninstall/migrate — только явные действия пользователя.
- `apply` не устанавливает, не обновляет, не переносит и не удаляет компоненты.
- Current managed roots — только `C:\Program Files\ProxyWarden\components\ProxiFyre` и `...\sing-box`.
- Service control требует exact `PathName`, marker/receipt, canonical path и non-reparse checks. Имя службы или fuzzy candidate недостаточны.
- Elevated UI action передаёт только UUID sealed job record; fixed early mode сам повторно проверяет ACL, TTL, action, paths, hashes и ownership.
- NSIS использует только exact `--nsis-verify-upgrade` и `--nsis-uninstall-managed`; никаких user/path/script arguments.
- Active/recovery/pending cutover journal блокирует upgrade/uninstall и не удаляется общим cleanup.
- Runtime-generated scripts и запуск `powershell.exe`/`pwsh` запрещены.
## Script rules
## PowerShell allowlist
PowerShell scripts should:
PowerShell остаётся только для build/release/QA:
- use `Set-StrictMode -Version Latest` where practical;
- set `$ErrorActionPreference = 'Stop'`;
- return structured JSON for plan/status paths;
- avoid localized text parsing for control flow;
- avoid writing secrets to host output;
- have clear exit codes;
- support `-PlanOnly` for dry-run/status checks;
- avoid downloading/executing arbitrary remote scripts.
- `scripts/check-runtime-powershell-boundary.ps1`;
- `scripts/update-component-bundle.ps1`;
- `scripts/prepare-release.ps1`;
- `scripts/audit-windows-smoke.ps1`.
## Elevation rules
`PlanOnly`/`CheckOnly` должны быть side-effect-free и возвращать structured JSON с `changed: false`. Любой новый `.ps1`, `.psm1`, `.psd1`, production caller или bundled cleanup resource должен ломать boundary checker.
When launching elevated PowerShell:
## Native service flow
- keep command fixed and parameters escaped;
- avoid user-controlled script text;
- avoid predictable temp script names;
- do not pass secrets via command line;
- verify script path before launch;
- clean up temp artifacts best-effort;
- return clear error if user cancels UAC.
1. Получить inventory через Windows API и canonicalize все пути.
2. Классифицировать `Missing / Managed / Foreign / Incomplete` до первой mutation.
3. Проверить marker/receipt, service `PathName`, file identity, ACL и reparse boundary.
4. Захватить общий lifecycle lock.
5. Выполнить только allowlisted fixed action.
6. Query-back подтвердить service/path/start policy/state.
7. При ошибке оставить durable recovery state; не угадывать cleanup.
## Service detection
Для uninstall сначала preflight всех компонентов. `Missing` — no-op; `Foreign`/`Incomplete` — zero mutation. Running service сначала останавливается и проверяется, затем удаляется. MSI code `3010` означает success with reboot required, а не обычную ошибку.
Preferred approach:
## Удаление файлов
1. Search known managed service names first.
2. Read service `PathName` through WMI/CIM.
3. Verify binary path and managed install metadata.
4. Only then mark as managed/controllable.
5. Fuzzy matches should be shown as candidates, not automatically controlled.
- Не использовать generic recursive delete по app root.
- Удалять только exact receipt/journal-owned entries после safe-path, ACL, reparse и file-shape checks.
- `.proxywarden-cutover` и `.proxywarden-quarantine` удаляет только owner terminal retirement после проверки journal state.
- Unexpected files, active jobs, process/service references или partial tombstone блокируют cleanup.
## Testing
## Проверка
Pure logic can be tested cross-platform with mocks.
Real verification requires Windows:
Cross-platform/pure logic:
```powershell
& .\scripts\install-control-app.ps1 -PlanOnly
& .\scripts\install-proxyfier.ps1 -PlanOnly
& .\scripts\install-singbox.ps1 -PlanOnly
npm run tauri -- dev
Push-Location src-tauri
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets
Pop-Location
& .\scripts\check-runtime-powershell-boundary.ps1 -CheckOnly
& .\scripts\update-component-bundle.ps1 -CheckOnly
& .\scripts\audit-windows-smoke.ps1 -Mode PlanOnly
```
For real service tests:
Реальная проверка требует Windows 10/11 x64 VM: UAC cancel/success, SCM create/start/stop/delete, driver/VC installer exit codes, fresh offline install, foreign same-name service refusal, legacy rollback/recovery и NSIS upgrade/uninstall/reboot.
- Windows 10/11.
- Admin/UAC path.
- Fresh machine or VM snapshot.
- Existing ProxiFyre/sing-box absent.
- Existing fuzzy ProxiFyre-like service present, if testing safety.
## Do not
- Do not claim actual service operations were tested unless they were run on Windows.
- Do not parse human-localized `sc.exe` output if structured WMI/CIM data is available.
- Do not delete paths from fuzzy discovery alone.
- Do not make scripts silently modify firewall/proxy/system settings outside their stated purpose.
Не называть service/elevation behavior проверенным без этой VM evidence.
## Как отчитываться
Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`.
Минимум для нетривиальной задачи:
- короткая сводка;
- таблица файлов `Файл / Что изменилось / Зачем`;
- важные места без пересказа каждой строки;
- что проверено;
- что не проверено;
- конкретные риски.
Перед финальным ответом применить `.agent/skills/communication-reporting/SKILL.md` и `.agent/checklists/communication.md`. Отдельно перечислить automated evidence, Windows/manual evidence и незакрытые UAC/SCM/driver риски.