Skip to content

S18.02: Define SolidSyslogBlockDevice interface and file-backed driver #235

Description

@DavidCozens

Parent epic: #112 (E18: Flash Storage Support)

Scope

Introduce the SolidSyslogBlockDevice abstraction so BlockSequence (internal to FileStore) sits on top of a swappable block I/O driver instead of SolidSyslogFile directly. Behaviour preserved at the message/store level — integrator-observable behaviour is unchanged once wiring is updated.

New public surface:

  • Core/Interface/SolidSyslogBlockDevice.h_Acquire / _Dispose / _Exists / _Read / _Append / _WriteAt / _Size consumer API. See E18: Flash Storage Support #112 for the illustrative shape.
  • Core/Interface/SolidSyslogBlockDeviceDefinition.h — vtable struct (extension point for integrator-supplied drivers, e.g. flash).
  • Core/Interface/SolidSyslogFileBlockDevice.h — file-backed driver. Wraps SolidSyslogFile* instances with sequence-numbered filenames. Acquire = "create empty file"; Dispose = "delete file" — preserves current behaviour.
  • Storage injection per CLAUDE.md "Callback Conventions": SolidSyslogFileBlockDeviceStorage opaque blob.

Wiring change: SolidSyslogFileStoreConfig replaces readFile / writeFile / pathPrefix with a single struct SolidSyslogBlockDevice* blockDevice field. The integrator now constructs SolidSyslogFileBlockDevice separately and passes it in.

Acceptance criteria

BDD scenarios

  • No regression — all pre-existing FileStore BDD scenarios remain green after step definitions are updated to wire SolidSyslogFileBlockDevice between the file handles and the FileStore.
  • Dispose only on capacity pressure — Given a workload that does not hit capacity, When the system runs, Then no Dispose occurs (block files are not deleted until rotation forces it). Confirms behaviour is preserved from the pre-S18.02 baseline.

Docs and header surface

  • New headers added: SolidSyslogBlockDevice.h, SolidSyslogBlockDeviceDefinition.h, SolidSyslogFileBlockDevice.h.
  • SolidSyslogFileStoreConfig updated — readFile / writeFile / pathPrefix removed; blockDevice added.
  • CLAUDE.md "Public header audiences" — three new rows for the BlockDevice headers; SolidSyslogFileStore.h row updated for the config change.
  • Existing examples and BDD step definitions updated for the new wiring.

Out of scope

  • Dispose-on-empty (S18.03 — purely behavioural).
  • Example flash block device (S18.04).
  • Real flash hardware drivers — supplied by the platform.

References

  • Parent epic E18 E18: Flash Storage Support #112 — layered decomposition and BlockDevice illustrative shape.
  • Predecessor story S18.01 — provides the layered decomposition this story builds on.
  • CLAUDE.md "Callback Conventions" — storage-injection pattern.

Metadata

Metadata

Assignees

No one assigned

    Labels

    storyStory issue

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions