Commit a8afd9a
committed
chore(scripts): isolate HOME and assert exact version in verify-install-simulation (#1490)
Two correctness fixes uncovered while running the script after the
v5.6.2 bump:
1. **HOME isolation** — the subprocess that ran the installed HUD
inherited the developer's real HOME, so `read_installed_version`
tier-1 lookup picked up `~/.claude/plugins/installed_plugins.json`
from the developer machine (5.6.1) instead of the version we are
about to ship. Output read `CB v5.6.1` even though plugin.json
was already 5.6.2. The script now passes an explicit `env=` to
subprocess.run with HOME pointing at the tmpdir.
2. **Fake installed_plugins.json** — Claude Code writes
`~/.claude/plugins/installed_plugins.json` after every plugin
install/update, and `hud_version.get_fresh_version` reads it as
tier 1. The simulation now writes a stub manifest in the isolated
tmpdir so the installed HUD's version-resolution path matches what
a real user will hit on first session-start after `/plugin update`.
3. **Exact version assertion** — the script now reads the version
from `plugin.json`, asserts `CB v<expected_version>` appears in
the rendered status line, and verifies `~/.claude/hud/.version`
contains the same value. This auto-tracks bump-version.sh and
removes the previous risk of shipping a release where the
version segment renders empty without anyone noticing.
Local verification:
$ bash packages/claude-code-plugin/scripts/verify-install-simulation.sh
[verify-install-simulation] stdout='◕‿◕ CB v5.6.2 | Ready 🟢 | $0.42🔥$0.21/m | 2m | 0% | Opus 4.6'
[verify-install-simulation] PASS: full status line rendered (v5.6.2)
exit=0
Refs #14901 parent 2f85d9a commit a8afd9a
2 files changed
Lines changed: 61 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
Lines changed: 60 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
68 | 94 | | |
69 | 95 | | |
70 | 96 | | |
| |||
103 | 129 | | |
104 | 130 | | |
105 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
106 | 143 | | |
107 | 144 | | |
108 | 145 | | |
109 | 146 | | |
110 | 147 | | |
111 | 148 | | |
| 149 | + | |
112 | 150 | | |
113 | 151 | | |
114 | 152 | | |
| |||
129 | 167 | | |
130 | 168 | | |
131 | 169 | | |
132 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
133 | 177 | | |
134 | 178 | | |
135 | 179 | | |
| |||
138 | 182 | | |
139 | 183 | | |
140 | 184 | | |
141 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
142 | 200 | | |
0 commit comments