diagnostics

package
v0.1.0-alpha.78 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: GPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package diagnostics records safe app traces and diagnostic exports.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MotionTracePlanner

type MotionTracePlanner struct {
	Mode              string         `json:"mode"`
	Event             string         `json:"event"`
	Style             string         `json:"style,omitempty"`
	Seed              int64          `json:"seed,omitempty"`
	PatternIdentifier string         `json:"pattern_id,omitempty"`
	SpeedPercent      int            `json:"speed_percent,omitempty"`
	DriftToPercent    int            `json:"drift_to_percent,omitempty"`
	DurationMillis    int64          `json:"duration_ms,omitempty"`
	SegmentIndex      int            `json:"segment_index,omitempty"`
	Scores            []PlannerScore `json:"scores,omitempty"`
	Note              string         `json:"note,omitempty"`
}

MotionTracePlanner records one deterministic mode-planner decision so a stopped device is diagnosable as planner-wait versus transport failure.

type MotionTraceRetarget

type MotionTraceRetarget struct {
	PreviousPlanID                  string             `json:"previous_plan_id,omitempty"`
	NextPlanID                      string             `json:"next_plan_id,omitempty"`
	PreviousPatternIdentifier       string             `json:"previous_pattern_id,omitempty"`
	NextPatternIdentifier           string             `json:"next_pattern_id,omitempty"`
	PreviousProgramIdentifier       string             `json:"previous_program_id,omitempty"`
	NextProgramIdentifier           string             `json:"next_program_id,omitempty"`
	PreviousTarget                  *MotionTraceTarget `json:"previous_target,omitempty"`
	NextTarget                      *MotionTraceTarget `json:"next_target,omitempty"`
	EstimatedCurrentPositionPercent float64            `json:"estimated_current_position_percent,omitempty"`
	EstimatedCurrentStreamMillis    int64              `json:"estimated_current_stream_ms,omitempty"`
	SelectedHandoffMillis           int64              `json:"selected_handoff_ms,omitempty"`
	SelectedLeadMillis              int64              `json:"selected_lead_ms,omitempty"`
	RecentCommandLatencyMillis      int64              `json:"recent_command_latency_ms,omitempty"`
	PhasePreserved                  bool               `json:"phase_preserved"`
	BridgePointsInserted            bool               `json:"bridge_points_inserted"`
	Recovery                        string             `json:"recovery,omitempty"`
}

MotionTraceRetarget records retarget decision details required for real-device review.

type MotionTraceRow

type MotionTraceRow struct {
	Sequence         uint64                   `json:"sequence"`
	Timestamp        string                   `json:"timestamp"`
	Source           string                   `json:"source"`
	Reason           string                   `json:"reason"`
	Target           *MotionTraceTarget       `json:"target,omitempty"`
	Sample           *MotionTraceSample       `json:"sample,omitempty"`
	Retarget         *MotionTraceRetarget     `json:"retarget,omitempty"`
	Planner          *MotionTracePlanner      `json:"planner,omitempty"`
	TransportCommand *transport.Command       `json:"transport_command,omitempty"`
	TransportResult  *transport.CommandResult `json:"transport_result,omitempty"`
	Annotation       string                   `json:"annotation,omitempty"`
}

MotionTraceRow is the stable JSON row schema for motion and transport traces.

type MotionTraceSample

type MotionTraceSample struct {
	PositionPercent float64 `json:"position_percent"`
	TimeMillis      int64   `json:"time_ms"`
}

MotionTraceSample records a sampled transport-neutral motion point.

type MotionTraceTarget

