Skip to content

fix(P1.2): remove firmware update deadlock and verify SV/PTP STOP before flashing - #354

Merged
masarray merged 3 commits into
mainfrom
fix/p1-physical-update-quiescence-deadlock
Nov 3, 2026
Merged

masarray merged 3 commits into
mainfrom
fix/p1-physical-update-quiescence-deadlock

Conversation

@masarray

@masarray masarray commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Physical-test blocker reproduced from operator screenshots

On COM15, board reports CFG REJECT, START not sent: device preparation timed out, and PTP STOP UNVERIFIED; Advanced > Firmware incorrectly disables the only update action until SV/PTP are stopped, although the update supervisor is the intended owner of that stop. This creates a circular recovery dependency.

Production fix

  • Advanced Firmware action stays available when the verified board is active or STOP is unverified; a compact confirmation explicitly authorizes interrupting SV/PTP and installing the exact matched firmware. No parallel QML updater or direct bypass.
  • SmartSessionController now always requests fresh both SV and PTP STOP, even when cached running=false, before handing the COM to espflash. It does not trust an old RUNNING/OFF value or a STOP command being queued.
  • DeviceController::beginFirmwareQuiescence() retires incomplete PROFILE/CFG staging, sends priority STOP and PTP STOP through the existing serial worker, and waits for board STOP ACK followed by SVLIFE STOPPED SHOW readback plus PTP STOP acknowledgement followed by PTP SHOW STOPPED. A STOP_UNVERIFIED state triggers a fresh supervised STOP, not a permanently disabled UI.
  • Non-safety mutations (START/CFG etc.) are rejected during the handoff. Exact boot/session identity, stage watchdog, ROM revision/MAC, image SHA, postboot identity and no-auto-START rules remain in force.
  • Failure/timeout terminates with a visible explanation and no firmware write. No unsafe force-flash or hidden reset of autonomous output.
  • S8 deterministic regression covers a not-RUNNING CFG-pending board and PTP STOP_UNVERIFIED, rejecting ACK-only/partial proof and reactivation.

Scope: Studio QML + DeviceController + sole SmartSessionController + S8 harness. No ESP-IDF changes, no conflict with LAN autonomy #330 or M4 roster #350. Preserve M3.H.3 stable.

Merge only after exact-head Windows/Linux build, S8, Qt, security and packaged preview smoke PASS. Physical STOP behavior still needs isolated board verification.

… quiescence

Remove Advanced firmware action's circular active-PTP disabled gate. Add operator confirmation and single-supervisor STOP/readback preflight that retires pending SV/profile transactions, preempts both services, requires board SVLIFE and PTP STOP proof before ROM probe, blocks new mutations during handoff, and fails closed on uncertain state. Add deterministic regression for CFG-pending plus PTP STOP_UNVERIFIED.
@chatgpt-codex-connector

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 ⚠️ Failed 2026-11-03T19:20:32.591244Z
We couldn’t complete this review. Comment @codex review to try again.
d3e191c PR opened
ℹ️ 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

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

…ew boot

Prevent maintenance quiescence from persisting into a successfully updated board and blocking future START; wake firmware preflight when prior M4 exclusive commands finish retirement.
…dden dialogs

Display supervisor updateStatus from authorization through reconnect in the same Advanced panel; block port refresh during exclusive handoff, show truthful Updating status in the compact header, and close confirmation even when C++ rejects preflight so the error is visible.
@masarray
masarray merged commit bbd222e into main Nov 3, 2026
9 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.

1 participant