HiveCreator

Builds a hive on disk, headlessly (§ACM row 16).

Declared in src/libs/libhive/hive/HiveCreator.hpp.

Detailed description

Why this class exists

Hive creation used to live only inside CreateHive::createHiveWorker(), a QWidget method that interleaved the real work with log() calls and button state. There was no way to obtain a hive without a widget, so no test could obtain a mounted one — the HiveSession suite, the one suite that called mountHive, passed non-existent paths and asserted the failure. Those cases now live in testHiveMountRoundTrip, beside the ones that mount a hive this class built. That absence, not any hardware requirement, is what kept row 16 unverifiable.

The primitives underneath were always headless and always in libfs:

  • a 4096-byte key file of entropy
  • FileBlockDevice512::createSparseFile
  • ShufflecakeVolume<512>::formatSimple / formatShufflecake
  • ExFatFilesystem512::format

This class is that sequence and nothing else. The widget keeps what is genuinely its own — validation, button state, the settings writes and the HiveRegistry registration — and calls this for the build. One code path, invoked two ways.

Progress

The widget shows a running log, so the sequence reports through a sink with the same (message, isError) shape the widget's log() already had. A caller that wants no log passes nothing.

Note: Argon2 runs during the format, so a call takes on the order of a second even for a small store. Callers on a UI thread already ran this work on a worker.

Related: CreateHive.

See also HiveSession.

In this section