Skip to content

keep media sessions fast and usable and let snapshots use the archive - #454

Merged
xandreeddev merged 1 commit into
mainfrom
fix/m5
Nov 2, 2026
Merged

xandreeddev merged 1 commit into
mainfrom
fix/m5

Conversation

@xandreeddev

@xandreeddev xandreeddev commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

What

  • Media storage stays fast as images accumulate: core's pure SHA-256 updates typed arrays in place (about nine times faster), the media fingerprint takes one pass, the directory store hashes with the platform's SHA-256, withMediaStore no longer hashes fetched bytes again (MediaStore.get promises they match their key), and a begin's turn lookups read no image (SessionReadQuery.media: "references").
  • A lost or damaged blob no longer makes every later begin of its session fail: that occurrence keeps its metadata with UNAVAILABLE_MEDIA_DATA, renders as its label line and is never sent; unavailable storage still fails with store.io. MediaStoreMemoryLive is documented for in-memory logs only.
  • withMediaStore returns rows without an envelope untouched, so a newer release's row or an unreferenced damaged request part no longer fails the whole read.
  • The directory media store sweeps temporary files an hour old, repairs a damaged blob when its bytes are put again (keeping the damaged copy in quarantine/), and nodeFilesIo.readStart keeps reading after short answers.
  • Render snapshots: retained facts unlike this release's selection log and use the full archive instead of failing every open with session.decode; snapshots no longer copy replaced summaries, out-of-view compaction text or cut runs' step contexts; render equality is checked by the first build of each placement instead of four full renders at open, and the checkpoint bridge decodes its history once.
  • Migration: SessionReadQuery.media (rerun sessionLogConformance), the MediaStore.get integrity promise, and the snapshot kit subject (validate without render options, project returning mismatch, MemoryProjection.Projected.verified) are in the CHANGELOG. No stored shape changes.

Checks

  • bun run typecheck: pass
  • bun test: 3786 pass, 0 fail
  • bun run foundry demo, build:packages, verify:packages, docs:generate (no diff), bun run --cwd packages/website check: pass

The media decorator no longer hashes fetched bytes again: MediaStore.get now
promises bytes that match their key, the directory store hashes with the
platform's SHA-256, core's pure SHA-256 updates typed arrays in place and the
media fingerprint takes one pass. A begin's turn lookups read with
SessionReadQuery.media "references", so beginning a turn reads no image. A
missing or damaged blob keeps its occurrence's metadata with
UNAVAILABLE_MEDIA_DATA, renders as its label line and never reaches the model,
instead of failing every later begin; rows without an envelope pass through
untouched, so a newer release's row or an unreferenced damaged part no longer
fails a whole read. The directory store sweeps abandoned temporary files,
repairs a damaged blob when its bytes are put again (keeping the damaged copy
in quarantine/), and start reads continue after short answers.

Render snapshots whose retained facts differ from this release's selection now
log and use the full archive instead of failing every open. They no longer
copy replaced summaries, views of omitted entries or cut runs' step contexts,
and render equality is checked by the first build of each step-context
placement instead of four full renders at open; the checkpoint bridge decodes
its history once.
@xandreeddev
xandreeddev merged commit 5e0c473 into main Nov 2, 2026
1 check passed
@xandreeddev
xandreeddev deleted the fix/m5 branch November 2, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant