Skip to content

Record a per-tick timeline in the trace #48

Description

@e54-bot

Problem

The editor and the user need a Workshop-Inspector-like view of a run: which rules ran at which server frame, how variables changed, what was logged. The trace only has end-of-run state (logs, globals, players, hud), so nothing can be shown per frame.

Scope

  • Add a timeline to Trace: one entry per tick that had activity (empty ticks omitted), in order. Each entry holds: tick, time (ms), the rule executions started or resumed on that tick (rule index and name, eventPlayer id or null, how it ended: finished, waiting with wake tick, aborted), and the state changes in execution order: global and player variable writes (name, index path when an array element, old, new), world-state changes (health/cooldown/ultimate), HUD element creation/destruction, log lines.
  • Bound the size: cap on entries with a truncated marker, so a long Bastion run cannot blow up the JSON. Pick and document the cap.
  • Recording is part of the simulator; wasm32 build stays green. Existing fields keep their meaning. A run that ends not_modeled still returns the timeline up to the stop.
  • Document the JSON shape in docs/simulator-interface.md. Add the shape to docs/scenario.schema.json only if the schema covers traces.

Acceptance criteria

  • Test: a program with Set Global Variable, Wait(0.5), then a second write yields timeline entries at the expected ticks with correct old/new and a wait wake tick.
  • Test: a not_modeled stop keeps the entries before the stop.
  • Test: the cap truncates and sets the marker.
  • Existing tests unchanged and green; standard gates and wasm32 build pass.

Non-goals

Any viewer UI (editor issue); new modeled constructs.

Activity

  1. added
    enhancementNew feature or request
    ready-for-implementationContract settled; an Engineer can implement without inventing a decision
    p1Critical path of the current roadmap line, or a bug that hits real workflows
    on Oct 25, 2026
  2. added theissue type on Oct 25, 2026
  3. added a commit that references this issue on Oct 25, 2026
    1f5c565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestp1Critical path of the current roadmap line, or a bug that hits real workflowsready-for-implementationContract settled; an Engineer can implement without inventing a decision

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions