Render run list miniatures from compact per-stage route evidence

This commit is contained in:
2026-10-20 18:21:24 +01:00
parent 855de19a35
commit 34939edd0e
14 changed files with 501 additions and 40 deletions
+9 -4
View File
@@ -15,7 +15,8 @@ const (
// RunEventFrame is the server-pushed run_event delta. It carries only the values
// that changed, never the whole run: the run's identity, status, outcome, current
// stage, completed-step count and timestamps, plus at most one changed step.
// stage, completed-step count and timestamps, plus the latest changed step and
// compact routing facts for all changed visits preserved during coalescing.
// Every field is optional so an older peer ignores what it does not know and a
// client can fold the frame into its cached run.
//
@@ -24,9 +25,13 @@ const (
// from the frame instead of re-reading the whole list. They repeat on every
// frame (pipeline identity never changes mid-run).
type RunEventFrame struct {
NotifyMode string `json:"notify_mode,omitempty"`
RunID int64 `json:"run_id"`
Workspace string `json:"workspace,omitempty"`
// GraphEvidence seeds a complete compact snapshot; GraphVisits preserves
// changed visits even when Step is replaced during frame coalescing.
GraphEvidence *RunGraphEvidence `json:"graph_evidence,omitempty"`
GraphVisits []RunGraphVisit `json:"graph_visits,omitempty"`
NotifyMode string `json:"notify_mode,omitempty"`
RunID int64 `json:"run_id"`
Workspace string `json:"workspace,omitempty"`
// PipelineID, Name, Title and Version identify the run's pipeline and its
// operator-facing title, so a new run's row can be built without a fetch.
PipelineID int64 `json:"pipeline_id,omitempty"`
+21 -4
View File
@@ -134,10 +134,11 @@ type SessionExportRecovery struct {
}
type RunSummary struct {
NotifyMode string `json:"notify_mode,omitempty"`
ID int64 `json:"id"`
PipelineID int64 `json:"pipeline_id"`
Name string `json:"name"`
GraphEvidence *RunGraphEvidence `json:"graph_evidence,omitempty"`
NotifyMode string `json:"notify_mode,omitempty"`
ID int64 `json:"id"`
PipelineID int64 `json:"pipeline_id"`
Name string `json:"name"`
// Title is the operator-facing, bounded single-line description of what the
// run is for, generated from its prompt. It is never empty for a new run;
// historical rows predating the title column may omit it.
@@ -165,6 +166,22 @@ type RunSummary struct {
OutputFormat string `json:"output_format,omitempty"`
}
// RunGraphVisit contains only routing and lifecycle facts, never private step
// inputs, outputs, diagnostics, sessions or transcripts. Repeated loop visits
// are compacted to the latest stage visit and the latest visit of each route.
type RunGraphVisit struct {
Sequence int `json:"sequence"`
Stage string `json:"stage"`
Status string `json:"status"`
Outcome string `json:"outcome"`
Target string `json:"target"`
}
type RunGraphEvidence struct {
Complete bool `json:"complete"`
Visits []RunGraphVisit `json:"visits"`
}
// Label is the operator-facing name of a run: the generated Title when the
// server stored one, otherwise the pipeline Name (historical rows predate
// titles). It is the single definition shared by the CLI and TUI.