This document defines the path from the current engine family to something that can honestly be called a general internal DB-building library.
The current state is:
allocdb-core,quota-core, andreservation-coreall exist onmain- the engine thesis is proven strongly enough
- a broad shared runtime is still premature
retire_queueis the first justified micro-extraction candidate
The goal is not to market a framework early. The goal is to extract only the runtime substrate that has actually stabilized under multiple engines.
We should only call this a general internal DB-building library when all of the following are true:
- more than one runtime module is shared cleanly across engines
- the shared-vs-domain boundary is explicit and stable
- a new engine or engine slice can be built with materially less copy-paste
- extraction reduces maintenance cost more than it adds abstraction cost
Until then, the honest description remains:
- multiple deterministic engines
- emerging shared runtime
Goal:
- extract the smallest runtime pieces that are already mechanically shared
Scope:
retire_queuewalwal_file- evaluate
snapshot_file, but extract it only if the file-level discipline stays separable from snapshot schemas across the full engine family
Non-goals:
- no public framework story
- no snapshot schema extraction
- no recovery API extraction
- no state-machine trait layer
Exit criteria:
- extracted modules are used by all applicable engines
- behavior is unchanged
- tests stay green without new abstraction leaks
Goal:
- define the stable boundary between shared runtime and engine-local semantics
Scope:
- one internal runtime contract note
- explicit ownership of:
- bounded collections
- durable frame/file helpers
- snapshot-file discipline
- recovery helper seams, if any
- explicit non-ownership of:
- command schemas
- result surfaces
- snapshot schemas
- state-machine semantics
Exit criteria:
- the contract is clear enough that another engine authoring pass is constrained by it
Goal:
- prove that the extracted substrate lowers authoring cost rather than only moving code around
Acceptable proof shapes:
- preferred: retrofit one substantial new engine slice against the extracted substrate with clearly reduced copy-paste and no correctness regression, or
- build a fourth engine against the extracted substrate if the smaller proof cannot answer the question cleanly
Exit criteria:
- one new engine or engine slice uses the extracted substrate directly
- the reduction in duplicated runtime code is obvious
- the authoring contract survives contact with real implementation work
M12: Extract the first internal shared runtime substrate from the three-engine familyM12-T01: Extract sharedretire_queueM12-T02: Extract sharedwalM12-T03: Extract sharedwal_fileM12-T04: Evaluate and, if still clean, extract sharedsnapshot_file
M13: Define the internal engine authoring boundary after the first extractionsM13-T01: Write the internal runtime-vs-engine contractM13-T02: Reassess whether a fourth-engine proof is still required or whether the extracted substrate already lowered authoring cost enough
M14: Prove the extracted substrate lowers engine-authoring costM14-T01: Build one new engine or engine slice against the extracted substrateM14-T02: Re-evaluate whether the repository can now honestly claim an internal DB-building library
- extract smallest-first
- after each micro-extraction, stop and verify before continuing
- if one extraction introduces awkward generic plumbing, stop and reassess rather than force the sequence
- keep domain logic local even if runtime discipline is shared
Do this next:
M12-T01sharedretire_queueM12-T02sharedwalM12-T03sharedwal_file- only then decide whether
snapshot_fileis still clean enough to extract
Result:
retire_queue,wal, andwal_filewere extracted successfullysnapshot_filewas evaluated and deferred because the seam is still only clean inside thequota-core/reservation-corepair, not across all three enginesM13is the next correct move, followed by a reassessment of whetherM14still needs a full fourth-engine proof or can prefer a smaller reduced-copy slice
Do not do this next:
- public framework branding
- generic state-machine APIs
- generic snapshot schemas
- extracting recovery entry points before the lower layers stabilize