Repository navigation
feat(viz): shared stack-and-heap snapshot and a light/dark palette - #202
Merged
Merged
Conversation
First step of ADR 0004's shared foundation. No behaviour or visual change. - src/shared/snapshot: Slot, StackFrame, HeapObject, Snapshot, Reference and the reference helpers, moved out of the Stack <-> Heap story so a Playground trace step can hold the same shape. Adds the `function` and `scope` kinds a trace needs and makes `cell` optional (`Placed<T>` for authored placement). The story re-exports every name it exported. - src/shared/viz/palette: one palette by role with a light and a dark variant. Light reproduces today's colours exactly; dark is defined and contrast-tested for the Playground, not used yet. - StackHeap2D and StackHeap3D read their colours from the light palette. - beat-model skill: stack-and-heap stories take the snapshot from src/shared/snapshot; other domains keep their own typed snapshots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR 3 of the ADR 0004 build plan: the shared foundation. No behaviour or visual change.
src/shared/snapshot/—Slot,StackFrame,HeapObject,Snapshot,Reference,slotKey,getReferences,getReachable, moved out of the Stack ↔ Heap story so a Playground trace step can hold the same shape.functionandscopethat a trace needs (a closure and the popped frame it keeps alive). No story uses them yet.cellis optional, because a trace has no authored cells;Placed<T>marks authored placement.stackHeapStory.test.tspasses unedited and the beat data is untouched.src/shared/viz/palette.ts— one palette organised by role, with alightand adarkvariant. Light reproduces today's colours exactly. Dark is defined and contrast-tested for the Playground and is not used yet. New roles:functionandscope.StackHeap2D/StackHeap3Dread their colours from the light palette; no raw hex remains in either file.beat-modelskill — stack-and-heap stories take the snapshot fromsrc/shared/snapshot; other domains (Git commits and refs) keep their own typed snapshots.Checks
npx tsc -b,npm run lint,npm run test:run(35 files, 364 tests; 24 new) andnpm run buildpass.npm run agents:checkpasses.WebGLRenderer;StackHeap3Dis still its own lazy chunk.Notes for review
getReachablenow ignores arefIdthat matches no heap object, and a slot may reference a frame id. No story has either case.frameActivefill and stroke, and thetext/labelentries (hex approximations of the current Tailwind classes) are used when the views are generalised in PR 4.🤖 Generated with Claude Code