Skip to content

Schema: work_observation_payload

Typed payload for the 25 durable WorkObservation kinds. Envelope conventions (validated by ``spec_kitty_events.strict``, see the module docstring): ``event_type="WorkObservation"``, ``aggregate_id`` = :func:`work_aggregate_id` — ``mission/<mission_id>`` when the observation is mission-bound, ``repo/<repository_id>`` for repository-bound work with no mission yet (LW-02: repo-bound sessions before a mission exists keep a real aggregate identity, never an invented mission), ``schema_version="3.0.0"``, ``timestamp`` = producer occurrence time, ``correlation_id`` / ``causation_id`` = standard Event causal semantics (a retry attempt causally follows the observation it retries), ``node_id`` = producer instance, ``lamport_clock`` = journal clock at emission. No time field in the payload (R-T-02, same as F1); no server-owned field (the principal/team binding, admitted-repo generation, ``received_at``, and committed cursor are ingestion-owned and forbidden here).

Payload schema for WorkObservation events.

Generated from src/spec_kitty_events/schemas/work_observation_payload.schema.json by scripts/schema_pages.py; never hand-edit (C-001).

Family

Part of the Runtime Observation Events event family.

Diagram

WorkObservationPayloadStructure of the JSON Schema WorkObservationPayload.$defs   $idspec-kitty-events/work_observation_payload$schemahttps://json-schema.org/draft/2020-12/schemaadditionalProperties☐ falsedescriptionTyped payload for the 25 durable WorkObservation kinds. Envelope conventions (validated by ``spec_kitty_events.strict``, see the module docstring): ``event_type="WorkObservation"``, ``aggregate_id`` = :func:`work_aggregate_id` — ``mission/<mission_id>`` when the observation is mission-bound, ``repo/<repository_id>`` for repository-bound work with no mission yet (LW-02: repo-bound sessions before a mission exists keep a real aggregate identity, never an invented mission), ``schema_version="3.0.0"``, ``timestamp`` = producer occurrence time, ``correlation_id`` / ``causation_id`` = standard Event causal semantics (a retry attempt causally follows the observation it retries), ``node_id`` = producer instance, ``lamport_clock`` = journal clock at emission. No time field in the payload (R-T-02, same as F1); no server-owned field (the principal/team binding, admitted-repo generation, ``received_at``, and committed cursor are ingestion-owned and forbidden here).properties   required   titleWorkObservationPayloadtypeobjectActionOutcome   ActionState   ActivityRef   ActorIdentity   AgentProfileRef   ArtifactReference   CoverageGap   FactoryAttemptRef   FileAction   FileOperation   MissionIdentity   PrincipalRef   ProducerIdentity   ProgrammeLink   RepositoryIdentity   SessionIdentity   SourceProvenance   TestAction   ToolAction   WorkContext   WorkKind   descriptionExplicit outcome for every concluded action — failure and skip are first-class observations, never laundered into success or silence (LW-03/LW-10). Only carried once the action has actually concluded (``state='result'``): an observation emitted while a tool/test is still running must not be forced to invent one.enum   titleActionOutcometypestringsuccessfailureskippeddescriptionLifecycle state of an observed tool/test activity (LW-04/LW-09: the live dashboard shows work *while it happens*, then correlates the conclusion to that same activity). ``STARTED``/``RUNNING`` are the pre-result states — no outcome, no test counts (nothing has concluded yet; forcing one would launder a live activity into a completed-work feed). ``RESULT`` is the terminal state that carries the :class:`ActionOutcome` (and test counts). ``CANCELLED`` records the abandonment of a previously started activity — an honest terminal observation in its own right, never a missing result. Start→result/cancel correlation is the observation *pair* sharing one ``activity`` (:class:`ActivityRef`): the start observation and the terminal observation name the same ``activity_id`` (the terminal one may also ``reply_to`` the start observation's event ID).enum   titleActionStatetypestringstartedrunningresultcancelledadditionalProperties☐ falsedescriptionActivity grouping: an observation may belong to a logical activity and an activity may name its parent — the durable analogue of the volatile focus/activity signal in :mod:`spec_kitty_events .harness_observation`.properties   required   titleActivityReftypeobjectactivity_id   parent_activity_id   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleActivity IdtypestringanyOf   default␀titleParent Activity Id      maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenullactivity_idadditionalProperties☐ falsedescriptionThe acting principal, with optional agent/factory framing. ``principal_id`` is the stable principal (a person account, an agent identity, a service, a factory role) — the *server* resolves it to the authenticated principal at ingestion; this field is producer-side attribution only. ``display_name`` is mutable presentation, never identity: renames change it, identity does not (LW-01).properties   required   titleActorIdentitytypeobjectagent_profile   display_name   factory_attempt   principal_id   principal_kind   anyOf   default␀      $ref#/$defs/AgentProfileReftypenullanyOf   default␀titleDisplay Name      maxLength128minLength1typestringtypenullanyOf   default␀      $ref#/$defs/FactoryAttemptReftypenullmaxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titlePrincipal Idtypestringenum   titlePrincipal Kindtypestringhumanagentservicefactoryprincipal_kindprincipal_idadditionalProperties☐ falsedescriptionThe agent profile a principal acted through — distinct from the principal itself (LW-01: principal, agent profile, session, and factory attempt are four different identities, never collapsed into one). Valid for every ``principal_kind``: they are independent identity dimensions, not exclusive modes — a factory worker retains both its profile/harness identity and its job/attempt attribution, and a human may act through an agent profile. Only ``principal_kind='agent'`` *requires* one (a bare agent principal is ambiguous).properties   required   titleAgentProfileReftypeobjectharness   model   profile_id   maxLength32pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleHarnesstypestringanyOf   default␀titleModel      maxLength64pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenullanyOf   default␀titleProfile Id      maxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenullharnessadditionalProperties☐ falsedescriptionA reference to authenticated artifact content — long content is never inlined (LW-11): it is referenced by content hash, byte length, media type, and completeness. ``complete=False`` marks a partial capture (e.g. truncated log tail) so consumers never mistake a fragment for the whole.properties   required   titleArtifactReferencetypeobjectartifact_id   byte_length   complete   content_hash   media_type   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleArtifact Idtypestringminimum0titleByte Lengthtypeintegerdefault☑ truetitleCompletetypebooleandescriptionSHA-256 of the referenced contentpattern^[0-9a-f]{64}$titleContent HashtypestringmaxLength128minLength1titleMedia Typetypestringartifact_idcontent_hashbyte_lengthmedia_typeadditionalProperties☐ falsedescriptionAn explicitly recorded capture gap (LW-08/LW-10): an area of work this producer could not observe, with the honest reason — gaps are recorded as data, never silently dropped.properties   required   titleCoverageGaptypeobjectarea   reason   maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleAreatypestringanyOf   default␀titleReason      maxLength240minLength1typestringtypenullareaadditionalProperties☐ falsedescriptionThe factory job/attempt an observation was produced under (planning #2270 binds these into continuous missions). Distinct from the session and the principal: one attempt may span sessions and one session may outlive several attempts.properties   required   titleFactoryAttemptReftypeobjectattempt_id   job_ref   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleAttempt IdtypestringanyOf   default␀titleJob Ref      maxLength240pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}$typestringtypenullattempt_idadditionalProperties☐ falsedescriptionA file operation, as metadata only (LW-04/LW-11): operation, path (and rename destination), size deltas. There is deliberately no ``contents`` field — file contents are never observable work, and ``contents`` is a :data:`FORBIDDEN_WORK_KEYS` member enforced at the envelope level as defense in depth. ``operation`` names what happened (read/edit/create/delete/rename); ``destination_path`` carries the rename's destination and is valid only for ``operation='rename'``. ``path``/``destination_p ath`` are repository-relative and may contain spaces and Unicode — validated by :func:`_validate_repository_relative_path`, not the ``_REF`` grammar.properties   required   titleFileActiontypeobjectbytes_added   bytes_removed   destination_path   language   operation   path   minimum0titleBytes Addedtypeintegerminimum0titleBytes RemovedtypeintegeranyOf   default␀titleDestination Path      maxLength240minLength1typestringtypenullanyOf   default␀titleLanguage      maxLength32minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenull$ref#/$defs/FileOperationmaxLength240minLength1titlePathtypestringoperationpathbytes_addedbytes_removeddescriptionThe operation a file observation records (LW-04: read/edit/create/ delete/rename are all supported observations — a byte-delta alone cannot distinguish them).enum   titleFileOperationtypestringreadeditcreatedeleterenameadditionalProperties☐ falsedescriptionCanonical mission identity — stable before, through, and after rename. ``mission_id`` is the canonical opaque identity: it exists from the first specify activity, before any Git push, and survives label changes, worktree moves, PRs, and merges (LW-02). ``display_label`` is mutable presentation only — two concurrent missions may share a label and remain distinct missions, and a rename changes the label, never the id.properties   required   titleMissionIdentitytypeobjectdisplay_label   mission_id   anyOf   default␀titleDisplay Label      maxLength240minLength1typestringtypenullmaxLength120minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,119}$titleMission Idtypestringmission_idadditionalProperties☐ falsedescriptionA lightweight reference to a principal (message recipient, handoff target) — the full identity is carried by the sender's ActorIdentity.properties   required   titlePrincipalReftypeobjectprincipal_id   principal_kind   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titlePrincipal Idtypestringenum   titlePrincipal Kindtypestringhumanagentservicefactoryprincipal_kindprincipal_idadditionalProperties☐ falsedescriptionWho produced this observation, at which instance, at which sequence. ``producer_id`` is the stable logical producer (a CLI install identity, an agent identity) — NOT the authenticated principal (server-owned) and NOT the person. ``instance_id`` is one process/run of that producer. ``sequence`` is the producer's monotonic per-instance sequence number: consumers use it (with the envelope's ``node_id``/``lamport_clock``) for duplicate, late, and gap detection — never the client ``timestamp`` (LW-10: no client timestamp establishes authoritative total order).properties   required   titleProducerIdentitytypeobjectinstance_id   producer_id   sequence   maxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleInstance IdtypestringmaxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleProducer Idtypestringminimum0titleSequencetypeintegerproducer_idinstance_idsequenceadditionalProperties☐ falsedescriptionCross-repo programme linkage (LW-02): distinct missions in distinct repositories that belong to one programme. Each linked mission keeps its own repository identity — the link relates missions, it never merges their identities.properties   required   titleProgrammeLinktypeobjectprogramme_id   role   maxLength120minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,119}$titleProgramme IdtypestringanyOf   default␀titleRole      maxLength64minLength1typestringtypenullprogramme_idadditionalProperties☐ falsedescriptionAdmitted repository identity — stable across provider renames. ``provider`` namespaces the forge (closed set; github today). ``repository_id`` is the provider-canonical stable repository id (e.g. the numeric GitHub repository id) — the admitted-repo *generation* that vets this id against the team's installation is server-owned (saas#1814). ``display_slug`` is the mutable ``owner/name`` presentation: a rename changes it, never the id (LW-02).properties   required   titleRepositoryIdentitytypeobjectdisplay_slug   provider   repository_id   anyOf   default␀titleDisplay Slug      maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}$typestringtypenullconstgithubtitleProvidertypestringmaxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$titleRepository Idtypestringproviderrepository_idadditionalProperties☐ falsedescriptionThe stable logical session that produced this observation. Identity survives reconnect (``reconnect_epoch`` bumps) and credential rotation (``credential_epoch`` bumps) — the session is the *logical* conversation, not the transport connection and not the credential (LW-01: two same-account agents stay distinct through reconnect and rotation because they hold distinct ``session_id``s). ``delegated_from`` names the delegating session's ``session_id`` when this session was spawned by a delegation (LW-05 delegated sessions).properties   required   titleSessionIdentitytypeobjectcredential_epoch   delegated_from   reconnect_epoch   session_id   default0minimum0titleCredential EpochtypeintegeranyOf   default␀titleDelegated From      maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenulldefault0minimum0titleReconnect EpochtypeintegermaxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleSession Idtypestringsession_idadditionalProperties☐ falsedescriptionHow this observation was captured (LW-04's capability matrix): the capture source, the named capability that produced it, and — when capture is partial — the honest limitation. ``limitation`` is the machine-readable home of the "record real capture/source limitations" requirement: a producer that cannot see something says so here.properties   required   titleSourceProvenancetypeobjectcapability   limitation   source   maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleCapabilitytypestringanyOf   default␀titleLimitation      maxLength240minLength1typestringtypenullenum   titleSourcetypestringharness_hookcli_wrapperemittermanualfactorysourcecapabilityadditionalProperties☐ falsedescriptionA test execution at any lifecycle state: selector plus explicit counts (carried only once the run concludes, ``state='result'``). Never raw output.properties   required   titleTestActiontypeobjectfailed   outcome   passed   selector   skipped   state   anyOf   default␀titleFailed      minimum0typeintegertypenullanyOf   default␀      $ref#/$defs/ActionOutcometypenullanyOf   default␀titlePassed      minimum0typeintegertypenullmaxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}$titleSelectortypestringanyOf   default␀titleSkipped      minimum0typeintegertypenull$ref#/$defs/ActionStateselectorstateadditionalProperties☐ falsedescriptionA tool invocation at any lifecycle state. Tool *name*, state, outcome (terminal only), duration — never the raw command environment or tool output (those are privacy keys).properties   required   titleToolActiontypeobjectduration_ms   outcome   state   tool   anyOf   default␀titleDuration Ms      minimum0typeintegertypenullanyOf   default␀      $ref#/$defs/ActionOutcometypenull$ref#/$defs/ActionStatemaxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$titleTooltypestringtoolstateadditionalProperties☐ falsedescriptionOptional work context slots — all optional, all presentation/scoping, none of them identity (identity is mission/session/repository above).properties   titleWorkContexttypeobjectbranch   operation   run_id   worktree   wp_id   anyOf   default␀titleBranch      maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}$typestringtypenullanyOf   default␀titleOperation      maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenullanyOf   default␀titleRun Id      maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenullanyOf   default␀titleWorktree      maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}$typestringtypenullanyOf   default␀titleWp Id      maxLength32minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}$typestringtypenulldescriptionClosed set of durable work-observation kinds — 25 members, 6 families. ``lifecycle`` (6) closes the LW-03 gap: mission review and retrospective outcomes are captured/failed/skipped, not just completed — failure and skip are first-class, never laundered into silence. ``session`` (5) covers session lifecycle, delegation, and mission/repo binding changes (LW-01/LW-02). ``action`` (3) covers tool/file/test observation with explicit outcomes (LW-04). ``narrative`` (9) covers the authored intent/progress/question /answer/decision/handoff/blocker/ resolution/next vocabulary (LW-05/LW-09). ``message`` (1) is the durable peer message. ``coverage`` (1) makes capture gaps explicit (LW-08/LW-10).enum   titleWorkKindtypestringlifecycle.mission_review_capturedlifecycle.mission_review_failedlifecycle.mission_review_skippedlifecycle.retrospective_capturedlifecycle.retrospective_failedlifecycle.retrospective_skippedsession.startedsession.endedsession.delegation_startedsession.delegation_endedsession.binding_changedaction.tool_invokedaction.file_editedaction.test_executednarrative.intent_declarednarrative.progress_reportednarrative.question_askednarrative.question_answerednarrative.decision_recordednarrative.handoff_performednarrative.blocker_raisednarrative.blocker_resolvednarrative.next_proposedmessage.peer_sentcoverage.gap_recordedaction   activity   actor   artifact   context   coverage   extensions   kind   mission   producer   programme   provenance   recipient   ref   reply_to   repository   session   text   anyOf   default␀titleAction            $ref#/$defs/ToolAction$ref#/$defs/FileAction$ref#/$defs/TestActiontypenullanyOf   default␀      $ref#/$defs/ActivityReftypenull$ref#/$defs/ActorIdentityanyOf   default␀      $ref#/$defs/ArtifactReferencetypenullanyOf   default␀      $ref#/$defs/WorkContexttypenullanyOf   default␀      $ref#/$defs/CoverageGaptypenullanyOf   default␀descriptionSafe optional extensions: keys MUST be x- prefixed; unknown un-namespaced keys are rejected by extra='forbid'.titleExtensions      additionalProperties   typeobjectanyOf                  typestringtypeintegertypenumbertypebooleantypenulltypenull$ref#/$defs/WorkKindanyOf   default␀descriptionCanonical mission identity when this observation is mission-bound. Required only for the lifecycle kinds (mission review/retrospective); repository-bound sessions and work exist before (and outside) any mission and leave it unset rather than inventing one (LW-02).      $ref#/$defs/MissionIdentitytypenull$ref#/$defs/ProducerIdentityanyOf   default␀      $ref#/$defs/ProgrammeLinktypenull$ref#/$defs/SourceProvenanceanyOf   default␀      $ref#/$defs/PrincipalReftypenullanyOf   default␀descriptionOpaque reference to the entity this observation resolves or records (blocker ref, decision record link).titleRef      maxLength240minLength1typestringtypenullanyOf   default␀descriptionEvent ID of the observation this one answers or retries.titleReply To      maxLength36minLength26typestringtypenull$ref#/$defs/RepositoryIdentity$ref#/$defs/SessionIdentityanyOf   default␀descriptionInline authored text (narrative/message kinds). Long content is an artifact reference, never inline.titleText      maxLength2000minLength1typestringtypenullkindproducersessionactorrepositoryprovenance
Structure of the JSON Schema WorkObservationPayload.

