feat(director-mode): v0 shot authoring with brand-safe validators#24
Open
ninan-versioning wants to merge 1 commit into
Open
feat(director-mode): v0 shot authoring with brand-safe validators#24ninan-versioning wants to merge 1 commit into
ninan-versioning wants to merge 1 commit into
Conversation
Render-backend-agnostic shot-authoring UX for product twins. Tap-to-drop camera, draw Bezier shot path, scrub preview, save presets, validate against Kinfolk composition + brand-safe rules. Emits portable DirectorShot JSON rendered via the existing open-imagine router → threejs_diffusion path. - schema + type guards (DirectorShot, UsdCameraPrim, BezierShotPath, AP2ProductRef) - core: shotBuilder, usdSerializer (.usda round-trip), presetStore - validator: kinfolk composition, brand safe-zone, focal-length gate - adapter: HMAC-signed POST /render submit; renderProvenance stamps RenderProvenance.external_id with DirectorShot.id (closes bandit seam #2) - ui: React 18 overlay (DirectorOverlay, CameraDrop, PathDraw, Scrubber, PresetLibrary) - 34 vitest tests green; Omniverse-free (no Kit/OVRTX/web-viewer-sample) Spec: /home/user/workspace/director-mode-spec.md Co-Authored-By: Claude Opus 4.7 <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
Director Mode v0 — a render-backend-agnostic shot-authoring package for product twins. Tap-to-drop a camera, draw a Bezier shot path, scrub a preview, save presets, and validate against brand-safe framing rules. Emits portable
DirectorShotJSON.Spec:
/home/user/workspace/director-mode-spec.mdNew package:
packages/director-mode/(@shoploop/director-mode), following the same pnpm-workspace / tsconfig / vitest patterns aspackages/twin-renderer/andpackages/bandit/.Render path is unchanged and Omniverse-free: open-imagine router (
POST /render) →threejs_diffusion. No@nvidia/omniverse, noweb-viewer-sample, no OVRTX, no Kit App Streaming. Live Kit streaming stays a deferred Tier-2 concern for unit-economics reasons (see spec).Modules
src/schema.ts—DirectorShot,UsdCameraPrim,BezierShotPath,AP2ProductRef,ShotValidationResult+ type guards.src/core/—shotBuilder(tap/drag → shot, ULID ids),usdSerializer(DirectorShot ↔.usdacamera + xform animation, round-trippable),presetStore(localStorage + remote-sync stub).src/validator/—kinfolkRule(subject 38–62% frame width, ≥30% negative space),brandSafeZone(5% edge buffer unlessallow_bleed),focalLengthGate(24–135mm unlessfocal_overrides), composed byvalidateShot. Thresholds configurable per brand viabrand_rules.json.src/adapter/—openImagineSubmit(HMAC-signedPOST /render),renderProvenance.src/ui/— React 18 overlay:DirectorOverlay,CameraDropTool,PathDrawTool,Scrubber,PresetLibrary(react/react-dom peer deps only — no new heavy UI deps).Seam closure (#2)
adapter/renderProvenance.tspopulatesRenderProvenance.external_idwithDirectorShot.id— the join seam the bandit (PR #21) added but left dangling.renderProvenance.test.tsproves the stamp lands and is idempotent. Director Mode is the producer that finally feeds the bandit'sexternal_idjoin, so reward attribution no longer relies only on the looseshopify_product_gid → twin_handlefallback.HMAC
openImagineSubmitsigns the raw request body asbase64(HMAC-SHA256(rawBody, OPEN_IMAGINE_HMAC_SECRET)), sent asX-Open-Imagine-Signature— matching the Shopify-webhook HMAC scheme already in this monorepo (connectors/shopify/src/primitives/webhooks.ts). Retries transient 503s.Cost
$0 incremental at idle (pure library + UI). Per-shot render unchanged from PR #34. No Tier-2 Kit/OVRTX path added.
Testing
pnpm --filter @shoploop/director-mode test→ 34 tests green across 10 files (spec target ≥25).pnpm --filter @shoploop/director-mode typecheckclean.pnpm --filter @shoploop/director-mode build(tsc → dist) succeeds.web-viewer-sample.DirectorShotschema with a full JSON example.🤖 Generated with Claude Code