Skip to content

P0-B: atomic running 4I+4V live setpoints with firmware commit/readback - #253

Closed
masarray wants to merge 25 commits into
fix/p0-sv-reject-unverified-start-20261019from
fix/p0-sv-atomic-live-apply-20261019
Closed

masarray wants to merge 25 commits into
fix/p0-sv-reject-unverified-start-20261019from
fix/p0-sv-atomic-live-apply-20261019

Conversation

@masarray

@masarray masarray commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

Root cause

RUNNING edits in Main.qml still used legacy per-channel SET / FREQ / SHAPE, which can publish mixed intermediate 4I+4V SV frames. Additionally an urgent SV STOP cleared a queued independent PTP STOP.

Design

Reuse the same SvScenarioTransaction and triple-bank state from parent PR #252; differentiate stopped START versus RUNNING live update, checksum the complete GUI 8-channel/FREQ/quality/enabled/CT shape snapshot, and atomically publish once. Firmware rejects non-transactional per-channel commands while RUNNING. Live transaction ACK + applied-state readback must agree with nonce/hash/boot/generation, without sending START or resetting smpCnt or phase. QML revisions preserve edits arriving during the in-flight transaction; pendingApply only clears on verified ACK. STOP suppresses retries and retains independent PTP STOP safety.

Tests: portable live transaction atomicity + replay rejection, Studio deterministic live ACK/no-START, emergency STOP with PTP STOP preserved; exact SHA CI must be green before hardware acceptance. No ISR/PTP/smpSynch modifications. No merge to main; physical waveform/phase/fps/PTP still pending.

Additional fail-closed reconnect gate

A board observed as RUNNING after USB reconnect is not proof of a newly operator-approved START. Main.qml now disarms live auto-apply on verification/reconnect and WorkflowBar arms it only from an in-flight operator START after token-bound ACK. Late or unsolicited RUNNING telemetry leaves the draft dirty without sending CFG. Source-policy regression guards this boundary. Independent PTP STOP still survives SV queue cancellation.

@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-19T09:01:41.766499Z 0e71eea 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 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: 0e71eea9ae

ℹ️ 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 on lines +669 to +670
bool DeviceController::applyLiveScenario(const QVariantMap& scenario) {
return submitScenario(scenario, false);

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 Negotiate live CFG support separately

When Studio connects to a previous same-version build, that build remains compatible because build mismatch is advisory and it already advertises SV-CONFIG-TXN-V1, but it rejects CFG BEGIN while running. This new method therefore submits an unsupported live batch; processLine() does not recognize CFG BEGIN rejected as terminal, so eight seconds later failScenarioStart() sends STOP, unexpectedly terminating an otherwise valid injection on its first edit. Conversely, the new firmware retains LIVE-SETPOINTS while rejecting the legacy running SET path used by older Studio builds. Add a distinct capability or bump the protocol/version, then gate both behaviors on it.

AGENTS.md reference: AGENTS.md:L235-L236

Useful? React with 👍 / 👎.

masarray added a commit that referenced this pull request Oct 22, 2026
Preserve PR #253 in current transactional bank: permit staging only within unchanged RUN state; reject legacy non-atomic SET/FREQ/ENABLE/QUALITY/SHAPE/ZERO while running, preserve one bank-generation atomicity, commit/readback and prevent live ticket rearming START. Add portable tests.

Copy link
Copy Markdown
Owner Author

Stage-main review 2026-10-23 — KEEP OPEN, owner for HW verification only

Canonical #286 042df0d40ddd3f061ebeebc81c662c585827e346 already has the software path proposed here: firmware accepts full CFG BEGIN/FREQ/SET/ENABLE/QUALITY/SHAPE/COMMIT/SHOW while RUNNING using SvScenarioTransaction; rejects legacy per-channel mutations while RUNNING; Studio DeviceController::applyLiveScenario() requires commit/readback token/hash/generation/boot and does not issue START/reset. DeterministicSessionHarness includes svLiveTransactionAckNoRestart and svLiveTransactionRejectKeepsRunning, and the active AUTO-LIVE QML coalesces Enter/Tab/focus-out changes without a manual Apply Live button, retaining newer revisions until ACK. Exact-head Native Preview both jobs PASS: https://github.com/masarray/arstack61850/actions/runs/39882032904.

Do not close yet: this PR's physical gate is still missing. Need matched new BIN+EXE on board with continuous SV smpCnt, IA/UA RMS/phase before/after edit, no STOP/START/PTP reset, no mixed partial 4I4V frames, reliable ACK/readback/reconnect fence, STOP safety under port trouble and 1h soak. Stage-main #286 remains Draft. This is a release gate, not a request to port stale QML or mutate the other thread's branch. Branch-only commits = 25 at last comparison, so this is not ancestry-contained. Current clean closure candidates elsewhere have been disposed; unique #253 source remains preserved.

Copy link
Copy Markdown
Owner Author

M3.H release=main reconciliation — 2026-10-24

Verified product baseline is a922e9bdba4e57a4e88406eb83344455dd8ff142 (ESP32-P4 firmware Build ID a922e9bdba4e57a4); consolidated PR #299 is MERGED to main with 14/14 integration checks passing. The official M3.H Stable tag and tested source are ancestors of main.

This PR has a distinct historical/divergent change scope and is not part of the immutable shipped M3.H baseline. It remains DRAFT / NOT READY for merge; do not merge against an obsolete stacked base or count its tests as final M3.H acceptance. Reconcile only still-needed unique behavior into a fresh branch from current main, with implementation-level comparison, all affected CI tests, and targeted ESP32-P4 FAT where relevant. If superseded, close with an explicit feature-by-feature disposition instead of importing old firmware wholesale.

Canonical closure record: https://github.com/masarray/arstack61850/blob/main/docs/integration/M3H_MAINLINE_RELEASE_SOURCE_CLOSURE_2026-10-24.md .

Copy link
Copy Markdown
Owner Author

PR archival decision — M3.H release hygiene (2026-10-24)

CLOSED as SUPERSEDED HISTORICAL IMPLEMENTATION — NOT MERGED and NOT marked as a completed feature.

This branch diverges from current main; its unique changes have not passed the validated M3.H release gate. The old source and discussion stay reachable for traceability. Future implementation must be a new, narrowly scoped PR based on current main, with focused CI and hardware evidence where applicable. Closing the obsolete PR removes misleading release-ready queue items while preserving the unresolved feature requirements.

Evidence ledger: M3.H Mainline Source Closure.

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