Skip to content

fix: verify render assets at point of use - #12

Draft
nkcbuilds wants to merge 1 commit into
feat/actor-look-envelopesfrom
fix/verified-render-inputs
Draft

nkcbuilds wants to merge 1 commit into
feat/actor-look-envelopesfrom
fix/verified-render-inputs

Conversation

@nkcbuilds

Copy link
Copy Markdown
Owner

Purpose

Address the four independent filesystem/path integrity findings documented against draft PR #10 without claiming a hostile multiuser security boundary. This is a draft stacked PR on feat/actor-look-envelopes (#11), which depends on #10 and #9. It must not be merged into main without reviewing the stack.

Fixes

  1. Source model/texture replacement after validation: For provenance-tracked imported characters, create a fresh per-render verified-actor-assets/ copy of source/spec/rig/texture files. Compare every copied file's SHA-256 with avatar-build.json and have Rev2D render from the copies, not the original paths. Model texture references must match the record.
  2. Audio/cues replacement between validation and FFmpeg: audio bind parses and hashes the same cue bytes. Bound scene rendering creates a fresh verified-speech/ copy of the voice and cues, hashes both against the previously verified sidecar and parses the copied cue JSON. FFmpeg receives the copied WAV path, not the original. Legacy unbound audio is still supported and has no such exact-byte guarantee.
  3. Symlinked/output-ancestor redirection and overwrite: create a fresh path-validated frames directory (no reuse); reject out-of-scope symlinks/junctions and validate flat frame_0000.png-style names from the external Rev2D process.
  4. Narrow options.root bypass: loadAndValidateScene checks its scene, actor, audio, cues and binding paths against the same supplied realpath-aware root; invalid scoped paths produce diagnostics rather than unexpected exceptions.

Full behavior and explicit threat-model limitations: docs/RENDER_INTEGRITY.md.

Validation

  • npm run verify: 211 tests passed across 36 files; TypeScript typecheck and build passed.
  • Tests added for copied rig/texture provenance after original replacement, stale inputs, symlink/junction frame escape, fresh output directory, subprocess frame-name traversal, scoped audio/actor path escapes and bound audio snapshot replacement.
  • Real imported-character QA render: disposable ignored copy of an existing unapproved experimental Hana rig, with forced approval on the copied fixture ONLY to exercise this integration test. Original remains unapproved. This successfully rendered .cache/render-snapshot-qa-20261107-1800/qa-snapshot.mp4, 45 frames, 15 FPS, 512×640, H.264 using snapshotted model/textures. This does NOT mean the input artwork passed visual review.
  • Real bound-voice QA render: .cache/first-video-demo/qa-12s-voiced/verified-snapshot-3s.mp4, 45 frames, 15 FPS, 512×640, H.264/AAC. FFmpeg's reported input is now .../verified-speech/voice.wav.
  • Both actual MP4s passed FFprobe acceptance and representative 0s/1s/2s frames were visually inspected. Source audio, rig, snapshots and videos are ignored, not committed.
  • git diff --check clean.

Remaining scope boundaries

These changes protect against ordinary accidental/replacement races, but they are not a sandbox against a malicious process with write access to the same render directory. Node, Rev2D and FFmpeg do not maintain pinned read-only file descriptors across every subprocess read. Unbound legacy audio does not receive exact-byte snapshotting. Both limits are stated plainly in the docs.

Animation quality (flat-PNG half-eye sprites, ghosting and cross-rig body bridges) remains independent and unresolved. Do not auto-approve the experimental character or merge the draft stack automatically.

@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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