Reliability
This page lists what can go wrong in an org-os instance and which check, if any, catches it. Each check below is a script or a workflow in this repository; where a failure mode has no check, the page says so.
Failure modes
- Data integrity — missing or malformed required files,
federation.yamlsections,.well-known/*.json, and identity files that disagree withfederation.yaml. Since 0.6,validate:datachecks eachdata/*.yamlregistry the admin knows against its JSON Schema, andvalidate:governancechecks the rules and the git history against them (see Data model); both needpackages/admin’s dependencies and run from the framework. Nothing validatesdashboard.yaml. - Agent runtime correctness —
/initialize,/closeand the scripts they call produce broken or stub output. Only the unit tests undertests/cover this; there is no runtime monitor. - Federation drift — an instance falls out of line with the framework (skills, packages, data registries,
framework_version). - Script divergence — instance scripts drift silently from the framework’s.
- Recovery — corruption, failed sync, broken migration, lost untracked content.
Trigger layers
| Layer | When | Checks |
|---|---|---|
| Manual | Operator on demand | npm run selftest (see below) |
| Pre-commit | Local commit, after npm run install:hooks | validate:structure always; validate:schemas if a data/*.yaml file is staged, and then validate:data and validate:governance as warnings only (never blocking), where their scripts exist. In a linked worktree with no node_modules it skips every check and says so. vault:audit is not part of it. |
| Pre-push | Local push, same installer | Refuses to push agent/* branches |
| CI | Push to main or release/**; pull request to main | .github/workflows/validate.yml (30-minute limit, full-depth checkout): validate:structure, validate:schemas, validate:data, validate:governance (with CI=true a commit that went around the rules is an error), analyze:instances, npm test, selftest (which includes check:divergence), test:admin, the site build and tests, a docs drift report that never blocks and is written to the run summary, and version:check |
| Scheduled | Weekly, Sunday 04:00 UTC | .github/workflows/drift.yml: analyze:instances, then commits any new report in memory/reports/ |
| Pre-destructive | Before a risky git operation | vault:snapshot (tracked files only; protect untracked notes first), run by the operator (see VAULT-SAFETY.md); vault:audit afterwards |
npm run install:hooks installs .github/hooks/pre-commit.sh and scripts/git-hooks/pre-push into the live hooks directory, once per clone; it does not overwrite a hook whose content differs unless run with --force. scripts/operator-setup.sh sets core.hooksPath to scripts/hooks; install:hooks resolves the hooks directory through git, so on a clone set up that way it targets scripts/hooks/, finds the main-blocking pre-commit there (different content) and refuses without --force. A separate hook, scripts/hooks/pre-commit, blocks commits to main for multi-operator clones; scripts/operator-setup.sh installs it. Another workflow, generate-schemas.yml, regenerates .well-known/ daily.
Federation drift
npm run analyze:instances reads data/instances.yaml (present only in the framework repository) and inspects each instance cloned locally. It lists, per instance, drift items such as not_cloned_locally, local_path_missing, missing_masterplan, missing_federation_yaml, framework_version_mismatch, undeclared_skill, unmapped_skill, unmapped_package and undeclared_data_registry. It writes memory/reports/instances-drift-YYYY-MM-DD.md and always exits 0: drift is informational, so the weekly job and the CI step cannot fail on it. --json prints the report instead of writing it.
There are no age thresholds. Nothing computes healthy, drifted or dormant from last_sync or from how many minors an instance is behind.
Script divergence
npm run check:divergence compares each of the framework’s scripts/*.mjs and *.js files with the same-named file in each instance, by md5. Instances come from data/instances.yaml (sibling directories that have a scripts/ folder) or from --instances "path1,path2"; --script <name> limits it to one script. It prints a result and never modifies files; with no instances found it says so and exits 0.
- IDENTICAL — instance on canonical version
- DIVERGES — local variant (intentional override, drift, or known divergence per
docs/SKILL-PROMOTION.md) - MISSING — script not present in that instance (instance hasn’t opted into the canonical pipeline)
The operator resolves divergences by hand. There is no merge tooling.
Recovery runbook
Data corruption
npm run validate:dataflags a registry that breaks its schema;npm run validate:schemasflags.well-known/and identity problemsgit log -- data/<file>.yamlfinds last good versiongit checkout <sha> -- data/<file>.yaml- Re-run validators to confirm
Failed sync (sync:upstream or sync:packages)
sync:upstreamrefuses to run on a dirty working tree, and refuses (exit 2) when a.sync-freezefile is present. It fetches and rebases onto the framework’smain, then runs the migrations,sync:packagesand the two validators. A failure leaves the git state (a rebase in progress, partly written files) for you to inspect.sync:packagescopies enabled packages and warns about disabled ones; it deletes them only with--prune.--drywrites nothing.- Fix the root cause and re-run. If the lineage stamp in
federation.yamlis corrupted, restore it fromgit log -p federation.yaml.
Broken migration
npm run migrateruns the scripts inscripts/migrations/from the instance’sframework_versionup topackage.json’s version or--target <version>(--drylists them). On the 0.x line that means the twov0.5-to-v0.6-…migrations; the two with legacy numbers never run on a 0.x instance. See Versioning. Each is written to be idempotent, so re-running should be safe- The v3 to v3.5 migration and both 0.6 migrations log to
memory/migrations-YYYY-MM-DD.md; the v2 to v3 migration does not - Roll back by reverting the commit, then fix the migration
Lost untracked content
- See the seven-layer recovery runbook in VAULT-SAFETY.md (snapshot refs → stash trees → Syncthing → dangling blobs → reflog → agent worktrees → OS backups)
Lost work (detached HEAD)
git reflog --date=isolists every HEAD position with timestampgit branch recover-<reason> <sha>to anchor before checking out
Self-test surface
npm run selftest (scripts/selftest.mjs) runs these checks in order:
validate:structure— must pass.validate:schemas—.well-known/*.jsonstructure (and, with adaoURI, the standards schemas and leak scan),IDENTITY.mdagainstfederation.yaml, theframework_versionand lineage stamp shape. Skipped if its script is missing.validate:dataandvalidate:governance— skipped, with the install command, whenpackages/adminhas nonode_modules; skipped as optional where the script is absent (an instance).analyze:instances— framework repository only (skipped wheredata/instances.yamlis absent). Writes the drift report; it cannot fail on drift.check:divergence— advisory; skippable with--skip divergence.- Berd skills mirror in sync (
sync-skills-berd.mjs --check) — framework repository only. clone:framework --dryagainsttests/fixtures/instance-config.yaml, into a temporary directory — skipped if the script is missing.node --test tests/**/*.test.mjs.test:admin— skipped, with the install command, ifpackages/adminor its dependencies are absent.
A check whose script does not exist, or that does not apply to an instance, is reported as skipped rather than failed. --verbose shows each check’s output; --skip a,b skips by key (divergence, berd, clone, tests, admin).
A failed check reports the names of the failing tests when its output has them (vitest and node --test; scripts/lib/test-failures.mjs), else its last lines. Exit code 0: all green. 1: at least one failure. 2: warnings only.
CI failure handling
- Pre-commit failures are bypassable with
git commit --no-verify; do it only with the operator’s explicit say-so - Fix the root cause of a CI failure rather than disabling the check (whether a failure blocks merge depends on the repository’s branch protection, which is not in the repo)
- The scheduled job commits each new drift report by itself; read them, since nothing else surfaces drift
Version triplet sanity
npm run version:check (scripts/update-version.mjs --check) confirms that these agree on major.minor:
package.jsonversionfederation.yamlmetadata.framework_version- the most recent
[X.Y.Z]heading inCHANGELOG.md - the
**Framework Version:**line inVERSION.md, if present - the
**Version:**header inMASTERPLAN.md, if present
It exits 1 with a diff on a mismatch and changes no file. CI runs it. validate:structure also compares package.json with framework_version (except on a 0.x instance version) and warns when CHANGELOG.md has no heading for the current version.