Repository navigation
Commit 0b69564
fix(create-objectstack): a failed install lists the install step in "Next steps" (#23966)
Fixes #23865
Clause-②: no
## What changed
- **`packages/create-objectstack/src/index.ts`, the "Next steps" block
only.** The install line is printed `if (!installed)` instead of `if
(options.skipInstall)`. `installed` is the flag the install block
already sets: it starts `false` and becomes `true` only after `${pm}
install` returns, so `!installed` covers both a skipped install and one
that was attempted and failed. Nothing else in the block changes. A
four-line comment states why.
- **`packages/create-objectstack/src/scaffold-next-steps-pm.test.ts`.**
Three legs in a new `describe`, driving the real CLI through `tsx` under
the file's existing stub-PATH harness. A new stub `pnpm` answers
`--version` with exit 0 and `install` with an exit code the leg chooses,
and logs each call's argv. Each leg proves from that log whether the
install was attempted. There is no new seam in `index.ts`.
- Install attempted and failed (stub exits 1): the "Next steps" list
names `pnpm install` on a line before `pnpm run dev`.
- CONTROL, install attempted and succeeded (stub exits 0): the list has
no install step.
- CONTROL, `--skip-install`: the stub saw only `--version`, and the list
names `pnpm install` before `pnpm run dev`, as before.
- The assertions read only the command list, the lines up to the blank
line that ends it. The "AI Skills" block below it says "After `pnpm
install`:" under `--skip-install`, so a match over the whole section
could pass without the list naming the install.
- **`.changeset/23865-next-steps-after-failed-install.md`:**
`create-objectstack` `patch`, `Clause-②: no`. This is printed guidance
only. No flag, exit code, prompt or scaffolded file changes.
## Evidence (head `539f59772`)
**Door, before and after.** The scaffolder ran from a scratch directory
outside the repo, with `src/index.ts` run through `tsx`. PATH held only
`node` and `npm`, so there was no pnpm, as in the filed case. The
install was pointed at `npm_config_registry=http://127.0.0.1:9` with
`npm_config_fetch_retries=0` and a fresh `npm_config_cache`, bounded by
`timeout 180`. In both runs the install failed with `npm error
FetchError: request to http://127.0.0.1:9/@objectstack%2fcli failed,
reason: connect ECONNREFUSED 127.0.0.1:9`, then the scaffolder printed
``Dependency installation failed. Run `npm install` manually.``
Before, at BASE `8f4260fe6`:
```text
Next steps:
cd my-app
npm run dev # Start development server
npm run validate # Verify metadata: schema + predicates + bindings
# (run after every metadata edit — see AGENTS.md)
```
After, at `539f59772`:
```text
Next steps:
cd my-app
npm install
npm run dev # Start development server
npm run validate # Verify metadata: schema + predicates + bindings
# (run after every metadata edit — see AGENTS.md)
```
**Ablation, once, after committing the fix.** The command was `node
scripts/ablation-replace.mjs --file
packages/create-objectstack/src/index.ts --anchor ' if (!installed) {'
--replacement ' if (options.skipInstall) {' -- pnpm --filter
create-objectstack exec vitest run --maxWorkers=2 --reporter=verbose
src/scaffold-next-steps-pm.test.ts`.
- On disk: anchor x1 → x0, replacement x0 → x1, blob `a76503cfe4ef` →
`2f7b9f0eb219`.
- Result: `Tests 1 failed | 9 passed (10)`. The failing-install leg went
red with `AssertionError: expected -1 to be greater than or equal to 0`,
and both CONTROL legs stayed green.
- Restore: the blob after restore, `a76503cfe4ef`, equals the HEAD blob,
and `git diff HEAD` is empty. This was re-proven after a container
restart.
- The pins run `src/index.ts` through `tsx`, so no `dist/` is in the
path and no rebuild leg applies.
**Local verification at `539f59772`:**
- `pnpm --filter 'create-objectstack^...' build`: `VERDICT command-exit
0`, and the tree was clean afterwards. This builds `@objectstack/spec`,
whose `.d.ts` the typecheck needs for two existing test imports.
- `pnpm --filter create-objectstack run typecheck`: exit 0. `tsc
--listFiles` includes the edited test file.
- `pnpm --filter create-objectstack test`: `Test Files 18 passed (18)`,
`Tests 278 passed (278)`. The edited file alone ran 10 tests in 4.6 s,
up from 7 in 3.0 s.
- `pnpm exec eslint --no-inline-config` over the two changed `.ts`
files: exit 0. The repo-wide run is CI's `Lint & Repo Gates`.
- Gate families: `node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 61 commands. 58 exited 0 and 3 are
NOT MEASURED:
- `pnpm check:dual-build-cjs-loads` and `pnpm check:lean-entry-closure`
exited 3 with `PREREQUISITE NOT MET`. Both need a full workspace build.
- `pnpm check:type-check-debt` hit my 540 s per-command cap. Its
coverage leg printed `OK` (one DEBT entry, which is not this package).
Its re-measure leg was still waiting for the shared verify lock behind
another session's build when the cap fired.
- The `--ran` reconciliation answered `61 derived, 58 run, 3
NOT-MEASURED, 0 UNRUN`.
- Roster gates the derivation flagged in directories these paths touch
(`node scripts/check-changeset-fixed.mjs`, `pnpm check:authz-resolver`,
`pnpm check:error-code-casing`, `pnpm check:filter-alias-parity`): all
exit 0.
- `test:repo` was not run locally because the diff touches no test in
that project. CI's `Test Core` runs it.
## Acceptance notes
- **Base.** `origin/main` has moved 6 commits past BASE `8f4260fe6`, to
`6d1660dc3`. None of them touches `packages/create-objectstack` or
`.changeset/config.json`, and `git merge-tree` reports a clean merge, so
nothing was merged before opening. The queue rebuilds on current `main`.
- **The "AI Skills" block is keyed the way the old install line was.**
Under `--skip-install` it reads "Not installed yet — they are read from
@objectstack/skills in node_modules. After `npm install`:". After a
failed install it reads "Read from @objectstack/skills in node_modules,
at your @objectstack/spec version:" (door transcript, BASE and head
alike). The command it prints is still right: the install line now comes
first in "Next steps", and the warning above already says "`npm install`
did not complete. Once it does, run:". So this is wording, not a wrong
command. The skills step is a hold-off for this card. Noted here, not
filed.
- **Out of scope:** the install step and its warning line, the
Dockerfile pin, and the npm 10 crash family. #23801 and #23849 stay as
they are and are not addressed here.
---
_Generated by [Claude
Code](https://claude.ai/code/session_018t6a5rvqPRvEDMCVVW9kYT)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 67e8792 commit 0b69564
3 files changed
Lines changed: 123 additions & 4 deletions
File tree
- .changeset
- packages/create-objectstack/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
635 | 639 | | |
636 | 640 | | |
637 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | | - | |
150 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
151 | 189 | | |
152 | 190 | | |
153 | 191 | | |
154 | 192 | | |
155 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
156 | 201 | | |
157 | 202 | | |
158 | 203 | | |
| |||
259 | 304 | | |
260 | 305 | | |
261 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
0 commit comments