Skip to content

Add sequence control, scrubbing, and stepping endpoints - #9

Merged
MasterUser43 merged 6 commits into
legacy_cartfrom
sequencing
Sep 15, 2026
Merged

MasterUser43 merged 6 commits into
legacy_cartfrom
sequencing

Conversation

@MasterUser43

@MasterUser43 MasterUser43 commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Implements sequence control endpoints (/sequence/* [view below]) to give operators control over test sequences. This enables pausing, resuming, timeline scrubbing, and stepping thro' predefined phases of fire.yaml w/o triggering intermediate hardware actions during jumps.

Endpoints Added

Method Endpoint Description
GET /sequence Retrieves the list of steps and static sequence configuration.
POST /sequence/start Resumes/starts the sequence from the current cursor position.
POST /sequence/stop Pauses execution and freezes the cursor at the current offset.
POST /sequence/time Scrubs the sequence clock to a target timestamp (only while stopped).
POST /sequence/step Scrubs the sequence clock to a target named step (only while stopped).

Response Schema (start, stop, time, step)

{
  "step": "<string | null>",
  "server_time_ms": 1717000000000,
  "sequence_time_ms": 12500
}

Errors relevant to issue

  • 409 Conflict: Returned by /sequence/time and /sequence/step for a backward seek while the sequence is actively running (forward seeks while running are allowed), or if fire.yaml cannot be loaded/driven.
  • 422 Unprocessable Entity: Returned by /sequence/step if an invalid or unknown step name is passed.

Operational & Safety Behavior

The following is based upon implementation and relevant action for Front-end folks:

  • The sequence clock is operator-driven. Clock would advance following POST /fire or POST /sequence/start, & freezes on POST /sequence/stop.
  • No hardware actions are triggered during scrubbing while stopped. Calling /sequence/time or /sequence/step while stopped only repositions the timeline pointer. While running, a forward /sequence/time//sequence/step call fires every actuator action between the current position and the target, then keeps ticking live from there; a backward seek while running is refused (409) since "unfiring" isn't safe.
  • Resume vs. Fire:
    • POST /fire always resets execution to $\tau=0$. <-- (Likely to be reviewed w/ an issue & fix to account for pre-ignition).
    • POST /sequence/start resumes execution from the current cursor offset (i.e., where /sequence/stop paused).
  • Cursor Reset Rules:
    • The offset is preserved on POST /sequence/stop & on natural completion (after the last scripted action, the clock keeps counting),instead of freezing or resetting to 0.
    • On abort, the position freezes wherever it was but is invalidated: POST /sequence/start is refused until a fresh POST /fire runs, which is what actually resets the cursor to $\tau=0$ and clears the invalidation.

Suggestions for Dashboard Integration

Keep the Fire and Resume / Start actions separate in the UI. Do not combine them.

  • Fire -> POST /fire (Resets to $\tau=0$) <-- (Likely to be reviewed w/ an issue & fix to account for pre-ignition).

  • Resume -> POST /sequence/start (Starts from current cursor)

  • Pause -> POST /sequence/stop (Preserves cursor)

  • UI Timer: The client-side sequence clock should not tick unless actively started, but note it keeps counting after natural completion (not reset/frozen). Must poll GET /sequence status or /status's sequence_step/timing fields rather than gating the display on sequence_active only.

For more friendly implementation, I've included step names in fire.yaml to be mapped s.t. functionality is more on the DAQ-side.

  1. purge_open
  2. ignition_on
  3. ignition_off
  4. purge_close
  5. main_valves_open
  6. main_valves_close
  7. purge_reopen
  8. press_vent_close
  9. purge_final_close

Future Considerations

  • SSE / Streaming Compatibility (/stream):
    sequence_step is omitted from SSE /stream to avoid breaking existing downstream consumers/tests pinning the exact key set (active, name, elapsed_s). This obviously can change; however, the benefit of doing that, from initial consideration, would just be time synchron. which can be solved alternatively. Since sequence_step is available via GET /status and GET /snapshot, the running step can be found via the streamed elapsed_s + static steps from GET /sequence. Additionally, each /sequence/* command returns the current step synchronously in its response body.

- Add POST /sequence/* endpoints for seekable playback.
- Fix thread on sequence start & debounce abort idle checks.
- Update tests and fire.yaml for sequence runs.
@MasterUser43 MasterUser43 linked an issue Sep 8, 2026 that may be closed by this pull request
@MasterUser43 MasterUser43 changed the title Add sequence playback controls & fix engine race conditions Add sequence control, scrubbing, and stepping endpoints Sep 8, 2026
@MasterUser43
MasterUser43 marked this pull request as draft September 8, 2026 21:53
@MasterUser43
MasterUser43 marked this pull request as ready for review September 15, 2026 20:09
@MasterUser43
MasterUser43 merged commit 1b67031 into legacy_cart Sep 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LQD-DAQ: Sequencing Support

1 participant