You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
S11.05 (#401 / #402 / #403) closed the Core sweep. This story is the first
platform-adapter sweep — POSIX. Six classes in Platform/Posix/ carry state
captured at _Create time and are file-scope singletons or storage-cast
today; all six get the canonical 3-TU split + SolidSyslogPoolAllocator
treatment.
Class
Lines
Vtable base
Today's shape
State
PosixMutex
63
Mutex
Storage-cast
pthread_mutex_t
PosixFile
159
File
Storage-cast
FILE*
PosixTcpStream
300
Stream
Storage-cast
socket FD, connect state
PosixDatagram
156
Datagram
File-scope singleton
socket FD
GetAddrInfoResolver
88
Resolver
File-scope singleton
none
PosixMessageQueueBuffer
97
Buffer
File-scope singleton
mqd_t, size + count
Out of scope per E11 epic: the five POSIX function-adapters (PosixClock, PosixHostname, PosixProcessId, PosixSysUpTime, PosixSleep) — stateless,
no _Create.
Decisions locked in pre-raise
1. Four new public GoF nulls land in S11.06, mirroring S11.04's NullSender
NullSd precedent. Each is reused immediately by the next platform sweeps:
SolidSyslogNullMutex (existing) and SolidSyslogNullBuffer (existing) cover
the remaining two. No class-private fallbacks anywhere in S11.06.
2. NullMutex migrates from _Create/_Destroy to _Get inside S11.06.
The other GoF nulls (NullSender, NullStore, NullSd, NullSecurityPolicy, NullBuffer, NullBlockDevice) are all on the _Get(void) shape. NullMutex
is the only odd one out. PosixMutex's fallback wiring lives in this story so
the shape-fix lands here too. Affected callers — Tests/SolidSyslogNullMutexTest.cpp, Tests/SolidSyslogCircularBufferTest.cpp, Tests/SolidSyslogTest.cpp, Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp — get caller-site updates
in the same commit. Crc16Policy keeps its _Create/_Destroy shape; it's
not a null object and stays out of scope here.
3. PosixMessageQueueBuffer keeps its positional _Create(size_t maxMessageSize, long maxMessages) — no config struct. Pure mechanical migration. long for maxMessages mirrors the upstream mq_attr.mq_maxmsg type and is fine under
the Pragmatic naming tier for Platform/*/Source/.
4. Pool size default 1U for every class. BDD targets and tests create one
instance per binary. Override via SOLIDSYSLOG_USER_TUNABLES_FILE per the
existing tunables mechanism.
Class
Tunable
Default
PosixMutex
SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZE
1U
PosixFile
SOLIDSYSLOG_POSIX_FILE_POOL_SIZE
1U
PosixTcpStream
SOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZE
1U
PosixDatagram
SOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZE
1U
GetAddrInfoResolver
SOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZE
1U
PosixMessageQueueBuffer
SOLIDSYSLOG_POSIX_MESSAGE_QUEUE_BUFFER_POOL_SIZE
1U
5. Three-TU split per class — unchanged from prior sweeps:
/* Before */structSolidSyslogMutex*SolidSyslogPosixMutex_Create(SolidSyslogPosixMutexStorage*);
structSolidSyslogFile*SolidSyslogPosixFile_Create(SolidSyslogPosixFileStorage*);
structSolidSyslogStream*SolidSyslogPosixTcpStream_Create(SolidSyslogPosixTcpStreamStorage*);
/* After */structSolidSyslogMutex*SolidSyslogPosixMutex_Create(void);
structSolidSyslogFile*SolidSyslogPosixFile_Create(void);
structSolidSyslogStream*SolidSyslogPosixTcpStream_Create(void);
<Class>Storage typedefs and SOLIDSYSLOG_<*>_SIZE enums deleted from public headers.
Singletons (before → after):
/* Before */voidSolidSyslogPosixDatagram_Destroy(void);
voidSolidSyslogGetAddrInfoResolver_Destroy(void);
voidSolidSyslogPosixMessageQueueBuffer_Destroy(void);
/* After */voidSolidSyslogPosixDatagram_Destroy(structSolidSyslogDatagram*base);
voidSolidSyslogGetAddrInfoResolver_Destroy(structSolidSyslogResolver*base);
voidSolidSyslogPosixMessageQueueBuffer_Destroy(structSolidSyslogBuffer*base);
NullMutex shape fix:
/* Before */structSolidSyslogMutex*SolidSyslogNullMutex_Create(void);
voidSolidSyslogNullMutex_Destroy(void);
/* After */structSolidSyslogMutex*SolidSyslogNullMutex_Get(void);
Acceptance criteria
Four new public GoF nulls (NullDatagram, NullStream, NullFile, NullResolver) ship with audience-table entries, 100% coverage, no new
MISRA findings.
SolidSyslogNullMutex migrated to _Get(void) shape; all callers updated.
All six POSIX classes migrated onto SolidSyslogPoolAllocator. Per-class *Static.c lands at ≤ ~3 file-scope functions + CleanupAtIndex.
Public SolidSyslogPosix{Mutex,File,TcpStream}Storage types and their SOLIDSYSLOG_*_SIZE enums gone from Platform/Posix/Interface/.
Per-class Pool TEST_GROUP — 9 tests mirroring SolidSyslogCircularBufferPool.
cppcheck-misra produces no new findings vs main. Per-class storage-cast
deviations evaporate — record which in DEVLOG (feedback_cppcheck_misra_invariant).
Coverage at 100% line for every new and migrated file.
Validation step: per migrated class, re-run the full suite at SOLIDSYSLOG_<CLASS>_POOL_SIZE=3 via SOLIDSYSLOG_USER_TUNABLES_FILE.
Verify in cpputest-freertos container per feedback_verify_in_freertos_host_image (BlockStorePosixTest runs there).
DEVLOG entry on the work branch BEFORE the PR per feedback_devlog_in_pr.
S11.05 part A + part B DEVLOG entries (storage-cast sweep + composition precedent).
Open questions for the next session
PosixTcpStream's bounded blocking connect via SO_SNDTIMEO is captured
in the audience-table row — confirm during migration that the timeout
semantics survive the slot-allocated rewrite.
GetAddrInfoResolver has no state today — the file-scope instance is
effectively a vtable holder. Migrating it onto PoolAllocator is honest (it
still has a Resolver slot to vend) but it could equivalently become a
pure null/get-style _Get(void). Default: pool-migrate for consistency
with every other Resolver/Datagram/Stream impl that will have state.
PosixMessageQueueBuffer's mq_open failure mode — Create today returns
the singleton instance unconditionally and stashes whatever mqd_t comes
back. Pool-migration is a good moment to either keep that, or route an mq_open failure to the NullBuffer fallback. Default: keep current
behaviour (mechanical migration); discuss separately if the failure-mode
hardening fits E12 instead.
Parent epic: #29
Context
S11.05 (#401 / #402 / #403) closed the Core sweep. This story is the first
platform-adapter sweep — POSIX. Six classes in
Platform/Posix/carry statecaptured at
_Createtime and are file-scope singletons or storage-casttoday; all six get the canonical 3-TU split +
SolidSyslogPoolAllocatortreatment.
PosixMutexpthread_mutex_tPosixFileFILE*PosixTcpStreamPosixDatagramGetAddrInfoResolverPosixMessageQueueBufferOut of scope per E11 epic: the five POSIX function-adapters (
PosixClock,PosixHostname,PosixProcessId,PosixSysUpTime,PosixSleep) — stateless,no
_Create.Decisions locked in pre-raise
1. Four new public GoF nulls land in S11.06, mirroring S11.04's
NullSenderNullSdprecedent. Each is reused immediately by the next platform sweeps:SolidSyslogNullDatagramSolidSyslogNullStreamSolidSyslogNullFileSolidSyslogNullResolverSolidSyslogNullMutex(existing) andSolidSyslogNullBuffer(existing) coverthe remaining two. No class-private fallbacks anywhere in S11.06.
2. NullMutex migrates from
_Create/_Destroyto_Getinside S11.06.The other GoF nulls (
NullSender,NullStore,NullSd,NullSecurityPolicy,NullBuffer,NullBlockDevice) are all on the_Get(void)shape. NullMutexis the only odd one out. PosixMutex's fallback wiring lives in this story so
the shape-fix lands here too. Affected callers —
Tests/SolidSyslogNullMutexTest.cpp,Tests/SolidSyslogCircularBufferTest.cpp,Tests/SolidSyslogTest.cpp,Tests/SolidSyslogBlockStoreDrainOrderingTest.cpp— get caller-site updatesin the same commit.
Crc16Policykeeps its_Create/_Destroyshape; it'snot a null object and stays out of scope here.
3. PosixMessageQueueBuffer keeps its positional
_Create(size_t maxMessageSize, long maxMessages)— no config struct. Pure mechanical migration.longformaxMessagesmirrors the upstreammq_attr.mq_maxmsgtype and is fine underthe Pragmatic naming tier for
Platform/*/Source/.4. Pool size default 1U for every class. BDD targets and tests create one
instance per binary. Override via
SOLIDSYSLOG_USER_TUNABLES_FILEper theexisting tunables mechanism.
SOLIDSYSLOG_POSIX_MUTEX_POOL_SIZESOLIDSYSLOG_POSIX_FILE_POOL_SIZESOLIDSYSLOG_POSIX_TCP_STREAM_POOL_SIZESOLIDSYSLOG_POSIX_DATAGRAM_POOL_SIZESOLIDSYSLOG_GETADDRINFO_RESOLVER_POOL_SIZESOLIDSYSLOG_POSIX_MESSAGE_QUEUE_BUFFER_POOL_SIZE5. Three-TU split per class — unchanged from prior sweeps:
SolidSyslog<Class>.c— vtable +_Initialise/_Cleanup.SolidSyslog<Class>Private.h— concrete struct + private signatures, TU-internal.SolidSyslog<Class>Static.c— pool +_Create/_Destroy/IndexFromHandleCleanupAtIndex+ fallback assignment.6. No new MISRA suppressions. Storage-cast deviations on the three
storage-cast classes are removed by this story (the whole point).
7. File-scope statics carry the class-prefix shape (
PosixMutex_InUse,PosixMutex_Pool,PosixMutex_Allocator) from the start, per S11.04convention.
Sequencing on the work branch
Recommended commit shape on
refactor/s11-06-posix-sweep:feat: S11.06 add SolidSyslogNullDatagramfeat: S11.06 add SolidSyslogNullStreamfeat: S11.06 add SolidSyslogNullFilefeat: S11.06 add SolidSyslogNullResolverrefactor: S11.06 migrate NullMutex to _Get shaperefactor: S11.06 migrate PosixMutex onto PoolAllocatorrefactor: S11.06 migrate PosixDatagram onto PoolAllocatorrefactor: S11.06 migrate GetAddrInfoResolver onto PoolAllocatorrefactor: S11.06 migrate PosixFile onto PoolAllocatorrefactor: S11.06 migrate PosixTcpStream onto PoolAllocatorrefactor: S11.06 migrate PosixMessageQueueBuffer onto PoolAllocatordocs: update DEVLOG for S11.06Squash-merge title:
feat: S11.06 POSIX adapters onto PoolAllocator.Per-class scope
For each of the six classes, the migration commit lands:
Storage-cast classes (PosixMutex, PosixFile, PosixTcpStream):
SolidSyslog<Class>.c— vtable +_Initialise(base, ...)+_Cleanup(base).SolidSyslog<Class>Private.h— TU-internal struct + private signatures.SolidSyslog<Class>Static.c— pool + Create/Destroy/IndexFromHandle/CleanupAtIndex.<Class>Storagetypedef andSOLIDSYSLOG_<*>_SIZEenum; drop the
storageparameter from_Create;_Destroy(base)shape.Core/Interface/SolidSyslogTunablesDefaults.h.Core/Source/SolidSyslogErrorMessages.h.Platform/Posix/Source/CMakeLists.txt— add the three new TU entries.<*>Storagelocals; switch to handle-based teardown.SolidSyslogCircularBufferPool.CLAUDE.mdaudience-table row updated.File-scope singletons (PosixDatagram, GetAddrInfoResolver, PosixMessageQueueBuffer):
1–3. Same 3-TU split.
4. Public header —
_Destroy(void) → _Destroy(handle); no Storage deletion (none today).5–10. Tunable / error messages / CMakeLists / test rewire / Pool TEST_GROUP / audience table.
Caller updates land in each per-class commit:
Bdd/Targets/Linux/main.cBdd/Targets/Common/BddTargetTlsSender_OpenSsl_PosixTcp.cTests/SolidSyslogPosix{Mutex,File,TcpStream,Datagram,MessageQueueBuffer}Test.cppTests/SolidSyslogGetAddrInfoResolverTest.cppTests/SolidSyslog{UdpSender,StreamSender,BlockStorePosix}Test.cppTests/Bdd/Targets/BddTargetServiceThreadTest.cppPublic API changes
Storage-cast classes (before → after):
<Class>Storagetypedefs andSOLIDSYSLOG_<*>_SIZEenums deleted from public headers.Singletons (before → after):
NullMutex shape fix:
Acceptance criteria
NullDatagram,NullStream,NullFile,NullResolver) ship with audience-table entries, 100% coverage, no newMISRA findings.
SolidSyslogNullMutexmigrated to_Get(void)shape; all callers updated.SolidSyslogPoolAllocator. Per-class*Static.clands at ≤ ~3 file-scope functions +CleanupAtIndex.SolidSyslogPosix{Mutex,File,TcpStream}Storagetypes and theirSOLIDSYSLOG_*_SIZEenums gone fromPlatform/Posix/Interface/.SolidSyslogCircularBufferPool.clang-format, iwyu.
deviations evaporate — record which in DEVLOG (feedback_cppcheck_misra_invariant).
SOLIDSYSLOG_<CLASS>_POOL_SIZE=3viaSOLIDSYSLOG_USER_TUNABLES_FILE.cpputest-freertoscontainer perfeedback_verify_in_freertos_host_image(BlockStorePosixTest runs there).feedback_devlog_in_pr.Out of scope
PosixClock,PosixHostname,PosixProcessId,PosixSysUpTime,PosixSleep) — stateless, no_Create.Crc16Policy— still uses_Create/_Destroy; not a null object; separatecleanup (likely S11.11).
SolidSyslogAddress/SolidSyslogAddressInternal— utility functions on astruct, no Create.
SolidSyslogcore retrofit — S11.10.only the three deviations applying to its three storage-cast classes.
Memory pointers for the next session
CLAUDE.md+SKILL.md.MEMORY.md, especially:project_e11_static_pool_designproject_e11_three_tu_splitproject_pool_allocator_helperproject_configlock_injectionfeedback_storage_pattern— obsoleted per class as each migratesfeedback_bad_setup_contract— fallback severity vocabularyfeedback_discuss_production_changesfeedback_tdd_and_review_stylefeedback_drive_arg_values_in_same_testfeedback_no_premature_generalisationfeedback_cppcheck_misra_invariantfeedback_devlog_in_prfeedback_pr_templatefeedback_no_git_commit_dash_sfeedback_no_mergefeedback_verify_in_freertos_host_imageOpen questions for the next session
SO_SNDTIMEOis capturedin the audience-table row — confirm during migration that the timeout
semantics survive the slot-allocated rewrite.
instanceiseffectively a vtable holder. Migrating it onto PoolAllocator is honest (it
still has a
Resolverslot to vend) but it could equivalently become apure null/get-style
_Get(void). Default: pool-migrate for consistencywith every other Resolver/Datagram/Stream impl that will have state.
mq_openfailure mode — Create today returnsthe singleton instance unconditionally and stashes whatever mqd_t comes
back. Pool-migration is a good moment to either keep that, or route an
mq_openfailure to the NullBuffer fallback. Default: keep currentbehaviour (mechanical migration); discuss separately if the failure-mode
hardening fits E12 instead.