open-standards/wai/wai-pack/tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Transaction Science c6cbb73843 wai-pack live writes as it goes: each object when published, each window when sealed
`wai-pack live` used to gather every object and window in memory and write
them all after the end of the stream. It now writes:

- each object when it is published;
- each window's index, then its receipt, when the window is sealed;
- the plan file and LISTING at the end.

Each file is written to a hidden temporary file beside it, then renamed into
place.

If the source fails mid-stream (a short frame or a frame of another size):

- every sealed window and the objects it lists are kept;
- the objects only unsealed pieces published are removed;
- no plan file and no LISTING are written;
- it exits 1, naming what it kept.

Once an object is written, its bytes are no longer held. A coded piece's stages
now carry their entry lengths (`pack::Lens`), so window_index builds an entry
without the envelope. The live packer moves each envelope into its publication.
The packer hands out sealed windows with `take_sealed()` and keeps none. With
--window 0, the packer still holds every piece's entry fields until the end of
the stream. The module doc, the CLI help and packaging §9.2 now say exactly what
is held.

wai::pin::listing_from_sha256 builds the listing from per-file digests (the
same lines as listing_from), so LISTING needs no file's bytes.

Tests:

- A CLI test feeds the stream through a pipe and checks that windows 0 and 1
  and their objects are on disk while the stream is still open.
- A second CLI test checks that a stream cut inside a frame keeps window 0 and
  its objects and nothing else.
- A unit test checks that no open piece holds an envelope.
- A wai-rs test checks that the listing from digests equals the listing from
  bytes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 19:47:05 -04:00
..
conformance.rs wai-pack: the policy, scene-cut segmentation and their corpus 2026-10-05 07:33:52 -04:00
packs.rs wai-pack: the v1 receipts test reads the refused cases as refused 2026-10-07 15:12:59 -04:00
refusals.rs wai-pack: staged packages — refinement layers, stills, a piece's ladder, live windows and simulated delivery (W4-4) 2026-10-08 14:21:54 -04:00
review.rs wai-pack: an override never relaxes royalty_free_only; empty and unreadable directories refused; pack only into an empty --out; classic in any case; deep alterations never panic 2026-10-06 09:09:09 -04:00
scenecut.rs wai-pack: the policy, scene-cut segmentation and their corpus 2026-10-05 07:33:52 -04:00
source_alloc.rs wai-pack: the WAV reader's own block bound is tested, whatever block a caller asks for 2026-10-05 09:04:29 -04:00
staged.rs wai-pack live writes as it goes: each object when published, each window when sealed 2026-10-08 19:47:05 -04:00