Skip to content

fix(room): keep diagnostic header in one stdio call - #55

Merged
vincentkoc merged 3 commits into
mainfrom
fix/room-diagnostics-header-stdio
Sep 12, 2026
Merged

fix(room): keep diagnostic header in one stdio call#55
vincentkoc merged 3 commits into
mainfrom
fix/room-diagnostics-header-stdio

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 11, 2026

Copy link
Copy Markdown
Member

Problem

The native diagnostics status header uses two printf calls, or three when a
tone error is present. Another normal stdout writer can emit a record between
the header prefix, optional error label, and counters.

A recent device observation did not retain its raw header or phase. This
source-level framing repair does not establish that observation's cause.

Stacked on #54.

Changes

  • Emit the complete header in one printf, preserving its exact text,
    conditional error suffix, frame counters, and newline.
  • Preserve error/none and error labels containing spaces. Query the error
    name only when the tone state is error.
  • Leave subsequent output lines, snapshots, command returns, logging levels,
    locks, buffers, timeouts, parsers, and all media behavior unchanged.
  • Extend the existing actual-controller fixture with explicitly enabled
    synthetic snapshots and a deterministic competing normal-stdio writer.
    No production test API or new test runner.

Validation

  • The original source compiles and passes the normal/error byte table, then
    fails both intact-header assertions when a competing record is scheduled
    after its first completed print call.
  • The repaired source passes all 41 lifecycle cases with ASan/UBSan and
    warnings-as-errors, including exact normal/error output and the same
    competing-writer schedule. Queue and unsupported-boundary checks also pass.
  • git diff --check passes. Existing CI already executes the lifecycle suite.
  • Fresh P2 autoreview and independent source review found no actionable P0-P2
    issues in the frozen five-file change.
  • All five native jobs passed in
    CI run 34545231042,
    attempt 1, for signed head 6ccdee816823fae7c583735487e5d30279d90f54.
    The Waveshare job executes the lifecycle suite, including the new console
    cases. The synthetic merge has the intended base/head parents and the same
    source tree as that head.

Limits

The fixture uses real stdio calls on a temporary stream with a deterministic
between-call schedule, not hardware concurrency. One header call does not make
the multi-line report atomic or protect it from ROM output that bypasses the
stdio locking path.

The historical b105 candidate was subsequently flashed with four writes and
independent readbacks passing. Boot and one complete idle-status response were
observed. This is not physical concurrency proof or attribution of the earlier
lost header. Voice remains unqualified.

Landing

Accept the single-header repair and deterministic byte/contention regression.
Land after #54 with a merge
commit. The reviewed context resolution preserves both the inherited logging
privacy tests and every original console test; it does not change production
behavior or weaken the prior repair. The complete expected tree and refreshed
exact-head native CI remain required. No release or full media qualification
is authorized.

Accept the inherited full-write result contract, including existing failure
handling for zero and short SDK writes. The owner has released the source
landing hold for this independently reviewed subset. Fresh/upgraded-device
qualification of the cumulative image remains separate and is not claimed.

Signed integration head fe8e2fbba12dcd639ef8160f38174a2cc19f90b3
preserves the reviewed full tree
9b46cbd0dda89dbd33943e7a57e2bec252a060ac. All five native jobs and
CodeQL passed for this head in
CI run 34705924236.
This includes the combined logging-privacy and console-header lifecycle
regressions; it is not a fresh hardware run.

GitHub retained an older synthetic-merge parent after the predecessor landed.
Signed ancestry-only head e98fc38f32b9b350239dfcfdf5b6a5063f7c4f84
merges current main without changing any source bytes or the expected tree.
All five native jobs passed again in
CI run 34706550831;
the final merge requires the fresh main/head parents.

@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 12:56 PM ET / 16:56 UTC (Revision 5).

ClawSweeper review

What this changes

The PR prints the room node’s diagnostic header in one stdio call and adds regression coverage for unchanged output and competing console records.

Merge readiness

Ready for maintainer review

This remains a useful, narrowly scoped repair absent from current main. No actionable defects remain in the introduced diff; the previous compatibility concern belongs to the now-merged predecessor.

Priority: P3
Reviewed head: e98fc38f32b9b350239dfcfdf5b6a5063f7c4f84

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, byte-preserving repair with useful regression coverage and appropriately bounded claims.
Proof confidence 🌊 off-meta tidepool Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its actual-handler fixture provides supplemental byte and scheduling coverage; the reported historical idle-status observation does not prove physical contention.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its actual-handler fixture provides supplemental byte and scheduling coverage; the reported historical idle-status observation does not prove physical contention.
Evidence reviewed 7 items Current main still splits the header: The default-branch handler prints the prefix and counters separately, with a third call for tone errors; the requested framing repair is still absent.
Introduced change preserves the output contract: The complete five-file diff changes one production print expression, preserving conditional error-name evaluation, counters, newline, and subsequent lines; remaining changes provide tests and documentation.
Focused framing regression coverage: The fixture invokes the actual status handler, checks 13 tone combinations and two deterministic competing-writer cases, and explicitly limits its claims to normal stdio framing. It does not establish hardware concurrency or the cause of the historical missing header. Tests were inspected, not executed during this read-only review.
Findings None None.
Security None None.

