Skip to content

refactor: S11.03 rename NullBuffer to PassthroughBuffer#398

Merged
DavidCozens merged 2 commits into
mainfrom
refactor/s11-03-passthrough-buffer-rename
May 18, 2026
Merged

refactor: S11.03 rename NullBuffer to PassthroughBuffer#398
DavidCozens merged 2 commits into
mainfrom
refactor/s11-03-passthrough-buffer-rename

Conversation

@DavidCozens

@DavidCozens DavidCozens commented May 18, 2026

Copy link
Copy Markdown
Owner

Purpose

Closes #397.

SolidSyslogNullBuffer is misnamed — it isn't a GoF Null Object. Its Write forwards directly into an injected SolidSyslogSender; its purpose is single-task targets where the application thread is willing to block on transport I/O. Calling it Null* has confused readers (the iec62443.md SR 6.1 row had to spell out "single-task / synchronous Send" because the name didn't). E11 already plans to migrate every stateful Created class onto SolidSyslogPoolAllocator; the rename belongs at some point in that work. Splitting it off from the Core sweep (S11.04) keeps both review surfaces small — the cross-tree identifier rename here, the pool semantics there.

Change Description

Purely mechanical rename observing docs/NAMING.md:

  • Files (git mv): Core/Interface/SolidSyslogNullBuffer.h, Core/Source/SolidSyslogNullBuffer.c, Tests/SolidSyslogNullBufferTest.cpp → corresponding PassthroughBuffer paths. The test rename is detected at the 50% similarity threshold; the .h/.c pair fall under it because every line carries an identifier swap, but git history is intact via --find-renames.
  • Tier 1: SolidSyslogNullBuffer_Create, _Destroy, struct SolidSyslogNullBuffer, include guard SOLIDSYSLOGNULLBUFFER_HSolidSyslogPassthroughBuffer_* / SOLIDSYSLOGPASSTHROUGHBUFFER_H.
  • Tier 2: file-scope statics NullBuffer_Read, _Write, _SelfFromBase, _InstancePassthroughBuffer_* per the strip-only rule.
  • Tests: TEST_GROUP(SolidSyslogPassthroughBuffer). Individual TEST names left alone — they describe behaviour.
  • Call sites: Tests/SolidSyslogTest.cpp (include + two Create/Destroy calls), two CMakeLists.txt source entries.
  • Docs: CLAUDE.md audience-table row, README.md (two prose), SKILL.md (one prose), docs/iec62443.md (three SR rows), Core/Interface/SolidSyslogBlockStore.h recursion-gotcha comment, Bdd/features/tcp_singletask.feature Feature description, Bdd/features/steps/syslog_steps.py historical-context block.
  • MISRA: misra_suppressions.txt 11.3 entry path updated (line number unchanged — same content).

Three adjacent doc honesty corrections forced by the rename (substantive edits in an otherwise mechanical story — calling them out explicitly):

  1. CLAUDE.md Design Patterns null-object bullet dropped PassthroughBuffer from the list. Not a null object — keeping it would propagate the false framing the rename is trying to fix. NullSecurityPolicy + NullStore remain (genuine no-ops).
  2. SKILL.md Architecture line "Null object pattern throughout (NullBuffer is the buffer null object)" — parenthetical struck. The remaining "Null object pattern throughout" stands (NullMutex / NullStore / NullSecurityPolicy genuinely are).
  3. Core/Source/SolidSyslog.c nil-collaborators comment block "(e.g. NullBuffer is a direct-send shim)" caveat removed. With the misleading example gone, the caveat no longer applies.

Three deliberate non-renames to keep visible:

  • Tests/SolidSyslogTest.cpp::TEST(SolidSyslogLifecycle, CreateWithNullBufferReportsError) — NULL pointer, not the class.
  • Tests/SolidSyslogUdpSenderTest.cpp::TEST(SolidSyslogUdpSenderBadSetup, SendWithNullBufferReportsErrorAndDoesNotSend) — NULL pointer, not the class.
  • Bdd/Targets/FreeRtos/main.c:6 historical S08.04 comment — preserved as historical narrative.

