feat: spool records to a file store with a CRC-16 at rest - #10
Merged
Conversation
Contributor
Author
|
@coderabbitai pause |
|
Note Reviews pausedUse the following commands to manage reviews:
Use the checkboxes below for quick actions:
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
✅ Action performedReviews paused. |
DavidCozens
force-pushed
the
stage-09-time-quality
branch
from
August 16, 2026 21:49
4991869 to
0b96bbd
Compare
A SolidSyslogBlockStore over a FileBlockDevice over the library's FatFs port, replacing the Null store. The service task drains the ring into the store and sends from there, so a failed send costs a retry rather than the record: the audit trail survives an outage instead of ending at it. Flash +11,596 B (+3,952 on the previous stage) RAM +9,124 B (+1,436) Log stack +672 B (unchanged) Service +960 B (+64) The log stack does not move: storing happens on the service task, and a task that calls Log still knows nothing about what happens after it returns. The service task's own high-water rises 64 bytes, which its existing allocation absorbs. The static RAM is pool allocation, not buffers. The block size is file capacity — nothing holds a block in memory, so the store costs its handles rather than its capacity. CRC-16 detects corruption, not tampering: it catches a truncated write or bit-rot, and anyone who can edit a stored record can recompute it. It establishes that a record came back the way it went in, which is the prerequisite for spooling at all. Making stored records tamper-evident, and then unreadable, are later stages. Three decisions come with the store — capacity, what happens when it fills, and whether to be warned before that point. This device stores four blocks, one file per block, syslog00.log upward on the volume it already mounts, and discards the oldest when full. FatFs joins SOLIDSYSLOG_PLATFORMS. Its sources take the application's flags and include set, so they compile against this device's own ffconf.h. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
DavidCozens
force-pushed
the
stage-10-file-store
branch
from
August 16, 2026 21:49
d168480 to
b378798
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spool to a
SolidSyslogBlockStoreover aSolidSyslogFileBlockDeviceover the library's FatFsport, replacing the Null store. The service task drains the ring into storage and sends from there,
so a failed send costs a retry rather than the record: the audit trail survives an outage instead of
ending at it.
Three decisions come with it: how much to store, which is capacity on the medium rather than RAM;
what happens when it fills — discard oldest, discard newest, or halt; and whether to be warned
before that point, via the capacity-threshold callback.
This device stores four blocks, one file per block,
syslog00.logupward on the volume it alreadymounts, and discards the oldest when full.
The CRC-16 detects corruption, not tampering. It catches a truncated write or bit-rot; anyone who
can edit a stored record can recompute it. It establishes that a record came back the way it went
in, which is the prerequisite for spooling at all. Making stored records tamper-evident, and then
unreadable, are later stages.
Storing happens on the service task, so a task that calls
SolidSyslog_Logstill knows nothingabout what happens after it returns and its stack does not move. The RAM is pool allocation and
handles rather than buffers — nothing holds a block in memory, so the store costs its handles
rather than its capacity.
FatFsjoinsSOLIDSYSLOG_PLATFORMS, and its sources compile against this device's ownffconf.hlike the rest of the application.
When you need it. If losing the records raised during an outage is not acceptable, or if they
must survive a reboot.