This document closes M12-T04 by evaluating whether snapshot_file is now clean enough to
extract as another shared internal runtime module after:
- shared
retire_queue - shared
wal - shared
wal_file
The question is deliberately narrower than "can snapshot persistence be shared in theory?" The
question is whether the current three-engine code on main justifies a real extraction now.
Do not extract a shared snapshot_file crate yet.
The seam is real only inside the smaller quota-core / reservation-core pair. It is not yet a
clean three-engine runtime boundary.
The correct outcome for this slice is:
- record that
snapshot_fileis not ready for extraction - keep each engine's
snapshot_filelocal - move on to
M13, the internal engine authoring boundary
All three engines share the same high-level persistence discipline:
- one snapshot file per engine
- temp-file write, sync, rename, and parent-directory sync
- snapshot bytes loaded before WAL replay
- fail-closed behavior on decode or integrity errors
That means there is still real family resemblance at the discipline level.
allocdb-core still stores only encoded snapshot bytes:
- no footer
- no checksum
- no explicit max-bytes bound
- decode-time corruption detection only
That is materially different from the newer engines.
quota-core and reservation-core both use the same stronger file-level discipline:
- footer magic
- persisted payload length
- CRC32C checksum
- explicit
max_snapshot_bytes - oversize rejection before decode
Those two modules are close enough to share helpers later, but that is not the same thing as a repository-wide extraction candidate.
The shared part is mostly:
- temp-file naming
- write, sync, rename, and parent-directory sync
- footer read/write mechanics for the newer engines
But the live module boundary still mixes those mechanics with engine-specific constructor and error surface choices:
allocdb-corehas no size-bound constructor argumentquota-coreandreservation-coreexpose integrity-specific error variants- the three wrappers are still tied to engine-local snapshot schemas and recovery expectations
That makes a forced crate extraction likely to create awkward generic plumbing rather than reduce maintenance cost.
Extracting now would create a misleading shared layer:
- it would either erase the real allocdb-vs-quota/reservation format difference
- or it would introduce configuration branches that mostly exist to paper over that difference
That is the wrong direction for this roadmap. M12 is about extracting only what is already
mechanically shared, not about normalizing divergent modules by force.
The current evidence supports:
- shared
retire_queue - shared
wal - shared
wal_file
It does not yet support:
- shared
snapshot_file
Revisit this seam only if one of these becomes true:
allocdb-coreadopts the same footer/checksum/max-bytes discipline as the newer engines- repeated snapshot-file fixes land independently in multiple engines
- a later authoring pass shows the snapshot-file helper boundary can stay below engine-local error and schema surfaces
Until then, local duplication is still cheaper than a fake shared abstraction.
Treat M12 as complete after this readout.
The next step is M13, not more extraction pressure:
- define the internal engine authoring boundary
- write the runtime-vs-engine contract
- reassess whether a fourth-engine or reduced-copy proof is still required