# Contributor handoff — clash-verge-rev/clash-verge-rev

> Canonical page: https://codevetter.com/unpack/clash-verge-rev/agent-handoff

# Contributor handoff — clash-verge-rev/clash-verge-rev

Scanned commit fd06fbb3b71ee5c4467bc0e3cc505dcac5348371 (2026-09-22). Generated by codevetter codevetter 1.12.0 on 2026-09-22.

Read AGENTS.md before editing: non-trivial work needs an existing issue, the diff must match that issue, and tests are not a default. Start from lib.rs generate_handlers, cmds.ts, and the config/core modules that own the behavior you touch. Respect draft transactions and the config-then-lifecycle lock order. Verify with pnpm typecheck, pnpm lint, and targeted cargo tests; do not assume CI runs the suite. Do not hand-edit the AI-slop review lockfile, and do not treat the webview capability set as a tight sandbox.
- AGENTS.md requires a pre-existing issue for non-trivial changes, English Conventional Commits, changelog lines per template/Changelog.md, and no drive-by refactors or dependency bumps. Tests are added only when the issue needs a regression guard. AI-assisted PRs append an Assisted by footer. The policy file pr-ai-slop-review.md is compiled; never edit pr-ai-slop-review.lock.yml by hand. — [AGENTS.md](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/AGENTS.md) [CONTRIBUTING.md#L9-L23](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/CONTRIBUTING.md#L9-L23)
- Files to read first for any behavior change: src-tauri/src/lib.rs (startup and command table), src-tauri/src/utils/resolve/mod.rs (init order), src-tauri/src/config/config.rs and enhance/mod.rs (runtime YAML), src-tauri/src/core/manager/lifecycle.rs (service vs sidecar), and src/services/cmds.ts plus src/services/events.ts (UI seam). — [src-tauri/src/lib.rs](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/lib.rs) [src-tauri/src/utils/resolve/mod.rs](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/resolve/mod.rs) [src-tauri/src/enhance/mod.rs](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/enhance/mod.rs) [src/services/cmds.ts](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/services/cmds.ts)
- A command implemented only in Rust or only in cmds.ts will not complete a user action. generate_handlers and the invoke wrappers are separate registries and nothing generates one from the other. (inferred) — [src-tauri/src/lib.rs#L126-L216](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/lib.rs#L126-L216) [src/services/cmds.ts#L9-L14](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/services/cmds.ts#L9-L14)
- Safe local checks that match repo tooling: pnpm typecheck, pnpm lint (eslint max-warnings 0), pnpm test, cargo fmt, and cargo clippy --all-targets --all-features -- -D warnings as in Makefile.toml. pnpm dev preserves an existing dev-channel service; pnpm dev:service installs it; pnpm dev:sidecar forces the unprivileged sidecar. — [package.json#L5-L36](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/package.json#L5-L36) [Makefile.toml#L15-L18](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/Makefile.toml#L15-L18) [README.md#L103-L113](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/README.md#L103-L113)
- Feature verge-dev changes APP_ID to io.github.clash-verge-rev.clash-verge-rev.dev and the backup directory name, and selects the service IPC development channel. Production and dev installs do not share app data. Do not point tests at the production id. — [src-tauri/src/utils/dirs.rs#L11-L19](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/dirs.rs#L11-L19) [src-tauri/Cargo.toml#L20-L21](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/Cargo.toml#L20-L21)
- Window close is hide, not quit. Exit and lightweight mode both call prevent_exit. A change that calls app.exit or stops the core must go through feat::quit or the session-ending cleanup, or the singleton server and system proxy can be left up. — [src-tauri/src/lib.rs#L374-L387](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/lib.rs#L374-L387) [src-tauri/src/lib.rs#L487-L498](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/lib.rs#L487-L498) [src-tauri/src/feat/window.rs#L113-L141](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/feat/window.rs#L113-L141)
- Do not write verge.yaml by calling serde outside with_encryption. WebDAV fields serialize as plaintext unless ENCRYPTION_ACTIVE is set. help::save_yaml is the path that turns the flag on. — [src-tauri/src/config/encrypt.rs#L52-L92](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/encrypt.rs#L52-L92) [src-tauri/src/utils/help.rs#L1-L23](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/utils/help.rs#L1-L23) [src-tauri/src/config/verge.rs#L168-L190](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/config/verge.rs#L168-L190)
- Hold Config::lock_config_write before the core lifecycle lock when a patch also starts or stops the core. The comments on continue_with_sidecar and uninstall_service_and_start_sidecar describe cross-transaction draft commits if that order flips. — [src-tauri/src/core/manager/lifecycle.rs#L370-L374](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/lifecycle.rs#L370-L374) [src-tauri/src/feat/config.rs#L291-L294](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/feat/config.rs#L291-L294)
- Mixed-port startup can rewrite the runtime port up to three retries. UI code should use MixedPort helpers and use-displayed-mixed-port rather than assuming 7897 after a failed bind. — [src-tauri/src/core/manager/mod.rs#L256-L287](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/core/manager/mod.rs#L256-L287) [src-tauri/src/constants.rs#L11](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/src/constants.rs#L11) [src/utils/mixed-port.ts](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src/utils/mixed-port.ts)
- i18n key types are generated. After editing locale JSON, pnpm i18n:types and the cleanup script are the repo's own tools; do not hand-maintain src/types/generated if the script owns it. Backend tray strings live in crates/clash-verge-i18n locales, default zh. — [package.json#L30-L32](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/package.json#L30-L32) [crates/clash-verge-i18n/src/lib.rs#L5-L6](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/crates/clash-verge-i18n/src/lib.rs#L5-L6) [Makefile.toml#L58-L74](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/Makefile.toml#L58-L74)
- pnpm run prebuild is required before a real core start because Mihomo and the service binary are downloaded, not stored as source. CI requires an explicit rustc target triple or prebuild throws. — [scripts/prebuild.mjs#L54-L70](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/scripts/prebuild.mjs#L54-L70) [CONTRIBUTING.md#L74-L78](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/CONTRIBUTING.md#L74-L78) [README.md#L103-L107](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/README.md#L103-L107)
- Edition 2024 and the deny-level workspace clippy set mean new unwrap, panic, todo, and unimplemented will fail lint. Match surrounding Result/CommandFailure style instead of adding unwrap. — [Cargo.toml#L137-L162](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/Cargo.toml#L137-L162) [src-tauri/Cargo.toml#L10-L11](https://github.com/clash-verge-rev/clash-verge-rev/blob/fd06fbb3b71ee5c4467bc0e3cc505dcac5348371/src-tauri/Cargo.toml#L10-L11)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
