@rizom/ops 0.2.0-alpha.29 → 0.2.0-alpha.291

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.
Files changed (59) hide show
  1. package/README.md +39 -2
  2. package/dist/brains-ops.js +404 -314
  3. package/dist/cert-bootstrap.d.ts +3 -1
  4. package/dist/content-repo-ref.d.ts +10 -0
  5. package/dist/content-repo.d.ts +1 -0
  6. package/dist/deploy.js +99 -166
  7. package/dist/directory-sync-stress-system.d.ts +74 -0
  8. package/dist/directory-sync-stress.d.ts +106 -0
  9. package/dist/entries/deploy.d.ts +3 -2
  10. package/dist/images.d.ts +79 -0
  11. package/dist/index.d.ts +7 -0
  12. package/dist/index.js +479 -298
  13. package/dist/legacy-pilot-migration.d.ts +11 -0
  14. package/dist/load-registry.d.ts +57 -6
  15. package/dist/observed-status.d.ts +1 -1
  16. package/dist/origin-ca.d.ts +1 -1
  17. package/dist/parse-args.d.ts +2 -10
  18. package/dist/preview-domain.d.ts +9 -0
  19. package/dist/push-secrets.d.ts +2 -9
  20. package/dist/push-target.d.ts +1 -2
  21. package/dist/reconcile-dry-run.d.ts +9 -0
  22. package/dist/run-command.d.ts +12 -3
  23. package/dist/run-subprocess.d.ts +1 -6
  24. package/dist/schema.d.ts +114 -162
  25. package/dist/secrets-encrypt.d.ts +7 -13
  26. package/dist/ssh-key-bootstrap.d.ts +1 -26
  27. package/dist/stage-legacy-crossover.d.ts +20 -0
  28. package/dist/stress-command.d.ts +14 -0
  29. package/dist/stress-git-checkout.d.ts +21 -0
  30. package/dist/stress-health-monitor.d.ts +46 -0
  31. package/dist/upgrade.d.ts +10 -0
  32. package/dist/user-add.d.ts +15 -0
  33. package/dist/verify-user.d.ts +22 -0
  34. package/package.json +47 -42
  35. package/templates/rover-pilot/.env.schema +24 -3
  36. package/templates/rover-pilot/.github/actions/varlock-env/action.yml +47 -0
  37. package/templates/rover-pilot/.github/workflows/build.yml +70 -17
  38. package/templates/rover-pilot/.github/workflows/deploy.yml +74 -61
  39. package/templates/rover-pilot/.github/workflows/directory-sync-stress.yml +119 -0
  40. package/templates/rover-pilot/.github/workflows/reconcile.yml +10 -4
  41. package/templates/rover-pilot/.github/workflows/upgrade.yml +104 -0
  42. package/templates/rover-pilot/README.md +16 -6
  43. package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +80 -24
  44. package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
  45. package/templates/rover-pilot/deploy/scripts/install-health-watchdog.ts +144 -0
  46. package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +12 -3
  47. package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
  48. package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +44 -9
  49. package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +51 -47
  50. package/templates/rover-pilot/deploy/scripts/update-dns.ts +14 -4
  51. package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +12 -1
  52. package/templates/rover-pilot/docs/canonical-crossover-record.md +104 -0
  53. package/templates/rover-pilot/docs/onboarding-checklist.md +28 -17
  54. package/templates/rover-pilot/docs/operator-playbook.md +259 -29
  55. package/templates/rover-pilot/docs/user-onboarding.md +47 -462
  56. package/templates/rover-pilot/pilot.yaml +3 -4
  57. package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
  58. package/templates/rover-pilot/deploy/Dockerfile +0 -30
  59. package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -40
package/README.md CHANGED
@@ -5,20 +5,57 @@ Operator CLI package for managing pilot brain fleet registry repos.
5
5
  ## Commands
6
6
 
7
7
  - `brains-ops init <repo>`
8
- - `brains-ops render <repo>` — regenerates `views/users.md` and fills status columns from built-in live probes (`DNS`, `/health`, unauthenticated `/mcp`)
9
- - `brains-ops onboard <repo> <handle>`
8
+ - `brains-ops crossover:stage <source-repo> <output-dir> [site-pins.yaml]` — creates a separate secret-free canonical review copy without mutating the source; a reviewed pins file is required when hosted site overrides exist
9
+ - `brains-ops render <repo>` — regenerates `views/users.md` and fills status columns from built-in live probes (`DNS`, `/health/ready`, unauthenticated `/mcp`)
10
+ - `brains-ops user:add <repo> <handle> --cohort <cohort>` — scaffolds a user file, per-user secrets template, and cohort membership
11
+ - `brains-ops onboard <repo> <handle>` — creates/seeds the user's content repo using `CONTENT_REPO_ADMIN_TOKEN` for GitHub repo administration and `GIT_SYNC_TOKEN` for git clone/push
10
12
  - `brains-ops age-key:bootstrap <repo>`
