Skip to content

Studio: ACK-gated PTP Start from native Timing GUI - #175

Merged
masarray merged 23 commits into
mainfrom
fix/studio-native-ptp-guided-start-ack-20261015
Oct 15, 2026
Merged

masarray merged 23 commits into
mainfrom
fix/studio-native-ptp-guided-start-ack-20261015

Conversation

@masarray

@masarray masarray commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

PTP fail-safe hardening checkpoint — 2026-10-15

Current PR HEAD: c9c01551789232e84f182d9092e52fe8848df486 (two focused commits after integration: 58ed859, c9c0155). Addresses two open Codex reviews on stale PTP role readback and STOP rollback after serial queue saturation.

  • STOP uses the existing DeviceIoWorker only. A single reserved/coalesced priority slot bypasses the ordinary 64-command queue and revokes unsent PTP START; all remaining FIFO commands preserve order.
  • DeviceController now treats STOP as a transaction: firmware PTP stop requested then subsequent PTP status=STOPPED. A stale STOPPED line before the acknowledgment is insufficient. Bounded Qt polling handles asynchronous stop; five-second confirmation budget does not extend on repeats.
  • On STOP timeout/rejection the controller enters stop_unconfirmed, reports output may still be active, blocks guided/legacy START and role changes, and offers manual Retry Stop PTP.
  • Older role SHOW readbacks do not abort an ACK-gated selection; the requested role must still arrive stopped before CONFIG.
  • Added deterministic regression cases for full queue, verified STOP, stale STOPPED, timeout/retry, role mismatch rollback and the guarded legacy control paths.
  • First 58ed859 Linux Qt CI compiled but revealed an expected obsolete test assertion (old test assumed failed START instantaneously became idle). c9c0155 replaces that assumption with verified rollback + retry assertions. New exact-head CI is running; do not merge before PASS: Native Preview, Qt, Windows Lifecycle, ESP32-P4, RC2.
  • A previously proven, still downloadable Inno installer for the integrated pre-hardening 03fceb0 is in artifact #11952330382. Do not label it as the newly hardened build. When new CI succeeds, independently download and verify the exact-head installer, firmware manifest, provenance, and SHA256.

Hardware GM/PPS/PTP wire-phase/IED interoperability remains unqualified. Experimental PTP M3 PR #166 stays Draft. Public stable v0.1.1 remains untouched.


ARStack Studio native Windows — ACK-gated PTP + Inno Setup Preview

Integration checkpoint (2026-10-15): head 03fceb01bb18f898076662fe2347c7592ad11b17 is a non-force, two-parent merge of main@61be86f and prior PR head a0adcbdb. The incoming 2 main commits (IED Browser M2J q/t evidence and canonical ARSAS SSOT handoff) touched no PR #175 paths, so both histories and all 17 native Studio change paths remain intact. Branch is ahead of main, not diverged. Do not merge until exact-head CI/installer gates complete.

Native product scope

  • Qt/C++/QML ARStack Studio is the only operator GUI; no web app, Python console or competing serial controller.
  • SmartSessionController / DeviceController guide PTP ROLE → stopped-role readback → CONFIG accepted → START accepted → role-matched PTP2 runtime → RUNNING; bounded Qt timeouts, cancellation, session-generation revocation and STOP rollback.
  • PTP and SV publication lifecycle remain separate. Board-reported LOCKED is not physical synchronization qualification; AUTO smpSynch=0 remains conservative.
  • apps/arstack_studio/packaging/ARStackStudio.iss: Inno Setup isolated Preview channel; same-AppId preview upgrades, running-app closure, user data preservation, uninstall; separate historical NSIS stable channel. Pinned/verified flasher, firmware built from exact Studio HEAD and manifest/SHA/capability checks.
  • New Preview workflow builds native Windows Qt app, deterministic session regression, ESP32-P4 firmware and Windows Inno install/update/uninstall smoke. It does not publish a release automatically.

Evidence (separate exact-head and hardware gates)

  • Previously green at a0adcbdb: Native Preview, Qt, Windows Lifecycle, ESP32-P4 and routing/policy CI.
  • Previous installer artifact #11946671066 checked independently (2026-10-15): ARStack-Studio-Preview-win-x64-setup.exe SHA-256 01e805c3ccfa9045ad776480659096c19322861886b7500b05ef3203228600bf; portable ZIP SHA-256 ddcec52d79212447415e53bd507859715018dc198a2d95d7553b729be0a97530. Portable firmware manifest source a0adcbdb matches GUI provenance and firmware image SHA-256. This is the PRE-integration artifact, not an artifact for the new merge head.
  • Exact integrated-head CI was triggered: Native Preview #38690271441, Qt #38690271394, Windows Lifecycle #38690271410, ESP32-P4 #38690271396, RC2 #38690271424. Mark PASS only when GitHub returns success; download/verify the NEW Inno installer and its SHA after completion.

