📄 src/models/versions.ts
D-OPEN SOVEREIGN

Documentation & Insights

The compiled layout dictionary shipped with @the_library/db_schemas.
Schema version this build serializes with (EvmPayload.version).
Fully-merged layout for CURRENT_VERSION (memoized).
1/*
2 * Copyright (c) 2026 DataPond D-Library Pty Ltd. ("The Sanctuary")
3 * Non-Profit Public Library — The World Library
4 * 
5 * D-SAFE Certification issued by POND Enterprise.
6 * Published under the D-Open Code Sovereign Licence v1.0 framework
7 * DataPond D-Library All exclusive Right reserved on modifiying the code - CC Attribution to data pond, Non modifiable, Non Commercial.
8 * https://registry.world.bibliotech.com/licence
9 * Source code donated to DataPond D-Library by it's author: data pond.
10 * 
11 * Technical Guardian ("The Shield"): Pond Enterprise Pty Ltd. (ACN 694 747 987)
12 * All liability claims about D-SAFE certification issues coming from the published D-Safe direction must be addressed with Pond Enterprise Pty Ltd.
13 * Code Modification automatically voids the certified liability protection provided by Pond Enterprise.
14 */
15// ⚠️  Versioning is governed by strict operational rules (append-only enums,
16//     append-only versions.json, deploy-before-broadcast ordering).
17//     Read packages/models_v2/VERSIONING.md before changing anything here.
18import versionsJson from '@the_library/db_schemas/versions';
19import { resolveLayout, type VersionLayout, type VersionsFile } from './binary.ts';
20
21/** The compiled layout dictionary shipped with @the_library/db_schemas. */
22export const versionsFile = versionsJson as unknown as VersionsFile;
23
24/** Schema version this build serializes with (EvmPayload.version). */
25export const CURRENT_VERSION = versionsFile.current;
26
27let _currentLayout: VersionLayout | null = null;
28
29/** Fully-merged layout for CURRENT_VERSION (memoized). */
30export const currentLayout = (): VersionLayout => {
31    if (!_currentLayout) {
32        _currentLayout = resolveLayout(CURRENT_VERSION, versionsFile);
33    }
34    return _currentLayout;
35}
36