Skip to content

P0 Studio: cancel queued SV START with bounded priority STOP and block bare START - #250

Open
masarray wants to merge 2 commits into
fix/studio-smart-serial-reconnect-20261019from
fix/studio-sv-stop-cancel-pending-start-20261019
Open

masarray wants to merge 2 commits into
fix/studio-smart-serial-reconnect-20261019from
fix/studio-sv-stop-cancel-pending-start-20261019

Conversation

@masarray

Copy link
Copy Markdown
Owner

P0 guardrail — queued SV START cancellation (precedes acknowledged scenario transaction)

Base: PR #247 at f3e445616e9e7d8ba10e787ba4248a1a0396e557 (stacked on #246/#234). Do not target or merge to main.

Root cause

The primary Studio START uses an all-or-none serial queue batch rather than firmware ACK. A second stale entry point requestStart() could bypass the current 4I+4V snapshot, while requestStop() returned success without sending STOP before RUNNING telemetry arrived. The Stop ribbon button was disabled during queued START, and only PTP STOP had a reserved full-queue safety slot.

Focused changes

  • Fail closed for bare DeviceController::start and supervisor requestStart; require requestStartWithScenario for operator intent.
  • Permit the Stop button during pending START and always send an SV STOP cancellation against a connected verified device.
  • Add one bounded, coalesced, reserved SV STOP slot in the existing serial worker, independent of PTP STOP; discard not-yet-written SV START commands (including future SCENARIO START) without relaxing bounded queue/ordering.
  • Extend deterministic session harness with bare-START rejection and full-queue START cancellation including exclusive queue accounting.

Invariants / test contract

No ISR, PTP servo, MAC hardware timestamp gate, smpSynch, SV codec, shape math, signal scales or automatic firmware flash changed. Shutdown still sends SV STOP before PTP STOP. Both emergency stop slots are bounded. Worker transport-write acceptance is not firmware ACK.

Explicitly NOT solved by this PR

The FREQ/SET/ENABLE/SHAPE commands still update firmware incrementally and the existing START batch is not firmware-atomic. A new typed scenario -> staging -> validated COMMIT -> generation/hash ACK -> readback -> gated START integration PR is P0-A and remains mandatory before hardware acceptance. This PR does not establish GUI-to-PCAP equality, physical STOP delivery or PTP <10s lock. Physical ESP32-P4 cancellation and PCAP must be tested, and exact-SHA CI runs must be checked.

Acceptance / rollback

Build Studio Qt + Windows Lifecycle + Native Preview from exact HEAD, run arstack_session_harness, then independently test STOP during queued START with serial + PCAP on isolated lab Ethernet. Roll back to #247 SHA f3e44561 if regression. Leave in draft until review/CI/field proof.

@masarray
masarray marked this pull request as ready for review October 19, 2026 04:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T04:48:52.560763Z eb7448b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb7448b23e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

tone: bar.workflow.injectionRunning ? "danger" : "neutral"
iconSource: Qt.resolvedUrl("../assets/material/stop.svg")
enabled: (bar.workflow.injectionRunning || bar.controller.offlinePreviewRunning)
enabled: (bar.workflow.injectionRunning || bar.workflow.startQueued || bar.controller.offlinePreviewRunning)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Enable the F6 stop shortcut while START is queued

During the pending-START interval, this enables cancellation only through the ribbon button, while the F6 shortcut in Main.qml:658 remains enabled only when the session state is already RUNNING. An operator pressing F6 while startQueued is true therefore gets no action, allowing the queued START to proceed despite the stop intent; gate the shortcut on workflowBar.startQueued as well.

Useful? React with 👍 / 👎.

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.

1 participant