type MotionTraceTarget struct {
	Label                     string   `json:"label,omitempty"`
	SpeedPercent              int      `json:"speed_percent,omitempty"`
	StrokeMinPercent          int      `json:"stroke_min_percent,omitempty"`
	StrokeMaxPercent          int      `json:"stroke_max_percent,omitempty"`
	ReverseDirection          bool     `json:"reverse_direction,omitempty"`
	PatternIdentifier         string   `json:"pattern_id,omitempty"`
	ProgramIdentifier         string   `json:"program_id,omitempty"`
	MediaIdentifier           string   `json:"media_id,omitempty"`
	MediaSpeedLimitEnabled    bool     `json:"media_speed_limit_enabled,omitempty"`
	AreaMinPercent            int      `json:"area_min_percent,omitempty"`
	AreaMaxPercent            int      `json:"area_max_percent,omitempty"`
	SoftAnchorPositionPercent int      `json:"soft_anchor_position_percent,omitempty"`
	SoftAnchorWeightPercent   int      `json:"soft_anchor_weight_percent,omitempty"`
	MotionKind                string   `json:"motion_kind,omitempty"`
	DynamicCenterPercent      int      `json:"dynamic_center_percent,omitempty"`
	DynamicSpanPercent        int      `json:"dynamic_span_percent,omitempty"`
	DynamicSpanMinPercent     int      `json:"dynamic_span_min_percent,omitempty"`
	DynamicSpanProfile        string   `json:"dynamic_span_profile,omitempty"`
	DynamicPhraseSeed         uint32   `json:"dynamic_phrase_seed,omitempty"`
	DynamicAnchors            []string `json:"dynamic_anchors,omitempty"`
	DynamicVariationPercent   int      `json:"dynamic_variation_percent,omitempty"`
	DynamicSegmentSeconds     int      `json:"dynamic_segment_seconds,omitempty"`
	DynamicSectionCount       int      `json:"dynamic_section_count,omitempty"`
	EffectiveSpeedPercent     float64  `json:"effective_speed_percent,omitempty"`
	PaceLimited               bool     `json:"pace_limited,omitempty"`
	PaceLimiters              []string `json:"pace_limiters,omitempty"`
	CommandedMeanTravel       float64  `json:"commanded_mean_travel_percent_per_second,omitempty"`
	CommandedPeakVelocity     float64  `json:"commanded_peak_velocity_percent_per_second,omitempty"`
	DevicePeakVelocity        float64  `json:"device_peak_velocity_percent_per_second,omitempty"`
}

MotionTraceTarget records semantic target context without raw transport shape.

type PlannerScore

type PlannerScore struct {
	PatternIdentifier string  `json:"pattern_id"`
	Score             float64 `json:"score"`
	Chosen            bool    `json:"chosen"`
}

PlannerScore records one candidate's deterministic score.

type TraceExport

type TraceExport struct {
	SchemaVersion             string                             `json:"schema_version"`
	Rows                      []MotionTraceRow                   `json:"rows"`
	DroppedRows               uint64                             `json:"dropped_rows"`
	IntifaceDispatches        []transport.IntifaceDispatchStatus `json:"intiface_dispatches,omitempty"`
	IntifaceDispatchesDropped uint64                             `json:"intiface_dispatches_dropped"`
	IntifaceLinearSentCount   uint64                             `json:"intiface_linear_sent_count"`
	VibratorEvents            []transport.VibratorEvent          `json:"vibrator_events,omitempty"`
	VibratorEventsDropped     uint64                             `json:"vibrator_events_dropped,omitempty"`
}

TraceExport is the stable JSON envelope returned by trace export endpoints.

type TraceRing

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

TraceRing is a fixed-capacity, oldest-first motion trace ring.

func NewTraceRing

func NewTraceRing(capacity int) *TraceRing

NewTraceRing creates an in-memory trace ring with at least one row capacity.

func (*TraceRing) Add

Add stores a sanitized trace row and returns the stored row.

func (*TraceRing) Export

func (r *TraceRing) Export() TraceExport

Export returns the stable trace export envelope.

func (*TraceRing) LatestSequence

func (r *TraceRing) LatestSequence() uint64

LatestSequence returns the most recently assigned row sequence. It lets a motion engine retain exactly its own stopped session without clearing or taking ownership of the process-wide diagnostic ring.

func (*TraceRing) Rows

func (r *TraceRing) Rows() []MotionTraceRow

Rows returns the trace rows in oldest-first order.

func (*TraceRing) Summary

func (r *TraceRing) Summary() TraceSummary

Summary returns trace metadata for app state snapshots.

type TraceSummary

type TraceSummary struct {
	SchemaVersion string `json:"schema_version"`
	RowCount      int    `json:"row_count"`
	Capacity      int    `json:"capacity"`
	DroppedRows   uint64 `json:"dropped_rows"`
}

TraceSummary is a compact app-state view of trace availability.

Jump to

Keyboard shortcuts

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