SACE

Schema

Single source of truth. Postgres tables, Zod types, JSON Schema.

sace_observations

Observations (Ring Buffer)

The dashcam. Modality-specific small-language-model output is buffered with a TTL. Most observations expire without ever being promoted.

export const SaceObservationsSchema = z.object({
  id: z.string(),
  subject_id: z.string(),
  modality: z.enum([...]),
  payload: z.record(...),
  salience_hint: z.number(),
  captured_at: z.string(),
  expires_at: z.string(),
  promoted: z.boolean(),
  promoted_at: z.nullable(...),
  expired: z.boolean(),
  expiry_reason: z.nullable(...),
  created_at: z.string(),
  updated_at: z.string(),
});