mirror of
https://github.com/stablyai/orca.git
synced 2026-10-09 08:02:35 +00:00
Migrate profile state to SQLite and move writes and backups into a background worker. Acknowledge terminal, SSH and automation changes only after durable saves. Preserve JSON import, recovery, rollback and compatibility exports. Validate migration, worker failures, maintenance, cross-profile moves and terminal lifetime races with unit, integration and end-to-end coverage.
30 lines
888 B
TypeScript
30 lines
888 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { eventSchemas } from './telemetry-events'
|
|
|
|
describe('profile state authority telemetry', () => {
|
|
it('accepts the bounded startup selection payload', () => {
|
|
expect(
|
|
eventSchemas.profile_state_authority_selected.safeParse({
|
|
backend: 'sqlite',
|
|
classification: 'json-only',
|
|
authority_mode: 'sqlite-candidate',
|
|
runtime: 'desktop',
|
|
migrated: true
|
|
}).success
|
|
).toBe(true)
|
|
})
|
|
|
|
it('rejects paths or other unbounded diagnostic fields', () => {
|
|
expect(
|
|
eventSchemas.profile_state_authority_selected.safeParse({
|
|
backend: 'sqlite',
|
|
classification: 'sqlite-only',
|
|
authority_mode: 'sqlite-established',
|
|
runtime: 'desktop',
|
|
migrated: false,
|
|
database_path: '/private/profile.sqlite'
|
|
}).success
|
|
).toBe(false)
|
|
})
|
|
})
|