Skip to content

feat: S08.03 slice 9 timeQuality SD + no-RTC FreeRTOS example#313

Merged
DavidCozens merged 2 commits into
mainfrom
feat/freertos-no-rtc
May 10, 2026
Merged

feat: S08.03 slice 9 timeQuality SD + no-RTC FreeRTOS example#313
DavidCozens merged 2 commits into
mainfrom
feat/freertos-no-rtc

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 10, 2026

Copy link
Copy Markdown
Owner

Purpose

Closes #312. Last slice of S08.03 (#268) — wires timeQuality SD into the
FreeRTOS SingleTask example and switches the example to a no-RTC product
stance per RFC 5424 §6.2.3.1. Bundled with a syslog-ng pin to keep the
dev/CI oracles stable.

Change Description

No-RTC reference example (Example/FreeRtos/SingleTask/main.c)

  • Drop the TEST_TIMESTAMP placeholder and GetTimestamp callback. Set
    config.clock = NULL; the library's NilClock then yields an all-zero
    timestamp that fails TimestampIsValid and emits NILVALUE on the wire.
  • Add GetTimeQuality returning tzKnown=false, isSynced=false, syncAccuracyMicroseconds=SOLIDSYSLOG_SYNC_ACCURACY_OMIT; wire
    SolidSyslogTimeQualitySd into sdList[] between metaSd and
    originSd.

BDD tag taxonomy@rtc / @no_rtc replace @freertoswip on
time-related scenarios. time_quality.feature and origin.feature
gain @no_rtc siblings that assert the no-RTC field values
(tzKnown="0", isSynced="0"). timestamp.feature becomes
feature-level @rtc.

Deviation from #312 scope — the issue listed a new
"Timestamp is NILVALUE when no RTC is present" scenario; dropped because
syslog-ng silently substitutes receipt time for both ${ISODATE} and
${S_ISODATE} when the wire TIMESTAMP is NILVALUE, so a BDD assertion
against the oracle can't actually distinguish "wire empty" from
"wire valid". Tests/SolidSyslogTest.cpp::NullClockProducesNilvalue
plus ten sibling boundary tests already cover NILVALUE emission
end-to-end through the formatter.

syslog-ng pin to 4.8.2 (.devcontainer/docker-compose.yml,
ci/docker-compose.bdd.yml, docs/containers.md) —
balabit/syslog-ng:latest resolves to 4.11.0, which has a regression in
stats-control.c that aborts the daemon (signal 6 / exit 134) when
anything sends STATS\n over the control socket. Reproduced standalone.
When syslog-ng-freertos aborts, freertos-target loses its network
namespace (network_mode: service:syslog-ng-freertos) and VS Code can
no longer reach the dev-container API — the only recovery is restarting
Docker. 4.8.2 (4.8 LTS, ships syslog-ng 4.9.0) handles STATS\n
correctly and keeps the same behaviour our existing config relies on.

Test Evidence

  • cmake --build --preset freertos-cross --target SolidSyslogFreeRtosSingleTask — clean.
  • behave --tags='not @wip and not @freertoswip and not @rtc and @udp' Bdd/features/
    inside freertos-target: 7 features / 20 scenarios pass, 0 fail
    (4 newly-untagged @no_rtc scenarios run against the QEMU FreeRTOS target).
  • behave --tags='@udp and @rtc' for the Linux pair: timestamp,
    origin, time_quality, header_fields features all green.
  • cmake --build --preset debug --target junit — 1084/1088 tests pass
    (no library change, no deltas).
  • clang-format --dry-run --Werror on Core/Interface Core/Source Tests Example — clean.
  • Reproduced the syslog-ng 4.11.0 STATS abort with a one-line python
    client; verified 4.8.2 returns CSV stats with the daemon staying healthy.

Areas Affected

  • Example/FreeRtos/SingleTask/main.c (Tier 3 — example).
  • Bdd/features/{time_quality,origin,timestamp}.feature and
    Bdd/README.md — tag taxonomy + new no-RTC scenarios.
  • CI tag filters: ci/docker-compose.bdd.yml (Linux + FreeRTOS),
    .github/workflows/ci.yml (Windows OTel).
  • Container image pin: .devcontainer/docker-compose.yml,
    ci/docker-compose.bdd.yml, docs/containers.md.

No production library code changed.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added test scenarios for Real-Time Clock (RTC) and no-RTC timestamp handling modes
    • Updated FreeRTOS example code to demonstrate enhanced timestamp behavior
  • Tests

    • Reorganized BDD test categorization with refined tag filtering for improved platform compatibility
  • Documentation

    • Enhanced BDD feature documentation with clarified RTC vs no-RTC scenario distinctions
    • Added container version compatibility notes
  • Chores

    • Pinned syslog-ng container images to version 4.8.2 for consistent test environments

Review Change Stack

Wire timeQuality SD into the FreeRTOS SingleTask example and switch the
example to a no-RTC product stance per RFC 5424 §6.2.3.1. Bundles a
syslog-ng pin (4.11 latest aborts on STATS over the control socket and
takes the dev-container network down).

Closes #312.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 10, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@DavidCozens has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 39 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b4a47f82-bea6-4169-b518-ee1223829fd4

📥 Commits

Reviewing files that changed from the base of the PR and between a1b1e2c and 136366c.

📒 Files selected for processing (2)
  • Bdd/features/time_quality.feature
  • Bdd/features/timestamp.feature
📝 Walkthrough

Walkthrough

This PR implements the no-RTC product stance for FreeRTOS (#312): models an embedded device with no real-time clock by replacing fixed timestamps with TimeQuality structured data and NILVALUE per RFC 5424, introduces @rtc/@no_rtc BDD tags to distinguish time-aware platforms from no-RTC ones, pins syslog-ng image to 4.8.2 across Docker configs, and updates CI test filters to run appropriate scenarios per platform.

Changes

FreeRTOS No-RTC Implementation

Layer / File(s) Summary
Documentation and Tag Schema
Bdd/README.md
Introduces @rtc and @no_rtc tags to distinguish platform time-awareness; documents tag purposes and platform coverage rules.
Docker Infrastructure and Pinning
.devcontainer/docker-compose.yml, ci/docker-compose.bdd.yml, docs/containers.md
Pins balabit/syslog-ng from latest to 4.8.2 for both Linux and FreeRTOS syslog-ng services; notes 4.11.0 regression with STATS and shared network cascades.
FreeRTOS Example No-RTC Implementation
Example/FreeRtos/SingleTask/main.c
Replaces fixed TEST_TIMESTAMP with GetTimeQuality() reporting no TZ knowledge and not synced; adds SolidSyslogTimeQualitySd includes; sets config.clock=NULL for NILVALUE timestamp and wires timeQualitySd into SD list.
BDD Feature Scenarios RTC vs No-RTC
Bdd/features/origin.feature, Bdd/features/time_quality.feature, Bdd/features/timestamp.feature
Retagged RTC-assuming scenarios from @freertoswip to @rtc; added parallel @no_rtc scenarios asserting tzKnown=0 and isSynced=0 behavior; expanded timestamp feature docs on RFC 5424 NILVALUE.
Test Execution Filters by Runner
.github/workflows/ci.yml, ci/docker-compose.bdd.yml, Bdd/README.md
Updated behave tag filters to exclude @no_rtc on Linux/Windows runners and exclude @rtc on FreeRTOS runner; Bdd/README.md targets @udp for local FreeRTOS testing.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #312 — This PR directly addresses the issue: wires TimeQuality SD and NILVALUE timestamp into FreeRTOS example, introduces @rtc/@no_rtc tag taxonomy, updates BDD scenarios and CI filters to close the FreeRTOS no-RTC coverage gap.

Possibly related PRs

  • DavidCozens/solid-syslog#311 — Both PRs modify Example/FreeRtos/SingleTask/main.c and related FreeRTOS example structured-data handling (slice 8 wired meta SD/sysUpTime; this slice adds TimeQuality/no-RTC SD).
  • DavidCozens/solid-syslog#305 — Both PRs update Docker Compose BDD/devcontainer service configurations and behave tag filters across ci/ and .devcontainer/ directories.
  • DavidCozens/solid-syslog#301 — Both PRs modify the FreeRTOS SingleTask example and related FreeRTOS example behavior and structured-data integration.

Poem

🐰 No Clock, Much Honest
A FreeRTOS leap—no fake time pretense,
NILVALUE rings true where wall-clocks make no sense,
TimeQuality whispers "synced=0, tz unknown,"
@rtc and @no_rtc now claim their own—
syslog-ng 4.8.2 stands guard on the wire.
Embedded virtue, sans mystique require.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: implementing timeQuality SD wiring and the no-RTC FreeRTOS example, which aligns with the PR's primary objectives from issue #312.
Description check ✅ Passed The description comprehensively covers all required sections: Purpose (closes #312, final slice), Change Description (example wiring, BDD taxonomy, syslog-ng pin), Test Evidence (builds, BDD scenarios, unit tests, formatting), and Areas Affected (listing all touched modules).
Linked Issues check ✅ Passed All coding requirements from issue #312 are met: FreeRTOS example now models no-RTC stance with NilClock and timeQuality SD [#312]; BDD tag taxonomy (@rtc/@no_rtc) introduced and scenarios retagged [#312]; behave invocation filters updated for proper tag filtering [#312]; syslog-ng pinned to 4.8.2 to avoid regression [#312].
Out of Scope Changes check ✅ Passed All changes are within scope of issue #312: example wiring, BDD tagging and scenarios, CI tag filters, and container pin to address documented regression. No extraneous modifications to unrelated areas.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/freertos-no-rtc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Bdd/features/time_quality.feature (1)

16-21: ⚡ Quick win

Make coexist scenarios assert full timeQuality pair (tzKnown + isSynced).

On Line 16–21 and Line 30–35, the coexist scenarios currently validate sequenceId + tzKnown only. Adding isSynced here improves parity with the dedicated time_quality scenarios and avoids partial regressions.

Proposed BDD assertion additions
   Scenario: Time quality and sequence ID coexist
@@
     Then the structured data contains sequenceId "1"
     And the structured data contains tzKnown "1"
+    And the structured data contains isSynced "1"
@@
   Scenario: Time quality and sequence ID coexist (no RTC)
@@
     Then the structured data contains sequenceId "1"
     And the structured data contains tzKnown "0"
+    And the structured data contains isSynced "0"
As per coding guidelines, “`Bdd/**/*.{feature,py,cpp,c}`: BDD test infrastructure with Gherkin features, step definitions, and syslog-ng config; out of scope for Tier 1 support”.

Also applies to: 30-35

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Bdd/features/time_quality.feature` around lines 16 - 21, Update the two "Time
quality and sequence ID coexist" scenarios to assert the full timeQuality pair:
add an assertion that the structured data contains isSynced "1" in addition to
the existing tzKnown "1" and sequenceId "1" checks; specifically modify the
scenario titled "Time quality and sequence ID coexist" (and the second identical
coexist scenario) to include a step verifying isSynced "1" so the tests validate
both tzKnown and isSynced together.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Bdd/features/time_quality.feature`:
- Around line 16-21: Update the two "Time quality and sequence ID coexist"
scenarios to assert the full timeQuality pair: add an assertion that the
structured data contains isSynced "1" in addition to the existing tzKnown "1"
and sequenceId "1" checks; specifically modify the scenario titled "Time quality
and sequence ID coexist" (and the second identical coexist scenario) to include
a step verifying isSynced "1" so the tests validate both tzKnown and isSynced
together.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0dee0768-47ad-4f13-b9c4-d2bbb5868391

📥 Commits

Reviewing files that changed from the base of the PR and between fabacab and a1b1e2c.

📒 Files selected for processing (9)
  • .devcontainer/docker-compose.yml
  • .github/workflows/ci.yml
  • Bdd/README.md
  • Bdd/features/origin.feature
  • Bdd/features/time_quality.feature
  • Bdd/features/timestamp.feature
  • Example/FreeRtos/SingleTask/main.c
  • ci/docker-compose.bdd.yml
  • docs/containers.md

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1105 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 91% successful (✔️ 40 passed, 🙈 4 skipped)
   🚦   bdd-freertos-qemu: 41% successful (✔️ 20 passed, 🙈 29 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 954 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

…arios

- timestamp.feature: U+2192 (right arrow) in the feature description
  trips Windows behave's cp1252 stdout codec with UnicodeEncodeError,
  failing bdd-windows-otel before any scenario runs. § (U+00A7) survives
  because it's in cp1252; → is not. Use ASCII '->' instead.
- time_quality.feature: extend the coexist scenarios (both @rtc and the
  new @no_rtc) to assert isSynced alongside tzKnown for parity with the
  dedicated time-quality scenarios. CodeRabbit nitpick on #313.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1105 passed, 🙈 3 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1042 passed, 🙈 3 skipped)
   🚦   integration-linux-openssl: 100% successful (✔️ 9 passed)
   🚦   integration-windows-openssl: 100% successful (✔️ 9 passed)
   🚦   bdd-linux-syslog-ng: 94% successful (✔️ 46 passed, 🙈 3 skipped)
   🚦   bdd-windows-otel: 90% successful (✔️ 44 passed, 🙈 5 skipped)
   🚦   bdd-freertos-qemu: 41% successful (✔️ 20 passed, 🙈 29 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 954 passed, 🙈 1 skipped)
   ⚠️   Clang-Tidy: No warnings
   ⚠️   CPPCheck: No warnings


Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result.

@DavidCozens DavidCozens merged commit 186c129 into main May 10, 2026
19 checks passed
@DavidCozens DavidCozens deleted the feat/freertos-no-rtc branch May 10, 2026 08:42
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.

S08.03 slice 9: timeQuality SD + NILVALUE timestamp on FreeRTOS (no-RTC product stance)

1 participant