Boundaries & coordinated handoff

  • PR M3C.1: bind SV sample-zero epochs to consecutive PTP seconds #166 M3 experimental stays Draft; no PTP M3 physical qualification or automatic stable-channel promotion.
  • Hardware acceptance remains OPEN: real ESP32-P4 firmware update/reboot/readback, external GM/PPS/hardware timestamp, SOURCE/RECEIVER lock/loss/relock, SV synchronization, IED subscriber and recovery.
  • Public v0.1.1 stable must not be overwritten. Verify operator workflow using the native Studio installer from exact integrated commit.
  • Ownership: avoid conflicting changes to native Studio/packaging and coordinate future updates on this existing PR. Canonical Workbench M2J–M2P SSOT remains under main / related IED Browser PRs.

Integration method: preserve main tree, overlay the 17 proven-disjoint file blobs from former PR HEAD, create two-parent merge commit, fast-forward the existing PR branch with expected-SHA protection (no force).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-15T01:20:14.352154Z 4ed8f69 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.

…e (M2J)

Retain true typed Quality/TimeQuality provenance from confirmed SCL-assisted initial MMS Read samples in both canonical native Browser trees. Keep the shared portable SCL adapter Qt-free; project only the first 96 eligible q/t details via the existing typed decoder. Preserve all authoritative leaf values, diagnose budget overflow with explicit Read fallback, and reject malformed/wrong-kind/failed-root evidence. Regression covers 150 mixed q/t/scalar leaves. Exact-head native Qt, portable SCL Connect and SCL Workbench CI all green.

@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: 4ed8f69587

ℹ️ 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".

Comment thread apps/arstack_studio/src/DeviceController.cpp Outdated
Comment thread apps/arstack_studio/src/DeviceController.cpp Outdated

Copy link
Copy Markdown
Owner Author

Native Studio GUI-first PTP checkpoint — verified 2026-10-15

Exact head: 8be7b8a. Branch is isolated from PTP embedded PR #166, public stable, and main.

Native implementation: existing Qt Timing panel now sends one supervisor-owned guided PTP intent, rather than blind ROLE, CONFIG, START commands; C++ waits for matching ROLE readback, CONFIG accepted, START accepted, and live runtime status in requested role. Bounded Qt timer per ACK, STOP cancels pending startup, session generation retirement cancels state. Separate exact acknowledgement parsing prevents PTP START from falsely changing the SV OUTPUT RUNNING state. Default Sync interval corrected from unsupported 250ms to 1000ms.

Exact-head CI

Release boundary: this verifies product-source GUI reliability, NOT a packaged Windows setup.exe artifact. The Windows Lifecycle workflow uploads no installer (confirmed no artifacts). ESP32-P4 M3 receiver/GM/PPS physical evidence and firmware/Studio bundle compatibility remain unverified; no claim of user-ready new EXE or smpSynch qualification. Keep PR reviewable and do not promote to public stable until Windows package smoke with approved firmware and hardware acceptance.

Copy link
Copy Markdown
Owner Author

Studio native PTP ACK/readback gate + Inno Preview verified — 2026-10-15

Exact PR head: a0adcbdb70182e8232458e906953454dfeea5282. Existing ARStack Studio Qt/C++/QML only; no web control surface or duplicate serial owner.

Implemented

  • Guided Start now requires PTPROLE accepted before matching stopped-role readback.
  • After CONFIG/START ACK, requires a role-matched live PTP2 readback plus PTP status=RUNNING before completion. Missing/wrong runtime identity is fail-closed and queues STOP rollback.
  • Presentation SHOW is suppressed only during the bounded native START transaction; no extra polls inserted between ACK steps.
  • GUI displays receiver LOCKED as board-reported, not independent PPS/GM time qualification.
  • Deterministic native regressions added for early role readback, mismatched/missing runtime role, and successful ACK order.

Exact-head CI and packaging

Boundary

Windows installer and software protocol ACK/readback regression are verified, not physical ESP32-P4 PTP/PPS/GM/IED interoperability. Do not promote smpSynch AUTO or label the experimental M3 embedded PR #166 hardware qualified. Public stable release and main remain unchanged; PR #175 remains unmerged pending review/reconciliation with newer main.

