@rizom/ops 0.2.0-alpha.370 → 0.2.0-alpha.372

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.370",
3
+ "version": "0.2.0-alpha.372",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",
@@ -4,11 +4,11 @@ on:
4
4
  workflow_dispatch:
5
5
  inputs:
6
6
  brain_version:
7
- description: Force one explicit build at this brain version (skips the registry-derived resolve)
7
+ description: Build one Brain version with the full fleet package union
8
8
  required: false
9
9
  type: string
10
10
  site_packages:
11
- description: "Space-separated exact site/theme packages for one explicit image build. Shared-fleet automatic builds derive the version-wide package union from desired state."
11
+ description: "Extra exact site/theme package pins for an explicit build. All builds include the full fleet package union; conflicting pins are rejected."
12
12
  required: false
13
13
  type: string
14
14
  overwrite:
@@ -134,6 +134,9 @@ jobs:
134
134
  echo "Timed out waiting for $IMAGE_TAG" >&2
135
135
  exit 1
136
136
 
137
+ - name: Verify runtime image packages
138
+ run: bun deploy/scripts/verify-runtime-image.ts
139
+
137
140
  - name: Install Kamal
138
141
  run: |
139
142
  gem install --user-install kamal
@@ -30,7 +30,7 @@ The repo also checks in its deploy contract:
30
30
 
31
31
  `.env.schema` is the single source of truth for required and sensitive deploy vars.
32
32
  Use separate GitHub tokens: `CONTENT_REPO_ADMIN_TOKEN` for operator-side content repo creation/checks, and `GIT_SYNC_TOKEN` for runtime directory-sync git access.
33
- The fleet publishes one `brain-${brainVersion}` image per effective Brain version and installs the union of exact site/theme package pins required by instances on that version.
33
+ The fleet publishes one immutable `brain-${brainVersion}` image per effective Brain version. New images install the exact site/theme package union across the entire fleet, so smoke-to-fleet promotion reuses the tested image. Build and Deploy verify installed package versions before reusing existing images.
34
34
  When an effective brain version (`pilot.yaml.brainVersion`, or a cohort override) changes and you push, CI builds every missing version image, refreshes generated user env files, and redeploys affected users. Every external site and theme package keeps its own exact version pin; change that package set only together with a fresh Brain version so published tags remain immutable.
35
35
  When a push changes only deploy contract files, CI prints `No affected user configs; skipping deploy.` and stops before Kamal.
36
36
 
@@ -0,0 +1,18 @@
1
+ import { loadPilotRegistry } from "@rizom/ops";
2
+ import {
3
+ requireEnv,
4
+ runtimeImageTag,
5
+ sitePackagesFor,
6
+ verifyRuntimeImage,
7
+ } from "@rizom/ops/deploy";
8
+
9
+ const handle = requireEnv("HANDLE");
10
+ const registry = await loadPilotRegistry(process.cwd());
11
+ const user = registry.users.find((entry) => entry.handle === handle);
12
+ if (!user) throw new Error(`Unknown fleet handle: ${handle}`);
13
+
14
+ await verifyRuntimeImage(`ghcr.io/${requireEnv("GITHUB_REPOSITORY")}`, {
15
+ tag: runtimeImageTag(user.brainVersion),
16
+ brainVersion: user.brainVersion,
17
+ sitePackages: sitePackagesFor(user.siteOverride),
18
+ });
@@ -19,7 +19,7 @@ The deploy scripts and workflows should read from that contract instead of inven
19
19
  The fleet has one image topology:
20
20
 
21
21
  - one immutable `brain-${brainVersion}` image is published for each effective Brain version
22
- - each image contains the union of exact site/theme package pins required by instances on that version
22
+ - every new image contains the union of exact site/theme package pins across the whole fleet, regardless of current Brain versions
23
23
  - conflicting versions of one package fail image resolution before build
24
24
  - generated `users/<handle>/.env` carries `BRAIN_VERSION=<brainVersion>`
25
25
  - build and deploy derive the same effective image tag from the resolved registry
@@ -28,7 +28,7 @@ The fleet has one image topology:
28
28
 
29
29
  When `pilot.yaml.brainVersion` changes and you push:
30
30
 
31
- 1. build publishes each missing version image with its declared package union
31
+ 1. build publishes each missing version image with the full fleet package union, and verifies existing images against their assigned instances
32
32
  2. reconcile refreshes generated `users/<handle>/.env`
33
33
  3. deploy runs for handles whose generated config changed
34
34
  4. generated file commits happen once in a final aggregation step after the deploy matrix finishes
@@ -37,6 +37,19 @@ Every external site and theme package has its own exact version pin. A cohort or
37
37
  pilot brain-version bump never changes those package versions implicitly; update each
38
38
  pin deliberately from reviewed package and image evidence.
39
39
 
40
+ Smoke-first upgrades build the full fleet package union before promotion. Moving
41
+ other cohorts onto the tested Brain version then reuses that same immutable image.
42
+ Explicit Build dispatches also include the fleet union; `site_packages` only adds
43
+ extra pins and cannot replace or conflict with declared pins.
44
+
45
+ Deploy verifies the actual installed Brain and selected instance's site/theme
46
+ versions on the CI runner after image readiness and before provisioning or
47
+ container replacement. It reads manifests in a read-only, network-disabled
48
+ container without starting the Brain or mounting fleet data. Missing packages,
49
+ wrong versions, or verification failures block deployment, even on manual runs.
50
+ Never bypass this gate or overwrite a deployed tag to recover an older incomplete
51
+ image; review artifact recovery separately.
52
+
40
53
  When a push changes only deploy contract files and no generated `users/<handle>/.env` or `users/<handle>/brain.yaml` files, the deploy workflow exits through its explicit no-op path and prints `No affected user configs; skipping deploy.`
41
54
 
42
55
  They are scaffolded from `@rizom/ops`, then versioned in this repo like any other deploy contract.