Document status:active Typed payload for the 25 durable WorkObservation kinds.
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).
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).
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).
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.
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).
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)
ProgrammeLink
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.
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.