Skip to content

M3E.3: fail-closed SOURCE readiness on STOP, TX faults and boot ambiguity - #223

Merged
masarray merged 2 commits into
feature/esp32p4-smv-ptp-epoch-binding-m3c-20261015from
fix/ptp-m3e-source-readiness-failclosed-20261017
Oct 17, 2026
Merged

masarray merged 2 commits into
feature/esp32p4-smv-ptp-epoch-binding-m3c-20261015from
fix/ptp-m3e-source-readiness-failclosed-20261017

Conversation

@masarray

Copy link
Copy Markdown
Owner

Root cause

M3E.2 SOURCE lifecycle checks accepted any historical PTP status=RUNNING with positive Announce/Sync/FollowUp counters. STOP, rejected START, unavailable/truncated status, or TX failure after an earlier RUNNING could incorrectly remain OBSERVED. Missing boot IDs on later IDENTIFY lines were also ignored.

Fix

  • Evaluate the latest complete native SOURCE PTP SHOW status, including STOPPED and TXfail.
  • Revoke readiness after STOP, rejected START, unavailable/incomplete SHOW; latch nonzero PTP TX failures within the same boot.
  • Require same valid boot ID on every IDENTIFY event.
  • Add three adversarial regression tests and M3E.3 documentation.

Host-only evidence hardening; no firmware, Studio, PCAP decoder or receiver behavior changed. The experimental stack remains Draft. Independent PTP phase/egress/IED physical evidence is still missing and smpSynch=AUTO must remain unqualified.

Exact code commit: bdaf84c1fe333eb88f0a025d290a2f0bbd0a52d2.

@masarray
masarray marked this pull request as ready for review October 17, 2026 08:28
@masarray
masarray merged commit ba3d6c3 into feature/esp32p4-smv-ptp-epoch-binding-m3c-20261015 Oct 17, 2026
13 checks passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T08:30:17.575960Z 7472f69 Draft marked ready
ℹ️ 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: 7472f6918c

ℹ️ 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 +33 to +34
SOURCE_INVALIDATION = re.compile(
r"\bPTP (?:stop requested|start rejected|status unavailable)\b")

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 Invalidate readiness on asynchronous TX failures

When a qualified source later emits the firmware's asynchronous PTP TX failed (...) warning from embedded/esp32p4_smv_injector/main/ptp_lab_task.cpp:763, this pattern does not match it and the log need not contain another PTP status= line. A capture ending at that fault therefore retains last_ready=True and sourceTxFaultObserved=False, returning OBSERVED, even though the same failure would veto qualification if a subsequent SHOW exposed its incremented TXfail; latch this native fault event as well.

AGENTS.md reference: AGENTS.md:L11-L16

Useful? React with 👍 / 👎.

Comment on lines +208 to +210
identity_lines = [line for line in lines if IDENTITY.search(line)]
boot_ids = [m.group(1).lower() for line in identity_lines
if (m := BOOT_ID.search(line))]

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 Validate every identity event before reusing boot provenance

identity_lines includes only lines that already satisfy IDENTITY, whose regex requires a valid build field. Consequently a later boot's truncated identity or the real firmware message ARSTACK identity unavailable: ... from embedded/esp32p4_smv_injector/main/live_control.cpp:234 is ignored; a preceding valid boot ID followed by that event and a new clean SOURCE status still returns OBSERVED. Detect all ARSTACK identity events first and require each one to contain the expected build and boot ID so evidence cannot cross an unidentified boot.

AGENTS.md reference: AGENTS.md:L11-L16

Useful? React with 👍 / 👎.

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