harnessed 5.0.4 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README-en.md CHANGED
@@ -36,6 +36,10 @@ irm https://raw.githubusercontent.com/easyinplay/harnessed/main/install.ps1 | ie
36
36
 
37
37
  The binary installer offers setup with your consent in interactive sessions. Do not repeat it if it completed successfully. If setup was skipped or failed, or you installed noninteractively, run `harnessed setup`.
38
38
 
39
+ `harnessed setup` installs a cache-only **SessionStart update reminder** by default. Its foreground path only reads a bounded local cache: zero network requests, zero filesystem mutation, and fail-soft exit `0`. It only displays a reminder for a cached available update; missing or stale cache may launch a detached background worker to refresh version information, never to install updates. Codex uses a local plugin and may require user trust approval; setup does not grant trust automatically.
40
+
41
+ `harnessed setup --no-update-reminder` persistently disables the reminder; later setup/update runs preserve that choice. To re-enable it, delete the corresponding `update-reminder-preferences.json` and run `harnessed setup` again. Default locations are `~/.claude/harnessed/update-reminder-preferences.json` for Claude Code and `~/.codex/harnessed/update-reminder-preferences.json` for Codex; when using `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, or `HARNESSED_ROOT_OVERRIDE`, use the corresponding reminder state root instead.
42
+
39
43
  **Via Bun (secondary recommendation; optional)**:
40
44
 
41
45
  ```bash
@@ -307,6 +311,8 @@ graph TD
307
311
  > Master orchestrator auto gate-routes to the right sub (chain-isolation rule — non-firing subs are transparently declared skipped).
308
312
  > Direct sub invocation also bypasses the master to run a single stage, e.g. `/discuss-strategic "new feature X"`.
309
313
 
314
+ **Update workflow:** use `/harnessed-update` in Claude Code or `$harnessed-update` in Codex after setup. It previews with `harnessed update --all --dry-run --json`, asks for explicit confirmation, then runs `harnessed update --all --json` exactly once and reports the structured result. If reviewed third-party components remain `failed`, `unsupported`, or `retained`, it shows a second bounded repair proposal. Only after explicit confirmation for the exact component list may it run `harnessed update --all --repair --yes --json`, which can invoke `claude -p` or `codex exec`. Repair never grants plugin/MCP trust, reads credentials, expands host roots, or declares success without deterministic re-verification.
315
+
310
316
  ---
311
317
 
312
318
  ## ⚡ Usage Flow
@@ -506,7 +512,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
506
512
 
507
513
  | Command | Description |
508
514
  | ---- | ---- |
509
- | `harnessed setup` | One-time setup; installs workflow skills to `~/.claude/skills/` + MCP to `~/.claude.json` |
515
+ | `harnessed setup [--no-update-reminder]` | One-time setup; installs workflow skills to `~/.claude/skills/` + MCP to `~/.claude.json`; installs the cache-only SessionStart update reminder by default; `--no-update-reminder` persists an opt-out |
510
516
  | `harnessed gates <master>` | Evaluate which sub-workflows fire for a master stage (JSON: fire/skip/parallelism). Used by slash commands to orchestrate native spawns. |
511
517
  | `harnessed prompt <sub>` | Output a spawn-ready prompt (role + checklist + disciplines + completion/clarification protocols) for a sub-workflow. |
512
518
  | `harnessed checkpoint <action> <sub>` | Record sub-workflow start/complete/fail to `~/.claude/harnessed/checkpoints/`. |
@@ -522,7 +528,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
522
528
  | `harnessed resume` | Resume from the most recent checkpoint after a session interruption |
523
529
  | `harnessed status` | Current phase + lock holder |
524
530
  | `harnessed doctor` | Health check (Node / MCP / jq / Win bash / routing / token budget / skill integrity / GateGuard conflict / update-available / stale hooks, etc.). The **stale hooks** check flags orphaned harnessed `Stop`/`UserPromptSubmit` entries in `~/.claude/settings.json` that point at a deleted `bin/*.mjs` — the cause of a `MODULE_NOT_FOUND` error on every prompt after a raw `npm uninstall -g harnessed`. Fix: run `harnessed uninstall` (it strips them) **before** removing the package. |
