Skip to content

Schema: work.observed v1 (producer row)

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 dataStructure of the JSON Schema ai.spec-kitty.work.observed.v1 data.$schemahttps://json-schema.org/draft/2020-12/schema$idurn:ai.spec-kitty:schema:work.observed.v1titleai.spec-kitty.work.observed.v1 dataadditionalProperties☐ falsedescriptionA unit of agent work was observed.properties   required   typeobjectaction   activity   actor   artifact   context   coverage   extensions   kind   mission   producer   programme   provenance   recipient   ref   reply_to   repository   session   text   anyOf               additionalProperties☐ 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   typeobjectduration_ms   outcome   state   tool   anyOf         minimum0typeintegertypenullanyOf         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   typestringsuccessfailureskippedtypenulldescriptionLifecycle 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   typestringstartedrunningresultcancelledmaxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtoolstateadditionalProperties☐ 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   typeobjectbytes_added   bytes_removed   destination_path   language   operation   path   minimum0typeintegerminimum0typeintegeranyOf         maxLength240minLength1typestringtypenullanyOf         maxLength32minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenulldescriptionThe operation a file observation records (LW-04: read/edit/create/ delete/rename are all supported observations — a byte-delta alone cannot distinguish them).enum   typestringreadeditcreatedeleterenamemaxLength240minLength1typestringoperationpathbytes_addedbytes_removedadditionalProperties☐ falsedescriptionA test execution at any lifecycle state: selector plus explicit counts (carried only once the run concludes, ``state='result'``). Never raw output.properties   required   typeobjectfailed   outcome   passed   selector   skipped   state   anyOf         minimum0typeintegertypenullanyOf         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   typestringsuccessfailureskippedtypenullanyOf         minimum0typeintegertypenullmaxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S])typestringanyOf         minimum0typeintegertypenulldescriptionLifecycle 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   typestringstartedrunningresultcancelledselectorstatetypenullanyOf         additionalProperties☐ 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   typeobjectactivity_id   parent_activity_id   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringanyOf         maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullactivity_idtypenulladditionalProperties☐ 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   typeobjectagent_profile   display_name   factory_attempt   principal_id   principal_kind   anyOf         additionalProperties☐ 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   typeobjectharness   model   profile_id   maxLength32pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringanyOf         maxLength64pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullanyOf         maxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullharnesstypenullanyOf         maxLength128minLength1typestringtypenullanyOf         additionalProperties☐ 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   typeobjectattempt_id   job_ref   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringanyOf         maxLength240pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S])typestringtypenullattempt_idtypenullmaxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringenum   typestringhumanagentservicefactoryprincipal_kindprincipal_idanyOf         additionalProperties☐ 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   typeobjectartifact_id   byte_length   complete   content_hash   media_type   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringminimum0typeintegertypebooleandescriptionSHA-256 of the referenced contentpattern^[0-9a-f]{64}(?![\s\S])typestringmaxLength128minLength1typestringartifact_idcontent_hashbyte_lengthmedia_typetypenullanyOf         additionalProperties☐ falsedescriptionOptional work context slots — all optional, all presentation/scoping, none of them identity (identity is mission/session/repository above).properties   typeobjectbranch   operation   run_id   worktree   wp_id   anyOf         maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S])typestringtypenullanyOf         maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullanyOf         maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullanyOf         maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S])typestringtypenullanyOf         maxLength32minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenulltypenullanyOf         additionalProperties☐ 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   typeobjectarea   reason   maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringanyOf         maxLength240minLength1typestringtypenullareatypenullanyOf   descriptionSafe optional extensions: keys MUST be x- prefixed; unknown un-namespaced keys are rejected by extra='forbid'.      additionalProperties   typeobjectanyOf                  typestringtypeintegertypenumbertypebooleantypenulltypenulldescriptionClosed 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   typestringlifecycle.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_recordedanyOf   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).      additionalProperties☐ 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   typeobjectdisplay_label   mission_id   anyOf         maxLength240minLength1typestringtypenullmaxLength120minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,119}(?![\s\S])typestringmission_idtypenulladditionalProperties☐ 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   typeobjectinstance_id   producer_id   sequence   maxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringmaxLength128pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringminimum0typeintegerproducer_idinstance_idsequenceanyOf         additionalProperties☐ 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   typeobjectprogramme_id   role   maxLength120minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,119}(?![\s\S])typestringanyOf         maxLength64minLength1typestringtypenullprogramme_idtypenulladditionalProperties☐ 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   typeobjectcapability   limitation   source   maxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringanyOf         maxLength240minLength1typestringtypenullenum   typestringharness_hookcli_wrapperemittermanualfactorysourcecapabilityanyOf         additionalProperties☐ falsedescriptionA lightweight reference to a principal (message recipient, handoff target) — the full identity is carried by the sender's ActorIdentity.properties   required   typeobjectprincipal_id   principal_kind   maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringenum   typestringhumanagentservicefactoryprincipal_kindprincipal_idtypenullanyOf   descriptionOpaque reference to the entity this observation resolves or records (blocker ref, decision record link).      maxLength240minLength1typestringtypenullanyOf   descriptionEvent ID of the observation this one answers or retries.      maxLength36minLength26typestringtypenulladditionalProperties☐ 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   typeobjectdisplay_slug   provider   repository_id   anyOf         maxLength240minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+/-]{0,239}(?![\s\S])typestringtypenullconstgithubtypestringmaxLength64minLength1pattern^[A-Za-z0-9][A-Za-z0-9._-]{0,63}(?![\s\S])typestringproviderrepository_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   typeobjectcredential_epoch   delegated_from   reconnect_epoch   session_id   minimum0typeintegeranyOf         maxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringtypenullminimum0typeintegermaxLength128minLength1pattern^[A-Za-z0-9][A-Za-z0-9._@+-]{0,63}(?![\s\S])typestringsession_idanyOf   descriptionInline authored text (narrative/message kinds). Long content is an artifact reference, never inline.      maxLength2000minLength1typestringtypenullkindproducersessionactorrepositoryprovenance
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