Test Evidence

  • No new tests, no behaviour change. The eight existing tests (now TEST_GROUP(SolidSyslogPassthroughBuffer)) carry over byte-for-byte except for the group identifier.
  • Gates run locally: debug, clang-debug, sanitize, coverage, tidy, cppcheck, clang-format.
  • Full suite green on both gcc and clang containers.
  • Coverage: SolidSyslogPassthroughBuffer.c at 100% line (matches SolidSyslogNullBuffer.c's prior coverage — identical code, different name).
  • cppcheck-misra: 88 hits on this branch, 88 on main — zero new findings, zero entries against SolidSyslogPassthroughBuffer.c. (Side-note: S11.02's closing notes recorded the baseline as "60". Re-running the identical CI command on main in isolation produces 88 — the earlier number was non-deterministic or a partial run. The true invariant — "no new findings introduced by the rename" — is met. The story body's AC E01: Core Syslog Formatting #3 inherits the same stale number; the real bar is "unchanged from main".)

Areas Affected

  • Core/Interface/, Core/Source/ — the renamed pair plus three small touches (SolidSyslogBlockStore.h recursion comment, SolidSyslog.c nil-collaborators comment, CMakeLists.txt).
  • Tests/ — renamed test file, group rename, two call sites in SolidSyslogTest.cpp, CMakeLists.txt.
  • Bdd/features/ — feature description + step file historical-context comment.
  • Root docs — CLAUDE.md, README.md, SKILL.md.
  • docs/iec62443.md.
  • misra_suppressions.txt.

Out of scope (carrying forward to S11.04): the Instance singleton, the void _Destroy(void) signature, the existing 11.3 storage-cast suppression on the SelfFromBase helper, the absence of a SOLIDSYSLOG_PASSTHROUGHBUFFER_POOL_SIZE tunable. S11.04 migrates this class onto SolidSyslogPoolAllocator and retires the cast in the same move.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated architecture documentation, deployment guides, and compliance materials to reflect buffer implementation changes.
  • Refactor

    • Replaced buffer implementation to optimize single-task system deployments.
  • Tests

    • Updated test suite to validate new buffer implementation behavior and maintain full coverage.

Review Change Stack

NullBuffer was misnamed -- it isn't a GoF Null Object, it's a
passthrough that forwards Write directly into an injected Sender.
Cross-tree rename observing docs/NAMING.md:

- Tier 1: public functions, struct tag, include guard
- Tier 2: file-scope statics (PassthroughBuffer_*) per the strip-only rule
- Tests: TEST_GROUP(SolidSyslogPassthroughBuffer); test names unchanged
- Files: git mv preserves history (test file rename detected; .h/.c pair
  rewritten too thoroughly for the 50% similarity threshold but history is
  intact via --find-renames)

Adjacent doc honesty corrections forced by the rename:

- CLAUDE.md null-object bullet drops PassthroughBuffer (it isn't one).
- SKILL.md parenthetical "NullBuffer is the buffer null object" struck.
- SolidSyslog.c nil-collaborators block drops the "different semantics
  (e.g. NullBuffer)" caveat -- without the example, the family is now
  uniform (NullMutex, NullStore, NullSecurityPolicy are genuine no-ops).

Out of scope (no behaviour change, no structural change):

- No 3-TU split, no PoolAllocator wiring, no _POOL_SIZE tunable.
  The Instance singleton, the void _Destroy, and the existing 11.3
  storage-cast all carry forward unchanged. S11.04 retires them.
- Two test names containing "NullBuffer" intentionally NOT renamed
  because they refer to NULL pointers, not the class:
  CreateWithNullBufferReportsError, SendWithNullBufferReportsErrorAndDoesNotSend.
- DEVLOG.md historical entries + Bdd/Targets/FreeRtos/main.c historical
  S08.04 comment preserved as-is.

Gates: debug, clang-debug, sanitize, coverage (PassthroughBuffer.c at
100%), tidy, cppcheck, clang-format. cppcheck-misra count 88 -- exactly
matches main, zero new findings, zero entries against the renamed file.

Refs #397.
@coderabbitai

coderabbitai Bot commented May 18, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d26d7cd-d572-4f63-8f9f-474287d5c9be

📥 Commits

Reviewing files that changed from the base of the PR and between 4829dfc and 77b7c8e.

📒 Files selected for processing (18)
  • Bdd/features/steps/syslog_steps.py
  • Bdd/features/tcp_singletask.feature
  • CLAUDE.md
  • Core/Interface/SolidSyslogBlockStore.h
  • Core/Interface/SolidSyslogNullBuffer.h
  • Core/Interface/SolidSyslogPassthroughBuffer.h
  • Core/Source/CMakeLists.txt
  • Core/Source/SolidSyslog.c
  • Core/Source/SolidSyslogNullBuffer.c
  • Core/Source/SolidSyslogPassthroughBuffer.c
  • DEVLOG.md
  • README.md
  • SKILL.md
  • Tests/CMakeLists.txt
  • Tests/SolidSyslogPassthroughBufferTest.cpp
  • Tests/SolidSyslogTest.cpp
  • docs/iec62443.md
  • misra_suppressions.txt
💤 Files with no reviewable changes (2)
  • Core/Interface/SolidSyslogNullBuffer.h
  • Core/Source/SolidSyslogNullBuffer.c

📝 Walkthrough

Walkthrough

A mechanical symbol rename of SolidSyslogNullBuffer to SolidSyslogPassthroughBuffer across public headers, implementation, build system, tests, and documentation. The buffer's behavior—write-through forwarding to a sender—is unchanged; the rename fixes a naming confusion between the actual "passthrough" semantics and the GoF Null Object pattern.

Changes

NullBuffer → PassthroughBuffer Symbol Rename

Layer / File(s) Summary
PassthroughBuffer public API contract
Core/Interface/SolidSyslogPassthroughBuffer.h
New header declares SolidSyslogPassthroughBuffer_Create(struct SolidSyslogSender* sender) and SolidSyslogPassthroughBuffer_Destroy(void) in place of the prior NullBuffer public functions.
PassthroughBuffer implementation and write-through semantics
Core/Source/SolidSyslogPassthroughBuffer.c
New implementation defines the singleton buffer with create/destroy lifecycle wiring and PassthroughBuffer_Write that forwards all data to SolidSyslogSender_Send, and PassthroughBuffer_Read that always returns failure (reads unsupported).
Build system and test infrastructure updates
Core/Source/CMakeLists.txt, Tests/CMakeLists.txt, Tests/SolidSyslogPassthroughBufferTest.cpp, Tests/SolidSyslogTest.cpp, misra_suppressions.txt
CMake source lists swap SolidSyslogNullBuffer.c for SolidSyslogPassthroughBuffer.c; test group renamed and setup/teardown fixture calls updated to SolidSyslogPassthroughBuffer_Create/_Destroy; MISRA suppression path updated to reference the new implementation file.
Documentation, comments, and semantic updates
Core/Source/SolidSyslog.c, README.md, CLAUDE.md, SKILL.md, Core/Interface/SolidSyslogBlockStore.h, docs/iec62443.md, Bdd/features/tcp_singletask.feature, Bdd/features/steps/syslog_steps.py
All architecture tables, design-pattern guidance, recursion notes, and compliance docs updated to reference PassthroughBuffer; internal comment in SolidSyslog.c clarifies that file-static Nil collaborators are distinct from the public SolidSyslogNull* family; PassthroughBuffer removed from the "no null-pointer checks" design rule (it is not a true Null Object).
Devlog entry
DEVLOG.md
New entry documents S11.03 scope, adjacent doc corrections, deliberate non-renames (e.g., CreateWithNullBuffer* test names that refer to NULL pointers), and verification gates (cppcheck-misra counts unchanged, coverage equivalence).

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • DavidCozens/solid-syslog#382: Prior refactoring of Core/Source/SolidSyslogNullBuffer.c internals; this PR removes and replaces that file with the renamed PassthroughBuffer implementation.
  • DavidCozens/solid-syslog#378: Earlier changes to the NullBuffer implementation surface; this PR completes the rename and removes the old API entirely.
  • DavidCozens/solid-syslog#368: MISRA suppression curation; this PR updates the suppression path from SolidSyslogNullBuffer.c:54 to SolidSyslogPassthroughBuffer.c:54.

🐰 A buffer renamed, no longer null,
PassthroughBuffer shines, candid and full—
Write-through it sends, with synchronous grace,
No more confusion in single-task space! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.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 and concisely describes the main change: a refactoring that renames NullBuffer to PassthroughBuffer, which is the primary objective of the PR.
Description check ✅ Passed The PR description comprehensively covers Purpose (links #397), Change Description (detailed mechanical rename with tiers, file moves, call sites, docs, and three doc honesty corrections), Test Evidence (existing tests carry over, gates green, coverage parity, cppcheck-misra unchanged), and Areas Affected.
Linked Issues check ✅ Passed The PR fully meets issue #397's requirements: all symbol renames across tiers (Tier 1 functions/struct/include guard, Tier 2 file-scope statics) are implemented, files renamed via git mv, call sites updated, docs/comments corrected, MISRA suppression path updated, three doc honesty edits applied, and three deliberate non-renames preserved.
Out of Scope Changes check ✅ Passed All changes are scoped to the mechanical rename objective. No unrelated refactoring, no pool allocator migration, no structural improvements—only identifier renames, file moves, call-site updates, and doc rewrites directly tied to the rename purpose.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/s11-03-passthrough-buffer-rename

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.

@github-actions

Copy link
Copy Markdown
Contributor

☀️   Quality Summary

   🚦   build-linux-gcc: 100% successful (✔️ 1145 passed, 🙈 2 skipped)
   🚦   build-freertos-host-tdd: 100% successful (✔️ 1265 passed, 🙈 2 skipped)
   🚦   build-linux-clang: 100% successful (✔️ 1097 passed, 🙈 2 skipped)
   🚦   sanitize-linux-gcc: 100% successful (✔️ 1097 passed, 🙈 2 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: 73% successful (✔️ 36 passed, 🙈 13 skipped)
   🚦   build-windows-msvc: 100% successful (✔️ 1001 passed, 🙈 1 skipped)
   🚦   build-linux-tunable-override: 100% successful (✔️ 1097 passed, 🙈 2 skipped)
   ⚠️   Clang-Tidy: 9 warnings (normal: 9)
   ⚠️   CPPCheck: No warnings


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

@DavidCozens DavidCozens merged commit 7c6d4b3 into main May 18, 2026
20 checks passed
@DavidCozens DavidCozens deleted the refactor/s11-03-passthrough-buffer-rename branch May 18, 2026 10:11
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.

S11.03: Rename NullBuffer to PassthroughBuffer (no functional change)

1 participant