Skip to content

fix(P1.3): prevent slow SV/PTP STOP proof from being cut off by Studio health monitor - #355

Open
masarray wants to merge 4 commits into
mainfrom
fix/p1-3-slow-serial-stop-proof-recovery
Open

masarray wants to merge 4 commits into
mainfrom
fix/p1-3-slow-serial-stop-proof-recovery

Conversation

@masarray

@masarray masarray commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Reproduced on COM15 — real operator trace (2026-11-03 20:03 UTC)

  • 20:03:40 Studio transmitted STOP, PTP STOP.
  • 20:03:44 normal 2 s SHOW-health watchdog treated the pending maintenance transaction as missing replies, retired the QSerialPort, and aborted firmware provisioning.
  • 20:03:52 board finally returned STOP accepted (after 12 s) and 20:03:53–55 returned PTP STOPPED and SV SVLIFE STOPPED, too late for the original session. No flash occurred. The core issue is premature COM teardown + competing stale telemetry, not permission to bypass safety.

Production fix

  1. StudioDeviceController suspends only ordinary SHOW health-probe accounting during sole-supervisor firmware quiescence. Clears pre-update pending probe/misses. Existing 700 ms safety HEARTBEAT, USB disconnect checks, QSerialPort errors and absolute firmware transaction deadline remain fully active. Health monitoring resumes afterward and genuine failures still trigger retirement.
  2. DeviceController drops facade-owned deferred non-safety SHOW/PROFILE/old PTP readbacks at handoff and stops replaying them until maintenance exits. Reserved priority STOPs and fresh post-ACK SVLIFE/PTP SHOW readbacks still run on the same single worker.
  3. The former 5 s maintenance PTP timeout/12 s STOP watchdog (shorter than actual field response) become bounded 40 s PTP proof / 45 s whole STOP proof, still under unchanged 300 s absolute transaction cap. Ordinary PTP STOP remains 5 s. No unconditional timeout extension for unrelated stages.
  4. Adds production-source deterministic S8 regression for watchdog isolation, restoration of normal monitoring after maintenance, fail-closed absence of proof, retired deferred readbacks, and fixed bounded stage deadlines.

No --force, ROM reset, flash, false READY, or auto SV/PTP restart without verified STOP. Preserves published M3.H.3 stable, M4 PR #350, LAN autonomy PR #330. Physical COM15 retest needed; code/CI alone is not hardware acceptance.

Merge gates

Exact-head Windows/Linux S8+Qt, Windows Lifecycle, matched Native Preview Windows ZIP/Inno installer, Linux paired preview, and firmware catalog/installer smoke tests must pass. Avoid pushes unless a genuine CI failure requires correction.

  1. Unverified Retry fail-closed: if a STOP/USB failure loses application identity, a remembered COM/Retry cannot silently invoke disruptive ROM probing. Only beginFirmwareInstall(true) on a currently isolated/identified blank-board candidate can authorize ROM-only recovery. New S8 negative case verifies no probe/flash on lost identity. This is the distinct operator-consent boundary required by AGENTS.md; normal verified post-STOP handoff remains unchanged.

Latest implementation SHA: 2f3b1bd0a8b9648c13055455410be55fded0e550.

  1. M4 retained-lease regression: if the serial worker must retire an in-flight M4 exclusive CFG tail, fresh STOP-created SV/PTP SHOW readbacks are held until the exclusive retirement ACK and then drained. Pre-update PROFILE SHOW is always discarded. S8 regression proves no premature STOP verification. Latest candidate head: c5cf218ec9891a5d927ad5f8774e2db5851702ff.

…ation

Suspend only ordinary SHOW health accounting during authorized firmware quiescence; keep heartbeat, OS link monitoring and fresh SV/PTP ACK/readback mandatory. Retire stale deferred reads at maintenance entry, suppress their replay, and apply bounded 40s PTP/45s supervised STOP windows grounded in field traces where STOP ACK followed after 12 seconds. Add S8 regression for premature COM retirement, proof isolation and restored normal health. No forced flash, no silent service restart.
@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.

…ied ROM retry

A failed STOP may retire application identity. Do not let Retry on a remembered COM bypass supervised STOP by entering the blank-board ROM path. Bind that exception to the confirmed beginFirmwareInstall entry only, fail closed with re-identification guidance, and lock it with S8 negative regression.
…retirement

Maintenance discards pre-existing readback flags before STOP, but STOP-created safety SHOW/PTP SHOW may still be deferred by M4 exclusive retirement. Drain only those proof readbacks once the serial worker acknowledges retirement, never stale PROFILE SHOW, and add a negative S8 regression ensuring no premature verification.
…onsole proof

The workspace source-policy gate hardcoded the removed 5 s PTP STOP syntax, causing an early CI failure before compilation. Assert the new bounded maintenance PTP/supervisor deadlines, strict deferred readback behavior and SHOW-health isolation instead; retain all existing QML authority guards.

This branch has not been deployed

No deployments
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