@runveric/cli 0.5.1 → 0.6.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/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  production runner image — without pushing anything or signing in.**
5
5
 
6
6
  ```sh
7
- npx @runveric/cli@0.5.1 init --id yourteam/restart-web-tier
7
+ npx @runveric/cli@0.6.0 init --id yourteam/restart-web-tier
8
8
  ```
9
9
 
10
10
  ---
@@ -40,7 +40,7 @@ script outside the platform. Nothing in the product offered that. This does.
40
40
  ## Install
41
41
 
42
42
  ```sh
43
- npx @runveric/cli@0.5.1 <command> # no install
43
+ npx @runveric/cli@0.6.0 <command> # no install
44
44
  npm install -g @runveric/cli # or install the `runveric` bin
45
45
  ```
46
46
 
@@ -63,7 +63,7 @@ Pin the version your Runveric deployment shows you on its Author page rather tha
63
63
  Scaffold a PowerShell action, look at what you got, validate it, and run it locally:
64
64
 
65
65
  ```sh
66
- $ npx @runveric/cli@0.5.1 init restart-web-tier \
66
+ $ npx @runveric/cli@0.6.0 init restart-web-tier \
67
67
  --id acme/restart-web-tier \
68
68
  --interpreter powershell \
69
69
  --yes
@@ -174,39 +174,49 @@ time through the action protocol, with handlers written against
174
174
  commands, so the four verbs keep meaning what they mean.
175
175
 
176
176
  ```sh
177
- npx @runveric/cli@0.5.1 action init action-azure-disk-snapshot --key azure.disk.snapshot --name "Snapshot Disk"
177
+ npx @runveric/cli@0.6.0 action init action-azure-disk-snapshot --key azure.disk.snapshot --name "Snapshot Disk"
178
178
  cd action-azure-disk-snapshot
179
179
  npm install # writes package-lock.json — commit it; the publish workflow runs `npm ci --ignore-scripts`
180
- npm test # type-checks src/, builds dist/index.js, then validate, execute and rollback through `action test`
180
+ npm test # type-checks src/, builds dist/index.js, runs the unit tests — no Azure, no network
181
+ npm run test:live # validate, then a dry-run execute, through `action test` with your own az login
181
182
  ```
182
183
 
183
184
  `action init` writes a repository that builds, tests and publishes with no hand step: `package.json`
184
- (the SDK pinned exactly to the version this CLI was built against; a `typecheck` that `npm test` runs
185
- first — esbuild strips types, so without it a type error would build and publish; a build that bundles
186
- `src/index.ts` and the SDK into the one file the runtime loads, `dist/index.js`), `tsconfig.json`
187
- (strict, against the installed SDK's types), `src/index.ts`
188
- (`defineAction({ validate, execute, rollback })`, whose `execute` makes a restore point durable
189
- before it acts), `catalog.yaml` (an engine `execution`, a beta version, an `azure/arm` target that
190
- depends on its resource group), a test, `README.md`, `.gitignore`, and the catalog's publish workflow
191
- — rendered from the same template, by the same function, as the catalog's own tooling plants it.
192
- The directory defaults to the repository name the key maps to. It never overwrites a file.
185
+ (the SDK pinned exactly to the version this CLI was built against; `test` runs a `typecheck` first —
186
+ esbuild strips types, so without it a type error would build and publish — then a build that bundles
187
+ `src/index.ts` and the SDK into the one file the runtime loads, `dist/index.js`, then `test:unit`, the
188
+ action's own vitest suite; `test:live` runs `action test` against Azure), `tsconfig.json` (strict,
189
+ against the installed SDK's types), `src/index.ts` (`defineAction({ validate, execute, rollback })`,
190
+ whose `execute` makes a restore point durable before it acts), `src/assess.ts` (the one pure function
191
+ that turns what was read into checks) and its unit tests, `catalog.yaml` (an engine `execution`, a beta
192
+ version, an `azure/arm` target that depends on its resource group, and the `checks:` it may raise — every
193
+ refusal and decision code, each decision with the words a requester ticks), `README.md`, `.gitignore`,
194
+ the catalog's publish workflow and a pull-request template with the promotion checklist — rendered from
195
+ the same templates, by the same function, as the catalog's own tooling plants them. The directory
196
+ defaults to the repository name the key maps to. It never overwrites a file.
193
197
 
194
198
  `action test` runs ONE phase of the built `dist/index.js` through the real action runtime and a
195
199
  **local engine**:
196
200
 
197
201
  ```sh
198
202
  runveric action test --phase validate --param resourceGroup=rg-example --param resource=example
199
- runveric action test --phase execute --params-file test/params.json [--dry-run]
203
+ runveric action test --phase validate --params-file test/params.json --expect disk.unreadable
204
+ runveric action test --phase execute --params-file test/params.json [--dry-run] [--decide disk.recentlyChanged]
200
205
  runveric action test --phase rollback --params-file test/params.json --prior-result test/prior-result.json
