@rizom/ops 0.2.0-alpha.265 → 0.2.0-alpha.266

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/dist/schema.d.ts CHANGED
@@ -10,6 +10,18 @@ export declare const canonicalBundleIdSchema: z.ZodEnum<{
10
10
  team: "team";
11
11
  }>;
12
12
  export type CanonicalBundleId = z.output<typeof canonicalBundleIdSchema>;
13
+ /**
14
+ * The profile kinds the runtime's profile plugin registers. A user config
15
+ * selecting anything else composes a brain that fails at boot, so reject it
16
+ * at parse time. Kept in lockstep with @brains/profile BUILT_IN_PROFILE_KINDS
17
+ * by a test. Collective/organization brains use "organization".
18
+ */
19
+ export declare const PROFILE_KINDS: readonly ["professional", "team", "organization"];
20
+ export declare const profileKindSchema: z.ZodEnum<{
21
+ professional: "professional";
22
+ team: "team";
23
+ organization: "organization";
24
+ }>;
13
25
  export interface PilotConfig {
14
26
  brainVersion: string;
15
27
  bundles: CanonicalBundleId[];
@@ -105,7 +117,7 @@ export declare const userSchema: z.ZodObject<{
105
117
  domainOverride: z.ZodOptional<z.ZodString>;
106
118
  cloudflareZoneId: z.ZodOptional<z.ZodString>;
107
119
  contentRepoOverride: z.ZodOptional<z.ZodString>;
108
- profileKind: z.ZodOptional<z.ZodString>;
120
+ profileKind: z.ZodOptional<typeof profileKindSchema>;
109
121
  addOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
122
  removeOverride: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
123
  siteOverride: z.ZodOptional<typeof siteOverrideSchema>;
@@ -0,0 +1,14 @@
1
+ export interface StressCommandOptions {
2
+ cwd?: string;
3
+ env?: NodeJS.ProcessEnv;
4
+ stdin?: string;
5
+ }
6
+ export interface StressCommandResult {
7
+ exitCode: number;
8
+ stdout: string;
9
+ stderr: string;
10
+ }
11
+ export type StressCommandRunner = (command: string, args: readonly string[], options?: StressCommandOptions) => Promise<StressCommandResult>;
12
+ export declare const runStressCommand: StressCommandRunner;
13
+ export declare function requireCommand(runner: StressCommandRunner, command: string, args: readonly string[], options?: StressCommandOptions): Promise<StressCommandResult>;
14
+ export declare function commandError(command: string, args: readonly string[], result: StressCommandResult): Error;
@@ -0,0 +1,21 @@
1
+ import { type StressCommandResult, type StressCommandRunner } from "./stress-command";
2
+ /**
3
+ * Git operations against one content-repo checkout, executed through a
4
+ * stress command runner with token-bearing credentials.
5
+ */
6
+ export declare class GitCheckout {
7
+ #private;
8
+ readonly dir: string;
9
+ constructor(runner: StressCommandRunner, dir: string, token: string);
10
+ /** Clone `repository`'s main branch into `dir` and pin it to origin/main. */
11
+ static clone(runner: StressCommandRunner, repository: string, dir: string, token: string): Promise<GitCheckout>;
12
+ run(args: readonly string[], required?: boolean): Promise<StressCommandResult>;
13
+ output(args: readonly string[]): Promise<string>;
14
+ sync(hardReset?: boolean): Promise<void>;
15
+ /** Stage everything and commit as the ops identity. */
16
+ commitAll(message: string): Promise<void>;
17
+ pushMainWithRebase(): Promise<void>;
18
+ /** Delete every remote stress backup branch; returns the deleted names. */
19
+ pruneStressBackupBranches(): Promise<string[]>;
20
+ private environment;
21
+ }
@@ -0,0 +1,46 @@
1
+ import type { FetchLike } from "@brains/deploy-support/origin-ca";
2
+ import { type StressHealthSample, type StressRuntimeSample } from "./directory-sync-stress";
3
+ export interface HealthPayload {
4
+ version: string;
5
+ entities: number;
6
+ entityCounts: {
7
+ entityType: string;
8
+ count: number;
9
+ }[];
10
+ }
11
+ export declare function noteCount(payload: HealthPayload): number;
12
+ export interface StressHealthMonitorOptions {
13
+ domain: string;
14
+ fetchImpl: FetchLike;
15
+ now: () => Date;
16
+ sleep: (milliseconds: number) => Promise<void>;
17
+ /** Take one runtime sample (e.g. docker stats over SSH), if available. */
18
+ sampleRuntime: () => Promise<StressRuntimeSample | undefined>;
19
+ }
20
+ /**
21
+ * Samples deployment health and runtime resource usage during a stress run,
22
+ * and answers entity-baseline waits against the operational health endpoint.
23
+ */
24
+ export declare class StressHealthMonitor {
25
+ #private;
26
+ constructor(options: StressHealthMonitorOptions);
27
+ /** ISO timestamp of the most recent start() call. */
28
+ get startedAt(): string;
29
+ /** The first sampling failure since start(), if any. */
30
+ get error(): unknown;
31
+ get healthSamples(): readonly StressHealthSample[];
32
+ get runtimeSamples(): readonly StressRuntimeSample[];
33
+ /** Health samples between start() and markGateEnd() (or now). */
34
+ gateHealthSamples(): StressHealthSample[];
35
+ /** Exclude samples taken after this point from the gate window. */
36
+ markGateEnd(): void;
37
+ /** Probe optional health endpoints and add responsive ones to the loop. */
38
+ discoverEndpoints(): Promise<void>;
39
+ start(): void;
40
+ /** Stop sampling and wait for the loops; a loop error stays on `error`. */
41
+ stop(): Promise<void>;
42
+ waitForHealthSnapshot(timeoutMs: number): Promise<HealthPayload | undefined>;
43
+ waitForEntityBaseline(expectedNotes: number | undefined, expectedEntities: number | undefined, timeoutMs: number): Promise<HealthPayload | undefined>;
44
+ waitForStableEntityBaseline(expectedNotes: number | undefined, expectedEntities: number | undefined, timeoutMs: number): Promise<HealthPayload | undefined>;
45
+ fetchHealthPayload(): Promise<HealthPayload | undefined>;
46
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.265",
3
+ "version": "0.2.0-alpha.266",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",
@@ -23,6 +23,7 @@
23
23
  "devDependencies": {
24
24
  "@brains/deploy-support": "workspace:*",
25
25
  "@brains/eslint-config": "workspace:*",
26
+ "@brains/profile": "workspace:*",
26
27
  "@brains/site-composition": "workspace:*",
27
28
  "@brains/typescript-config": "workspace:*",
28
29
  "@brains/utils": "workspace:*",
@@ -11,6 +11,11 @@ on:
11
11
  description: 'Space-separated site packages for a per-instance site image (e.g. "@rizom/site-rizom-ai@0.2.0-alpha.148"). Empty builds the default fleet image.'
12
12
  required: false
13
13
  type: string
14
+ overwrite:
15
+ description: Rebuild an existing tag in place. Published tags are immutable; confirm only when replacing a tag whose containers were never deployed.
16
+ required: false
17
+ type: boolean
18
+ default: false
14
19
  push:
15
20
  branches: ["main"]
16
21
  paths:
@@ -54,6 +59,7 @@ jobs:
54
59
  env:
55
60
  BRAIN_VERSION_INPUT: ${{ inputs.brain_version || '' }}
56
61
  SITE_PACKAGES_INPUT: ${{ inputs.site_packages || '' }}
62
+ ALLOW_TAG_OVERWRITE: ${{ inputs.overwrite && 'true' || 'false' }}
57
63
  run: bun deploy/scripts/resolve-missing-images.ts
58
64
 
59
65
  no_builds: