Add preview_record: spec, plan, and Slice 1 core primitives#128
Draft
Add preview_record: spec, plan, and Slice 1 core primitives#128
Conversation
Spec and implementation plan for 3 new MCP tools (preview_record, preview_record_start, preview_record_stop) targeting animation debugging and stakeholder demo recording. Slice 1 delivers the platform-agnostic core algorithms: - FrameDiff: SSIM on 128×128 grayscale CGImage (Wang et al.) - KeyframeSelector: pairwise threshold scene-detect with 80ms min-gap - ActionLog: Sendable actor for recording session action timelines 21 tests across 3 suites, all passing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
da14f4d to
f521f36
Compare
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
SPEC.md): Full design for 3 new MCP tools (preview_record,preview_record_start,preview_record_stop) targeting animation debugging and stakeholder demo recording. Went through two rounds of adversarial subagent review with prior-art citations (Playwright, Cypress, Maestro, ffmpeg scene-detect, etc.).tasks/plan.md,tasks/todo.md): 6 vertical slices with 3 human checkpoints. Updated for daemon architecture post-rebase.PreviewsCore/Recording/:FrameDiff— SSIM on 128×128 grayscale CGImage (Wang et al. formulation, 8×8 non-overlapping windows)KeyframeSelector— pairwise threshold scene-detect with 80ms min-gap, forced endpoints, greedy highest-diff selectionActionLog— Sendable actor for recording session action timelines, Codable for JSON serializationKey design decisions in the spec
Snapshot.capture(bitmapImageRepForCachingDisplay) on a 30fps timer. No TCC permissions, no CI headaches, works headless.preview_record(atomic keyframes for agents) vspreview_record_start/stop(session video + action timeline for stakeholders). Different shapes, different outputs.{path, durationMs, actions: [{tMs, tool, params, causedRecompile}]}.Test plan
swift test --filter "FrameDiff|KeyframeSelector|ActionLog")swift buildclean — no cross-module import issuesswift-format lint --strictcleanpreview_recordend-to-end)🤖 Generated with Claude Code