201
206
  runveric action test --phase execute --params-file test/params.json --azure-token-from-az
202
207
  ```
203
208
 
209
+ Before anything runs, `catalog.yaml` is held to the rules the catalog refuses a manifest for — its
210
+ `checks:` and its one target — by the very functions the platform uses, and every broken rule is named.
204
211
  The invocation is built from `catalog.yaml` and the parameters, with the platform's own functions for
205
212
  the parameter schema and the one target a run names. Every message the action sends is checked by the
206
- protocol's own parsers, every checkpoint is acknowledged, and an execute's success is held to the
207
- engine's rule that a destructive action records a restore point first. It prints the events, the
208
- checks and the outcome, and exits 1 on a protocol violation or a failed outcome. `--prior-result` is
209
- the record an execute prints: the restore point it made and its outcome.
213
+ protocol's own parsers, every checkpoint is acknowledged, every code a validate raises must be one
214
+ `catalog.yaml` declares, and an execute's success is held to the engine's rule that a destructive action
215
+ records a restore point first. It prints the events, the checks and the outcome, and exits 1 on a
216
+ protocol violation or a failed outcome. A validate exits 0 only when no check is still at error — or,
217
+ with `--expect <code>` (repeatable), only when exactly those codes were raised — and says why.
218
+ `--decide <code>` (repeatable) gives an execute or a rollback a requester's recorded decision.
219
+ `--prior-result` is the record an execute prints: the restore point it made and its outcome.
210
220
 
211
221
  **Credentials:** none by default — the action's `ctx.azure` refuses with a sentence saying how to give
212
222
  one. `--azure-token-from-az` hands it ONE token for Azure Resource Manager from your own
@@ -219,8 +229,8 @@ every message again, and the catalog's release workflow verifies and signs the i
219
229
  can run it. Neither happens here, and a local pass does not claim them.
220
230
 
221
231
  Publishing is a tag equal to `catalog.yaml`'s `version`, in two jobs. `build`, which can write nothing,
222
- installs with `npm ci --ignore-scripts` (no dependency's install script runs), type-checks and builds
223
- `dist/index.js`. `publish`, which holds the package write, installs nothing: it builds the image from the
232
+ installs with `npm ci --ignore-scripts` (no dependency's install script runs), type-checks, builds
233
+ `dist/index.js` and runs `npm run test:unit`. `publish`, which holds the package write, installs nothing: it builds the image from the
224
234
  action runtime by digest, pushes it by digest and publishes the catalog artifact. The catalog's release
225
235
  workflow then verifies and signs it.
226
236
 
@@ -234,21 +244,21 @@ publish and verify with these commands:
234
244
 
235
245
  ```sh
236
246
  # one action's manifest, verbatim — stdout: <key>=<repository>@<digest>
237
- npx @runveric/cli@0.5.1 catalog publish-action --manifest catalog.yaml \
247
+ npx @runveric/cli@0.6.0 catalog publish-action --manifest catalog.yaml \
238
248
  --to ghcr.io/<org>/action-azure-vm-stop
239
249
 
240
250
  # an ENGINE action: its manifest and the image its workflow pushed, by digest, to the same package
241
- npx @runveric/cli@0.5.1 catalog publish-action --manifest catalog.yaml \
251
+ npx @runveric/cli@0.6.0 catalog publish-action --manifest catalog.yaml \
242
252
  --to ghcr.io/<org>/action-azure-publicip-delete-unattached \
243
253
  --image ghcr.io/<org>/action-azure-publicip-delete-unattached@sha256:<digest>
244
254
 
245
255
  # a release naming each action artifact by digest — stdout: <repository>@<digest>
246
- npx @runveric/cli@0.5.1 catalog publish-release --from release.yaml --to ghcr.io/<org>/catalog
256
+ npx @runveric/cli@0.6.0 catalog publish-release --from release.yaml --to ghcr.io/<org>/catalog
247
257
 
248
258
  # what the release workflow may sign: each engine action's image, judged by the server's rule
249
259
  # — stdout: one <repository>@<digest> per image that passed
250
- npx @runveric/cli@0.5.1 catalog verify-image --from release.yaml
251
- npx @runveric/cli@0.5.1 catalog verify-image <repository>@<digest> --key <action key> --commit <sha>
260
+ npx @runveric/cli@0.6.0 catalog verify-image --from release.yaml
261
+ npx @runveric/cli@0.6.0 catalog verify-image <repository>@<digest> --key <action key> --commit <sha>
252
262
  ```
253
263
 
254
264
  An action's package must be named after its key (`azure.vm.stop` → `action-azure-vm-stop`); the