Files
buzz/desktop
npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 d979427a7b fix(read-state): structured decode for NIP-RS override layer
Replace the flat-map decode path with a parseContexts() function that
returns {frontiers, overrides} — separate namespaces keyed by raw
context ID.  This fixes three correctness defects in the previous
implementation:

- Frontier keys were stored with their esc: prefix intact, so
  isOverrideActive evaluated against the wrong frontier for any raw
  context ID starting with ov_ or esc: (e.g. raw ov_s:evil had its
  frontier stored as esc:ov_s:evil while the override register was
  keyed by ov_s:evil).
- The 256-byte UTF-8 key-length check was applied only to frontier
  entries; ov_* sibling keys were written back unchecked, allowing
  wire keys up to 5 + suffix bytes through.
- extractOverrideRegisters accepted an arbitrary flat map and zero-filled
  missing components, reconstructing partial groups that group-first
  validation had already rejected.

Changes:
- readStateFormat.ts: add ParsedContexts interface and parseContexts();
  make partitionOverrideGroups internal; add 256-byte enforcement to
  every wire key (frontier and override siblings alike); fix the
  sanitizeContexts doc comment.
- readStateSnapshot.ts: add contexts: ParsedContexts to
  ParsedReadStateEvent; parseReadStateEvent populates both blob.contexts
  (flat, for readStateManager backward compat) and contexts (structured);
  mergeReadStateEvents iterates parsed.contexts.frontiers so callers
  receive unescaped raw ctx IDs; remove extractOverrideRegisters; update
  mergeOverrideRegisterMaps to accept ReadonlyMap inputs.
- readStateOverride.test.mjs: rewrite around parseContexts(); add the
  full partial-group rejection matrix (S-only, B-only, S+B, C+B, S+C),
  invalid sibling at each position, uint32 boundary values, 256/257-byte
  key-length cases for live and floor shapes, multibyte UTF-8 boundary,
  and Thufir's exact collision witness (raw ctx ov_s:evil alongside ctx
  evil with its own ov_s:evil counter).  3968/3968 pass.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-07-31 14:15:31 -04:00
..
2026-03-09 13:02:11 -07:00
2026-06-11 15:06:24 +00:00
2026-03-09 13:02:11 -07:00

Buzz

Desktop chat shell with:

  • Tauri + React + TypeScript + Vite
  • Tailwind CSS
  • shadcn/ui-ready shared components
  • Biome (lint/format/check)
  • Feature-driven frontend structure

Scripts

  • pnpm dev - run the web frontend
  • pnpm tauri dev - run the desktop app
  • pnpm build - typecheck and build frontend
  • pnpm typecheck - TypeScript checks
  • pnpm lint - Biome lint
  • pnpm format - Biome format (write)
  • pnpm check - Biome check

Structure

  • src/shared - reusable app-wide code (ui, lib, styles)
  • src/features - feature modules (vertical slices)
  • src/app - top-level app composition