@cloudbitmaps/core 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +11 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -20,9 +20,13 @@ export { o as BufferReader, p as BufferSink, q as GovernanceMeta, r as NO_ROW, s
|
|
|
20
20
|
* **Interface surface = exactly what the engine needs**, kept general enough for the known fast-follow codecs
|
|
21
21
|
* (positional/rank-select access + raw-bitset interop that `@cloudbitmaps/bitset` will add live on that
|
|
22
22
|
* package's own extended value type, not here — the engine never calls them). The one codec-linked concern
|
|
23
|
-
* this seam intentionally leaves in the format layer is the `.crbm` **
|
|
24
|
-
* in `crbm/format.ts`): it is stamped in the footer
|
|
25
|
-
*
|
|
23
|
+
* this seam intentionally leaves in the format layer is the `.crbm` **payload codec id**
|
|
24
|
+
* (`PAYLOAD_CODEC_ROARING_PORTABLE` / `KNOWN_PAYLOAD_CODEC_IDS` in `crbm/format.ts`): it is stamped in the footer
|
|
25
|
+
* and validated on read. That generalization is **done** as of 0.7.0 — the field was `roaringSerializationId`
|
|
26
|
+
* and validated by equality against a single constant, which would have frozen a codec-specific name into the
|
|
27
|
+
* format at `1.0`. It is now a registry the reader checks membership against, so a future codec is a one-line
|
|
28
|
+
* registration rather than a major format version. Still deliberately outside this interface: a codec declares
|
|
29
|
+
* its bytes, the seam does not.
|
|
26
30
|
*/
|
|
27
31
|
/**
|
|
28
32
|
* The value type a codec produces — a mutable set of `u32` with set algebra and portable (de)serialization.
|
|
@@ -2285,7 +2289,13 @@ declare class RetryingRegistryDriver implements IRegistryDriver {
|
|
|
2285
2289
|
interface CrbmWriterOptions {
|
|
2286
2290
|
/** Self-describing generation number (also encoded in the object key). */
|
|
2287
2291
|
readonly generation: number;
|
|
2288
|
-
|
|
2292
|
+
/**
|
|
2293
|
+
* Which codec produced the chunk payloads. Defaults to {@link PAYLOAD_CODEC_ROARING_PORTABLE}.
|
|
2294
|
+
*
|
|
2295
|
+
* Renamed from `roaringSerializationId` in 0.7.0 — same footer field, same offset and width, generalized
|
|
2296
|
+
* because `.crbm` is a shared container and a second codec is expected before the format freezes.
|
|
2297
|
+
*/
|
|
2298
|
+
readonly payloadCodecId?: number;
|
|
2289
2299
|
readonly elementWidth?: number;
|
|
2290
2300
|
/** When set, payloads + index are AES-256-GCM-encrypted, bound to `(segment, generation, scope)` via AAD. */
|
|
2291
2301
|
readonly crypto?: CrbmCrypto;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,13 @@ export { o as BufferReader, p as BufferSink, q as GovernanceMeta, r as NO_ROW, s
|
|
|
20
20
|
* **Interface surface = exactly what the engine needs**, kept general enough for the known fast-follow codecs
|
|
21
21
|
* (positional/rank-select access + raw-bitset interop that `@cloudbitmaps/bitset` will add live on that
|
|
22
22
|
* package's own extended value type, not here — the engine never calls them). The one codec-linked concern
|
|
23
|
-
* this seam intentionally leaves in the format layer is the `.crbm` **
|
|
24
|
-
* in `crbm/format.ts`): it is stamped in the footer
|
|
25
|
-
*
|
|
23
|
+
* this seam intentionally leaves in the format layer is the `.crbm` **payload codec id**
|
|
24
|
+
* (`PAYLOAD_CODEC_ROARING_PORTABLE` / `KNOWN_PAYLOAD_CODEC_IDS` in `crbm/format.ts`): it is stamped in the footer
|
|
25
|
+
* and validated on read. That generalization is **done** as of 0.7.0 — the field was `roaringSerializationId`
|
|
26
|
+
* and validated by equality against a single constant, which would have frozen a codec-specific name into the
|
|
27
|
+
* format at `1.0`. It is now a registry the reader checks membership against, so a future codec is a one-line
|
|
28
|
+
* registration rather than a major format version. Still deliberately outside this interface: a codec declares
|
|
29
|
+
* its bytes, the seam does not.
|
|
26
30
|
*/
|
|
27
31
|
/**
|
|
28
32
|
* The value type a codec produces — a mutable set of `u32` with set algebra and portable (de)serialization.
|
|
@@ -2285,7 +2289,13 @@ declare class RetryingRegistryDriver implements IRegistryDriver {
|
|
|
2285
2289
|
interface CrbmWriterOptions {
|
|
2286
2290
|
/** Self-describing generation number (also encoded in the object key). */
|
|
2287
2291
|
readonly generation: number;
|
|
2288
|
-
|
|
2292
|
+
/**
|
|
2293
|
+
* Which codec produced the chunk payloads. Defaults to {@link PAYLOAD_CODEC_ROARING_PORTABLE}.
|
|
2294
|
+
*
|
|
2295
|
+
* Renamed from `roaringSerializationId` in 0.7.0 — same footer field, same offset and width, generalized
|
|
2296
|
+
* because `.crbm` is a shared container and a second codec is expected before the format freezes.
|
|
2297
|
+
*/
|
|
2298
|
+
readonly payloadCodecId?: number;
|
|
2289
2299
|
readonly elementWidth?: number;
|
|
2290
2300
|
/** When set, payloads + index are AES-256-GCM-encrypted, bound to `(segment, generation, scope)` via AAD. */
|
|
2291
2301
|
readonly crypto?: CrbmCrypto;
|
package/dist/index.js
CHANGED
|
@@ -1394,8 +1394,8 @@ var FOOTER = {
|
|
|
1394
1394
|
// u32
|
|
1395
1395
|
flags: 20,
|
|
1396
1396
|
// u32
|
|
1397
|
-
|
|
1398
|
-
// u16
|
|
1397
|
+
payloadCodecId: 24,
|
|
1398
|
+
// u16 — was `roaringSerializationId`; same offset, same width, wider meaning
|
|
1399
1399
|
elementWidth: 26,
|
|
1400
1400
|
// u8
|
|
1401
1401
|
containerCodec: 27,
|
|
@@ -1423,7 +1423,10 @@ var FOOTER_CRC_COVERAGE = FOOTER.footerCrc32c;
|
|
|
1423
1423
|
var FLAG_ENCRYPTED = 1 << 0;
|
|
1424
1424
|
var FLAG_LITTLE_ENDIAN = 1 << 2;
|
|
1425
1425
|
var ELEMENT_WIDTH_32 = 32;
|
|
1426
|
-
var
|
|
1426
|
+
var PAYLOAD_CODEC_ROARING_PORTABLE = 1;
|
|
1427
|
+
var KNOWN_PAYLOAD_CODEC_IDS = /* @__PURE__ */ new Set([
|
|
1428
|
+
PAYLOAD_CODEC_ROARING_PORTABLE
|
|
1429
|
+
]);
|
|
1427
1430
|
var CONTAINER_CODEC_NONE = 0;
|
|
1428
1431
|
var DEFAULT_TAIL_BYTES = 256 * 1024;
|
|
1429
1432
|
var DEFAULT_MAX_INDEX_BYTES = 8 * 1024 * 1024;
|
|
@@ -1520,10 +1523,10 @@ var CrbmReader = class _CrbmReader {
|
|
|
1520
1523
|
`.crbm element_width ${elementWidth} not supported (v1 reads 32-bit ids; 64-bit is a future major version)`
|
|
1521
1524
|
);
|
|
1522
1525
|
}
|
|
1523
|
-
const
|
|
1524
|
-
if (
|
|
1526
|
+
const payloadCodecId = fview.getUint16(FOOTER.payloadCodecId, true);
|
|
1527
|
+
if (!KNOWN_PAYLOAD_CODEC_IDS.has(payloadCodecId)) {
|
|
1525
1528
|
throw new UnsupportedError(
|
|
1526
|
-
`.crbm
|
|
1529
|
+
`.crbm payload_codec_id ${payloadCodecId} not supported by this build (known: ${[...KNOWN_PAYLOAD_CODEC_IDS].join(", ")}; ${PAYLOAD_CODEC_ROARING_PORTABLE}=roaring portable). A generation written by a different codec is rejected rather than decoded \u2014 a store uses one codec throughout.`
|
|
1527
1530
|
);
|
|
1528
1531
|
}
|
|
1529
1532
|
const containerCodec = footer[FOOTER.containerCodec];
|
|
@@ -1818,8 +1821,8 @@ var CrbmWriter = class {
|
|
|
1818
1821
|
view.setUint32(FOOTER.indexCrc32c, crc32c(indexRegion), true);
|
|
1819
1822
|
view.setUint32(FOOTER.flags, FLAG_LITTLE_ENDIAN | (encrypted ? FLAG_ENCRYPTED : 0), true);
|
|
1820
1823
|
view.setUint16(
|
|
1821
|
-
FOOTER.
|
|
1822
|
-
this.options.
|
|
1824
|
+
FOOTER.payloadCodecId,
|
|
1825
|
+
this.options.payloadCodecId ?? PAYLOAD_CODEC_ROARING_PORTABLE,
|
|
1823
1826
|
true
|
|
1824
1827
|
);
|
|
1825
1828
|
footer[FOOTER.elementWidth] = this.options.elementWidth ?? ELEMENT_WIDTH_32;
|