@intentius/behold 0.29.50 → 0.29.52

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/AGENTS.md CHANGED
@@ -1275,6 +1275,58 @@ and the strip says which chant adds points. A public view refuses the route.
1275
1275
  `BEHOLD_TEST_CHANT_BIN` names one; src/__fixtures__/decision-points/ is
1276
1276
  chant 0.124.31's output for it.
1277
1277
 
1278
+ ## Runtime health and rotation (#825)
1279
+
1280
+ `GET /api/health?env=<env>` (src/health-overlay.ts) reads `chant lifecycle
1281
+ health <env> --json` (chant#4177, floor `HEALTH_CHANT_FLOOR`, 0.124.33, read
1282
+ "runtime health") once per chant project: the served project, or each chant
1283
+ member of a workspace or an estate in its own directory with its own chant,
1284
+ ids composed `<member>/<id>`. The read is the reader's `readHealth`
1285
+ (src/workspace-reader.ts). Its document is `chant-health/v1`, not a contract 1
1286
+ document, so it is checked against chant's schema, vendored unchanged in
1287
+ src/health-schema/ (chant PR #4193 at d727944c4) and validated with ajv, with
1288
+ a hole's `reason` loosened to any string; a document the schema refuses is
1289
+ refused whole. A project with no lexicon that reads health is `none`, not a
1290
+ failure. A member below the floor is refused before anything is spawned; when
1291
+ every member is, the answer carries the refusal and `degraded`.
1292
+
1293
+ The answer is `nodes` (per id: `healthy`, `unhealthy` or `unknown` with
1294
+ chant's `detail`, `observedAt` and `checkedAt`; `unobserved` with chant's
1295
+ `reason`; or `absent`), `rotation`, `members` and `counts`. Rotation is
1296
+ behold's (src/runtime-health.ts, `rotationOf`): a Route 53 record whose
1297
+ `HealthCheckId` edge (or `$ref` attribute) names a declared check is out of
1298
+ rotation only when that check is unhealthy, in rotation when it is healthy,
1299
+ and `inRotation: null` with the reason in words otherwise. The edges come
1300
+ from each member's cached source graph (`memberIr` at detail 2). The answer
1301
+ is cached per environment for 30 s, `?fresh=1` reads again, and `POST
1302
+ /api/refresh` drops it. A public view refuses the route (it reads the live
1303
+ estate with behold's credentials), and `behold export` captures it once per
1304
+ environment. The page (web/health-marks.js) draws a tag under each card, a
1305
+ solid ring on an unhealthy one and a dashed ring on a hole, dims a record out
1306
+ of rotation with its edges, counts the states in the Model tab and shows the
1307
+ detail in the inspect pane. It never changes a card's fill.
1308
+ `src/__fixtures__/health/` was recorded from chant main at cd9a90716 against
1309
+ a floci whose health checks probe (lex00/floci#259); src/runtime-health.test.ts
1310
+ names each file's provenance. A multi-stack document (a project that declares
1311
+ `stacks`) is keyed `<member>/<stack>::<name>` (#824), the ids chant's live
1312
+ overlay gives that project's nodes.
1313
+
1314
+ ## The three-cloud demo (#824)
1315
+
1316
+ `example-three-cloud` is a chant workspace (`dns`, `aws`, `azure`, `gcp`) on
1317
+ floci, floci-az and floci-gcp; docs/src/content/docs/using/three-cloud.mdx is
1318
+ its page. `behold demo three-cloud` runs `scripts/emulators-up.sh` (the
1319
+ emulators under chant's own container names, with the Docker socket, floci-az
1320
+ running Container Apps unmocked), then serves with `--local --env local`.
1321
+ `--local` on a workspace boots every chant member's emulators
1322
+ (`emulatorDirs`/`emulatorsUp` in src/emulator.ts), not the first member's, and
1323
+ tears down the same set. The `front-door` Op (`dns/ops/front-door.op.ts`)
1324
+ runs `scripts/front-door.ts`: apply all four, deactivate the Azure revision,
1325
+ wait for `azureCheck` to read unhealthy, then `behold export --open-env local
1326
+ --open-zoom composites --note …`. `--note` (`settleNote` in src/export.ts) is
1327
+ one line under 200 characters, written to the manifest as `note` and drawn at
1328
+ the foot of a static page by web/export-note.js, backticked spans as code.
1329
+
1278
1330
  ## Invariant
1279
1331
 
1280
1332
  If a request would have behold write to a cloud or to source directly, it's wrong.
package/demos.json CHANGED
@@ -129,6 +129,21 @@
129
129
  "terralith": true
130
130
  }
131
131
  },
132
+ {
133
+ "name": "three-cloud",
134
+ "description": "A website in three clouds behind Route 53: ECS on Fargate, Azure Container Apps and Cloud Run, each answering through a latency record guarded by a health check, as one chant workspace on the floci, floci-az and floci-gcp emulators. Turn Azure off and its record drops out of rotation; dns/ops/front-door.op.ts (or npm run front-door) applies it all, does that, and exports the page. Pulls three emulator images on first run.",
135
+ "source": "bundled",
136
+ "dir": "example-three-cloud",
137
+ "requires": [
138
+ "docker",
139
+ "curl"
140
+ ],
141
+ "setup": "bash scripts/emulators-up.sh",
142
+ "serve": {
143
+ "local": true,
144
+ "env": "local"
145
+ }
146
+ },
132
147
  {
133
148
  "name": "fountain",
134
149
  "description": "The mature estate: self-hosted fountain (a real app) on a throwaway k3d cluster — tiers (try the ha tier picker), seams, drift, runtime Pods. Clones INTENTIUS/fountain-ops; ~5 minutes, mostly image pulls. `just down` in the clone removes the cluster.",