How this fits together

The room node’s local USB console reads runtime, audio, and speaker-test snapshots. Its status command turns those snapshots into diagnostic lines for operators.

flowchart TD
  A[USB console command] --> B[Read diagnostic snapshots]
  B --> C{Tone error present}
  C -->|Yes| D[Include error label]
  C -->|No| E[Omit error suffix]
  D --> F[Print complete header once]
  E --> F
  F --> G[Print remaining status lines]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production versus test delta Production +4/-6; tests +165/-12; documentation +20/-4 Production shrinks while the added fixture checks output preservation and between-call interleaving.

Technical review

Best possible solution:

Keep the byte-preserving single-call header and focused framing regression, with hardware and full-media qualification remaining separate.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main leaves a scheduling opportunity between header print calls, and the fixture exercises that exact schedule. This review did not execute tests or reproduce the historical device observation.

Is this the best way to solve the issue?

Yes. Combining the existing format into one call removes the identified inter-call gap without changing output bytes, adding locks, or introducing another diagnostic path.

AGENTS.md: not found in the target repository.

Codex review notes: model internal, reasoning medium; reviewed against 6a1dac665311.

Labels

Label changes:

  • add P3: This improves local diagnostic readability without changing device operation, configuration, or message delivery.
  • remove P2: Current review triage priority is P3, so this older priority label is no longer current.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.

Label justifications:

  • P3: This improves local diagnostic readability without changing device operation, configuration, or message delivery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The MEMBER-authored PR is exempt from the external-contributor proof gate and changes no authority boundary. Its actual-handler fixture provides supplemental byte and scheduling coverage; the reported historical idle-status observation does not prove physical contention.

Evidence

What I checked:

  • Current main still splits the header: The default-branch handler prints the prefix and counters separately, with a third call for tone errors; the requested framing repair is still absent. (components/esp-openclaw-room-node/esp_openclaw_room_node.c:1143, 6a1dac665311)
  • Introduced change preserves the output contract: The complete five-file diff changes one production print expression, preserving conditional error-name evaluation, counters, newline, and subsequent lines; remaining changes provide tests and documentation. (components/esp-openclaw-room-node/esp_openclaw_room_node.c:1143, e98fc38f32b9)
  • Focused framing regression coverage: The fixture invokes the actual status handler, checks 13 tone combinations and two deterministic competing-writer cases, and explicitly limits its claims to normal stdio framing. It does not establish hardware concurrency or the cause of the historical missing header. Tests were inspected, not executed during this read-only review. (components/esp-openclaw-room-node/tests/test_room_talk_lifecycle.c:736, e98fc38f32b9)
  • Previous blocker is outside the remaining PR delta: GitHub confirms fix(node): validate JSON sends and trace invoke replies #54 merged at the pinned main SHA. Its full-write send contract is therefore base behavior, not introduced by this PR. The supplied maintainer disposition also accepts that contract. (6a1dac665311)
  • Review continuity and merge identity: The current head and previously reviewed head have the identical tree 9b46cbd0dda89dbd33943e7a57e2bec252a060ac. Raw test-merge parents are pinned main followed by exact PR head, and its delta contains only the five diagnostic-header files. (676bbcc3390f)
  • Area history and routing: Main-branch history identifies Vincent Koc’s recent controller and fixture work and Peter Steinberger’s earlier room lifecycle work. GitHub also verifies steipete authored the merged diagnostics-menu PR feat(room-node): add live diagnostics menu #21. Exact historical line attribution could not be completed because an older blob was unavailable; these are routing candidates, not introduction claims. (components/esp-openclaw-room-node/esp_openclaw_room_node.c, 6a1dac665311)

Likely related people:

  • vincentkoc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-09-11T00:11:04.617Z sha 6ccdee8 :: needs changes before merge. :: none
  • reviewed 2026-09-11T00:24:35.218Z sha 6ccdee8 :: needs changes before merge. :: none
  • reviewed 2026-09-12T16:16:59.036Z sha 6ccdee8 :: blocked before merge. :: none
  • reviewed 2026-09-12T16:44:10.913Z sha fe8e2fb :: blocked before merge. :: none

@vincentkoc
vincentkoc changed the base branch from diag/invoke-reply-boundaries to main September 12, 2026 16:11
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. label Sep 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. and removed P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. labels Sep 12, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review September 12, 2026 16:50
@clawsweeper clawsweeper Bot added P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. and removed P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. labels Sep 12, 2026
@clawsweeper

clawsweeper Bot commented Sep 12, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(room): keep diagnostic header in one stdio call This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@vincentkoc
vincentkoc merged commit b97b7ca into main Sep 12, 2026
14 checks passed
@vincentkoc
vincentkoc deleted the fix/room-diagnostics-header-stdio branch September 12, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant