-
Notifications
You must be signed in to change notification settings - Fork 220
feat(observability): enrich execution facts for downstream reasoner-level analysis #340
Description
Summary
Strengthen the execution observability contract so downstream systems can do reasoner-level trend analysis without AgentField shipping a built-in regression engine.
This is not about adding slope math or alert policy to core. It is about making terminal execution facts clean, stable, and available on the right rails.
Why
Today AF is pretty good at per-execution visibility, but not yet strong enough at exposing a stable fact shape for downstream behavioral analysis over time.
The missing piece is not "analyzer logic in core". The missing piece is a contract that makes it easy for users to:
- consume terminal execution facts in real time via webhook
- backfill or bootstrap historical analysis via execution history/export
- group by
reasoner_idas the main identity - optionally segment further using caller-provided execution
context
This keeps AF focused on facts, not interpretation.
Scope
Define and implement a stable execution fact shape for downstream analysis, centered on:
execution_idworkflow_id/run_idagent_node_idreasoner_idstatusstatus_reasonstarted_atcompleted_atduration_msretry_counterror_categorysession_idactor_id- execution
contextas caller-provided grouping metadata
Proposed rails
1. Observability webhook
Enrich terminal execution events so downstream consumers can analyze completed runs directly from the webhook stream.
Target event types:
execution.completedexecution.failedexecution.cancelled
Optional:
execution.startedif useful for consumers that want early visibility before terminal state
2. Execution history / export
Expose the same core fact shape through a stable read path so consumers can backfill or bootstrap historical analysis without replaying webhook logs.
Exact endpoint shape can be decided in implementation, but it should support:
- filtering by
reasoner_id - time-bounded reads
- cursor pagination
Important design notes
reasoner_idis the primary identity for this work- AF should not introduce a platform-owned
task_classconcept here - if callers want finer segmentation inside a reasoner, that should ride in execution
context - this issue does not add slope computation, thresholds, or alert semantics to core
- Prometheus additions can be evaluated separately; they are adjacent, not the main contract work
Example
The same reasoner_id might be invoked with different caller-defined analysis groups:
{
"input": { "...": "..." },
"context": {
"analysis_group": "summary.short_form"
}
}{
"input": { "...": "..." },
"context": {
"analysis_group": "summary.long_form"
}
}Downstream consumers can then analyze:
- all executions for
reasoner_id = summarizer - or only executions where
context.analysis_group = summary.short_form
without AF needing to hardcode a universal taxonomy.
Acceptance criteria
- terminal execution webhook events include the agreed execution fact shape
- execution history/export exposes the same core fields with a stable contract
reasoner_idis consistently available as the main downstream analysis keyretry_countanderror_categoryare available on terminal execution facts- execution
contextis available for caller-defined grouping metadata - docs explain webhook-first real-time analysis and history/export backfill usage
- no built-in regression analyzer, slope computation, or alert policy is introduced in core as part of this issue
Follow-up
Once this lands, issue #329 can close as resolved by primitives:
- downstream trend analysis becomes easy to build
- richer analytics and alerting remain outside core