…-thread handoff

Publish one actionable M2K–M2P milestone and ownership plan; clarify canonical MMS/q/t/RCB evidence, UI/CI/performance budgets and multi-PR merge gates. Refresh obsolete M2G handoff and add discovery pointers for all engineers. Documentation only; no runtime behavior changed.
…rkbench main

Preserve main's M2J q/t evidence and ARSAS SSOT docs alongside all PR #175 native Studio, PTP ACK gating and Inno preview changes. Trees are disjoint; both commit histories retained.
…rt saturation

Reserve a single coalesced priority STOP slot in DeviceIoWorker and discard unsent PTP START while preserving other bounded FIFO commands. Hold cancellation until firmware stop-request ACK plus subsequent STOPPED readback, polling within a fixed deadline and blocking unsafe restart on unverified STOP. Ignore stale different-role SHOW telemetry until the requested stopped role arrives. Add deterministic queue/stop/role regressions and native GUI recovery state.
…retry

Update pre-existing PTP runtime regression for stronger fail-closed cancellation semantics; exercise both guided and legacy direct START plus role-selection guards while PTP STOP remains unconfirmed.
@masarray
masarray merged commit a47d65e into main Oct 15, 2026
10 checks passed

Copy link
Copy Markdown
Owner Author

FINAL ENGINEERING HANDOFF — Native Studio/Inno/PTP fail-safe merged (2026-10-15)

PR #175 MERGED into main, merge a47d65e301bcd9ccfd0201f34322c38c7fbb91d2, reviewed head c9c01551789232e84f182d9092e52fe8848df486. Both commits share identical source tree dbaee2124f6344928857e71d0c2dfb6d3e0b596f (so the reviewed PR tree was preserved precisely in main). Preserves latest Workbench/IED Browser SSOT main commits.

Acceptance evidence

  • All 10/10 exact-PR-HEAD checks SUCCESS: native Qt and deterministic session, Windows lifecycle/ownership, ESP32-P4 firmware, RC2 Linux/Windows policy, CI routing, Windows Inno Preview. Exact-head native installer acceptance.
  • Native Inno Setup Windows Preview installer artifact ID 11952739936 for exact c9c0155, expiring 2026-10-22 06:41:30 UTC. Includes Windows Setup EXE + portable + SHA256SUMS. Installer SHA256 0a2990b8bbe836d1430b6cd4fdd7281058498cc75af451b7a155fbc2441d9025; portable ZIP SHA256 e12fda0654291494ba900352ae3d3e6762a889bfcaf02cfa467beb6033e39efa.
  • Qt runtime, flasher and firmware present. Firmware manifest sourceCommit=c9c0155..., chip=esp32p4, PROFILE-BINARY-V1, and image SHA256 independently checked.
  • Native preview tested for clean install, in-place hot upgrade with running GUI, safe uninstall and operator-owned data preservation, and actual hash-pinned NSIS v0.1.1 migration in CI only (not published as stable).
  • Two Codex review threads answered + RESOLVED: (1) PTP STOP after queued START under saturated serial queue, (2) stale PTPROLE telemetry. Resolved by reserved/coalesced priority STOP in the existing sole DeviceIoWorker, ACK + subsequent STOPPED readback/timeout state machine, unsafe START guards, stale-role handling, deterministic regression, user-visible Retry STOP.

Safety / coordination

  • Public v0.1.1 release is unchanged; this merge is not a stable release. PR M3C.1: bind SV sample-zero epochs to consecutive PTP seconds #166 remains experimental Draft, not merged. PTP SOURCE/RECEIVER physical GM/PPS/IED acceptance not established; AUTO smpSynch conservatively unqualified. No forced synchronization/trust claims.
  • Do not repeat/build parallel serial controller or web GUI. ARStack Studio native Qt GUI + Inno Setup is the operator product. Workbench canonical SSOT work remains separate.
  • Post-merge CI on merge commit a47d65e was triggered; routing and RC2 policy already PASS while Qt/Windows/ESP32-P4 build checks were still running at last inspection. Do not label postmerge checks PASS before completion.
  • NEXT: physical ESP32-P4 GUI-guided flash/reboot/readback, PTP SOURCE/RECEIVER with real GM/PPS/hardware timestamps, loss/relock/STOP fault scenarios, SV/IED subscriber interop, no auto restart on reconnect. Preserve preview/stable channel separation.

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