181 lines
9.3 KiB
Markdown
181 lines
9.3 KiB
Markdown
# Fixture provenance
|
||
|
||
No private notebook may be committed. Each binary fixture requires a public,
|
||
reviewed source, an immutable revision, a redistribution licence, a content
|
||
expectation, and a retained hash. Base64 encoding is only a repository transport
|
||
and does not change the underlying file's licence.
|
||
|
||
## `onenote_desktop.one.b64`
|
||
|
||
- Source: Joplin
|
||
[`packages/app-cli/tests/support/onenote/onenote_desktop.one`](https://github.com/laurent22/joplin/blob/28eb53bd9f0cd4ae0dec0c59a08037075a38302b/packages/app-cli/tests/support/onenote/onenote_desktop.one),
|
||
introduced at commit
|
||
[`28eb53bd9f0cd4ae0dec0c59a08037075a38302b`](https://github.com/laurent22/joplin/commit/28eb53bd9f0cd4ae0dec0c59a08037075a38302b).
|
||
- Licence: AGPL-3.0-or-later; full text in `LICENSES/AGPL-3.0.txt`.
|
||
- Decoded size: 34,904 bytes.
|
||
- Decoded SHA-256:
|
||
`7c43e85e2169b4bc3236db73a24c8f20d5c284b74563c07baf1406887d20eb5e`.
|
||
- Golden expectation: desktop OneStore section with three pages — `Test`,
|
||
`Another page`, and `Page 3` — plus readable text/timestamps and diagnostics
|
||
for image, table, and ink content.
|
||
|
||
## `joplin-test.onepkg.base64`
|
||
|
||
- Source: Joplin
|
||
[`packages/app-cli/tests/support/onenote/test.onepkg`](https://github.com/laurent22/joplin/blob/1e73aad7eb08fde5d9e4cb533df40052a5cd32d7/packages/app-cli/tests/support/onenote/test.onepkg)
|
||
at commit `1e73aad7eb08fde5d9e4cb533df40052a5cd32d7`, introduced by
|
||
[Joplin PR #14094](https://github.com/laurent22/joplin/pull/14094).
|
||
- Licence: AGPL-3.0-or-later; full text in `LICENSES/AGPL-3.0.txt`.
|
||
- Decoded size: 11,066 bytes.
|
||
- Decoded SHA-256:
|
||
`83cb622d40f0ab127038b629553b6926be3e2a6ce642f169df0e2614c13e8469`.
|
||
- CAB expectation: one LZX `0x1203` folder, three CFDATA blocks, seven UTF-8
|
||
and nested paths, five `.one` sections, and two `.onetoc2` entries.
|
||
- Parser expectation: all five sections parse, producing seven pages in total:
|
||
`Page 1`, `Page 2`, `Test`, `Test page`, `Testing…`, `A test`, and
|
||
`Tuesday, January 13, 2026`.
|
||
|
||
Tests verify the package hash, all seven paths, the native `.one` magic for
|
||
every section, section parse statuses, and representative title/text output.
|
||
|
||
## `joplin-quick-notes-fsshttp.one.b64`
|
||
|
||
- Immediate reviewed source: `onenote.rs`
|
||
[`crates/parser/tests/samples/joplin/Simple notebook/Quick Notes.one`](https://github.com/msiemens/onenote.rs/blob/5138a39a3f4e72b840932f9872fecde52fa9da60/crates/parser/tests/samples/joplin/Simple%20notebook/Quick%20Notes.one)
|
||
at the parser reference revision
|
||
`5138a39a3f4e72b840932f9872fecde52fa9da60`; introduced there by commit
|
||
`3011a1f0f2a13288aa8ac366f783adc0673e4989` as test data from Joplin.
|
||
- Upstream attribution recorded alongside the source fixture: Joplin,
|
||
copyright Laurent Cozic, AGPL-3.0-or-later. The full licence is retained in
|
||
`LICENSES/AGPL-3.0.txt`.
|
||
- Decoded size: 17,197 bytes.
|
||
- Decoded SHA-256:
|
||
`5e501ef5f539cd2f149786f57659be9d0762913d863a69867deb9c8e8c43efe2`.
|
||
- Golden package expectation: FSSHTTPB package-store section with one Storage
|
||
Index, one Storage Manifest, four Cell Manifests, nine Revision Manifests,
|
||
and nine Object Groups. This fixture contains no Data Element Fragments or
|
||
Object Data BLOB elements.
|
||
|
||
Tests retain the exact hash, validate the package envelope and element counts,
|
||
and exercise truncated, malformed, padding, and configured-limit failures.
|
||
|
||
## Inline rust-cab CAB fixtures
|
||
|
||
`src/onenote/onepkg/cabinet.test.ts` contains byte-for-byte test arrays copied
|
||
from rust-cab `src/cabinet.rs` at commit
|
||
[`c5839f5fdfa4c4e7cc9b22f570c79c96af0560e2`](https://github.com/mdsteele/rust-cab/tree/c5839f5fdfa4c4e7cc9b22f570c79c96af0560e2).
|
||
They are MIT-licensed; the exact upstream text is in
|
||
`LICENSES/rust-cab-MIT.txt`.
|
||
|
||
The arrays cover an uncompressed single-entry CAB, an uncompressed two-entry
|
||
CAB, a single-block MSZIP CAB, and an LZX `0x1303` CAB containing `hi.txt` and
|
||
`bye.txt`. They are CAB unit fixtures, not OneNote exports, and are not evidence
|
||
of `.onepkg` producer compatibility.
|
||
|
||
## Inline generated two-block MSZIP fixture
|
||
|
||
`src/onenote/onepkg/cabinet.test.ts` also contains a generated 593-byte CAB
|
||
with one 36,864-byte `history.bin` entry. The input byte at index `i` is
|
||
`i % 251`. It is split into a 32,768-byte block and a 4,096-byte block; the
|
||
second raw DEFLATE stream uses the first block as its preset 32 KiB dictionary,
|
||
so decoding it without folder history fails.
|
||
|
||
- Generator: CPython 3.13.14 `zlib.compressobj`, zlib 1.3.1, raw DEFLATE
|
||
(`wbits=-15`), level 9; the second call uses `zdict=first_block`. Each stream
|
||
is prefixed with `CK` and placed in a spec-shaped single-folder CAB with CAB
|
||
checksums.
|
||
- Generator invocation: `python3` with the documented deterministic input and
|
||
CAB layout above; the frozen Base64 bytes, sizes, checksums, and hashes are
|
||
asserted by the test. No notebook or third-party content is an input.
|
||
- CAB SHA-256:
|
||
`9f71b97623395492f401ddc152ca648e8416996b14092b0df42ad712c27f9cb2`.
|
||
- Extracted SHA-256:
|
||
`cb441d1f6e7d9c5789a306c51a00a654c9b7715c2c3d624e3d2a75bd0af549ff`.
|
||
- Licence: original test data under this project's MPL-2.0 licence.
|
||
|
||
This fixture establishes block-history behavior only. It is not a OneNote
|
||
export and is not evidence of `.onepkg` producer compatibility.
|
||
|
||
## Inline compcol Quantum fixtures
|
||
|
||
`src/onenote/onepkg/quantum/decoder.test.ts` copies two small Quantum payloads
|
||
from compcol
|
||
[`tests/quantum.rs`](https://github.com/KarpelesLab/compcol/blob/04a6db2aa7bd487a89c559631d79d1b384139f50/tests/quantum.rs)
|
||
at commit `04a6db2aa7bd487a89c559631d79d1b384139f50`. The 48-byte
|
||
`qtm.txt` payload decodes with an 18-bit window to the 59-byte ASCII string
|
||
`If you can read this, the Quantum decompressor is working!` followed by a
|
||
line feed. The first two compressed blocks of compcol's multi-frame zero-run
|
||
fixture are 14 and 6 bytes and decode to two 32,768-byte zero frames. Tests
|
||
exercise arithmetic-model and LZ-window continuity, per-block synthetic
|
||
sentinels, malformed trailers, truncation, cancellation, and operation limits.
|
||
|
||
The immediate reviewed compcol source is MIT-licensed; its exact licence is in
|
||
`LICENSES/compcol-MIT.txt`. The compcol comments record that the payloads were
|
||
originally extracted from libmspack CAB test files. This repository copies only
|
||
the small arrays published in the pinned compcol test source, not those CAB
|
||
files.
|
||
|
||
`src/onenote/onepkg/cabinet.test.ts` wraps the 48-byte payload in a generated,
|
||
single-folder CAB so the actual CAB enumeration, checksum, and extraction path
|
||
is covered:
|
||
|
||
- CAB compression type: `0x1222` (Quantum level 2, 18-bit/256 KiB window).
|
||
- CFDATA sizes/checksum: 48 compressed bytes, 59 output bytes, checksum
|
||
`0x4bec2dfd`.
|
||
- CAB size: 124 bytes.
|
||
- CAB SHA-256:
|
||
`f622c5a8f5a000dfaddc5569750344f5a6e35d0de9fbd3c4f0c8720c7d94d291`.
|
||
- Wrapper/header/filename licence: original test data under this project's
|
||
MPL-2.0 licence; embedded payload licence: compcol MIT as above.
|
||
|
||
The frozen CAB contains only the compressed payload; the decoder appends the
|
||
required `0xFF` byte after each CFDATA block in memory. These are CAB-level
|
||
codec fixtures, not OneNote exports, and do not establish producer-specific
|
||
`.onepkg` compatibility.
|
||
|
||
## libmspack five-part CAB fixture
|
||
|
||
`libmspack-multi-basic-pt1.cab.b64` through
|
||
`libmspack-multi-basic-pt5.cab.b64` are byte-for-byte copies of libmspack's
|
||
[`multi_basic_pt*.cab`](https://github.com/kyz/libmspack/tree/55d501976171397ccd5d5a7a1ca7da065b1d9a06/libmspack/test/test_files/cabd)
|
||
fixtures at commit
|
||
[`55d501976171397ccd5d5a7a1ca7da065b1d9a06`](https://github.com/kyz/libmspack/commit/55d501976171397ccd5d5a7a1ca7da065b1d9a06).
|
||
The immediate reviewed source is LGPL-2.1-only; its exact licence text is in
|
||
`LICENSES/libmspack-LGPL-2.1.txt`.
|
||
|
||
The CAB headers name the parts `cabd_multi_basic_pt1.cab` through
|
||
`cabd_multi_basic_pt5.cab`. They form set ID 12345, indexes 0 through 4, and
|
||
split one 190-byte uncompressed CFDATA block across all five cabinets. The
|
||
three spanning files contain the five ASCII lines
|
||
`This is the data from cabinet part N.` (plus line feeds), grouped as parts
|
||
1–2, part 3, and parts 4–5.
|
||
|
||
- Part 1: 221 bytes; SHA-256
|
||
`3658aaf68b0d538a5b321919f1de3eb1bcc258cba44e97b07a1938230995c632`.
|
||
- Part 2: 274 bytes; SHA-256
|
||
`ce5fac4470fb850ae593de70ab03d3493069b77f8f81376216768bbf74e52321`.
|
||
- Part 3: 274 bytes; SHA-256
|
||
`e58b57f63ac0858effa75ceb6f242b447fbce6a910d3840c37228fdbc9e7bc95`.
|
||
- Part 4: 274 bytes; SHA-256
|
||
`fbcd45e503c3cffd5f5946ccc45bbc46b9884fe47abef7d09247154c7f8148fb`.
|
||
- Part 5: 221 bytes; SHA-256
|
||
`16ebbb274c8dc09f98415795212683b9ea8b2d6450080a79ab63cd5cdbac7cc4`.
|
||
|
||
Tests retain all hashes and exercise unordered selection, strict link/set/order
|
||
validation, `0xFFFD`/`0xFFFE`/`0xFFFF` spanning-file reconciliation, split-block
|
||
reassembly, reserve/compression continuity, aggregate limits, and cancellation.
|
||
These are generic CAB fixtures, not OneNote exports, and do not establish
|
||
producer-specific `.onepkg` compatibility.
|
||
|
||
## Distribution policy
|
||
|
||
The decoded fixture bytes are used only by tests. Vite does not copy them into
|
||
`dist`, and the release packager does not add them to the application ZIP. The
|
||
release may include this provenance document and licence text so its notices
|
||
remain complete.
|
||
|
||
A copied upstream fixture needs an individual licence and redistribution
|
||
review; a repository-level licence must not be assumed to cover every binary.
|
||
Generated fixtures must document the generator command/input and must not be
|
||
described as real application exports.
|