mirror of
https://github.com/bunny-lab-io/Borealis.git
synced 2025-12-14 22:35:47 -07:00
2.1 KiB
2.1 KiB
Assemblies Runtime Reference
Database Layout
- Three SQLite databases live under
Data/Engine/Assemblies(official.db,community.db,user_created.db) and mirror toEngine/Assembliesat runtime. - Automatic JSON → SQLite imports for the official domain have been retired; the staged
official.dbnow serves as the authoritative store unless you invoke a manual sync. - Payload binaries/json store under
Payloads/<payload-guid>in both staging and runtime directories; the AssemblyCache references payload GUIDs instead of embedding large blobs. - WAL mode with shared-cache is enabled on every connection; queue flushes copy the refreshed
.db,-wal, and-shmfiles into the runtime mirror. AssemblyCache.describe()reveals dirty/clean state per assembly, helping operators spot pending writes before shutdown or sync operations.
Dev Mode Controls
- User-created domain mutations remain open to authenticated operators; community/official writes require an administrator with Dev Mode enabled.
- Toggle Dev Mode via
POST /api/assemblies/dev-mode/switchor the Assemblies admin controls; state expires automatically based on the server-side TTL. - Privileged actions (create/update/delete, cross-domain clone, queue flush, official sync, import into protected domains) emit audit entries under
Engine/Logs/assemblies.log. - When Dev Mode is disabled, API responses return
dev_mode_requiredto prompt admins to enable overrides before retrying protected mutations.
Backup Guidance
- Regularly snapshot
Data/Engine/AssembliesandData/Engine/Assemblies/Payloadsalongside the mirrored runtime copies to preserve both metadata and payload artifacts. - Include the queue inspection endpoint (
GET /api/assemblies) in maintenance scripts to verify no dirty entries remain before capturing backups. - Maintain the staged databases directly; to publish new official assemblies copy the curated
official.dbintoData/Engine/Assembliesbefore restarting the Engine. - Future automation will extend to scheduled backups and staged restore helpers; until then, ensure filesystem backups capture both SQLite databases and payload directories atomically.