{
  "manifestVersion": 1,
  "name": "work-activity",
  "table": "work_activities",
  "description": "An append-only, user-facing entry on a subject's work timeline. Its vocabulary is closed -- task_created, task_completed, task_cancelled, note -- and it is written only inside the transaction of the action that caused it. It is NOT a projection of the audit log: audit and trace stay the technical record of every write, and this is the curated semantic one. It stores no provider payload, no attachment, no email body and no chat message; the only free text is a bounded, control-character-free note body. taskId is a plain indexed string rather than a reference field because managed fields cannot be references, and because a timeline entry must survive being read beside a subject the database cannot join to.",
  "fields": [
    { "name": "sourceKey", "type": "string", "unique": true, "writable": "managed" },
    { "name": "kind", "type": "enum", "values": ["task_created", "task_completed", "task_cancelled", "note"], "index": true, "writable": "managed" },
    { "name": "subjectResource", "type": "string", "index": true, "writable": "managed" },
    { "name": "subjectId", "type": "string", "index": true, "writable": "managed" },
    { "name": "taskId", "type": "string", "index": true, "writable": "managed" },
    { "name": "body", "type": "string", "writable": "managed" },
    { "name": "occurredAt", "type": "timestamp", "writable": "managed" },
    { "name": "actorType", "type": "enum", "values": ["user", "agent", "system"], "writable": "managed" },
    { "name": "actorId", "type": "string", "writable": "managed" },
    { "name": "sourcePackage", "type": "string", "index": true, "writable": "managed" },
    { "name": "sourceAction", "type": "string", "writable": "managed" }
  ]
}