11
13
  - `brains-ops ssh-key:bootstrap <repo>`
12
14
  - `brains-ops cert:bootstrap <repo>`
13
15
  - `brains-ops secrets:push <repo>`
14
16
  - `brains-ops secrets:encrypt <repo> <handle>`
17
+ - `brains-ops verify-user <repo> <handle>` — checks `/health/operate`, unauthenticated `/mcp`, and site-enabled browser/CMS routes
18
+ - `brains-ops stress:directory-sync <repo> <handle> --profile <regression|load|stress> --confirm stress:<handle>` — runs a smoke-only, reversible directory-sync workload and writes structured evidence
19
+ - `brains-ops stress:directory-sync:verify-access <repo> <handle> --confirm stress:<handle>` — clones the smoke content repository and verifies push authorization with `git push --dry-run`, without creating a ref or starting a workload
20
+ - `brains-ops stress:directory-sync:cleanup <repo> <handle> --confirm stress:<handle>` — idempotently removes residual stress probes
15
21
  - `brains-ops reconcile-cohort <repo> <cohort>`
16
22
  - `brains-ops reconcile-all <repo>`
23
+ - `brains-ops reconcile-all <repo> --dry-run` — reconciles an isolated copy twice with external content-repository access blocked, lists both passes' changed files, and requires second-pass zero drift
24
+
25
+ `render` owns the observational `views/users.md` projection. Onboard and reconcile commands own generated per-user config and never rewrite live observed status in that view.
26
+
27
+ ## Directory-sync stress profiles
28
+
29
+ Directory-sync stress is deliberately smoke-only. The handle, domain, and content repository must each identify smoke, and the operator must pass the exact `stress:<handle>` confirmation. The runner refuses production-like targets. The smoke user must also declare the hermetic posture below; reconcile and deploy it before running the workload:
30
+
31
+ ```yaml
32
+ embeddingEnabled: false
33
+ topicExtractionEnabled: false
34
+ ```
35
+
36
+ - `regression`: add 20 files, update all 20, then delete them;
37
+ - `load`: ramp through 50, 150, and 350 files, update 350, rename 100, update again, then delete all probes;
38
+ - `stress`: continue the same deterministic ramp to 700 files and 200 renames.
39
+
40
+ Each run creates a rollback branch, gates on health failures during the monitored workload window, preserves warmup and cleanup health samples as evidence without poisoning that gate, samples container CPU/memory/PIDs, detects watchdog restarts even when Docker's restart counter remains zero, rejects external AI usage, waits for Git and entity persistence, and always attempts cleanup. JSON, Markdown, runtime logs, and samples are written under `.brains-ops/stress/` unless `--artifacts-dir` is supplied. The scaffolded `Directory Sync Stress` workflow runs a weekly regression and supports manual profiles. Its manual `verify_only` mode exercises the Bitwarden/Varlock content credential path through clone and a dry-run push, skips the workload, and does not schedule cleanup. Workload runs retain a separate `always()` cleanup job. Successful idempotent cleanup also prunes retained stress backup branches; branches remain available when probes remain for recovery. The workflow never deploys or targets a non-smoke user.
17
41
 
18
42
  ## Scope
19
43
 
20
44
  `brains-ops` lives in the `brains` monorepo and is consumed as a separate package.
21
45
 
46
+ The active loader accepts one unversioned canonical schema. Legacy parsing is isolated to the temporary `crossover:stage` command and is never used by render, verify, or reconciliation paths.
47
+
48
+ Crossover staging excludes source `.git`, `.operator`, `.brains-ops`, `.turbo`, `dist`, `node_modules`, plaintext `.env`/`.env.local`, and `*.secrets.yaml` artifacts. It generates fresh per-user `.env` selector files in the review copy without copying source secret values. Hosted sites must be enumerated in a separate reviewed file; staging rejects missing, extra, or identity-mismatched pins instead of inferring versions:
49
+
50
+ ```yaml
51
+ sites:
52
+ example:
53
+ package: "@rizom/site-example"
54
+ version: 0.2.0-alpha.1
55
+ theme: "@rizom/theme-example"
56
+ themeVersion: 0.2.0-alpha.1
57
+ ```
58
+
22
59
  It operates on a separate private data repo, such as `rover-pilot/`, which stores:
23
60
 
24
61
  - `pilot.yaml`