dashboard

package
v0.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Overview

Package dashboard serves a local, read-only web view over the verifiable provenance graph: the runs, their merged timeline, the unified signals/risks, the verify+signature status, and -- the signature view -- the causality DAG (LLM intent -> action -> policy -> risk), which a flat event stream cannot show. It is a thin presentation layer: every JSON endpoint reuses the SAME internal functions as the CLI/AI tools (provenance.Verify, signals.Export, etc.), so the UI never diverges from the contract. Read-only, local-first: the HTML/JS is embedded in the binary and loads no external assets.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReplayScript added in v0.9.0

func ReplayScript() []byte

ReplayScript returns the browser reader used by exported public demos.

Types

type ComparisonIssue added in v0.10.0

type ComparisonIssue struct {
	SourceID  string `json:"source_id"`
	Dimension string `json:"dimension"`
	Code      string `json:"code"`
}

type ComparisonPage added in v0.10.0

type ComparisonPage struct {
	SchemaVersion string             `json:"schema_version"`
	RunID         string             `json:"run_id"`
	Records       []ComparisonRecord `json:"records"`
	Issues        []ComparisonIssue  `json:"issues"`
	SourcesRead   int                `json:"sources_read"`
	HasMore       bool               `json:"has_more"`
	NextCursor    string             `json:"next_cursor,omitempty"`
}

type ComparisonRecord added in v0.10.0

type ComparisonRecord struct {
	Dimension       string                      `json:"dimension"`
	Key             string                      `json:"key"`
	Label           string                      `json:"label"`
	Operation       string                      `json:"operation"`
	EvidenceKind    string                      `json:"evidence_kind,omitempty"`
	Mechanism       string                      `json:"mechanism,omitempty"`
	ComparisonScope string                      `json:"comparison_scope,omitempty"`
	Value           *agentcontext.SnapshotValue `json:"value"`
	Partial         bool                        `json:"partial"`
	Evidence        SearchSource                `json:"evidence"`
}

Comparison records are read projections of saved evidence. Keys identify comparable fields or observed sets, never paired sessions or tool steps.

type PreparedReplay added in v0.10.0

type PreparedReplay struct {
	Inventory       ReplayInventory
	InventorySHA256 string
	// contains filtered or unexported fields
}

PreparedReplay owns a private, frozen directory, independent of the source database and workspace. Close removes it after download or cancellation.

func (*PreparedReplay) Close added in v0.10.0

func (p *PreparedReplay) Close() error

func (*PreparedReplay) WriteZIP added in v0.10.0

func (p *PreparedReplay) WriteZIP(ctx context.Context, out io.Writer) error

WriteZIP uses only the prepared inventory, never the live database. Each file is checked before writing, so a changed or missing shard aborts the download.

type ReplayContents added in v0.10.0

type ReplayContents struct {
	Sessions       int            `json:"sessions"`
	ContextEntries int            `json:"context_entries"`
	LatestEntries  int            `json:"latest_context_entries"`
	BodyRefs       int            `json:"context_body_refs"`
	RawRefs        int            `json:"context_raw_refs"`
	Sources        map[string]int `json:"indexed_sources"`
}

Counts describe saved sources, not successful operations or collection coverage.

type ReplayExports added in v0.10.0

type ReplayExports struct {
	// contains filtered or unexported fields
}

ReplayExports owns at most one preparation or frozen archive. It is enabled by the local CLI, not by public static replay or internal projection handlers.

func NewReplayExports added in v0.10.0

func NewReplayExports(server Server) *ReplayExports

func (*ReplayExports) Close added in v0.10.0

func (m *ReplayExports) Close()

type ReplayFile added in v0.10.0

type ReplayFile struct {
	Path   string `json:"path"`
	SHA256 string `json:"sha256"`
	Bytes  int64  `json:"bytes"`
}

type ReplayInventory added in v0.10.0

type ReplayInventory struct {
	SchemaVersion     string                         `json:"schema_version"`
	RunID             string                         `json:"run_id"`
	Scope             string                         `json:"scope"`
	CreatedAt         string                         `json:"created_at"`
	Commit            string                         `json:"commit"`
	Signed            bool                           `json:"signed"`
	Events            int                            `json:"events"`
	Contents          ReplayContents                 `json:"contents"`
	Selection         ReplayFile                     `json:"record_selection"`
	SelectionSummary  *ReplaySelectionSummary        `json:"selection_summary,omitempty"`
	AnalysisOmissions map[string]int                 `json:"analysis_omissions,omitempty"`
	CapturePolicy     *agentcontext.CapturePolicy    `json:"capture_policy,omitempty"`
	CaptureSettings   *observability.CaptureSettings `json:"capture_settings,omitempty"`
	Files             []ReplayFile                   `json:"files"`
	Bytes             int64                          `json:"bytes_excluding_inventory"`
}

ReplayInventory describes the exact files frozen for a share. The inventory excludes itself; its digest is returned separately by the preparation step.

type ReplayPages added in v0.9.0

type ReplayPages struct {
	Offsets []int64          `json:"offsets"`
	Pages   []staticdata.Ref `json:"pages"`
}

type ReplayRun added in v0.9.0

