runtime

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package runtime derives the render-time runtime of quests in one pass over the session scan: which adventurers (attached sessions) are on each quest, what each is doing (the hook-observed activity), the armed loop marker, and the observed auto-gate results from the sidecar. The board, the tracker, and `quest view` all consume this one join, so their pictures of "who is on the quest and what are they doing" cannot drift. Derived state only — nothing here is ever written back to a quest.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoopRuntime

func LoopRuntime(sessionID string, marker *state.QuestLoopState) *quest.LoopRuntime

LoopRuntime maps the advisory loop marker to its render-time view. Shared by the quest snapshot and the tracker's per-session rows so the loop label (iterations, verdict, phase) is derived in exactly one place.

func Snapshot

func Snapshot(sidecar *gate.Sidecar, questIDs []string, now time.Time) map[string]quest.Runtime

Snapshot builds the derived runtime for the given quest ids in ONE pass over the state root (the per-quest SessionsForQuest scan is O(quests × sessions); a polling board cannot afford that). Sidecar results load per quest id whether or not the quest is attached — a recorded verdict outlives its session. now stamps Runtime.ObservedAt so renderers can show durations and verdict ages without a global clock.

Types

This section is empty.

Jump to

Keyboard shortcuts

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