Properties

  • action (ToolAction | FileAction | TestAction | null)
  • activity (ActivityRef | null)
  • actor (ActorIdentity, required): The acting principal, with optional agent/factory framing. ``principal_id`` is the stable principal (a person account, an agent identity, a service, a factory role) — the *server* resolves it to the authenticated principal at ingestion; this field is producer-side attribution only. ``display_name`` is mutable presentation, never identity: renames change it, identity does not (LW-01).
  • artifact (ArtifactReference | null)
  • context (WorkContext | null)
  • coverage (CoverageGap | null)
  • extensions (map of string | integer | number | boolean | null | null): Safe optional extensions: keys MUST be x- prefixed; unknown un-namespaced keys are rejected by extra='forbid'.
  • kind (enum: lifecycle.mission_review_captured, lifecycle.mission_review_failed, lifecycle.mission_review_skipped, lifecycle.retrospective_captured, lifecycle.retrospective_failed, lifecycle.retrospective_skipped, session.started, session.ended, session.delegation_started, session.delegation_ended, session.binding_changed, action.tool_invoked, action.file_edited, action.test_executed, narrative.intent_declared, narrative.progress_reported, narrative.question_asked, narrative.question_answered, narrative.decision_recorded, narrative.handoff_performed, narrative.blocker_raised, narrative.blocker_resolved, narrative.next_proposed, message.peer_sent, coverage.gap_recorded, required): Closed set of durable work-observation kinds — 25 members, 6 families. ``lifecycle`` (6) closes the LW-03 gap: mission review and retrospective outcomes are captured/failed/skipped, not just completed — failure and skip are first-class, never laundered into silence. ``session`` (5) covers session lifecycle, delegation, and mission/repo binding changes (LW-01/LW-02). ``action`` (3) covers tool/file/test observation with explicit outcomes (LW-04). ``narrative`` (9) covers the authored intent/progress/question/answer/decision/handoff/blocker/ resolution/next vocabulary (LW-05/LW-09). ``message`` (1) is the durable peer message. ``coverage`` (1) makes capture gaps explicit (LW-08/LW-10).
  • mission (MissionIdentity | null): Canonical mission identity when this observation is mission-bound. Required only for the lifecycle kinds (mission review/retrospective); repository-bound sessions and work exist before (and outside) any mission and leave it unset rather than inventing one (LW-02).
  • producer (ProducerIdentity, required): Who produced this observation, at which instance, at which sequence. ``producer_id`` is the stable logical producer (a CLI install identity, an agent identity) — NOT the authenticated principal (server-owned) and NOT the person. ``instance_id`` is one process/run of that producer. ``sequence`` is the producer's monotonic per-instance sequence number: consumers use it (with the envelope's ``node_id``/``lamport_clock``) for duplicate, late, and gap detection — never the client ``timestamp`` (LW-10: no client timestamp establishes authoritative total order).
  • programme (ProgrammeLink | null)
  • provenance (SourceProvenance, required): How this observation was captured (LW-04's capability matrix): the capture source, the named capability that produced it, and — when capture is partial — the honest limitation. ``limitation`` is the machine-readable home of the "record real capture/source limitations" requirement: a producer that cannot see something says so here.
  • recipient (PrincipalRef | null)
  • ref (string | null): Opaque reference to the entity this observation resolves or records (blocker ref, decision record link).
  • reply_to (string | null): Event ID of the observation this one answers or retries.
  • repository (RepositoryIdentity, required): Admitted repository identity — stable across provider renames. ``provider`` namespaces the forge (closed set; github today). ``repository_id`` is the provider-canonical stable repository id (e.g. the numeric GitHub repository id) — the admitted-repo *generation* that vets this id against the team's installation is server-owned (saas#1814). ``display_slug`` is the mutable ``owner/name`` presentation: a rename changes it, never the id (LW-02).
  • session (SessionIdentity, required): The stable logical session that produced this observation. Identity survives reconnect (``reconnect_epoch`` bumps) and credential rotation (``credential_epoch`` bumps) — the session is the *logical* conversation, not the transport connection and not the credential (LW-01: two same-account agents stay distinct through reconnect and rotation because they hold distinct ``session_id``s). ``delegated_from`` names the delegating session's ``session_id`` when this session was spawned by a delegation (LW-05 delegated sessions).
  • text (string | null): Inline authored text (narrative/message kinds). Long content is an artifact reference, never inline.

ToolAction

A tool invocation at any lifecycle state. Tool *name*, state, outcome (terminal only), duration — never the raw command environment or tool output (those are privacy keys).

  • duration_ms (integer | null)
  • outcome (enum: success, failure, skipped | null)
  • state (enum: started, running, result, cancelled, required): Lifecycle state of an observed tool/test activity (LW-04/LW-09: the live dashboard shows work *while it happens*, then correlates the conclusion to that same activity). ``STARTED``/``RUNNING`` are the pre-result states — no outcome, no test counts (nothing has concluded yet; forcing one would launder a live activity into a completed-work feed). ``RESULT`` is the terminal state that carries the :class:`ActionOutcome` (and test counts). ``CANCELLED`` records the abandonment of a previously started activity — an honest terminal observation in its own right, never a missing result. Start→result/cancel correlation is the observation *pair* sharing one ``activity`` (:class:`ActivityRef`): the start observation and the terminal observation name the same ``activity_id`` (the terminal one may also ``reply_to`` the start observation's event ID).
  • tool (string, required)

FileAction

A file operation, as metadata only (LW-04/LW-11): operation, path (and rename destination), size deltas. There is deliberately no ``contents`` field — file contents are never observable work, and ``contents`` is a :data:`FORBIDDEN_WORK_KEYS` member enforced at the envelope level as defense in depth. ``operation`` names what happened (read/edit/create/delete/rename); ``destination_path`` carries the rename's destination and is valid only for ``operation='rename'``. ``path``/``destination_path`` are repository-relative and may contain spaces and Unicode — validated by :func:`_validate_repository_relative_path`, not the ``_REF`` grammar.

  • bytes_added (integer, required)
  • bytes_removed (integer, required)
  • destination_path (string | null)
  • language (string | null)
  • operation (enum: read, edit, create, delete, rename, required): The operation a file observation records (LW-04: read/edit/create/ delete/rename are all supported observations — a byte-delta alone cannot distinguish them).
  • path (string, required)

TestAction

A test execution at any lifecycle state: selector plus explicit counts (carried only once the run concludes, ``state='result'``). Never raw output.

  • failed (integer | null)
  • outcome (enum: success, failure, skipped | null)
  • passed (integer | null)
  • selector (string, required)
  • skipped (integer | null)
  • state (enum: started, running, result, cancelled, required): Lifecycle state of an observed tool/test activity (LW-04/LW-09: the live dashboard shows work *while it happens*, then correlates the conclusion to that same activity). ``STARTED``/``RUNNING`` are the pre-result states — no outcome, no test counts (nothing has concluded yet; forcing one would launder a live activity into a completed-work feed). ``RESULT`` is the terminal state that carries the :class:`ActionOutcome` (and test counts). ``CANCELLED`` records the abandonment of a previously started activity — an honest terminal observation in its own right, never a missing result. Start→result/cancel correlation is the observation *pair* sharing one ``activity`` (:class:`ActivityRef`): the start observation and the terminal observation name the same ``activity_id`` (the terminal one may also ``reply_to`` the start observation's event ID).

ActivityRef

Activity grouping: an observation may belong to a logical activity and an activity may name its parent — the durable analogue of the volatile focus/activity signal in :mod:`spec_kitty_events.harness_observation`.

  • activity_id (string, required)
  • parent_activity_id (string | null)

ActorIdentity

The acting principal, with optional agent/factory framing. ``principal_id`` is the stable principal (a person account, an agent identity, a service, a factory role) — the *server* resolves it to the authenticated principal at ingestion; this field is producer-side attribution only. ``display_name`` is mutable presentation, never identity: renames change it, identity does not (LW-01).

  • agent_profile (AgentProfileRef | null)
  • display_name (string | null)
  • factory_attempt (FactoryAttemptRef | null)
  • principal_id (string, required)
  • principal_kind (enum: human, agent, service, factory, required)

ArtifactReference

A reference to authenticated artifact content — long content is never inlined (LW-11): it is referenced by content hash, byte length, media type, and completeness. ``complete=False`` marks a partial capture (e.g. truncated log tail) so consumers never mistake a fragment for the whole.

  • artifact_id (string, required)
  • byte_length (integer, required)
  • complete (boolean)
  • content_hash (string, required): SHA-256 of the referenced content
  • media_type (string, required)

WorkContext

Optional work context slots — all optional, all presentation/scoping, none of them identity (identity is mission/session/repository above).

  • branch (string | null)
  • operation (string | null)
  • run_id (string | null)
  • worktree (string | null)
  • wp_id (string | null)

CoverageGap

An explicitly recorded capture gap (LW-08/LW-10): an area of work this producer could not observe, with the honest reason — gaps are recorded as data, never silently dropped.

  • area (string, required)
  • reason (string | null)

MissionIdentity

Canonical mission identity — stable before, through, and after rename. ``mission_id`` is the canonical opaque identity: it exists from the first specify activity, before any Git push, and survives label changes, worktree moves, PRs, and merges (LW-02). ``display_label`` is mutable presentation only — two concurrent missions may share a label and remain distinct missions, and a rename changes the label, never the id.

  • display_label (string | null)
  • mission_id (string, required)

ProducerIdentity

Who produced this observation, at which instance, at which sequence. ``producer_id`` is the stable logical producer (a CLI install identity, an agent identity) — NOT the authenticated principal (server-owned) and NOT the person. ``instance_id`` is one process/run of that producer. ``sequence`` is the producer's monotonic per-instance sequence number: consumers use it (with the envelope's ``node_id``/``lamport_clock``) for duplicate, late, and gap detection — never the client ``timestamp`` (LW-10: no client timestamp establishes authoritative total order).

  • instance_id (string, required)
  • producer_id (string, required)
  • sequence (integer, required)

Cross-repo programme linkage (LW-02): distinct missions in distinct repositories that belong to one programme. Each linked mission keeps its own repository identity — the link relates missions, it never merges their identities.

  • programme_id (string, required)
  • role (string | null)

SourceProvenance

How this observation was captured (LW-04's capability matrix): the capture source, the named capability that produced it, and — when capture is partial — the honest limitation. ``limitation`` is the machine-readable home of the "record real capture/source limitations" requirement: a producer that cannot see something says so here.

  • capability (string, required)
  • limitation (string | null)
  • source (enum: harness_hook, cli_wrapper, emitter, manual, factory, required)

PrincipalRef

A lightweight reference to a principal (message recipient, handoff target) — the full identity is carried by the sender's ActorIdentity.

  • principal_id (string, required)
  • principal_kind (enum: human, agent, service, factory, required)

RepositoryIdentity

Admitted repository identity — stable across provider renames. ``provider`` namespaces the forge (closed set; github today). ``repository_id`` is the provider-canonical stable repository id (e.g. the numeric GitHub repository id) — the admitted-repo *generation* that vets this id against the team's installation is server-owned (saas#1814). ``display_slug`` is the mutable ``owner/name`` presentation: a rename changes it, never the id (LW-02).

  • display_slug (string | null)
  • provider (const: "github", required)
  • repository_id (string, required)

SessionIdentity

The stable logical session that produced this observation. Identity survives reconnect (``reconnect_epoch`` bumps) and credential rotation (``credential_epoch`` bumps) — the session is the *logical* conversation, not the transport connection and not the credential (LW-01: two same-account agents stay distinct through reconnect and rotation because they hold distinct ``session_id``s). ``delegated_from`` names the delegating session's ``session_id`` when this session was spawned by a delegation (LW-05 delegated sessions).

  • credential_epoch (integer)
  • delegated_from (string | null)
  • reconnect_epoch (integer)
  • session_id (string, required)

AgentProfileRef

The agent profile a principal acted through — distinct from the principal itself (LW-01: principal, agent profile, session, and factory attempt are four different identities, never collapsed into one). Valid for every ``principal_kind``: they are independent identity dimensions, not exclusive modes — a factory worker retains both its profile/harness identity and its job/attempt attribution, and a human may act through an agent profile. Only ``principal_kind='agent'`` *requires* one (a bare agent principal is ambiguous).

  • harness (string, required)
  • model (string | null)
  • profile_id (string | null)

FactoryAttemptRef

The factory job/attempt an observation was produced under (planning #2270 binds these into continuous missions). Distinct from the session and the principal: one attempt may span sessions and one session may outlive several attempts.

  • attempt_id (string, required)
  • job_ref (string | null)

Source

Schema file: schemas/work_observation_payload.schema.json