OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Synchronize sleep intervals from connected providers.
Goal
Keep canonical sleep records aligned with upstream provider data.
Context
Triggered by scheduled jobs or manual refresh in health surfaces.
Source Definition
import {
type AnyOperationSpec,
defineCommand,
defineQuery,
} from '@lssm-tech/lib.contracts-spec/operations';
import type { OperationSpecRegistry } from '@lssm-tech/lib.contracts-spec/operations/registry';
import { ScalarTypeEnum, SchemaModel } from '@lssm-tech/lib.schema';
import { HealthSleepRecord } from '../models';
import { HEALTH_TELEMETRY_EVENTS } from '../telemetry';
export const HealthSyncSleep = defineCommand({
meta: {
key: 'health.sleep.sync',
version: '1.0.0',
description: 'Synchronize sleep intervals from connected providers.',
goal: 'Keep canonical sleep records aligned with upstream provider data.',
context:
'Triggered by scheduled jobs or manual refresh in health surfaces.',
owners: ['@platform.integrations'],
tags: ['health', 'sleep', 'wearables'],
stability: 'experimental',
},
io: {
input: HealthSyncSleepInput,
output: HealthSyncSleepOutput,
},
policy: {
auth: 'admin',
},
telemetry: {
success: {
event: { key: HEALTH_TELEMETRY_EVENTS.sleepSynced },
},
failure: {
event: { key: HEALTH_TELEMETRY_EVENTS.sleepSyncFailed },
},
},
});