Repository navigation
Conversation
…erialized fail-safe watchdog and durable SV STOP cause
…lently report READY
…Y after unsolicited STOP
… and red GUI status
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ea447c1a19
ℹ️ 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".
| if (svStopReason_ != reason) { | ||
| svStopReason_ = reason; | ||
| emit svStopReasonChanged(); |
There was a problem hiding this comment.
Mark lease expiry as a stopped state
When the board emits Control session lease expired, firmware has already disabled SV output, but this branch only records the reason and leaves running_ true. Because WorkflowBar.unexpectedSvStop also requires !device.running, Studio continues showing green Injection running until a later SHOW response updates the state; that poll can be delayed or suppressed during other transactions. Transition to stopped when this authoritative lease-expiry event is received.
AGENTS.md reference: AGENTS.md:L74-L86
Useful? React with 👍 / 👎.
| operatorStopPending_ = false; | ||
| setRunning(false); |
There was a problem hiding this comment.
Preserve operator-stop intent through the state transition
For a normal operator STOP while running_ is true, clearing operatorStopPending_ before calling setRunning(false) makes that method classify the transition as unsolicited and set svStopReason_ to AWAITING_BOARD_CAUSE. The UI therefore shows a red unexpected-stop warning after an intentional STOP until a later SVLIFE readback clears it; perform the running transition while the operator intent is still set.
AGENTS.md reference: AGENTS.md:L74-L86
Useful? React with 👍 / 👎.
| if (seqOk && (seq >= lastSvStopSeq_ || !deviceVerified_)) { | ||
| lastSvStopSeq_ = seq; |
There was a problem hiding this comment.
Reset STOP sequence tracking when the boot ID changes
The firmware's stop_seq restarts at zero on every boot, but a same-COM soft reboot leaves lastSvStopSeq_ intact and keeps deviceVerified_ true. If the previous boot reached a higher sequence, this comparison rejects every new boot's STOP cause until its counter catches up, leaving Studio with a stale reason or AWAITING_BOARD_CAUSE; scope the sequence to the boot ID or reset it in the existing new-boot path.
AGENTS.md reference: AGENTS.md:L74-L86
Useful? React with 👍 / 👎.
…estarts publisher
…nly on board session change
…previous board cause
… Copy Diagnostics
…tatus and operator notice
2026-10-21 field-failure follow-up — verified P0 code checkpointGitHub HEAD: Independent physical evidence, from the operator's new #269 board build
Actual repairs at HEAD
Exact SHA CI: 8/8 workflow successEmbedded Profile CI; Qt Studio full harness, headless and Hi-DPI UI; C++ CI Linux+MSVC; Windows Lifecycle; Naming Guard; ESP32-P4 SMV Injector; PTP SOURCE+RECEIVER profile; Windows Native Preview. Windows native built and checked GUI + matched ESP32-P4 firmware, firmware contract, portable+Inno installer, clean install/upgrade/uninstall, real public NSIS v0.1.1 migration. Matched native Windows Studio package: https://github.com/masarray/arstack61850/actions/runs/39525598664/artifacts/12313397185 (~78 MB, GitHub Actions temporary artifact). Build ID Physical acceptance still FAILED / outstandingFlash exact build from Studio GUI and verify build ID before test. Capture >=1h without operator STOP: board must maintain true 4kfps SV, distinguish PTP physical state, classify any stopped output using SVLIFE from Copy diagnostics, prove heartbeat when serial/capture CPU under load, test safe stop after actual USB unplug, no spontaneous STOP under connected control; measure warm-vs-cold click-to-LOCK, MAC+phase proof. The 59s AUTO synchronization acquisition is NOT fixed/certified by this P0 watchdog change and requires a separate timing investigation with full early SV/PTP phase telemetry. Do not merge to main or release until bench gates pass. |
Field-reproduced failure on #269 (2026-10-21) — physical acceptance FAILED
Real board build
d21d66e2872de4cdwas flashed, verified, and captured with Studio. PCAPARStack_SV_20261021_004403_675.pcap+ report/CSV prove SV active ~00:44:06–00:44:32Z, then SV ceased until ~00:44:51Z while source PTP continued (354 valid PTP L2 frames). Studio independently reports RUNNING=false at 00:44:33Z and operator restarted. After restart smpSynch went 0→1 at 00:45:50.259Z (~59s), which is still too slow. PCAP 417,881 SV frames, no duplicated counters, one discontinuity across the actual STOP/START gap (1189 counter delta; does NOT prove 1189 packets missed while RUNNING). The only provided Studio serial log is a trailing 12,000-character snapshot from 00:46:10 onward, and cannot establish the precise physical STOP trigger at 00:44:32. Do not falsely claim actual cause is proven.Corrections (on top of #269)
HEARTBEATtask and timer callback. Replace with 4Hz periodic watchdog started once at boot, using a tight FreeRTOS critical section for heartbeat timestamp vs watchdog's STOP decision. 2.5-second fail-closed cutoff is unchanged and UART disconnect still stops physical output. No QML auto-restart, no bypass of explicit STOP. The old watchdog's races are a plausible failure path, not yet conclusively established as this incident's exact cause.SVLIFE state=... stop_cause=... stop_seq=... ..., emitted on everySHOW, surviving log truncation and STOP→START. Categories OPERATOR_STOP, LEASE_EXPIRED, RUNTIME_FAULT. This makes the next unexpected stop causally attributable without an early short serial log.SVLIFEreadback forsvStopReasonand surfaces an explicit red "SV stopped · lease expired/runtime fault" instead of misleading READY green on unrequested physical STOP. While awaiting the board's cause display a neutral pending explanation. Status clears on verified restart/board RUNNING. PTP SOURCE remains logically independent.Acceptance gates
Build ESP32-P4 / Qt Studio / Windows native combined Studio+firmware exact-head preview; all CI green required before installer is offered. Repeat physical capture with installed matching firmware, prove no unexplained STOP over 1h and enforce continuity/heartbeat fault injection, and investigate slow smpSynch 60-second acquisition separately. Do not merge main, release publicly, or label hardware PASS from CI. Stack: #270 → #269 → #268.