type ReplayRun struct {
	Audit     *replayAuditIndex                    `json:"audit,omitempty"`
	Compare   map[string]staticdata.Ref            `json:"compare,omitempty"`
	Search    map[string]map[string]staticdata.Ref `json:"search,omitempty"`
	Sessions  map[string]replaySession             `json:"sessions,omitempty"`
	API       map[string]staticdata.Ref            `json:"api"`
	Lenses    staticdata.Ref                       `json:"lenses"`
	Events    staticdata.Ref                       `json:"events"`
	Timeline  staticdata.Ref                       `json:"timeline"`
	Context   staticdata.Ref                       `json:"context"`
	Artifacts staticdata.Ref                       `json:"artifacts"`
	EventRefs map[string][]string                  `json:"event_refs"`
	Filters   map[string]eventQuery                `json:"filters"`
}

type ReplaySelection added in v0.10.0

type ReplaySelection struct {
	RunID             string   `json:"run_id"`
	Scope             string   `json:"scope"`
	Harness           string   `json:"harness,omitempty"`
	SessionID         string   `json:"session_id,omitempty"`
	ExcludeRecords    []string `json:"exclude_records,omitempty"`
	ExcludeCategories []string `json:"exclude_categories,omitempty"`
}

ReplaySelection defines a sharing copy, without changing the saved evidence. Record IDs use the existing search catalog, including entry/<id>.

type ReplaySelectionSummary added in v0.10.0

type ReplaySelectionSummary struct {
	Selection    ReplaySelection          `json:"selection"`
	Included     int                      `json:"included_records"`
	Excluded     int                      `json:"excluded_records"`
	Reasons      map[string]int           `json:"exclusion_reasons"`
	Warnings     []replaySelectionWarning `json:"warnings,omitempty"`
	WarningCount int                      `json:"warning_count"`
}

The preview uses this bounded summary instead of loading the complete record manifest into the browser. Detailed membership remains in record-selection.json.

type SearchSource added in v0.10.0

type SearchSource struct {
	ID                 string                           `json:"id"`
	Category           string                           `json:"category"`
	Kind               string                           `json:"kind"`
	Label              string                           `json:"label"`
	Node               string                           `json:"node,omitempty"`
	GraphNode          string                           `json:"graph_node,omitempty"`
	SourceID           string                           `json:"source_id,omitempty"`
	Harness            string                           `json:"harness,omitempty"`
	SessionID          string                           `json:"session_id,omitempty"`
	AgentID            string                           `json:"agent_id,omitempty"`
	ToolCallID         string                           `json:"tool_call_id,omitempty"`
	RecordedAt         string                           `json:"recorded_at,omitempty"`
	ExecutionScope     string                           `json:"execution_scope,omitempty"`
	Entry              *agentcontext.Entry              `json:"entry,omitempty"`
	Content            agentcontext.ContentRef          `json:"content"`
	SessionAssociation *provenance.SessionAuditRelation `json:"session_association,omitempty"`
}

Search sources describe existing readers; they never copy or index a body. The same bounded browser scanner consumes this catalog online and offline.

type SearchSourceOptions added in v0.10.0

type SearchSourceOptions struct {
	RunID, Harness, SessionID, Cursor string
}

type SearchSources added in v0.10.0

type SearchSources struct {
	SchemaVersion string                        `json:"schema_version"`
	RunID         string                        `json:"run_id"`
	Harness       string                        `json:"harness,omitempty"`
	SessionID     string                        `json:"session_id,omitempty"`
	Sources       []SearchSource                `json:"sources"`
	HasMore       bool                          `json:"has_more"`
	NextCursor    string                        `json:"next_cursor,omitempty"`
	SessionAudit  *provenance.SessionAuditScope `json:"session_audit,omitempty"`
}

type Server

type Server struct {
	DB            *sql.DB
	ReplayExports *ReplayExports
	RunLabels     map[string]string // Presentation-only titles; evidence identities stay unchanged.
	// contains filtered or unexported fields
}

Server serves the dashboard over a single read-only *sql.DB.

func (Server) ComparisonRecords added in v0.10.0

func (s Server) ComparisonRecords(ctx context.Context, run, cursor string) (ComparisonPage, error)

func (Server) ExportReplay added in v0.9.0

func (s Server) ExportReplay(ctx context.Context, run string, w *staticdata.Writer) (ReplayRun, error)

ExportReplay exports only the supplied run from an isolated, verified demo database. It uses the same readers as the local dashboard, including redaction, content limits and absence diagnostics. It never opens a workspace file.

func (Server) ExportReplaySet added in v0.10.0

func (s Server) ExportReplaySet(ctx context.Context, run string, w *staticdata.Writer, visibleRuns []string) (ReplayRun, error)

ExportReplaySet includes relationship discovery within an explicit export catalog, without following those links to copy additional runs.

func (Server) Handler

func (s Server) Handler() http.Handler

Handler returns the dashboard's HTTP routes (static UI + JSON API).

func (Server) PrepareOfflineReplay added in v0.10.0

func (s Server) PrepareOfflineReplay(ctx context.Context, run string) (_ *PreparedReplay, err error)

PrepareOfflineReplay freezes one complete run. Selection is explicit here; linked runs remain references and are never recursively exported. Source content is read only through the dashboard's saved-evidence readers.

func (Server) PrepareSelectedOfflineReplay added in v0.10.0

func (s Server) PrepareSelectedOfflineReplay(ctx context.Context, input ReplaySelection) (_ *PreparedReplay, err error)

PrepareSelectedOfflineReplay freezes a run and projects all replay readers onto the same explicit selection. Related records outside it stay references.

func (Server) SearchSources added in v0.10.0

func (s Server) SearchSources(ctx context.Context, opts SearchSourceOptions) (SearchSources, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL