feat: S14.08 make SolidSyslogFormatter library-private (#548)#558
Conversation
Additive opaque destination-host sink mirroring SolidSyslogHeaderField, wrapping a sender's stack formatter. Verbatim bounded copy (no PRINTUSASCII substitution) so a DNS name / IP literal reaches the resolver intact. No consumer yet; the endpoint cutover follows in slice 2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Flip SolidSyslogEndpoint.Host from a raw SolidSyslogFormatter* to the opaque SolidSyslogEndpointHost*. Every endpoint-host writer migrates together: - both senders wrap their stack host formatter in the sink before invoking the endpoint callback and read the host back out unchanged; - StreamSender's nil-endpoint, all five BDD target configs (TCP/UDP/TLS/mTLS/ Windows), the FreeRTOS pipeline, and the BDD service-thread test write via the sink. Byte-identical: the existing sender + BDD-target tests are the safety net. SolidSyslogFormatter.h is now the only public header referencing the formatter, unblocking the move to Core/Source in slice 3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Move SolidSyslogFormatter.h from Core/Interface to Core/Source. With the endpoint host now behind SolidSyslogEndpointHost, no public header or Tier-3 target reaches the formatter; it is a Core implementation detail. Platform sources compile into the library target and keep their PRIVATE Core/Source view, and tests/BDD-target tests already add Core/Source to their include path, so the move needs no CMake include-path changes and the header drops out of the installed public set. The two worst-case sizing macros gain a NOLINTBEGIN/END(macro-usage) pair (matching SolidSyslogMacros.h) since the Core/Interface tier-wide disable no longer covers them; the stale Formatter.h example is dropped from that tier's .clang-tidy comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drop the now-private SolidSyslogFormatter.h row and the retired SolidSyslogStringFunction.h row from the CLAUDE.md public-header table; add SolidSyslogEndpointHost, SolidSyslogHeaderField(+Function), and the SD writers SolidSyslogSdElement / SdValue / SdValueFunction; fix the Endpoint, StructuredData(Definition), MetaSd, and OriginSd rows to match the post-E14 writer model. Sweep the stale OriginSd lines in rfc-compliance.md (escaping is applied by SolidSyslogSdValue, not a raw formatter; no pre-formatted scratch storage). The SD-authoring design note (docs/structured-data.md) is deferred to S14.09, where it lands beside the integrator guide. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update misra_suppressions.txt for the SolidSyslogFormatter.h Core/Interface → Core/Source path move (11.2/11.3 cast 28→35, 5.7 stays 14) and the StreamSender/UdpSender line drift from the endpoint-host cutover (verified by re-running CI's exact --addon=misra command: branch returns exit 0, fired set matches the main baseline). clang-format reflow on the new sink files; DEVLOG entry for the session. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR introduces ChangesFormatter Privatization via EndpointHost
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1511 passed) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/rfc-compliance.md (2)
26-26: 💤 Low valueConsider streamlining the SD-NAME/SD-ID syntax validation parenthetical.
The parenthetical "(…the standard SDs (meta / timeQuality / origin) use compile-time-constant names)" is tangential to the escaping requirement in §6.3.3. While not incorrect, it adds editorial weight to an already dense compliance entry. Consider moving this detail to the E14 reference or removing it if the distinction is documented elsewhere.
🤖 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 `@docs/rfc-compliance.md` at line 26, The parenthetical about standard SD names is tangential and should be removed from the §6.3.3 escaping row; edit the text for SD-PARAM / SolidSyslogSdValue (and its mentions of OriginSd, MetaSd, SolidSyslogSdValueFunction) to keep only the escaping behaviour and UTF‑8 substitution detail, and either move the removed parenthetical into the E14 discussion or convert it into a short cross-reference sentence like "See E14 for SD-NAME / SD-ID validation and compile-time-constant standard SD names" so the E14 issue remains the canonical place for that detail.
28-28: ⚡ Quick winClarify the IP count bounding statement.
The phrase "the IP value length is the integrator's to bound (ultimately by
SOLIDSYSLOG_MAX_MESSAGE_SIZE), as is the IP count" creates ambiguity. The parallel structure suggests the IP count is also bounded "ultimately bySOLIDSYSLOG_MAX_MESSAGE_SIZE," but the preceding text states "the IP count [is unbounded by library logic]."Consider: "...the IP value length is the integrator's to bound (ultimately by
SOLIDSYSLOG_MAX_MESSAGE_SIZE); the IP count is likewise integrator-controlled (unbounded by library logic, but collectively limited by message capacity)."🤖 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 `@docs/rfc-compliance.md` at line 28, The sentence about IP bounding is ambiguous; clarify that the integrator controls both individual IP value length and the IP count, and that while the library does not enforce an IP-count limit (via SolidSyslogOriginIpCountFunction/SolidSyslogOriginIpAtFunction), both per-IP length and the total number of IP params are effectively constrained by overall message capacity (SOLIDSYSLOG_MAX_MESSAGE_SIZE). Change the wording to state: IP value length is up to the integrator (ultimately bounded by SOLIDSYSLOG_MAX_MESSAGE_SIZE); the IP count is also integrator-controlled (the library will call SolidSyslogOriginIpCountFunction and loop 0..N-1) — the library imposes no separate per-count limit, only the collective limit imposed by message size.
🤖 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.
Inline comments:
In `@Core/Source/CMakeLists.txt`:
- Line 38: The SOURCES list in CMakeLists.txt is out of alphabetical order: move
the entry SolidSyslogEndpointHost.c so it appears before
SolidSyslogHeaderField.c within the SOURCES list to restore alphabetical
ordering (adjust the CMakeLists.txt SOURCES block accordingly).
---
Nitpick comments:
In `@docs/rfc-compliance.md`:
- Line 26: The parenthetical about standard SD names is tangential and should be
removed from the §6.3.3 escaping row; edit the text for SD-PARAM /
SolidSyslogSdValue (and its mentions of OriginSd, MetaSd,
SolidSyslogSdValueFunction) to keep only the escaping behaviour and UTF‑8
substitution detail, and either move the removed parenthetical into the E14
discussion or convert it into a short cross-reference sentence like "See E14 for
SD-NAME / SD-ID validation and compile-time-constant standard SD names" so the
E14 issue remains the canonical place for that detail.
- Line 28: The sentence about IP bounding is ambiguous; clarify that the
integrator controls both individual IP value length and the IP count, and that
while the library does not enforce an IP-count limit (via
SolidSyslogOriginIpCountFunction/SolidSyslogOriginIpAtFunction), both per-IP
length and the total number of IP params are effectively constrained by overall
message capacity (SOLIDSYSLOG_MAX_MESSAGE_SIZE). Change the wording to state: IP
value length is up to the integrator (ultimately bounded by
SOLIDSYSLOG_MAX_MESSAGE_SIZE); the IP count is also integrator-controlled (the
library will call SolidSyslogOriginIpCountFunction and loop 0..N-1) — the
library imposes no separate per-count limit, only the collective limit imposed
by message size.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b02c4957-a4cd-439d-bfe3-c4285f196b91
📒 Files selected for processing (24)
Bdd/Targets/Common/BddTargetFreeRtosPipeline.cBdd/Targets/Common/BddTargetMtlsConfig.cBdd/Targets/Common/BddTargetTlsConfig.cBdd/Targets/Linux/BddTargetTcpConfig.cBdd/Targets/Linux/BddTargetUdpConfig.cBdd/Targets/Windows/BddTargetWindows.cCLAUDE.mdCore/Interface/.clang-tidyCore/Interface/SolidSyslogEndpoint.hCore/Interface/SolidSyslogEndpointHost.hCore/Source/CMakeLists.txtCore/Source/SolidSyslogEndpointHost.cCore/Source/SolidSyslogEndpointHostPrivate.hCore/Source/SolidSyslogFormatter.hCore/Source/SolidSyslogStreamSender.cCore/Source/SolidSyslogUdpSender.cDEVLOG.mdTests/Bdd/Targets/BddTargetServiceThreadTest.cppTests/CMakeLists.txtTests/SolidSyslogEndpointHostTest.cppTests/SolidSyslogStreamSenderTest.cppTests/SolidSyslogUdpSenderTest.cppdocs/rfc-compliance.mdmisra_suppressions.txt
| SolidSyslogSdValue.c | ||
| SolidSyslogSdElement.c | ||
| SolidSyslogHeaderField.c | ||
| SolidSyslogEndpointHost.c |
There was a problem hiding this comment.
File inserted in incorrect alphabetical position.
SolidSyslogEndpointHost.c (line 38) appears after SolidSyslogHeaderField.c (line 37), but alphabetically "EndpointHost" should precede "HeaderField". The SOURCES list appears to maintain alphabetical order.
📋 Suggested fix
Move SolidSyslogEndpointHost.c to precede SolidSyslogHeaderField.c:
SolidSyslogSdValue.c
SolidSyslogSdElement.c
+ SolidSyslogEndpointHost.c
SolidSyslogHeaderField.c
- SolidSyslogEndpointHost.c
SolidSyslogTimeQualitySd.c🤖 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 `@Core/Source/CMakeLists.txt` at line 38, The SOURCES list in CMakeLists.txt is
out of alphabetical order: move the entry SolidSyslogEndpointHost.c so it
appears before SolidSyslogHeaderField.c within the SOURCES list to restore
alphabetical ordering (adjust the CMakeLists.txt SOURCES block accordingly).
Closes #548.
Makes
SolidSyslogFormattera library-internal detail. The issue's premise — "no remaining public consumer of the formatter" — was wrong:SolidSyslogEndpoint.Hostwas still a rawSolidSyslogFormatter*the endpoint callback wrote the destination host into. Resolved (David's call) with a new dedicated endpoint-host writer, mirroring the S14.07 HeaderField migration.Slices
SolidSyslogEndpointHostsink (TDD, 3 tests) — opaque, stack-transient, wraps the sender's stack host formatter._Stringdoes a verbatim bounded copy (no PRINTUSASCII substitution, unlike HeaderField) so a DNS name / IP literal reaches the resolver intact. That charset difference is why it's its own type.Endpoint.Host→SolidSyslogEndpointHost*. Every endpoint-host writer migrates together: both senders (byte-identical), StreamSender nil-endpoint, all five BDD configs (TCP/UDP/TLS/mTLS/Windows), the FreeRTOS pipeline, and the BDD service-thread test.SolidSyslogFormatter.h→Core/Source/(private). No CMake include-path change needed; the two sizing macros gain aNOLINTBEGIN/END(macro-usage)pair (matchingSolidSyslogMacros.h).rfc-compliance.mdOriginSd lines swept.Verification
debug: 1474 tests green.BddTargetTests: 66/66 (these compile the BDD configs thejunittarget does not).--addon=misracommand).Deferred
docs/structured-data.md(the SD-authoring design note) moves to S14.09, where it lands beside the integrator guide. E14 then closes with S14.09.🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
SolidSyslogEndpointHostAPI for endpoint host configuration with newSolidSyslogEndpointHost_String()function.Documentation