@m-kopa/launchpad-cli 0.77.0 → 0.79.0
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/CHANGELOG.md +21 -0
- package/dist/cli.js +1444 -254
- package/dist/commands/deploy-flags.d.ts +2 -0
- package/dist/commands/deploy-flags.d.ts.map +1 -1
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/destroy.d.ts +36 -0
- package/dist/commands/destroy.d.ts.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/skills.d.ts +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/status.d.ts +13 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/deploy/preflight.d.ts +134 -0
- package/dist/deploy/preflight.d.ts.map +1 -0
- package/dist/deploy/verify-deploy.d.ts.map +1 -1
- package/dist/destroy-failure.d.ts +23 -0
- package/dist/destroy-failure.d.ts.map +1 -0
- package/dist/scaffold/react-api-starter-files.d.ts +7 -0
- package/dist/scaffold/react-api-starter-files.d.ts.map +1 -0
- package/dist/scaffold/react-api-starter.d.ts +26 -0
- package/dist/scaffold/react-api-starter.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/skills/README.md +1 -0
- package/skills/launchpad-content-pr/SKILL.md +1 -1
- package/skills/launchpad-deploy/SKILL.md +159 -73
- package/skills/launchpad-deploy-status/SKILL.md +39 -22
- package/skills/launchpad-destroy/SKILL.md +20 -13
- package/skills/launchpad-fix-findings/SKILL.md +218 -0
- package/skills/launchpad-identity/SKILL.md +82 -2
- package/skills/launchpad-ingest/SKILL.md +1 -1
- package/skills/launchpad-integration-contract/SKILL.md +1 -1
- package/skills/launchpad-onboard/SKILL.md +2 -2
- package/skills/launchpad-report/SKILL.md +1 -1
- package/skills/launchpad-status/SKILL.md +6 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: launchpad-deploy
|
|
3
3
|
description: Walk a Launchpad user through deploying an app from their local working directory (Model A — `launchpad init` + `launchpad deploy`). Wraps the CLI verbs end-to-end: detects the app shape, scaffolds `launchpad.yaml`, resolves the allowed Entra group via `launchpad groups`, bundles the CWD via `launchpad deploy`, and watches the rollout via `launchpad status`. Use when someone says "deploy a new app", "ship my app to Launchpad", "/launchpad-deploy", "I have an app locally — get it on Launchpad", or any variant. Resume/abandon for legacy in-flight provisioning is at the bottom.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.79.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
|
|
@@ -80,6 +80,18 @@ Never type the acceptance phrase, never pipe input into `accept`, and never clai
|
|
|
80
80
|
An AI agent may not accept the agreement for a person.
|
|
81
81
|
`launchpad destroy` is never blocked by the agreement.
|
|
82
82
|
|
|
83
|
+
## Build it safe
|
|
84
|
+
|
|
85
|
+
Follow these five rules while you write or change the app, and tell the user when their app breaks one:
|
|
86
|
+
|
|
87
|
+
1. **No file with people's details in what the app publishes.** No CSV, Excel, JSON, database or SQL dump with names, phone numbers, emails, IDs or similar in `public/`, `static/`, `dist/` or anything else the app serves. Keep the data in a store (for example D1) and return it from a route that checks the signed-in user.
|
|
88
|
+
2. **Every route that returns or changes data checks the signed-in user on the server.** Verify the identity the platform sends (see `/launchpad-identity`). A check in the page or the browser is not enough: anyone can call the route directly.
|
|
89
|
+
3. **Writes and deletes need a role or group check** on the server, not only a signed-in user. `/launchpad-identity` § "Only this group may write" shows how.
|
|
90
|
+
4. **No password or key in code**, config or a committed `.env`. Declare the name in `launchpad.yaml` and set the value with `launchpad secrets push` (§A.4).
|
|
91
|
+
5. **A route that calls an AI or another service with the app's key** fixes the model, the request size and the destination in server code, and needs a signed-in user. Never forward whatever the browser sends.
|
|
92
|
+
|
|
93
|
+
**What the platform checks, and what it does not.** The gateway checks sign-in and the app's audience before a request reaches the app. At deploy the bot scans the bundle for secrets (§A.5). The platform does **not** check that your routes verify the user, that writes have a role check, or that you publish no data file with people's details. Those are the app author's job; `launchpad validate --app-lints` and the data-file check in §A.4 help, but they do not prove the app safe.
|
|
94
|
+
|
|
83
95
|
## Constants (single source of truth)
|
|
84
96
|
|
|
85
97
|
These values are referenced by `/launchpad-deploy-status`,
|
|
@@ -213,6 +225,7 @@ This is interactive by default. It will ask for:
|
|
|
213
225
|
server-side; you don't need to pre-check.
|
|
214
226
|
- **team** — for the registry.
|
|
215
227
|
- **owner email** — must be a valid email address.
|
|
228
|
+
- **second owner** — not an `init` prompt, but ask now: "Who should be the second owner of this app, so it is not left without an owner when you are away?" Note the email. After the first deploy is live, add them with `launchpad add-owner <slug> <email>` (§A.6).
|
|
216
229
|
- **deployment type** — `static`, `react`, `react+api`, or
|
|
217
230
|
`container`. The detector pre-selects the right one for Vite/React
|
|
218
231
|
layouts; the user overrides if needed.
|
|
@@ -247,14 +260,16 @@ silently overwrite it.
|
|
|
247
260
|
|
|
248
261
|
**What `init` does not create.** `launchpad init` writes `./launchpad.yaml`
|
|
249
262
|
and adds `.env` / `.env.local` to `.gitignore`. For a `static` app it also
|
|
250
|
-
writes a starter `static/index.html` when none exists.
|
|
251
|
-
code:
|
|
252
|
-
`
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
`launchpad --version` before
|
|
263
|
+
writes a starter `static/index.html` when none exists. For `react` it writes
|
|
264
|
+
no app code: the project (`package.json`, lockfile, `src/`) is the user's own,
|
|
265
|
+
and `launchpad deploy` ships what is already in the folder. If the folder is
|
|
266
|
+
empty, tell the user to add their app first. For `react+api`, CLI 0.78.0 and
|
|
267
|
+
newer also writes a working starter app (§A.2b) unless `--no-starter` is
|
|
268
|
+
passed; it writes nothing when the folder already has a `package.json`, a
|
|
269
|
+
lockfile or a `vite.config.*`, and never overwrites a file. Check
|
|
270
|
+
`launchpad --version` before relying on it. (`--secure-template`, which
|
|
271
|
+
scaffolds a secure `react+api` router, needs CLI 0.77.0 or newer; with the
|
|
272
|
+
starter, the secure router replaces the starter router.)
|
|
258
273
|
|
|
259
274
|
**Stack constraints by app-type** (single source of truth:
|
|
260
275
|
`launchpad-platform/ARCHITECTURE.md § Tech Stack` and `PATTERNS.md §
|
|
@@ -280,46 +295,36 @@ the existing app uses any of these, plan the swap **before** picking
|
|
|
280
295
|
a slug — do not deploy first and port later. What the bot *does*
|
|
281
296
|
enforce at deploy time is the gate set in §A.5.
|
|
282
297
|
|
|
283
|
-
### A.2b React API app: the
|
|
298
|
+
### A.2b React API app: the short path
|
|
284
299
|
|
|
285
300
|
A `react+api` app on dispatch went live from one `launchpad deploy` in 477 s
|
|
286
|
-
(observed on 16-17 Nov 2026) when it
|
|
287
|
-
that used their own `package.json` and their own
|
|
288
|
-
newer bun, failed the first delivery build.
|
|
301
|
+
(observed on 16-17 Nov 2026) when it started from the platform's files. Two
|
|
302
|
+
earlier runs that used their own `package.json` and their own
|
|
303
|
+
`functions/api/*.js`, or a newer bun, failed the first delivery build. CLI
|
|
304
|
+
0.78.0 and newer writes those files for you, so the path is short.
|
|
289
305
|
|
|
290
306
|
**Why the app must start from the platform's files.** The bootstrap pull
|
|
291
|
-
request seeds a `react+api` app with a
|
|
292
|
-
`tsconfig.json` and `functions/api/[[path]].ts` (see
|
|
293
|
-
`portal-bot/src/bootstrap-manifest.ts`). That `[[path]].ts` is a Hono router
|
|
307
|
+
request seeds a `react+api` app with a `functions/api/[[path]].ts` Hono router
|
|
294
308
|
that imports `hono` and `@m-kopa/platform-auth`. The first delivery build
|
|
295
309
|
compiles it, so if the owner's `package.json` lacks those two dependencies the
|
|
296
310
|
build fails with `Could not resolve "hono/cloudflare-pages"` and the app ends
|
|
297
311
|
`provisioning_failed` at `deployment_verified`.
|
|
298
312
|
|
|
299
|
-
1. **
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
`
|
|
303
|
-
a
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
Never add a second functions file such as
|
|
309
|
-
it: it is a competing route.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
5. **Install with bun 1.3.4**, which also rewrites the lockfile at version 1
|
|
315
|
-
(see "bun version" below):
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
npx --yes bun@1.3.4 install
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
6. **Run the local gate** with the same bun, in the app folder. The last
|
|
322
|
-
command is the functions compile that the delivery workflow runs:
|
|
313
|
+
1. **Run `launchpad init --type react+api`** (with the other init flags from
|
|
314
|
+
§A.2) in an empty folder. It writes the manifest and a working starter:
|
|
315
|
+
`package.json` (with `hono`, `@m-kopa/platform-auth`, React, Vite and a
|
|
316
|
+
`build` script), a `bun.lock` written by bun 1.3.4, `tsconfig.json`, the
|
|
317
|
+
router `functions/api/[[path]].ts`, a page (`index.html`, `src/main.jsx`) and
|
|
318
|
+
`vite.config.js`; the manifest gets `spec.build`. `--no-starter` writes only
|
|
319
|
+
the manifest. Check `launchpad --version` shows 0.78.0 or newer first; an
|
|
320
|
+
older CLI writes no starter.
|
|
321
|
+
2. **Add API routes inside the starter's router**, in
|
|
322
|
+
`functions/api/[[path]].ts`. Never add a second functions file such as
|
|
323
|
+
`functions/api/hello.js` beside it: it is a competing route. Add the app's
|
|
324
|
+
own packages with `npx --yes bun@1.3.4 add <package>` so the lockfile stays
|
|
325
|
+
at version 1.
|
|
326
|
+
3. **Run the local gate** with bun 1.3.4, in the app folder. The last command is
|
|
327
|
+
the functions compile that the delivery workflow runs:
|
|
323
328
|
|
|
324
329
|
```bash
|
|
325
330
|
npx --yes bun@1.3.4 install --frozen-lockfile --ignore-scripts
|
|
@@ -329,21 +334,29 @@ build fails with `Could not resolve "hono/cloudflare-pages"` and the app ends
|
|
|
329
334
|
npx --yes wrangler@4.136.3 pages functions build functions --outdir "$(mktemp -d)" --compatibility-date 2026-07-27 --compatibility-flags nodejs_compat
|
|
330
335
|
```
|
|
331
336
|
|
|
332
|
-
Every command must exit 0. The functions compile
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
`spec.build` block (`bun install --frozen-lockfile && bun run build`,
|
|
338
|
-
destination `dist`). Run before the install, `init` wrote no `spec.build`
|
|
339
|
-
(observed on 16 Nov 2026). Check the block is there. Add `test/**` and
|
|
340
|
-
`eslint.config.js` to `spec.app.include` if the app has them.
|
|
341
|
-
8. **`launchpad validate`, then ONE `launchpad deploy`.** The first deploy
|
|
337
|
+
Every command must exit 0. The functions compile catches a missing `hono` or
|
|
338
|
+
`@m-kopa/platform-auth`; `launchpad validate` and `launchpad deploy
|
|
339
|
+
--dry-run` do not.
|
|
340
|
+
4. **`launchpad validate --app-lints` and the data-file check (§A.4), then ONE
|
|
341
|
+
`launchpad deploy`.** The first deploy
|
|
342
342
|
ships the content; do not deploy again to check.
|
|
343
343
|
|
|
344
|
+
**When `init` writes no starter.** `init` writes nothing beyond the manifest
|
|
345
|
+
when the folder already has a `package.json`, a lockfile or a `vite.config.*`,
|
|
346
|
+
and it never overwrites a file; it says why. For such an existing app, bring it
|
|
347
|
+
in line by hand: keep `hono` and `@m-kopa/platform-auth` in `package.json`
|
|
348
|
+
(the platform's reference files are `react-api/starter/` and
|
|
349
|
+
`react-api/functions/api/[[path]].ts` in `M-KOPA/launchpad-template`), put the
|
|
350
|
+
routes in the one `functions/api/[[path]].ts` router, give `package.json` a
|
|
351
|
+
`build` script such as `"build": "vite build"`, make sure the manifest has
|
|
352
|
+
`spec.build` (`bun install --frozen-lockfile && bun run build`, destination
|
|
353
|
+
`dist`), install with `npx --yes bun@1.3.4 install`, then run steps 3 and 4.
|
|
354
|
+
|
|
344
355
|
Two traps (observed on 16-17 Nov 2026):
|
|
345
356
|
|
|
346
|
-
- **Hidden files in the build output
|
|
357
|
+
- **Hidden files in the build output.** The build output (`dist`) must contain
|
|
358
|
+
no hidden files or folders: do not create `public/.gitkeep`, because Vite
|
|
359
|
+
copies it into `dist` and dispatch refuses the delivery.
|
|
347
360
|
- **A global `~/.npmrc` that routes `@m-kopa` to another registry** (for
|
|
348
361
|
example GitHub Packages) can make the install 404 for
|
|
349
362
|
`@m-kopa/platform-auth`, which is on the public npm registry. Put one line
|
|
@@ -354,16 +367,14 @@ Two traps (observed on 16-17 Nov 2026):
|
|
|
354
367
|
(`bun-version: "1.3.4"`). A lockfile written by bun 1.4 or newer has
|
|
355
368
|
`"lockfileVersion": 2`, which bun 1.3.4 cannot read: the first delivery build
|
|
356
369
|
fails at "Install dependencies" with `Unknown lockfile version`, and the app
|
|
357
|
-
ends `provisioning_failed` at `deployment_verified`.
|
|
370
|
+
ends `provisioning_failed` at `deployment_verified`. `launchpad deploy` now
|
|
371
|
+
checks this itself before it uploads anything (see §A.5, "Pre-flight checks").
|
|
372
|
+
If it reports a lockfile problem, the fix is:
|
|
358
373
|
|
|
359
374
|
```bash
|
|
360
|
-
bun
|
|
361
|
-
grep lockfileVersion bun.lock
|
|
375
|
+
npx --yes bun@1.3.4 install
|
|
362
376
|
```
|
|
363
377
|
|
|
364
|
-
The second line must show `"lockfileVersion": 1`. If it shows 2, regenerate
|
|
365
|
-
with `npx --yes bun@1.3.4 install`.
|
|
366
|
-
|
|
367
378
|
### A.3 Deliberately share with an Entra group
|
|
368
379
|
|
|
369
380
|
The CLI resolves Entra groups via the bot's `/groups` endpoint
|
|
@@ -436,15 +447,45 @@ Use `launchpad groups whoami` to remind the user which groups
|
|
|
436
447
|
**they** are currently a member of — handy when an app is gated and
|
|
437
448
|
they want to confirm they'll still be able to reach it.
|
|
438
449
|
|
|
439
|
-
### A.4
|
|
450
|
+
### A.4 Validate before shipping
|
|
440
451
|
|
|
441
452
|
```bash
|
|
442
|
-
launchpad validate
|
|
453
|
+
launchpad validate --app-lints
|
|
443
454
|
```
|
|
444
455
|
|
|
445
456
|
Parses `launchpad.yaml` and reports problems (it accepts both the v1alpha1
|
|
446
|
-
and the v2 manifest). Doesn't talk to the bot by default.
|
|
447
|
-
|
|
457
|
+
and the v2 manifest). Doesn't talk to the bot by default. Run it before every
|
|
458
|
+
deploy.
|
|
459
|
+
|
|
460
|
+
`--app-lints` also reads the app's server code (folders such as `functions/`,
|
|
461
|
+
`server/`, `api/`, `backend/`, `worker/`) and reports:
|
|
462
|
+
|
|
463
|
+
- `route-without-auth`: a file with write routes (POST, PUT, PATCH, DELETE)
|
|
464
|
+
where no identity check is in reach;
|
|
465
|
+
- `assertion-decoded-without-verify`, `assertion-read-without-platform-auth`,
|
|
466
|
+
`assertion-verified-without-platform-auth`: the identity header is read
|
|
467
|
+
without `@m-kopa/platform-auth` verifying it;
|
|
468
|
+
- `app-session-over-1h`: the app keeps its own session for more than an hour.
|
|
469
|
+
|
|
470
|
+
It is report only: findings never change the exit code, and deploy does not
|
|
471
|
+
run these lints today. It does not look at read routes, it cannot tell a role
|
|
472
|
+
check from a plain sign-in check, and it does not see data files. Show the user
|
|
473
|
+
every finding and fix it (see §"Build it safe" and `/launchpad-identity`)
|
|
474
|
+
before you deploy.
|
|
475
|
+
|
|
476
|
+
**Data-file check.** Before every deploy, list the data files the app could
|
|
477
|
+
publish:
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
find . \( -path ./node_modules -o -path ./.git \) -prune -o -type f \( -iname '*.csv' -o -iname '*.tsv' -o -iname '*.xls' -o -iname '*.xlsx' -o -iname '*.json' -o -iname '*.db' -o -iname '*.sqlite' -o -iname '*.sqlite3' -o -iname '*.sql' -o -iname '*.parquet' \) ! -name 'package.json' ! -name 'package-lock.json' ! -name 'tsconfig*.json' ! -name 'authz-attestation.json' -print
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
Ignore config files and schema migrations (SQL with only `CREATE` or `ALTER`). For every other file, open its first lines (headers or
|
|
484
|
+
keys only; never print rows into the chat) and look for people's details. If a
|
|
485
|
+
file has them and sits in a folder the app serves or bundles (`public/`,
|
|
486
|
+
`static/`, `dist/`, `src/`, the app root), stop and ask the user before you
|
|
487
|
+
deploy: the data belongs in a store behind a signed-in route (§"Build it
|
|
488
|
+
safe", rule 1). Never delete a data file without the user's yes.
|
|
448
489
|
|
|
449
490
|
Add `--strict-groups` to *additionally* resolve the manifest's
|
|
450
491
|
allowed Entra group online — it catches typo'd / renamed / ineligible
|
|
@@ -515,6 +556,25 @@ for `react+api`); it leaves out lint config (`eslint.config.*`) and tests
|
|
|
515
556
|
(`test/**`, `vitest.config.*`). Add them to `spec.app.include` when the app's
|
|
516
557
|
CI needs them.
|
|
517
558
|
|
|
559
|
+
**Pre-flight checks (CLI 0.78.0 and newer).** Before it uploads anything,
|
|
560
|
+
`launchpad deploy` looks at the bundle for two shapes that fail the delivery
|
|
561
|
+
build. It refuses (exit 1, nothing uploaded) only when the build is certain to
|
|
562
|
+
fail, and prints a warning, then continues, in every other case:
|
|
563
|
+
|
|
564
|
+
- a `bun.lock` with `"lockfileVersion"` 2 or newer, which the build's bun 1.3.4
|
|
565
|
+
cannot read. It is refused only for a dispatch app whose build runs
|
|
566
|
+
`bun install --frozen-lockfile` on that lockfile; elsewhere it warns. Fix:
|
|
567
|
+
`npx --yes bun@1.3.4 install`.
|
|
568
|
+
- a dispatch `react+api` app that ships no API router of its own and whose
|
|
569
|
+
`package.json` is missing, is not valid JSON, or lacks `hono` or
|
|
570
|
+
`@m-kopa/platform-auth` (the seeded router imports both). A package missing
|
|
571
|
+
for a router the app does ship only warns. Fix: `npx --yes bun@1.3.4 add hono
|
|
572
|
+
@m-kopa/platform-auth`, or the install command above.
|
|
573
|
+
|
|
574
|
+
Each refusal names the flag `--allow-preflight-failure`, which turns refusals
|
|
575
|
+
into warnings. Do not pass it to get past a refusal: fix the named file first.
|
|
576
|
+
It is valid only for a content deploy.
|
|
577
|
+
|
|
518
578
|
### Container apps — use `auth: gateway` (AIO-811)
|
|
519
579
|
|
|
520
580
|
Container apps (`type: container`) sign in through the same Entra auth gateway as Pages apps. `launchpad init` scaffolds new container apps with `auth: gateway` by default; keep it. Pass `--auth access` only for a legacy Access app.
|
|
@@ -584,10 +644,11 @@ fresh slug auto-provisions:
|
|
|
584
644
|
|
|
585
645
|
- **Time.** Expect 5-10 minutes from the bot accepting the deploy to `live`
|
|
586
646
|
(three runs on 16-17 Nov 2026 took about 8 to 9.5 minutes). The CLI waits
|
|
587
|
-
about
|
|
647
|
+
about 8 minutes, and returns earlier if the deploy fails inside that window.
|
|
588
648
|
- **Exit 0 after `Still provisioning (stage: ...)` is not success.** The wait
|
|
589
|
-
expired and the app is not live yet; the CLI still exits 0
|
|
590
|
-
|
|
649
|
+
expired and the app is not live yet; the CLI still exits 0, and its last line
|
|
650
|
+
now reads `Deploy NOT finished: <slug> is still provisioning and is not live
|
|
651
|
+
yet`. Never tell the user it is deployed. Run:
|
|
591
652
|
|
|
592
653
|
```bash
|
|
593
654
|
launchpad watch <slug>
|
|
@@ -604,13 +665,17 @@ fresh slug auto-provisions:
|
|
|
604
665
|
`503 enforced_access_unavailable` ("cannot verify enforced access from
|
|
605
666
|
Terraform - retry shortly") is a retryable 503 too: same wait, same limit.
|
|
606
667
|
Do not change the manifest, the groups or the slug to get past it.
|
|
607
|
-
- **A failed bootstrap
|
|
668
|
+
- **A failed bootstrap check is a platform fault, not your lockfile.**
|
|
608
669
|
The bot's bootstrap pull request runs CI (the `launchpad-review` workflow) on
|
|
609
670
|
the platform's starter files, not on your app. If it fails (for example
|
|
610
671
|
`bootstrap PR #1 CI failed: failed checks: npm-audit`), the first deploy ends
|
|
611
|
-
`bot_pr_ci_failed`.
|
|
612
|
-
|
|
613
|
-
|
|
672
|
+
`bot_pr_ci_failed`. The starter's advisories and the audit script are fixed
|
|
673
|
+
for new apps, so this should not happen; if it does, report it with
|
|
674
|
+
`/launchpad-report`. Do not change your lockfile and do not retry under
|
|
675
|
+
another slug. `launchpad status` may still suggest running `bun audit
|
|
676
|
+
--prod`; that does not predict this check. To clear the slug, the owner runs
|
|
677
|
+
`launchpad destroy <slug> --confirm-slug <slug> --yes` (see
|
|
678
|
+
`/launchpad-deploy-status`).
|
|
614
679
|
|
|
615
680
|
What the bootstrap CI runs on the first PR, on the starter files (jobs `lint`,
|
|
616
681
|
`typecheck`, `test`, `gitleaks`, `npm-audit`):
|
|
@@ -677,6 +742,22 @@ Flags — there is nothing useful to pass on the Model A path:
|
|
|
677
742
|
Run `/launchpad-status` to confirm; `/launchpad-content-pr` is no
|
|
678
743
|
longer needed under Model A (the first deploy already shipped your
|
|
679
744
|
content)."
|
|
745
|
+
On a first deploy, add the second owner the user named in §A.2. A co-owner
|
|
746
|
+
gets full owner rights, including destroy, so name the person and the app
|
|
747
|
+
and wait for the user's yes in this conversation. Then run (the Bash tool
|
|
748
|
+
is not a terminal, so the command needs `--yes`; the user's answer is the
|
|
749
|
+
confirmation):
|
|
750
|
+
|
|
751
|
+
```bash
|
|
752
|
+
launchpad add-owner <slug> <email> --yes
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
`launchpad list-owners <slug>` shows the owners afterwards (as Entra ids,
|
|
756
|
+
not emails).
|
|
757
|
+
- **`couldn't reach the served URL to verify: served URL redirected (HTTP 302)`**
|
|
758
|
+
after a successful deploy is expected for an app behind gateway sign-in: the
|
|
759
|
+
CLI has no browser session, so the app sends it to sign-in. It is not a
|
|
760
|
+
failure. Confirm with `launchpad status <slug>`.
|
|
680
761
|
- **Terminal failure stages** — `validator_rejected`,
|
|
681
762
|
`tf_apply_failed`, `bot_pr_ci_failed`, `abandoned`, `failed` → run
|
|
682
763
|
`/launchpad-deploy-status <slug>` and surface the failure reason
|
|
@@ -687,15 +768,20 @@ Flags — there is nothing useful to pass on the Model A path:
|
|
|
687
768
|
them verbatim and let the user fix and re-`launchpad deploy`.
|
|
688
769
|
- **First deploy ended `provisioning_failed` / `bot_pr_ci_failed`** (for
|
|
689
770
|
example `bootstrap PR #1 CI failed: failed checks: npm-audit`) → a platform
|
|
690
|
-
fault
|
|
771
|
+
fault. The owner can now free the slug: `launchpad destroy <slug>
|
|
772
|
+
--confirm-slug <slug> --yes` releases it in seconds (proven on production on
|
|
773
|
+
17 Nov 2026). Do not create a second slug before that destroy, and do not
|
|
691
774
|
loop `deploy`, `recover`, `--resume`, `--abandon` or `--allow-unguarded`:
|
|
692
775
|
none of them clears it. Follow `/launchpad-deploy-status` § "First deploy
|
|
693
|
-
stuck at `provisioning_failed`" and run `/launchpad-report` with the slug
|
|
776
|
+
stuck at `provisioning_failed`", and run `/launchpad-report` with the slug
|
|
777
|
+
if the destroy is refused.
|
|
694
778
|
- **First deploy ended `provisioning_failed` at `deployment_verified`** with
|
|
695
779
|
`dispatch delivery refused: build-failed` (the bootstrap PR merged, the first
|
|
696
780
|
delivery build failed) → follow `/launchpad-deploy-status` § "First deploy
|
|
697
781
|
failed at `deployment_verified`". Do not use `launchpad recover`: it does not
|
|
698
|
-
apply to dispatch apps
|
|
782
|
+
apply to dispatch apps. From CLI 0.78.0, `launchpad status` no longer
|
|
783
|
+
suggests it for a dispatch app; it says to fix the cause, destroy and deploy
|
|
784
|
+
again. An older CLI may still print the `recover` line: ignore it.
|
|
699
785
|
- **Dispatch delivery refused** (`launchpad status` shows `v2 delivery:
|
|
700
786
|
state refused`) → surface the `failed at` reason verbatim. For
|
|
701
787
|
`hidden build output is not supported`, follow the fix in §A.2 and
|
|
@@ -707,8 +793,8 @@ Flags — there is nothing useful to pass on the Model A path:
|
|
|
707
793
|
was moved from dispatch to Pages needs the platform team to return
|
|
708
794
|
it to dispatch (`launchpad migrate` only moves live Pages apps), so
|
|
709
795
|
offer `/launchpad-report` with the slug and the error.
|
|
710
|
-
- **Terminal-failed but the app is actually serving**
|
|
711
|
-
recover <slug>`. The bot re-derives reality from live Cloudflare
|
|
796
|
+
- **Terminal-failed but the app is actually serving** (a Pages app; `recover`
|
|
797
|
+
refuses dispatch apps) → `launchpad recover <slug>`. The bot re-derives reality from live Cloudflare
|
|
712
798
|
state and repairs the record to `live` only when the app is
|
|
713
799
|
verifiably serving; if it isn't, it refuses with exactly what was
|
|
714
800
|
checked — it never fabricates a live state.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: launchpad-deploy-status
|
|
3
3
|
description: Show the current provisioning stage + failure reason for a Launchpad app via `launchpad status` (Model A drift + deployment_verified) and `launchpad apps` (lifecycle bucket), or watch provisioning live with `launchpad watch`. Renders the M-892 stage trace for in-flight provisioning, and is the canonical home for `launchpad recover` (repair a terminal-failed app record that is actually live). Use when someone says "what's the status of demo-X", "/launchpad-deploy-status", "is my deploy stuck", "watch my deploy go live", "watch provisioning", "my app says failed but it's serving", or after `/launchpad-deploy` reports a non-`done` terminal stage.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.79.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
|
|
@@ -70,7 +70,7 @@ inference source resolves.
|
|
|
70
70
|
| What was actually deployed? | `launchpad pull --manifest <slug>` |
|
|
71
71
|
| Is the app stuck in the legacy M-892 zero-touch flow? | See § Legacy below |
|
|
72
72
|
| What broke the most recent deploy? | `launchpad status <slug> --json` + the bot's PR check trail |
|
|
73
|
-
| It says `failed` but the app is live in a browser | `launchpad recover <slug>` — see § Recover below |
|
|
73
|
+
| It says `failed` but the app is live in a browser (a Pages app; `recover` refuses a dispatch app) | `launchpad recover <slug>` — see § Recover below |
|
|
74
74
|
| A container app is `provisioning_failed` at `deployment_verified` (deploy workflow found its secrets missing; a one-step `launchpad deploy` normally prevents this) | `launchpad secrets push`, then `launchpad recover <slug>`; the bot authorizes and verifies the retry run and marks the app live (watch `launchpad status`) |
|
|
75
75
|
|
|
76
76
|
The Model A default is `launchpad status <slug>` (a one-shot read).
|
|
@@ -116,13 +116,18 @@ the canonical reference). Lifecycle-shaped states:
|
|
|
116
116
|
To watch it advance to its terminal state live, use
|
|
117
117
|
`launchpad watch <slug>` (§ Watch).
|
|
118
118
|
- **`provisioning_failed`** — provisioning failed; the failing stage
|
|
119
|
-
and reason are shown inline. If the app is actually live
|
|
120
|
-
§ Recover
|
|
119
|
+
and reason are shown inline. If the app is actually live and is a Pages
|
|
120
|
+
app, see § Recover; for a failed dispatch app see § First deploy stuck at
|
|
121
|
+
`provisioning_failed`.
|
|
121
122
|
- **`destroying` / `destroyed` / `destroy_failed`** — teardown
|
|
122
123
|
states. Route to `/launchpad-destroy`.
|
|
123
124
|
After a destroy that ends `destroy_failed`, run `launchpad destroy <slug>
|
|
124
125
|
--confirm-slug <slug> --yes` again; the teardown resumes from the failed
|
|
125
|
-
step (a second destroy completed in about 80 s on 16 Nov 2026).
|
|
126
|
+
step (a second destroy completed in about 80 s on 16 Nov 2026). From CLI
|
|
127
|
+
0.78.0, `launchpad status <slug>` on a `destroy_failed` app shows which
|
|
128
|
+
teardown step failed, the reason the platform recorded, and a next step
|
|
129
|
+
(`--json` adds `failedReason` and `destroyFailure`); an older CLI prints only
|
|
130
|
+
"destroy FAILED".
|
|
126
131
|
|
|
127
132
|
Live-app states:
|
|
128
133
|
|
|
@@ -180,8 +185,9 @@ field. Common values:
|
|
|
180
185
|
- **`failed`** — provisioning failed. See `launchpad status <slug>
|
|
181
186
|
--json` for the most recent error, and the bot's open PR on
|
|
182
187
|
`launchpad-platform` for the apply trace. If the app is actually
|
|
183
|
-
live and serving, repair the record with
|
|
184
|
-
<slug>` (§ Recover).
|
|
188
|
+
live and serving and is a Pages app, repair the record with
|
|
189
|
+
`launchpad recover <slug>` (§ Recover). For a failed dispatch app see
|
|
190
|
+
§ First deploy stuck at `provisioning_failed`.
|
|
185
191
|
- **`destroying` / `destroyed` / `destroy_failed`** — teardown
|
|
186
192
|
states. Route to `/launchpad-destroy`.
|
|
187
193
|
After a destroy that ends `destroy_failed`, run `launchpad destroy <slug>
|
|
@@ -231,7 +237,7 @@ Next steps:
|
|
|
231
237
|
`live`.
|
|
232
238
|
```
|
|
233
239
|
|
|
234
|
-
Failed deploy:
|
|
240
|
+
Failed deploy (a Pages app; a failed dispatch app gets the destroy-and-deploy-again steps instead of `recover`):
|
|
235
241
|
|
|
236
242
|
```
|
|
237
243
|
App: demo-7
|
|
@@ -312,8 +318,11 @@ The bootstrap pull request runs CI on the platform's starter files, not on the
|
|
|
312
318
|
owner's app, so a failure here is a platform fault. Do not change your
|
|
313
319
|
lockfile, do not retry, do not use another slug; run `/launchpad-report`. (Run
|
|
314
320
|
`bun audit` on your own app as good practice only; it does not predict this
|
|
315
|
-
check.) The owner cannot retry, resume, abandon
|
|
316
|
-
|
|
321
|
+
check.) The owner cannot retry, resume, abandon or recover this app, but CAN
|
|
322
|
+
free the slug with `launchpad destroy` (below). The starter's dependency
|
|
323
|
+
advisories and the audit script are fixed for new apps, so a new failure here
|
|
324
|
+
is unexpected: report it. `launchpad status` may still suggest running `bun
|
|
325
|
+
audit --prod`; that is not the owner's fix.
|
|
317
326
|
|
|
318
327
|
What the user can and cannot do in case (a):
|
|
319
328
|
|
|
@@ -328,23 +337,29 @@ What the user can and cannot do in case (a):
|
|
|
328
337
|
- **`launchpad recover <slug>`**: refuses (409 `not_live`). It repairs only an
|
|
329
338
|
app that is verifiably serving, and it checks a Pages project that a
|
|
330
339
|
dispatch app does not have.
|
|
331
|
-
- **`launchpad destroy <slug
|
|
332
|
-
|
|
333
|
-
|
|
340
|
+
- **`launchpad destroy <slug> --confirm-slug <slug> --yes`**: works. An owner
|
|
341
|
+
can destroy an app whose first deploy failed at `bot_pr_ci_failed`; it
|
|
342
|
+
releases the slug in seconds (proven on production on 17 Nov 2026 with two
|
|
343
|
+
apps). It archives the app repo and frees the slug; nothing needs deleting by
|
|
344
|
+
hand. Only the owner can run it. An older bot answered 409 `no_per_app_tf`;
|
|
345
|
+
if destroy is refused now, do not retry under another slug and run
|
|
346
|
+
`/launchpad-report` with the slug and the refusal text.
|
|
334
347
|
- **Operator route.** The runbook (`docs/runbooks/m-892-zero-touch-demo.md`)
|
|
335
348
|
lists one action for `bot_pr_ci_failed`: "push a fix to the bot PR's branch".
|
|
336
349
|
That needs write access to the app repo, which an app owner normally does not
|
|
337
350
|
have, so it is an operator action, not something to offer the user. It also
|
|
338
351
|
does not restart the stopped provisioning run. On 16 Nov 2026 a fix made
|
|
339
352
|
every check on the bootstrap PR pass, and the app stayed at
|
|
340
|
-
`bot_pr_ci_failed`.
|
|
341
|
-
- **Do not create a second slug**
|
|
342
|
-
by hand.
|
|
353
|
+
`bot_pr_ci_failed`. Free the slug with `launchpad destroy` instead.
|
|
354
|
+
- **Do not create a second slug** before the destroy, and do not try to clean
|
|
355
|
+
up by hand.
|
|
343
356
|
|
|
344
|
-
Say this to the user
|
|
345
|
-
`
|
|
346
|
-
|
|
347
|
-
|
|
357
|
+
Say this to the user. Because a bootstrap check failure is a platform fault,
|
|
358
|
+
run `/launchpad-report` with the slug and the `failed` stage and reason text
|
|
359
|
+
from `launchpad status <slug>`, and ask for confirmation before filing, as that
|
|
360
|
+
skill requires. Offer the destroy so the owner can create the app again; if
|
|
361
|
+
the destroy is refused, report that too, and tell the user not to start a
|
|
362
|
+
second app meanwhile.
|
|
348
363
|
|
|
349
364
|
### (b) `provisioning_failed` at `deployment_verified`: first delivery build failed
|
|
350
365
|
|
|
@@ -369,8 +384,10 @@ Destroy works in this state (observed twice on 16-17 Nov 2026) and takes about
|
|
|
369
384
|
2.5 minutes; if it ends `destroy_failed`, run it again. Fix the cause, then
|
|
370
385
|
create the app again with `/launchpad-deploy`.
|
|
371
386
|
|
|
372
|
-
`launchpad recover` does not apply to dispatch apps
|
|
373
|
-
status`
|
|
387
|
+
`launchpad recover` does not apply to dispatch apps. From CLI 0.78.0 `launchpad
|
|
388
|
+
status` no longer suggests it for a failed dispatch app: it says to read the
|
|
389
|
+
failed build, fix the cause, run the destroy above and deploy again. An older
|
|
390
|
+
CLI may still print the `recover` line; ignore it.
|
|
374
391
|
|
|
375
392
|
## Legacy — M-892 stage taxonomy
|
|
376
393
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: launchpad-destroy
|
|
3
3
|
description: Tear down a Launchpad app end-to-end via `launchpad destroy` — Cloudflare resources (Pages project, or the dispatch Worker script), edge-auth wiring (gateway KV/audience entries, or the Access app for `auth: access` apps), custom hostname, platform-repo TF, and the app repo (archive-renamed). Owner-only verb with a two-step destructive confirmation. Use when someone says "destroy this app", "/launchpad-destroy", "tear down `<slug>`", "delete the app", or asks to clean up a smoke-test / orphan / retired app.
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.79.0
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
<!-- BEGIN shell-contract (managed by scripts/sync-skill-contract.sh — edit skills/_partials/shell-contract.md) -->
|
|
@@ -125,7 +125,11 @@ Every destroy starts with the same shared steps:
|
|
|
125
125
|
There is **no destroy PR and no `destroy:confirmed` label** on this
|
|
126
126
|
path. Workspace apps live in isolated TF state, so there is no
|
|
127
127
|
shared apply to pick up a file deletion — teardown is an explicit
|
|
128
|
-
`terraform destroy
|
|
128
|
+
`terraform destroy`. The CLI's last lines say so: the platform's destroy
|
|
129
|
+
workflow is removing the resources now, with no PR to merge. (An app that never
|
|
130
|
+
got Cloudflare resources, such as a first deploy stopped at `bot_pr_ci_failed`,
|
|
131
|
+
is torn down before any Terraform and the CLI prints `Done:` and that the slug
|
|
132
|
+
is free.)
|
|
129
133
|
|
|
130
134
|
1. The bot fires an **HMAC-signed `repository_dispatch`**
|
|
131
135
|
(`tf-destroy-per-app`): it signs `<slug>|<exp>` with a secret
|
|
@@ -185,10 +189,10 @@ Use the platform runbook `docs/runbooks/d1-destroy-export-restore.md` to recover
|
|
|
185
189
|
|---|---|---|
|
|
186
190
|
| `live` (or absent) | App is operational. | Destroy works. |
|
|
187
191
|
| `provisioning` | Initial create still running. | Wait, then destroy. |
|
|
188
|
-
| `failed` | Provisioning failed. | Destroy works (cleans up partial state)
|
|
192
|
+
| `failed` | Provisioning failed. | Destroy works (cleans up partial state), including a first deploy that failed at `bot_pr_ci_failed`. If a Pages app is actually live and serving, consider `launchpad recover <slug>` first — it repairs the record instead of tearing down. |
|
|
189
193
|
| `destroying` | Teardown in flight (workspace: destroy run dispatched; legacy: destroy PR open, tf-apply pending). | Re-running `launchpad destroy` is idempotent — workspace: re-dispatches the run; legacy: returns the existing PR. |
|
|
190
194
|
| `destroyed` | Teardown succeeded + repo archive-renamed. | Re-running exits 0 with `already destroyed at <ts>`. The slug remains retired until platform recovery proves live infrastructure. |
|
|
191
|
-
| `destroy_failed` | The teardown failed or hung. | **Workspace path:** re-run `launchpad destroy` — it re-dispatches from the failure point. **Legacy path:** re-run is rejected with `platform-team intervention required` (409). On both, the app repo is **not** archive-renamed (recovery path stays clean). |
|
|
195
|
+
| `destroy_failed` | The teardown failed or hung. | **Workspace path:** re-run `launchpad destroy` — it re-dispatches from the failure point. From CLI 0.78.0, `launchpad status <slug>` shows which teardown step failed, the reason the platform recorded and a next step (`--json`: `failedReason`, `destroyFailure`); an older CLI prints only "destroy FAILED". **Legacy path:** re-run is rejected with `platform-team intervention required` (409). On both, the app repo is **not** archive-renamed (recovery path stays clean). |
|
|
192
196
|
|
|
193
197
|
## Carve-outs
|
|
194
198
|
|
|
@@ -290,13 +294,14 @@ Two cases, both described in `/launchpad-deploy-status` § "First deploy stuck
|
|
|
290
294
|
at `provisioning_failed`":
|
|
291
295
|
|
|
292
296
|
- **`bot_pr_ci_failed`** (the bootstrap PR check failed, for example
|
|
293
|
-
`npm-audit`): a platform fault, not the owner's lockfile.
|
|
294
|
-
`launchpad destroy <slug
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
297
|
+
`npm-audit`): a platform fault, not the owner's lockfile. The owner CAN
|
|
298
|
+
destroy it: `launchpad destroy <slug> --confirm-slug <slug> --yes` releases
|
|
299
|
+
the slug in seconds (proven on production on 17 Nov 2026 with two apps).
|
|
300
|
+
It archives the app repo; the open bootstrap PR stays on the archived repo.
|
|
301
|
+
`launchpad recover` refuses this app (`not_live`); do not use it. Do not
|
|
302
|
+
create a second slug before the destroy, do not change the lockfile and do
|
|
303
|
+
not delete anything by hand. If the destroy is refused (an older bot answers
|
|
304
|
+
409 `no_per_app_tf`), run `/launchpad-report` with the slug and the text.
|
|
300
305
|
- **`deployment_verified`** with `dispatch delivery refused: build-failed`
|
|
301
306
|
(the bootstrap PR merged, the first delivery build failed):
|
|
302
307
|
`launchpad destroy <slug> --confirm-slug <slug> --yes` works (observed twice
|
|
@@ -314,7 +319,9 @@ main — neither an `apps/<slug>/` workspace nor a `<slug>.tf` +
|
|
|
314
319
|
`<slug>.allow.tf` file pair (the bot probes both before this 409).
|
|
315
320
|
This usually means: (a) the app was never fully provisioned (look
|
|
316
321
|
at `lifecycle` — likely `failed`), or (b) the TF was hand-removed
|
|
317
|
-
outside of this verb. Either way: platform-team intervention.
|
|
322
|
+
outside of this verb. Either way: platform-team intervention. (A first deploy
|
|
323
|
+
stopped at `bot_pr_ci_failed` no longer lands here: its destroy runs the
|
|
324
|
+
pre-Terraform teardown. An older bot still answers this 409.)
|
|
318
325
|
|
|
319
326
|
### `slug ${urlSlug} is already being destroyed`
|
|
320
327
|
|
|
@@ -406,7 +413,7 @@ On an idempotent re-run against a `destroyed` slug:
|
|
|
406
413
|
- **`/launchpad-deploy-status`** — diagnose `provisioning` /
|
|
407
414
|
`failed` lifecycle stages. Less relevant after destroy lands.
|
|
408
415
|
If the app shows `failed` but is actually live and serving, reach
|
|
409
|
-
for `launchpad recover <slug>` (documented there) before assuming
|
|
416
|
+
for `launchpad recover <slug>` (documented there; Pages apps only) before assuming
|
|
410
417
|
destroy + re-create is the fix — recover repairs the registry
|
|
411
418
|
record against live state. (Recover refuses destroy-side states —
|
|
412
419
|
`destroying` / `destroyed` / `destroy_failed` are owned by this
|