525
- | `harnessed update [--check\|--rollback [version]\|--upstreams\|--migration-report]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports the latest version; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--upstreams` re-runs the base manifests; `--migration-report` is a read-only stale-state inventory |
531
+ | `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports versions without installing; `--dry-run` previews without writing; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--all` (alias `--upstreams`) requests fresh-runtime closure, including owned assets and reviewed third-party updates; `--json` emits one structured result; `--platform <host>` selects `claude` or `codex`; `--non-interactive` skips prompts, and repair automation additionally requires explicit `--repair --yes`; `--repair --yes` invokes a bounded, user-authorized agent repair and then deterministic verification; `--migration-report` is a read-only stale-state inventory |
526
532
  | `harnessed release-preflight` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); exits 1 if not ready. The Ship-stage gate. |
527
533
  | `harnessed retro --done` | Reset the retro-reminder phase counter after running `/retro` (clears the per-turn RETRO-DUE nudge). |
528
534
  | `harnessed install <name>` | Install an upstream manifest |
@@ -532,6 +538,12 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
532
538
  | `harnessed gc` | Clean up expired backups |
533
539
  | `harnessed audit-log` | Routing transparency log query (supports `--filter` jq expression) |
534
540
 
541
+ **Fresh-runtime closure (Phase 78):** `harnessed update --all --json` first performs self-update, then hands off to a verified fresh runtime through an absolute executable/package entry path. Only that runtime refreshes harnessed-owned workflow/hook assets and updates already-installed third-party components through reviewed adapters for the selected host. Self-update failure prevents third-party mutation; handoff failure reports incomplete closure even if harnessed itself changed. GSD is the first reviewed adapter, with runtime identity/version verification before and after its upstream-owned update action. Components without a reviewed adapter report `unsupported`; missing third-party components remain `not-installed` and are not installed.
542
+
543
+ `--json` writes exactly one JSON object to stdout (`status`, `components`, `warnings`, `error`, plus schema/operation/mode/host/runtime metadata); diagnostics and child-process output go to stderr. `unsupported` and `retained` produce top-level `partial` and exit `1`, never all-success: `retained` means an update failed but the previous installation still verifies. Completed updates and valid previews (`complete` / `planned`) exit `0`; failed/incomplete execution exits `1`; invalid arguments/protocol exit `2`. Respect each component's `restartRequired` before continuing.
544
+
545
+ Package self-update applies only after proving that the selected npm executable's global `harnessed` package is the running, locked package (including its declared binary entry). The updater probes `npm prefix -g` and `npm root -g --prefix <prefix>`, then pins the same prefix for installation. Unknown/mismatched targets and linked global package slots fail closed with exit `1`, before any installer, fresh-runtime handoff or third-party update. Bun package apply is currently refused as `package-target-unproven`, without npm fallback; version checks, previews and already-current installs remain available.
546
+
535
547
  ### Flags
536
548
 
537
549
  > All commands **apply (immediate write)** by default — no flag needed. Advanced users can add `--dry-run` to preview.
package/README-zh.md CHANGED
@@ -34,6 +34,10 @@ irm https://raw.githubusercontent.com/easyinplay/harnessed/main/install.ps1 | ie
34
34
 
35
35
  二进制安装脚本在交互会话中征得同意后提供 setup。成功完成后无需重复;若跳过、失败或使用非交互安装,请运行 `harnessed setup`。
36
36
 
37
+ `harnessed setup` 默认安装 cache-only **SessionStart 更新提醒**。其 foreground 路径只读取有大小上限的本地 cache:零网络请求、零文件系统 mutation,失败时静默退出 `0`。仅在 cache 表明有可用更新时显示提醒;cache 缺失或过期时可启动 detached background worker 刷新版本信息,不会安装更新。Codex 使用 local plugin,可能需要用户批准 trust;setup 不会自动授予 trust。
38
+
39
+ `harnessed setup --no-update-reminder` 持久禁用提醒,后续 setup/update 会保留该选择。重新启用时,删除对应的 `update-reminder-preferences.json`,再运行 `harnessed setup`。Claude Code 默认路径为 `~/.claude/harnessed/update-reminder-preferences.json`,Codex 默认路径为 `~/.codex/harnessed/update-reminder-preferences.json`;若使用 `CLAUDE_CONFIG_DIR`、`CODEX_HOME` 或 `HARNESSED_ROOT_OVERRIDE`,则使用对应 reminder state root 下的文件。
40
+
37
41
  **通过 Bun 安装 (次要推荐; 可选)**:
38
42
 
39
43
  ```bash
@@ -303,6 +307,8 @@ graph TD
303
307
  > Master orchestrator 自动 gate-route 到合适的 sub (chain-isolation 铁律 —— 不 fire 的 sub 透明声明跳过)。
304
308
  > 直接调用 sub 也可绕过 master 单跑某 stage,例如 `/discuss-strategic "新功能 X"`。
305
309
 
310
+ **更新 workflow:** setup 后,在 Claude Code 中使用 `/harnessed-update`,在 Codex 中使用 `$harnessed-update`。它先运行 `harnessed update --all --dry-run --json` 预览,请求明确确认,再仅执行一次 `harnessed update --all --json` 并展示结构化结果。如果已审查第三方组件仍为 `failed`、`unsupported` 或 `retained`,会展示第二份有边界的 repair proposal。只有用户对精确组件列表再次确认后,才允许执行 `harnessed update --all --repair --yes --json`,该命令可能调用 `claude -p` 或 `codex exec`。repair 不会授予 plugin/MCP trust、读取凭据、扩大 host root,也不会在没有确定性复核时声称成功。
311
+
306
312
  ---
307
313
 
308
314
  ## ⚡ 使用流程
@@ -502,7 +508,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
502
508
 
503
509
  | 命令 | 说明 |
504
510
  | ---- | ---- |
505
- | `harnessed setup` | 一次性 setup,装 workflow skills 到 `~/.claude/skills/` + MCP 到 `~/.claude.json` |
511
+ | `harnessed setup [--no-update-reminder]` | 一次性 setup,装 workflow skills 到 `~/.claude/skills/` + MCP 到 `~/.claude.json`;默认安装 cache-only SessionStart 更新提醒;`--no-update-reminder` 持久禁用提醒 |
506
512
  | `harnessed gates <master>` | 评估某 master stage 下哪些 sub-workflow 会 fire (JSON: fire/skip/parallelism)。供 slash command 编排 native spawn |
507
513
  | `harnessed prompt <sub>` | 输出某 sub-workflow 的 spawn-ready prompt (role + checklist + disciplines + completion/clarification 协议) |
508
514
  | `harnessed checkpoint <action> <sub>` | 记录 sub-workflow 的 start/complete/fail 到 `~/.claude/harnessed/checkpoints/` |
@@ -518,7 +524,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
518
524
  | `harnessed resume` | session 中断后从最近 checkpoint 恢复 |
519
525
  | `harnessed status` | 当前 phase + lock holder |
520
526
  | `harnessed doctor` | 健康检查 (Node / MCP / jq / Win bash / routing / token budget / skill 完整性 / GateGuard 冲突 / update-available 等) |
521
- | `harnessed update [--check\|--rollback [version]\|--upstreams\|--migration-report]` | 自更新,按安装通道分流:二进制安装从 GitHub releases 原地自替换(sha256 + ed25519 签名双重校验 —— releases 附带 `<asset>.sha256.sig`,4.32.19 起为签名发布契约;被替换的版本存档备回滚);npm 安装执行 `npm i -g harnessed@latest`。`--check` 报告最新版本;`--rollback [version]`(仅二进制安装)原子恢复已存档的上一版二进制 —— npm 安装则被指引执行 `npm i -g harnessed@<version>`;`--upstreams` 重跑基础 manifests;`--migration-report` 为只读陈旧状态盘点 |
527
+ | `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | 自更新,按安装通道分流:二进制安装从 GitHub releases 原地自替换(sha256 + ed25519 签名双重校验 —— releases 附带 `<asset>.sha256.sig`,4.32.19 起为签名发布契约;被替换的版本存档备回滚);npm 安装执行 `npm i -g harnessed@latest`。`--check` 报告版本但不安装;`--dry-run` 预览不写盘;`--rollback [version]`(仅二进制安装)原子恢复已存档的上一版二进制 —— npm 安装则被指引执行 `npm i -g harnessed@<version>`;`--all`(别名 `--upstreams`)请求 fresh-runtime closure,包含自有 assets 和 reviewed 第三方更新;`--json` 输出单个结构化结果;`--platform <host>` 选择 `claude` 或 `codex`;`--non-interactive` 跳过 prompt,而 repair 自动化还必须显式使用 `--repair --yes`;`--repair --yes` 启动有边界且经过用户授权的 agent repair,随后执行确定性验证;`--migration-report` 为只读陈旧状态盘点 |
522
528
  | `harnessed release-preflight` | Read-only 发布就绪关卡 (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent);未就绪则 exit 1。即 Ship-stage 关卡 |
523
529
  | `harnessed retro --done` | 跑完 `/retro` 后重置 retro-reminder phase 计数器 (清掉每轮的 RETRO-DUE 提醒) |
524
530
  | `harnessed install <name>` | 装上游 manifest |
@@ -528,6 +534,12 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
528
534
  | `harnessed gc` | 清理过期 backup |
529
535
  | `harnessed audit-log` | 路由透明日志 query (支持 `--filter` jq 表达式) |
530
536
 
537
+ **Fresh-runtime closure (Phase 78):** `harnessed update --all --json` 先自更新,再通过可执行文件/package entry 的绝对路径交接到经过验证的 fresh runtime。仅该 runtime 刷新 harnessed-owned workflow/hook assets,并通过 reviewed adapter 更新所选宿主中已安装的第三方组件。自更新失败时不修改第三方组件;handoff 失败时,即使 harnessed 自身已变化也会报告 closure 未完成。GSD 是首个 reviewed adapter,在其 upstream-owned 更新操作前后验证 runtime identity/version。没有 reviewed adapter 的组件报告 `unsupported`;缺失的第三方组件保持 `not-installed`,不会被安装。
538
+
539
+ `--json` 在 stdout 只输出一个 JSON 对象(`status`、`components`、`warnings`、`error`,以及 schema/operation/mode/host/runtime 元数据);诊断和子进程输出写到 stderr。`unsupported` 和 `retained` 产生顶层 `partial` 并退出 `1`,不算全部成功:`retained` 表示更新失败,但旧安装仍通过验证。更新完成或有效预览(`complete` / `planned`)退出 `0`;执行失败或未完成退出 `1`;参数/protocol 无效退出 `2`。继续前需遵守每个组件的 `restartRequired`。
540
+
541
+ Package 自更新仅在证明所选 npm executable 的 global `harnessed` package 与当前运行且已加锁的 package 一致后执行,并验证其声明的 binary entry。更新器探测 `npm prefix -g` 和 `npm root -g --prefix <prefix>`,安装时固定使用同一 prefix。目标无法证明、不匹配或 global package slot 为 symlink/junction 时,以 exit `1` 阻断,不执行 installer、fresh-runtime handoff 或第三方更新。当前 Bun package apply 返回 `package-target-unproven`,不回退 npm;版本检查、预览和已是当前版本的安装不受影响。
542
+
531
543
  ### 参数 (Flags)
532
544
 
533
545
  > 所有命令默认 **apply (immediate write)**,无需加 flag。高级用户可加 `--dry-run` 预览。
package/README.md CHANGED
@@ -34,6 +34,10 @@ irm https://raw.githubusercontent.com/easyinplay/harnessed/main/install.ps1 | ie
34
34
 
35
35
  The binary installer offers setup with your consent in interactive sessions. Do not repeat it if it completed successfully. If setup was skipped or failed, or you installed noninteractively, run `harnessed setup`.
36
36
 
37
+ `harnessed setup` installs a cache-only **SessionStart update reminder** by default. Its foreground path only reads a bounded local cache: zero network requests, zero filesystem mutation, and fail-soft exit `0`. It only displays a reminder for a cached available update; missing or stale cache may launch a detached background worker to refresh version information, never to install updates. Codex uses a local plugin and may require user trust approval; setup does not grant trust automatically.
38
+
39
+ `harnessed setup --no-update-reminder` persistently disables the reminder; later setup/update runs preserve that choice. To re-enable it, delete the corresponding `update-reminder-preferences.json` and run `harnessed setup` again. Default locations are `~/.claude/harnessed/update-reminder-preferences.json` for Claude Code and `~/.codex/harnessed/update-reminder-preferences.json` for Codex; when using `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, or `HARNESSED_ROOT_OVERRIDE`, use the corresponding reminder state root instead.
40
+
37
41
  **Via Bun (secondary recommendation; optional)**:
38
42
 
39
43
  ```bash
@@ -305,6 +309,8 @@ graph TD
305
309
  > Master orchestrator auto gate-routes to the right sub (chain-isolation rule — non-firing subs are transparently declared skipped).
306
310
  > Direct sub invocation also bypasses the master to run a single stage, e.g. `/discuss-strategic "new feature X"`.
307
311
 
312
+ **Update workflow:** use `/harnessed-update` in Claude Code or `$harnessed-update` in Codex after setup. It previews with `harnessed update --all --dry-run --json`, asks for explicit confirmation, then runs `harnessed update --all --json` exactly once and reports the structured result. If reviewed third-party components remain `failed`, `unsupported`, or `retained`, it shows a second bounded repair proposal. Only after explicit confirmation for the exact component list may it run `harnessed update --all --repair --yes --json`, which can invoke `claude -p` or `codex exec`. Repair never grants plugin/MCP trust, reads credentials, expands host roots, or declares success without deterministic re-verification.
313
+
308
314
  ---
309
315
 
310
316
  ## ⚡ Usage Flow
@@ -504,7 +510,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
504
510
 
505
511
  | Command | Description |
506
512
  | ---- | ---- |
507
- | `harnessed setup` | One-time setup; installs workflow skills to `~/.claude/skills/` + MCP to `~/.claude.json` |
513
+ | `harnessed setup [--no-update-reminder]` | One-time setup; installs workflow skills to `~/.claude/skills/` + MCP to `~/.claude.json`; installs the cache-only SessionStart update reminder by default; `--no-update-reminder` persists an opt-out |
508
514
  | `harnessed gates <master>` | Evaluate which sub-workflows fire for a master stage (JSON: fire/skip/parallelism). Used by slash commands to orchestrate native spawns. |
509
515
  | `harnessed prompt <sub>` | Output a spawn-ready prompt (role + checklist + disciplines + completion/clarification protocols) for a sub-workflow. |
510
516
  | `harnessed checkpoint <action> <sub>` | Record sub-workflow start/complete/fail to `~/.claude/harnessed/checkpoints/`. |
@@ -520,7 +526,7 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
520
526
  | `harnessed resume` | Resume from the most recent checkpoint after a session interruption |
521
527
  | `harnessed status` | Current phase + lock holder |
522
528
  | `harnessed doctor` | Health check (Node / MCP / jq / Win bash / routing / token budget / skill integrity / GateGuard conflict / update-available / stale hooks, etc.). The **stale hooks** check flags orphaned harnessed `Stop`/`UserPromptSubmit` entries in `~/.claude/settings.json` that point at a deleted `bin/*.mjs` — the cause of a `MODULE_NOT_FOUND` error on every prompt after a raw `npm uninstall -g harnessed`. Fix: run `harnessed uninstall` (it strips them) **before** removing the package. |
523
- | `harnessed update [--check\|--rollback [version]\|--upstreams\|--migration-report]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports the latest version; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--upstreams` re-runs the base manifests; `--migration-report` is a read-only stale-state inventory |
529
+ | `harnessed update [--check\|--dry-run\|--rollback [version]\|--all\|--upstreams\|--migration-report] [--json] [--platform <host>] [--non-interactive] [--repair --yes]` | Self-update, channel-aware: binary installs replace themselves in place from GitHub releases (sha256 + ed25519-signature verified — releases ship `<asset>.sha256.sig`, signed-release contract since 4.32.19; the replaced version is banked for rollback); npm installs run `npm i -g harnessed@latest`. `--check` reports versions without installing; `--dry-run` previews without writing; `--rollback [version]` (binary installs only) atomically restores a banked previous binary — npm installs are pointed at `npm i -g harnessed@<version>`; `--all` (alias `--upstreams`) requests fresh-runtime closure, including owned assets and reviewed third-party updates; `--json` emits one structured result; `--platform <host>` selects `claude` or `codex`; `--non-interactive` skips prompts, and repair automation additionally requires explicit `--repair --yes`; `--repair --yes` invokes a bounded, user-authorized agent repair and then deterministic verification; `--migration-report` is a read-only stale-state inventory |
524
530
  | `harnessed release-preflight` | Read-only release-readiness gate (CHANGELOG `[Unreleased]` / version / git-clean / tag-absent); exits 1 if not ready. The Ship-stage gate. |
525
531
  | `harnessed retro --done` | Reset the retro-reminder phase counter after running `/retro` (clears the per-turn RETRO-DUE nudge). |
526
532
  | `harnessed install <name>` | Install an upstream manifest |
@@ -530,6 +536,12 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
530
536
  | `harnessed gc` | Clean up expired backups |
531
537
  | `harnessed audit-log` | Routing transparency log query (supports `--filter` jq expression) |
532
538
 
539
+ **Fresh-runtime closure (Phase 78):** `harnessed update --all --json` first performs self-update, then hands off to a verified fresh runtime through an absolute executable/package entry path. Only that runtime refreshes harnessed-owned workflow/hook assets and updates already-installed third-party components through reviewed adapters for the selected host. Self-update failure prevents third-party mutation; handoff failure reports incomplete closure even if harnessed itself changed. GSD is the first reviewed adapter, with runtime identity/version verification before and after its upstream-owned update action. Components without a reviewed adapter report `unsupported`; missing third-party components remain `not-installed` and are not installed.
540
+
541
+ `--json` writes exactly one JSON object to stdout (`status`, `components`, `warnings`, `error`, plus schema/operation/mode/host/runtime metadata); diagnostics and child-process output go to stderr. `unsupported` and `retained` produce top-level `partial` and exit `1`, never all-success: `retained` means an update failed but the previous installation still verifies. Completed updates and valid previews (`complete` / `planned`) exit `0`; failed/incomplete execution exits `1`; invalid arguments/protocol exit `2`. Respect each component's `restartRequired` before continuing.
542
+
543
+ Package self-update applies only after proving that the selected npm executable's global `harnessed` package is the running, locked package (including its declared binary entry). The updater probes `npm prefix -g` and `npm root -g --prefix <prefix>`, then pins the same prefix for installation. Unknown/mismatched targets and linked global package slots fail closed with exit `1`, before any installer, fresh-runtime handoff or third-party update. Bun package apply is currently refused as `package-target-unproven`, without npm fallback; version checks, previews and already-current installs remain available.
544
+
533
545
  ### Flags
534
546
 
535
547
  > All commands **apply (immediate write)** by default — no flag needed. Advanced users can add `--dry-run` to preview.