[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6993ZSV9XH4F2SRQT12AFA0":3,"skill-same:01M6993ZSV9XH4F2SRQT12AFA0":59},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":31,"linkOnly":32,"markdownContent":33,"markdownBody":34,"frontMatter":35,"refName":36,"commitSha":37,"skillDirectory":38,"forksCount":39,"repositoryHtmlUrl":40,"repositoryHomepageUrl":7,"ownerHtmlUrl":41,"ownerBlogUrl":42,"ownerDescription":43,"updatedAt":44,"install":45,"resources":58},"01M6993ZSV9XH4F2SRQT12AFA0","dev-installation","开发环境安装",null,"","google\u002Fcapsem","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M69939YZJTP726NQK4NZNB48",186,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fdev-installation\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BSTR9G4A4GZ0VB2DFN9490","开发环境与工具链管理","SCENARIO","使用场景",[30],"dev installation","2026-11-10 10:12:30",false,"---\nname: dev-installation\ndescription: The native package installer: install, update, uninstall, service registration, asset download, corp config. Use when working on those or the installed ~\u002F.capsem\u002F layout.\n---\n\n# Native Package Installer\n\n## Installed layout\n\n```\n~\u002F.capsem\u002F\n  bin\u002Fcapsem, capsem-service, capsem-process, capsem-tui,\n      capsem-mcp-aggregator, capsem-mcp-builtin,\n      capsem-gateway, capsem-tray, capsem-admin, capsem-mock-server\n  assets\u002Fmanifest.json, manifest-metadata.json, {asset-name}-{hash16}.{ext}\n  run\u002Fservice.sock, service.pid, instances\u002F, persistent\u002F\n  corp.toml               (CLI-provisioned corp config)\n  corp-source.json         (corp config source metadata)\n```\n\n## CLI commands (no service required)\n\nThese commands dispatch before UdsClient creation -- they work without the service running:\n\n| Command | Module | What |\n|---------|--------|------|\n| `capsem version` | main.rs | Print version + build hash |\n| `capsem update` | update.rs | Check the selected release manifest URL and report the matching binary installer |\n| `capsem service install\\|uninstall\\|status` | service_install.rs | Service registration |\n| `capsem completions bash\\|zsh\\|fish` | completions.rs | Shell completions |\n| `capsem uninstall --yes` | uninstall.rs | Full removal |\n\n## Path discovery (paths.rs)\n\n`discover_paths()` finds sibling binaries and assets:\n\n1. `current_exe().parent()` -> bin_dir -> the packaged host binary cohort:\n   `capsem`, `capsem-service`, `capsem-process`, `capsem-tui`,\n   `capsem-mcp-aggregator`, `capsem-mcp-builtin`,\n   `capsem-gateway`, `capsem-tray`, `capsem-admin`, `capsem-mock-server`\n2. Assets: `~\u002F.capsem\u002Fassets\u002F` (the only installed layout -- packages install\n   manifest URL provenance, then postinstall hydrates the live manifest and\n   assets through `capsem update --assets --manifest \u003CURL>`)\n\n## Auto-launch (main.rs UdsClient)\n\n`try_ensure_service()` runs on every service-dependent command:\n\n1. Check socket connectivity\n2. Try systemd\u002FLaunchAgent if unit installed (via `try_start_via_service_manager()`)\n3. Fall back to direct spawn only for explicit development commands; installed\n   package paths are otherwise authoritative\n4. Poll socket for 5s\n\nThe `request()` method wraps all HTTP calls with retry-on-connect-fail.\n\nThe host MCP server is the separately installed `@capsem\u002Fmcp` npm package.\nNative installation must not install Node.js or download that package.\n\n## Service registration (service_install.rs)\n\nPure generators (unit-testable on all platforms):\n- `generate_plist()` -> macOS LaunchAgent XML\n- `generate_systemd_unit()` -> systemd user unit\n\nSide-effecting:\n- `install_service()` -> write + `launchctl bootstrap` \u002F `systemctl --user enable --now`\n- `uninstall_service()` -> `launchctl bootout` \u002F `systemctl --user disable --now` + delete\n- `service_status()` -> installed + running + pid + unit_path\n\n## Package install\n\nThe package is the install unit. It may accept a manifest URL override for corp\nand development installs, records that URL in packaged\n`manifest-metadata.json`, hydrates the live manifest through\n`capsem update --assets --manifest \u003CURL>` during postinstall, installs\u002Frestarts\nservice files, and writes timestamped install logs. Packages do not carry a\n`~\u002F.capsem\u002Fassets\u002Fmanifest.json` payload: VM\nassets are the channel's one runtime, hydrated from the manifest. They do not run an AI-provider setup wizard and\nthey do not create a user policy file.\n\nPostinstall writes the selected verified release document unchanged to\n`~\u002F.capsem\u002Fassets\u002Fmanifest.json`. The boot resolver derives its compact runtime view in\nmemory; it must never serialize that view over the installed release graph.\nThe adjacent `~\u002F.capsem\u002Fassets\u002Fmanifest-metadata.json` sidecar, with schema\n`capsem.manifest_metadata.v1`, is the only sidecar for provenance and update\nstate. CLI status and About Capsem both read the service's canonical\n`GET \u002Fsystem\u002Fstatus` response, which includes those exact two JSON documents.\n\nThe public installer fetches the selected manifest once and hands postinstall\ntwo identities: its logical URL and root-owned exact payload bytes. The hidden\npreactivation rail consumes those bytes through stdin, uses the logical URL for\nrelative assets and `checked_url`, and preserves the package-owned polling URL,\nchannel, and origin. The request and payload remain paired for package-manager\nretry after failure; postinstall removes both only after success.\n\n## Package maintainer scripts\n\n- macOS `.pkg`: `build_system\u002Fpackaging\u002Fmacos\u002Fpkg-scripts\u002Fpreinstall` unloads the LaunchAgent, kills\n  stale package-owned helpers, removes old app\u002Fshare payloads, then\n  `build_system\u002Fpackaging\u002Fmacos\u002Fpkg-scripts\u002Fpostinstall` copies binaries, hydrates assets, registers\n  the service, waits for service\u002Fgateway readiness, and opens the app.\n- Linux `.deb`: `build_system\u002Fpackaging\u002Flinux\u002Fdeb-preinst.sh` is packaged as `DEBIAN\u002Fpreinst`. It\n  requires a non-root installing account from sudo's `SUDO_USER` (or an explicit\n  non-root `USER` in the package environment). A root-only unattended install\n  fails rather than choosing UID 1000. Both maintainer scripts run every\n  `~\u002F.capsem` write, log append, and deletion as that account; root handles\n  only package-owned paths and VM-device setup. The preinstall helper also\n  drops to that account before signalling a checked process, closing PID-reuse\n  races across users. Preinstall normally runs\n  `systemctl --user stop capsem.service` when a user systemd\n  session is available, then kills the stale helper cohort before package replacement\n  so old service\u002Fgateway\u002Ftray\u002Fprocess binaries cannot survive from\n  old inodes. A self-update started by an older installed service is the one\n  exception: `\u002Fproc\u002Fself\u002Fcgroup` proves that `dpkg` belongs to\n  `capsem.service`, so preinst preserves that unit and cohort until the old\n  updater activates the new manifest and requests its managed restart.\n  Postinstall detects the same service-owned transaction and defers manifest\n  hydration, update-status refresh, service registration, and readiness because\n  the public manifest still selects the previous package until publication and\n  the new client must not probe the deliberately preserved old service; the old\n  updater already owns the exact preverified candidate and final restart. This\n  is the bootstrap for releases whose previous service does not yet contain the\n  sibling `systemd-run` updater.\n  For ordinary installs, `build_system\u002Fpackaging\u002Flinux\u002Fdeb-postinst.sh` symlinks the packaged\n  binaries into `~\u002F.capsem\u002Fbin`, hydrates assets, and invokes `capsem install`\n  to register or enable the user service without restarting an already active\n  unit mid-transaction. Adding the user to `kvm` is not immediate access for an\n  already-running `systemd --user` manager: postinstall must apply the shared\n  narrow ACL helper after the packaged udev rule, and the Docker\u002Fsystemd proof\n  deliberately starts its manager before installation to preserve that test.\n  Never make `\u002Fdev\u002Fkvm` or `\u002Fdev\u002Fvhost-vsock` world-writable in CI; doing so\n  hides the installed-package permission boundary.\n\n## Self-update (update.rs)\n\n- `read_cached_update_notice()` -> sync file read on every command\n- `refresh_update_cache_if_stale()` -> background 24h-cached check merged atomically into the installed `manifest-metadata.json` sidecar\n- `run_update()` -> check the selected manifest URL and stage one complete compatible release transaction before mutating the installation\n- `capsem update --yes` -> verifies every changed package\u002Fruntime artifact, prints the tested package-manager apply command for audit, executes it through `sudo` when the native package changes, and atomically activates the selected release graph; this is the one ordinary update path used by the installed service. It also removes a leftover `~\u002F.capsem\u002Fprofiles` directory from older installs with a no-follow contained removal (a symlink is removed as the link)\n- `capsem update --assets` -> low-level diagnostic\u002Frepair rail for hydrating the locally installed manifest or an explicit `--manifest` URL; normal product surfaces never direct users to apply assets separately\n- Corporate VM asset channels use `capsem update --assets --manifest \u003CURL>`; `--corp \u003CURL>` provisions policy config and must not be combined with `--assets`\n- `--manifest` and `--corp` are URL-only inputs. Local files must use `file:\u002F\u002F\u002Fabsolute\u002Fpath`, while hosted release and corporate channels use `https:\u002F\u002F...` or `http:\u002F\u002F...`; bare paths are rejected so update checks share one URL-based mechanism.\n- Stable\u002Fnightly switching uses the one complete installed transaction: `capsem update --yes --channel \u003Cstable|nightly>`. Explicit channel transitions may downgrade; Linux uses `apt-get --allow-downgrades`. The single metadata file records the installed manifest URL separately from the most recently checked URL.\n- An explicit corporate asset manifest moves the installation into a one-way locked channel. Persist `channel_kind=corporate` and `channel_locked=true`; later public-channel or different-manifest selections must fail before fetch or mutation.\n- Runtime images\u002Fevidence belong to the selected channel's one `runtime` document. Updating the nightly runtime can refresh only nightly runtime image refs and matching digests; it must not mutate stable, packages, or per-binary inventory.\n- The runtime may set `min_capsem_version` when it requires newer client behavior. That is the compatibility hook; the runtime must not point at the selected Capsem binary.\n- Layout detection: MacosPkg, LinuxDeb, UserDir, Development (development bails with \"build from source\")\n- Pre-updater installed binaries cannot be retrofitted through the release\n  channel. If a shipped binary prints \"Binary self-update is not yet wired up\",\n  that install needs one manual `.pkg` or `.deb` bootstrap into a version that\n  contains the package apply path; only then can later binary releases move\n  through `capsem update --yes`.\n- Installed update smokes require that all packaged host binaries expose a version surface and report the same installed Capsem package version after replacement.\n\n## Corp config provisioning (capsem-core: corp_provision.rs)\n\n- `fetch_corp_config(url)` -> GET + validate + return content + ETag\n- `validate_corp_toml(content)` -> parse as SettingsFile\n- `install_corp_config(dir, content, source)` -> write corp.toml + corp-source.json\n- `refresh_corp_config_if_stale(dir)` -> background conditional GET with ETag\n\nLoader changes: `corp_config_paths()` returns [\u002Fetc, ~\u002F.capsem\u002F] with first-wins merge.\n\n## Remote manifest + asset download (capsem-core: asset_manager.rs)\n\n- `download_missing_assets(manifest, binary_version, arch, dir, progress)` -> hydrate missing or corrupt assets from the manifest's release-channel URLs\n- `copy_missing_local_assets(...)` -> same contract for `file:\u002F\u002F` corporate\u002Flocal manifests\n- `cleanup_unused_assets(base_dir, manifest)` -> remove hash-named files no longer referenced by non-deprecated releases\n\n## Test harness\n\nDocker-based e2e tests in `tests\u002Fcapsem_install\u002F`:\n\n| File | Tests |\n|------|-------|\n| test_smoke.py | Harness works (systemd, binaries, build hash) |\n| test_auto_launch.py | Auto-launch, path discovery, asset resolution, error cases |\n| test_service_install.py | Install\u002Funinstall\u002Fstatus, idempotent, systemd integration |\n| test_corp_config.py | Provisioning, validation, precedence |\n| test_update.py | Dev build bail, layout detection, cache, preserve-on-fail |\n| test_completions.py | bash\u002Fzsh\u002Ffish output |\n| test_uninstall.py | Full cleanup |\n| test_lifecycle.py | End-to-end user journey |\n| test_reinstall.py | Binary replacement verification |\n| test_error_paths.py | Failure scenarios with actionable errors |\n\nRun `just _gate-install` for the Linux Docker\u002Fsystemd boundary. On Apple Silicon\nmacOS, run `python3 build_system\u002Fpackaging\u002Fmacos\u002Fmacos_release_glowup.py` for the exact `.pkg` build, clean Tart\ninstall, receipt\u002Fapp\u002Fbinary verification, and service health. Because Tart\nmacOS guests cannot expose nested virtualization, the recipe then extracts the\nsame package on the physical Mac and boots a real Capsem guest from its exact\nbinary\u002Fruntime payload to a shell marker. Both focused scripts remain\ndebugging tools; `just test` is the release gate that owns them.\n\nThe Linux qualification image is a visible four-step graph: capacity,\ndependency materialization, sealed source build, and sealed smoke. Only the\ninput-keyed materializer may use BuildKit's ordinary network; it consumes the\nexact host-platform parent, immutable Ubuntu snapshot, locked uv environment,\nand frozen pnpm store. Source build, smoke, and the privileged systemd runtime\nall use networking disabled. They bind the runnable input-keyed tag to the\nexact platform-child ID before use; the child ID is evidence but is not itself\nrunnable on every containerd store. Do not repair a failure with runtime apt,\npnpm, uv sync --project build_system, a second build, or an unverified image tag.\n\nManifest-selected runtime content includes a verified immutable input subtree\nunder the same `RuntimeContent` root as assets. Mount\nthat root read-only, reverify it inside the container, and use the extracted\n`capsem-admin` from the exact package to author the checked local package\u002Fruntime\ngraph before the single `dpkg -i`. The narrower Debian proof uses the same graph\nprimitive and secure handoff; neither proof may fall back to a public URL.\n\nThe local `.pkg` is intentionally unsigned. Its installer postinstall applies\nad-hoc signatures and the required entitlements to executable payloads, which\nthe Tart guest verifies before service and gateway checks. Local installation\ntests must not import or unlock an Apple Developer certificate or mutate the\nuser's keychain. Developer ID signing, notarization, and stapling are\npublication-workflow responsibilities.\n\n## Key files\n\n```\ncrates\u002Fcapsem\u002Fsrc\u002F\n  main.rs              CLI entry, command dispatch, UdsClient with auto-launch\n  paths.rs             Binary + asset path discovery\n  platform.rs          Install layout detection\n  package.rs           Package install orchestration and manifest placement\n  update.rs            Self-update + cache\n  service_install.rs   LaunchAgent + systemd unit generation + registration\n  completions.rs       Shell completions via clap_complete\n  uninstall.rs         Full removal\n  build.rs             Build hash embedding (CAPSEM_BUILD_HASH)\n\ncrates\u002Fcapsem-core\u002Fsrc\u002F\n  asset_manager.rs     Remote manifest, background download, cleanup\n  net\u002Fpolicy_config\u002F\n    corp_provision.rs  Corp config fetch, validate, install, refresh\n    loader.rs          corp_config_paths() with merge\n```\n","# Native Package Installer\n\n## Installed layout\n\n```\n~\u002F.capsem\u002F\n  bin\u002Fcapsem, capsem-service, capsem-process, capsem-tui,\n      capsem-mcp-aggregator, capsem-mcp-builtin,\n      capsem-gateway, capsem-tray, capsem-admin, capsem-mock-server\n  assets\u002Fmanifest.json, manifest-metadata.json, {asset-name}-{hash16}.{ext}\n  run\u002Fservice.sock, service.pid, instances\u002F, persistent\u002F\n  corp.toml               (CLI-provisioned corp config)\n  corp-source.json         (corp config source metadata)\n```\n\n## CLI commands (no service required)\n\nThese commands dispatch before UdsClient creation -- they work without the service running:\n\n| Command | Module | What |\n|---------|--------|------|\n| `capsem version` | main.rs | Print version + build hash |\n| `capsem update` | update.rs | Check the selected release manifest URL and report the matching binary installer |\n| `capsem service install\\|uninstall\\|status` | service_install.rs | Service registration |\n| `capsem completions bash\\|zsh\\|fish` | completions.rs | Shell completions |\n| `capsem uninstall --yes` | uninstall.rs | Full removal |\n\n## Path discovery (paths.rs)\n\n`discover_paths()` finds sibling binaries and assets:\n\n1. `current_exe().parent()` -> bin_dir -> the packaged host binary cohort:\n   `capsem`, `capsem-service`, `capsem-process`, `capsem-tui`,\n   `capsem-mcp-aggregator`, `capsem-mcp-builtin`,\n   `capsem-gateway`, `capsem-tray`, `capsem-admin`, `capsem-mock-server`\n2. Assets: `~\u002F.capsem\u002Fassets\u002F` (the only installed layout -- packages install\n   manifest URL provenance, then postinstall hydrates the live manifest and\n   assets through `capsem update --assets --manifest \u003CURL>`)\n\n## Auto-launch (main.rs UdsClient)\n\n`try_ensure_service()` runs on every service-dependent command:\n\n1. Check socket connectivity\n2. Try systemd\u002FLaunchAgent if unit installed (via `try_start_via_service_manager()`)\n3. Fall back to direct spawn only for explicit development commands; installed\n   package paths are otherwise authoritative\n4. Poll socket for 5s\n\nThe `request()` method wraps all HTTP calls with retry-on-connect-fail.\n\nThe host MCP server is the separately installed `@capsem\u002Fmcp` npm package.\nNative installation must not install Node.js or download that package.\n\n## Service registration (service_install.rs)\n\nPure generators (unit-testable on all platforms):\n- `generate_plist()` -> macOS LaunchAgent XML\n- `generate_systemd_unit()` -> systemd user unit\n\nSide-effecting:\n- `install_service()` -> write + `launchctl bootstrap` \u002F `systemctl --user enable --now`\n- `uninstall_service()` -> `launchctl bootout` \u002F `systemctl --user disable --now` + delete\n- `service_status()` -> installed + running + pid + unit_path\n\n## Package install\n\nThe package is the install unit. It may accept a manifest URL override for corp\nand development installs, records that URL in packaged\n`manifest-metadata.json`, hydrates the live manifest through\n`capsem update --assets --manifest \u003CURL>` during postinstall, installs\u002Frestarts\nservice files, and writes timestamped install logs. Packages do not carry a\n`~\u002F.capsem\u002Fassets\u002Fmanifest.json` payload: VM\nassets are the channel's one runtime, hydrated from the manifest. They do not run an AI-provider setup wizard and\nthey do not create a user policy file.\n\nPostinstall writes the selected verified release document unchanged to\n`~\u002F.capsem\u002Fassets\u002Fmanifest.json`. The boot resolver derives its compact runtime view in\nmemory; it must never serialize that view over the installed release graph.\nThe adjacent `~\u002F.capsem\u002Fassets\u002Fmanifest-metadata.json` sidecar, with schema\n`capsem.manifest_metadata.v1`, is the only sidecar for provenance and update\nstate. CLI status and About Capsem both read the service's canonical\n`GET \u002Fsystem\u002Fstatus` response, which includes those exact two JSON documents.\n\nThe public installer fetches the selected manifest once and hands postinstall\ntwo identities: its logical URL and root-owned exact payload bytes. The hidden\npreactivation rail consumes those bytes through stdin, uses the logical URL for\nrelative assets and `checked_url`, and preserves the package-owned polling URL,\nchannel, and origin. The request and payload remain paired for package-manager\nretry after failure; postinstall removes both only after success.\n\n## Package maintainer scripts\n\n- macOS `.pkg`: `build_system\u002Fpackaging\u002Fmacos\u002Fpkg-scripts\u002Fpreinstall` unloads the LaunchAgent, kills\n  stale package-owned helpers, removes old app\u002Fshare payloads, then\n  `build_system\u002Fpackaging\u002Fmacos\u002Fpkg-scripts\u002Fpostinstall` copies binaries, hydrates assets, registers\n  the service, waits for service\u002Fgateway readiness, and opens the app.\n- Linux `.deb`: `build_system\u002Fpackaging\u002Flinux\u002Fdeb-preinst.sh` is packaged as `DEBIAN\u002Fpreinst`. It\n  requires a non-root installing account from sudo's `SUDO_USER` (or an explicit\n  non-root `USER` in the package environment). A root-only unattended install\n  fails rather than choosing UID 1000. Both maintainer scripts run every\n  `~\u002F.capsem` write, log append, and deletion as that account; root handles\n  only package-owned paths and VM-device setup. The preinstall helper also\n  drops to that account before signalling a checked process, closing PID-reuse\n  races across users. Preinstall normally runs\n  `systemctl --user stop capsem.service` when a user systemd\n  session is available, then kills the stale helper cohort before package replacement\n  so old service\u002Fgateway\u002Ftray\u002Fprocess binaries cannot survive from\n  old inodes. A self-update started by an older installed service is the one\n  exception: `\u002Fproc\u002Fself\u002Fcgroup` proves that `dpkg` belongs to\n  `capsem.service`, so preinst preserves that unit and cohort until the old\n  updater activates the new manifest and requests its managed restart.\n  Postinstall detects the same service-owned transaction and defers manifest\n  hydration, update-status refresh, service registration, and readiness because\n  the public manifest still selects the previous package until publication and\n  the new client must not probe the deliberately preserved old service; the old\n  updater already owns the exact preverified candidate and final restart. This\n  is the bootstrap for releases whose previous service does not yet contain the\n  sibling `systemd-run` updater.\n  For ordinary installs, `build_system\u002Fpackaging\u002Flinux\u002Fdeb-postinst.sh` symlinks the packaged\n  binaries into `~\u002F.capsem\u002Fbin`, hydrates assets, and invokes `capsem install`\n  to register or enable the user service without restarting an already active\n  unit mid-transaction. Adding the user to `kvm` is not immediate access for an\n  already-running `systemd --user` manager: postinstall must apply the shared\n  narrow ACL helper after the packaged udev rule, and the Docker\u002Fsystemd proof\n  deliberately starts its manager before installation to preserve that test.\n  Never make `\u002Fdev\u002Fkvm` or `\u002Fdev\u002Fvhost-vsock` world-writable in CI; doing so\n  hides the installed-package permission boundary.\n\n## Self-update (update.rs)\n\n- `read_cached_update_notice()` -> sync file read on every command\n- `refresh_update_cache_if_stale()` -> background 24h-cached check merged atomically into the installed `manifest-metadata.json` sidecar\n- `run_update()` -> check the selected manifest URL and stage one complete compatible release transaction before mutating the installation\n- `capsem update --yes` -> verifies every changed package\u002Fruntime artifact, prints the tested package-manager apply command for audit, executes it through `sudo` when the native package changes, and atomically activates the selected release graph; this is the one ordinary update path used by the installed service. It also removes a leftover `~\u002F.capsem\u002Fprofiles` directory from older installs with a no-follow contained removal (a symlink is removed as the link)\n- `capsem update --assets` -> low-level diagnostic\u002Frepair rail for hydrating the locally installed manifest or an explicit `--manifest` URL; normal product surfaces never direct users to apply assets separately\n- Corporate VM asset channels use `capsem update --assets --manifest \u003CURL>`; `--corp \u003CURL>` provisions policy config and must not be combined with `--assets`\n- `--manifest` and `--corp` are URL-only inputs. Local files must use `file:\u002F\u002F\u002Fabsolute\u002Fpath`, while hosted release and corporate channels use `https:\u002F\u002F...` or `http:\u002F\u002F...`; bare paths are rejected so update checks share one URL-based mechanism.\n- Stable\u002Fnightly switching uses the one complete installed transaction: `capsem update --yes --channel \u003Cstable|nightly>`. Explicit channel transitions may downgrade; Linux uses `apt-get --allow-downgrades`. The single metadata file records the installed manifest URL separately from the most recently checked URL.\n- An explicit corporate asset manifest moves the installation into a one-way locked channel. Persist `channel_kind=corporate` and `channel_locked=true`; later public-channel or different-manifest selections must fail before fetch or mutation.\n- Runtime images\u002Fevidence belong to the selected channel's one `runtime` document. Updating the nightly runtime can refresh only nightly runtime image refs and matching digests; it must not mutate stable, packages, or per-binary inventory.\n- The runtime may set `min_capsem_version` when it requires newer client behavior. That is the compatibility hook; the runtime must not point at the selected Capsem binary.\n- Layout detection: MacosPkg, LinuxDeb, UserDir, Development (development bails with \"build from source\")\n- Pre-updater installed binaries cannot be retrofitted through the release\n  channel. If a shipped binary prints \"Binary self-update is not yet wired up\",\n  that install needs one manual `.pkg` or `.deb` bootstrap into a version that\n  contains the package apply path; only then can later binary releases move\n  through `capsem update --yes`.\n- Installed update smokes require that all packaged host binaries expose a version surface and report the same installed Capsem package version after replacement.\n\n## Corp config provisioning (capsem-core: corp_provision.rs)\n\n- `fetch_corp_config(url)` -> GET + validate + return content + ETag\n- `validate_corp_toml(content)` -> parse as SettingsFile\n- `install_corp_config(dir, content, source)` -> write corp.toml + corp-source.json\n- `refresh_corp_config_if_stale(dir)` -> background conditional GET with ETag\n\nLoader changes: `corp_config_paths()` returns [\u002Fetc, ~\u002F.capsem\u002F] with first-wins merge.\n\n## Remote manifest + asset download (capsem-core: asset_manager.rs)\n\n- `download_missing_assets(manifest, binary_version, arch, dir, progress)` -> hydrate missing or corrupt assets from the manifest's release-channel URLs\n- `copy_missing_local_assets(...)` -> same contract for `file:\u002F\u002F` corporate\u002Flocal manifests\n- `cleanup_unused_assets(base_dir, manifest)` -> remove hash-named files no longer referenced by non-deprecated releases\n\n## Test harness\n\nDocker-based e2e tests in `tests\u002Fcapsem_install\u002F`:\n\n| File | Tests |\n|------|-------|\n| test_smoke.py | Harness works (systemd, binaries, build hash) |\n| test_auto_launch.py | Auto-launch, path discovery, asset resolution, error cases |\n| test_service_install.py | Install\u002Funinstall\u002Fstatus, idempotent, systemd integration |\n| test_corp_config.py | Provisioning, validation, precedence |\n| test_update.py | Dev build bail, layout detection, cache, preserve-on-fail |\n| test_completions.py | bash\u002Fzsh\u002Ffish output |\n| test_uninstall.py | Full cleanup |\n| test_lifecycle.py | End-to-end user journey |\n| test_reinstall.py | Binary replacement verification |\n| test_error_paths.py | Failure scenarios with actionable errors |\n\nRun `just _gate-install` for the Linux Docker\u002Fsystemd boundary. On Apple Silicon\nmacOS, run `python3 build_system\u002Fpackaging\u002Fmacos\u002Fmacos_release_glowup.py` for the exact `.pkg` build, clean Tart\ninstall, receipt\u002Fapp\u002Fbinary verification, and service health. Because Tart\nmacOS guests cannot expose nested virtualization, the recipe then extracts the\nsame package on the physical Mac and boots a real Capsem guest from its exact\nbinary\u002Fruntime payload to a shell marker. Both focused scripts remain\ndebugging tools; `just test` is the release gate that owns them.\n\nThe Linux qualification image is a visible four-step graph: capacity,\ndependency materialization, sealed source build, and sealed smoke. Only the\ninput-keyed materializer may use BuildKit's ordinary network; it consumes the\nexact host-platform parent, immutable Ubuntu snapshot, locked uv environment,\nand frozen pnpm store. Source build, smoke, and the privileged systemd runtime\nall use networking disabled. They bind the runnable input-keyed tag to the\nexact platform-child ID before use; the child ID is evidence but is not itself\nrunnable on every containerd store. Do not repair a failure with runtime apt,\npnpm, uv sync --project build_system, a second build, or an unverified image tag.\n\nManifest-selected runtime content includes a verified immutable input subtree\nunder the same `RuntimeContent` root as assets. Mount\nthat root read-only, reverify it inside the container, and use the extracted\n`capsem-admin` from the exact package to author the checked local package\u002Fruntime\ngraph before the single `dpkg -i`. The narrower Debian proof uses the same graph\nprimitive and secure handoff; neither proof may fall back to a public URL.\n\nThe local `.pkg` is intentionally unsigned. Its installer postinstall applies\nad-hoc signatures and the required entitlements to executable payloads, which\nthe Tart guest verifies before service and gateway checks. Local installation\ntests must not import or unlock an Apple Developer certificate or mutate the\nuser's keychain. Developer ID signing, notarization, and stapling are\npublication-workflow responsibilities.\n\n## Key files\n\n```\ncrates\u002Fcapsem\u002Fsrc\u002F\n  main.rs              CLI entry, command dispatch, UdsClient with auto-launch\n  paths.rs             Binary + asset path discovery\n  platform.rs          Install layout detection\n  package.rs           Package install orchestration and manifest placement\n  update.rs            Self-update + cache\n  service_install.rs   LaunchAgent + systemd unit generation + registration\n  completions.rs       Shell completions via clap_complete\n  uninstall.rs         Full removal\n  build.rs             Build hash embedding (CAPSEM_BUILD_HASH)\n\ncrates\u002Fcapsem-core\u002Fsrc\u002F\n  asset_manager.rs     Remote manifest, background download, cleanup\n  net\u002Fpolicy_config\u002F\n    corp_provision.rs  Corp config fetch, validate, install, refresh\n    loader.rs          corp_config_paths() with merge\n```\n",{},"main","d357170bb677125c80cebed720e62bf47bf083ad","skills\u002Fdev-installation",26,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 00:49:59",{"source":9,"skillName":5,"commands":46,"prompt":56,"zipAvailable":57},[47,50,53],{"tool":48,"command":49},"npx","npx skills add google\u002Fcapsem --skill dev-installation",{"tool":51,"command":52},"bunx","bunx skills add google\u002Fcapsem --skill dev-installation",{"tool":54,"command":55},"pnpm","pnpm dlx skills add google\u002Fcapsem --skill dev-installation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fdev-installation\u002FSKILL.md",true,[],[60,77,93,108,120,132],{"skillNo":61,"name":62,"nameZh":63,"description":64,"descriptionZh":65,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":66,"categories":67,"keywords":74,"publishedAt":31},"01M699558T2T4DJMBN08ZCQ79K","use-capsem","Capsem 虚拟机任务执行","Run tasks in Capsem VMs through MCP. Use when an agent needs isolated execution, file analysis, or reports returned to the host.","通过 MCP 在 Capsem 虚拟机中运行任务。在智能体需要隔离执行、文件分析，或将报告返回到主机时使用。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fuse-capsem\u002FSKILL.md",[68,71],{"categoryNo":69,"categoryName":70,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BRN0DBCRG4XGJMB6QQEP11","编码任务委派",{"categoryNo":72,"categoryName":73,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师",[75,76],"use capsem","MCP",{"skillNo":78,"name":79,"nameZh":80,"description":81,"descriptionZh":82,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":83,"categories":84,"keywords":91,"publishedAt":31},"01M69953Z1CSVQ4N07QX529CZY","site-marketing","营销网站内容维护","The marketing website, capsem.org. Use when editing copy, adding sections, or changing the site theme.","营销网站 capsem.org。在编辑文案、添加板块或更改网站主题时使用。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fsite-marketing\u002FSKILL.md",[85,88],{"categoryNo":86,"categoryName":87,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQGD6C0J544QTJ9R38Z7ZG","营销专员",{"categoryNo":89,"categoryName":90,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQV98WRP4APE9VKKKKJ6FV","社交媒体与内容平台管理",[92],"site marketing",{"skillNo":94,"name":95,"nameZh":96,"description":97,"descriptionZh":98,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":99,"categories":100,"keywords":105,"publishedAt":31},"01M69952B33KBBV37N8QTC4191","site-infra","文档站基础设施维护","The documentation site, docs.capsem.org. Use for user-directed Diátaxis documentation and Astro Starlight changes.","文档站点 docs.capsem.org。用于面向用户的 Diátaxis 文档和 Astro Starlight 相关更改。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fsite-infra\u002FSKILL.md",[101,104],{"categoryNo":102,"categoryName":103,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TK1MPB82068236GSXDE","文档处理",{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},[106,107],"site infra","docs",{"skillNo":109,"name":110,"nameZh":111,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":112,"categories":113,"keywords":118,"publishedAt":31},"01M69950YKCZKCDB98JDQNBBRJ","site-architecture","站点架构设计","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fsite-architecture\u002FSKILL.md",[114,117],{"categoryNo":115,"categoryName":116,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TKQDF2K4KQS863Q79P4","开发参考",{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},[119],"site architecture",{"skillNo":121,"name":122,"nameZh":123,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":124,"categories":125,"keywords":130,"publishedAt":31},"01M6994Z61JWZ0G2YRJTWFH933","release-process","版本发布流程","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Frelease-process\u002FSKILL.md",[126,127],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},{"categoryNo":128,"categoryName":129,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQNXPY1AV6BSR5VKHDMWRH","部署与发布管理",[131],"release process",{"skillNo":133,"name":134,"nameZh":135,"description":136,"descriptionZh":137,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":138,"categories":139,"keywords":144,"publishedAt":31},"01M6994XKHADM6FBTYTAPG7FYC","meta-skill-creation","智能体技能创建与优化","Create, improve, and evaluate skills. Use when writing a new skill, editing an existing one, or tuning a description for better triggering.","创建、改进和评估技能。在编写新技能、编辑现有技能或调整 description 以优化触发效果时使用。","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fcapsem\u002Fblob\u002Fmain\u002Fskills\u002Fmeta-skill-creation\u002FSKILL.md",[140,143],{"categoryNo":141,"categoryName":142,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BRN0CV1NMDZ5TEJX1GVM29","插件与技能管理",{"categoryNo":72,"categoryName":73,"taxonomyType":22,"taxonomyTypeDesc":23},[145,146],"meta skill creation","writing"]