/ concept-collection / hitandrun-commonview
Sign in
concept-collection / hitandrun-commonview
hitandrun-commonview / CLAUDE.md
3.5 KBPreviewCodeBlameHistoryRaw

CLAUDE.md#

Tips for future agents working in this repo. It combines the sibling projects commonview (p2p shared state; central-peer authority) and hitandrun-interactive (the figure + MATLAB sampler), so read those first — this file only covers what is different here.

Architecture#

src/p2p/       identity, nostr discovery, WebRTC peer  — ported from commonview
  network.ts   the heart: shared ViewState + sample blobs + central election
  blob.ts      Float32 codec + chunk reassembly for the sample sets
src/engine/    the numbl runtime, run ONLY by the central peer
  numbl.worker.ts  executeCode against an in-memory VFS; uihtml intercepted
  engine.ts        host wrapper: start/resample/newRegion with timeouts
  project.ts       ?raw imports of matlab/*.m (verbatim from hitandrun-interactive)
src/App.tsx    the figure UI (controls dispatch p2p commands, not sendToMATLAB)
src/render/    RegionView canvas — verbatim from hitandrun-interactive
matlab/        the .m files — DO NOT EDIT here; they are copies (see below)

Key design decisions#

The matlab/ copies#

matlab/**/*.m are verbatim copies from hitandrun-interactive (plus a placeholder served as app/dist/index.html, which the sampler filereads for its uihtml HTMLSource — never rendered). If the upstream figure protocol changes (resample/newRegion events, payload shapes), re-copy the files and revisit src/engine/engine.ts.

Testing#

moveopenescclose