A unit of agent work was observed.
Data schema for the work.observed.v1 producer row (the CloudEvents data member).
Generated from src/spec_kitty_events/producer_contract/data/work.observed.v1.schema.json by scripts/schema_pages.py; never hand-edit (C-001).
Family
Listed on the Producer row schemas and the total order hub.
Diagram
ai.spec-kitty.work.observed.v1 data Structure of the JSON Schema ai.spec-kitty.work.observed.v1 data. $schema https://json-schema.org/draft/2020-12/schema $id urn:ai.spec-kitty:schema:work.observed.v1 title ai.spec-kitty.work.observed.v1 data additionalProperties ☐ false description A unit of agent work was observed. properties required type object action activity actor artifact context coverage extensions kind mission producer programme provenance recipient ref reply_to repository session text anyOf additionalProperties ☐ false description 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). properties required type object duration_ms outcome state tool anyOf minimum 0 type integer type null anyOf description Explicit 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 type string success failure skipped type null description 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). enum type string started running result cancelled maxLength 64 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string tool state additionalProperties ☐ false description 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_p
ath`` are repository-relative and may contain
spaces and Unicode — validated by
:func:`_validate_repository_relative_path`, not
the ``_REF`` grammar. properties required type object bytes_added bytes_removed destination_path language operation path minimum 0 type integer minimum 0 type integer anyOf maxLength 240 minLength 1 type string type null anyOf maxLength 32 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null description The operation a file observation records (LW-04:
read/edit/create/ delete/rename are all
supported observations — a byte-delta alone
cannot distinguish them). enum type string read edit create delete rename maxLength 240 minLength 1 type string operation path bytes_added bytes_removed additionalProperties ☐ false description A test execution at any lifecycle state:
selector plus explicit counts (carried only once
the run concludes, ``state='result'``). Never
raw output. properties required type object failed outcome passed selector skipped state anyOf minimum 0 type integer type null anyOf description Explicit 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 type string success failure skipped type null anyOf minimum 0 type integer type null maxLength 240 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S]) type string anyOf minimum 0 type integer type null description 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). enum type string started running result cancelled selector state type null anyOf additionalProperties ☐ false description 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`. properties required type object activity_id parent_activity_id maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string anyOf maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null activity_id type null additionalProperties ☐ false description 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). properties required type object agent_profile display_name factory_attempt principal_id principal_kind anyOf additionalProperties ☐ false description 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). properties required type object harness model profile_id maxLength 32 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string anyOf maxLength 64 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null anyOf maxLength 128 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null harness type null anyOf maxLength 128 minLength 1 type string type null anyOf additionalProperties ☐ false description 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. properties required type object attempt_id job_ref maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string anyOf maxLength 240 pattern ^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S]) type string type null attempt_id type null maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string enum type string human agent service factory principal_kind principal_id anyOf additionalProperties ☐ false description 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. properties required type object artifact_id byte_length complete content_hash media_type maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string minimum 0 type integer type boolean description SHA-256 of the referenced content pattern ^[0-9a-f]{64}(?![\s\S]) type string maxLength 128 minLength 1 type string artifact_id content_hash byte_length media_type type null anyOf additionalProperties ☐ false description Optional work context slots — all optional, all
presentation/scoping, none of them identity
(identity is mission/session/repository above). properties type object branch operation run_id worktree wp_id anyOf maxLength 240 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S]) type string type null anyOf maxLength 64 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null anyOf maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null anyOf maxLength 240 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S]) type string type null anyOf maxLength 32 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null type null anyOf additionalProperties ☐ false description 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. properties required type object area reason maxLength 64 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string anyOf maxLength 240 minLength 1 type string type null area type null anyOf description Safe optional extensions: keys MUST be x-
prefixed; unknown un-namespaced keys are
rejected by extra='forbid'. additionalProperties type object anyOf type string type integer type number type boolean type null type null description 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). enum type string 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 anyOf description 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). additionalProperties ☐ false description 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. properties required type object display_label mission_id anyOf maxLength 240 minLength 1 type string type null maxLength 120 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,119}(?![\s\S]) type string mission_id type null additionalProperties ☐ false description 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). properties required type object instance_id producer_id sequence maxLength 128 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string maxLength 128 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string minimum 0 type integer producer_id instance_id sequence anyOf additionalProperties ☐ false description 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. properties required type object programme_id role maxLength 120 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,119}(?![\s\S]) type string anyOf maxLength 64 minLength 1 type string type null programme_id type null additionalProperties ☐ false description 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. properties required type object capability limitation source maxLength 64 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string anyOf maxLength 240 minLength 1 type string type null enum type string harness_hook cli_wrapper emitter manual factory source capability anyOf additionalProperties ☐ false description A lightweight reference to a principal (message
recipient, handoff target) — the full identity
is carried by the sender's ActorIdentity. properties required type object principal_id principal_kind maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string enum type string human agent service factory principal_kind principal_id type null anyOf description Opaque reference to the entity this observation
resolves or records (blocker ref, decision
record link). maxLength 240 minLength 1 type string type null anyOf description Event ID of the observation this one answers or
retries. maxLength 36 minLength 26 type string type null additionalProperties ☐ false description 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). properties required type object display_slug provider repository_id anyOf maxLength 240 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S]) type string type null const github type string maxLength 64 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(?![\s\S]) type string provider repository_id additionalProperties ☐ false description 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). properties required type object credential_epoch delegated_from reconnect_epoch session_id minimum 0 type integer anyOf maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string type null minimum 0 type integer maxLength 128 minLength 1 pattern ^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S]) type string session_id anyOf description Inline authored text (narrative/message kinds).
Long content is an artifact reference, never
inline. maxLength 2000 minLength 1 type string type null kind producer session actor repository provenance Structure of the JSON Schema ai.spec-kitty.work.observed.v1 data.
Properties
action (object | object | object | null)
activity (object | null)
activity_id (string, required)
parent_activity_id (string | null)
actor (object, 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).
agent_profile (object | null)
harness (string, required)
model (string | null)
profile_id (string | null)
display_name (string | null)
factory_attempt (object | null)
attempt_id (string, required)
job_ref (string | null)
principal_id (string, required)
principal_kind (enum: human, agent, service, factory, required)
artifact (object | null)
artifact_id (string, required)
byte_length (integer, required)
complete (boolean)
content_hash (string, required): SHA-256 of the referenced content
media_type (string, required)
context (object | null)
branch (string | null)
operation (string | null)
run_id (string | null)
worktree (string | null)
wp_id (string | null)
coverage (object | null)
area (string, required)
reason (string | 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 (object | 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).
display_label (string | null)
mission_id (string, required)
producer (object, 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).
instance_id (string, required)
producer_id (string, required)
sequence (integer, required)
programme (object | null)
programme_id (string, required)
role (string | null)
provenance (object, 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.
capability (string, required)
limitation (string | null)
source (enum: harness_hook, cli_wrapper, emitter, manual, factory, required)
recipient (object | null)
principal_id (string, required)
principal_kind (enum: human, agent, service, factory, required)
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 (object, 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).
display_slug (string | null)
provider (const: "github", required)
repository_id (string, required)
session (object, 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).
credential_epoch (integer)
delegated_from (string | null)
reconnect_epoch (integer)
session_id (string, required)
text (string | null): Inline authored text (narrative/message kinds). Long content is an artifact reference, never inline.
Source
Schema file: schemas/producer-rows/work.observed.v1.schema.json