Skip to content

[Video]: add H3 artifact demo / 新增 H3 产物演示页 - #1086

Merged
edwingao28 merged 3 commits into
masterfrom
feat/h3-video-demo
Sep 9, 2026
Merged

[Video]: add H3 artifact demo / 新增 H3 产物演示页#1086
edwingao28 merged 3 commits into
masterfrom
feat/h3-video-demo

Conversation

@edwingao28

@edwingao28 edwingao28 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add the hidden /video and /zh/video production views using the existing ↑↑↓↓ feature flag and InferenceX styling, as requested by Oren. Read the real artifacts from InferenceX #2894 without introducing another backend schema.

  • Play baseline/candidate videos with native audio; show prompt, seed, generation settings, source/runtime revisions, hardware and exact CI/artifact downloads.
  • Display latency, valid clips/sec, completion counts, sampled memory, measured board power and integrated sampled energy. Explain units/windows and separate complete execution from uncalibrated A/A comparisons.
  • Estimate revenue and full-cost profit per participating or billed GPU-hour from explicit user-entered price/cost/source/date assumptions.
  • Preserve noindex routes and hidden navigation. Artifact folders stay browser-local. Persistent private media storage remains a stretch goal requiring an approved bucket, credentials and collaborator access; the feature flag is not media access control. No added public documentation.

PR preview uses existing Vercel SSO. After merge the viewer is at /video on the production site; collaborators import an authorized downloaded artifact folder.

Testing

  • Local typecheck, lint, format and typography checks pass.
  • Local smoke: 46 component and 113 integration checks; dedicated navigation: 19 pass; focused artifact/route/Chinese checks: 103 pass.
  • Real four-second and eight-second CI bundles: all 55 hashes verified per bundle; native video and nonzero decoded audio, original report playback, exact manifest download, error recovery and Chinese mobile layout pass. Real failed bundle: 23 hashes, failed state preserved and absent metrics unavailable.
  • CORS helper: both allowed loopback origins work; foreign origins and folded-header injection are not reflected.
  • Read-only Claude Chinese-copy review and follow-up completed.
  • CI at 257a10ce: all eight Chrome/Firefox E2E shards, component tests, full typecheck/unit suite, lint and CodeQL passed. E2E run.

中文说明

按 Oren 的要求,使用现有 ↑↑↓↓ 功能开关与 InferenceX 样式,将 /video/zh/video 作为隐藏生产页面交付,直接读取 #2894 的真实产物。

  • 播放基线/候选视频与原生音频,显示 prompt、seed、配置、版本、硬件及对应 CI/产物下载。
  • 展示延迟、有效视频吞吐、完成计数、显存采样、实测板卡功率及采样积分能耗,说明单位和测量时段,区分执行成功与未经校准的 A/A 比较。
  • 按用户明确输入的售价、完整成本、来源与日期,分别按参与计算/计费 GPU 数估算每 GPU 小时收入和利润。
  • 页面保持 noindex 和隐藏导航;产物在浏览器中读取。私有持久化媒体存储仍为 stretch goal,需要获准的存储桶、凭据与协作者访问配置,隐藏入口不等于媒体访问控制。不新增公开文档。

本地类型、lint、格式、字体、46 项组件、113 项集成、19 项导航与 103 项定向检查通过;两份真实成功产物和一份失败产物的播放、音频、校验和、下载、错误状态与中文移动端已验证。本地 CORS 来源与折叠头部检查通过。Claude 中文只读审查及复查完成。257a10ce 的 CI 已通过全部八个 Chrome/Firefox E2E 分片、组件测试、完整类型/单元测试、lint 与 CodeQL。

合并后查看器位于生产站点 /video;协作者导入有权下载的产物文件夹。生产部署不会自动公开私有媒体。


Note

Medium Risk
Introduces client-side fetching from user-supplied manifest URLs and in-browser rendering of untrusted artifact HTML (mitigated by URL rules, checksums, and iframe sandbox/CSP), but the hidden nav is not access control for private bundles.

Overview
Adds a feature-gated H3 video benchmark viewer at /video and /zh/video, wired into the existing ↑↑↓↓ unlock and dashboard registry (standalone shell, noindex metadata, Video in the Hidden tab menu).

The new VideoBenchmark UI loads CI bundles entirely in the browser via extracted artifact folders or a restricted HTTPS manifest.json URL (checksum verification, path hardening, size caps). It surfaces baseline/candidate playback, metrics, power/memory estimates, optional revenue/profit assumptions, and a CSP-sandboxed embedded report—without shipping sample media on an empty page.

Supporting changes: bundle.ts loader/helpers with Vitest contract tests, Cypress navigation/load-error/locale checks, and a loopback serve-h3-artifact.py helper for local CORS demos (localhost-only auto-load from ?manifest=).

Reviewed by Cursor Bugbot for commit 257a10c. Bugbot is set up for automated code reviews on this repo. Configure here.

中文:新增 H3 视频产物查看器,直接读取 CI manifest、原始媒体和遥测;复用隐藏导航,区分执行、回归及测量窗口,并提供明确计费口径的收入与利润估算。
@vercel

vercel Bot commented Sep 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
inferencemax-app Ready Ready Preview Sep 9, 2026 1:41am UTC

Request Review

Comment thread scripts/serve-h3-artifact.py Fixed
补齐视频保真度与硬件表格的中文标签,明确假设基准日期、计费口径及缺失数据文案。更新真实参考产物说明;中文移动端与真实媒体播放检查通过。
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @edwingao28's task in 3m 9s —— View job


Claude review — H3 video artifact viewer

  • Read changed files (bundle.ts, VideoBenchmark.tsx, serve script, routes, tests)
  • Static review (bugs, security, resource leaks, hooks)
  • Runtime verification of /video + /zh/video
  • Check CI status
  • Chinese-copy pass (advisory)

🟢 LGTM — no blocking issues found

Reviewed statically and verified at runtime on the local dev server. /video and /zh/video both render the empty state cleanly, the EN↔中文 toggle links correctly (/zh/video), and there are no console errors (only the preexisting unrelated left-pattern-full.svg preload warning). The empty state, Chinese state, and recoverable load-error flow are covered by the two new navigation.cy.ts specs.

What I checked closely and found sound:

  • Object-URL lifecycleopen() re-clear()s and bumps a generation counter; stale async completions revoke their own URLs (bundle.ts/VideoBenchmark.tsx:333,368,384), the effect cleanup revokes activeUrls on unmount. No leak on rapid reloads or concurrent loads.
  • Bundle verification — per-file SHA-256, manifest evidence, and paired media identity all validated before render; size guards (512 MiB/file, 1 GiB total, 2000 entries) bound memory. Path traversal is blocked by safePath (well-tested).
  • Report sandbox — script/iframe/link/meta nodes stripped, attributes rewritten to blob URLs or removed, and an injected default-src 'none' CSP + sandbox with no allow-scripts. Defense-in-depth looks correct.
  • sampledPower / estimateEconomics — trapezoidal integration, denominator handling, and null-preservation on missing data are correct and covered by unit tests, including negative-profit and gap-invalidation cases.
  • Tests presentbundle.ts has colocated bundle.test.ts; the UI component has E2E coverage. No test-coverage gap.

Notes (non-blocking):

  • Left one inline comment on scripts/serve-h3-artifact.py:26: the CodeQL "HTTP Response Splitting" alert is a false positive (the echoed Origin is gated by exact-set membership to two fixed literals; loopback-bound dev-only script). Safe to dismiss.
  • Chinese copy: reviewed the new STRINGS.zh dictionary and tab-meta-zh.ts entries against their English sources — accurate and natural, matching the surrounding register. No fidelity issues; no maintainer action needed. (advisory)
  • CI (Lint / Unit / E2E) was still pending at review time; this is a draft PR with the standard jobs skipped, per the description. The merge gate should be green before merging.
    · feat/h3-video-demo

中文:按隐藏生产功能交付 H3 演示,移除新增公开文档。为本地产物服务输出固定的 CORS 来源,验证非法来源与折叠头部不会反射到响应中。
Comment thread scripts/serve-h3-artifact.py
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @edwingao28's task in 2m 27s —— View job


Review: PR #1086 — H3 video artifact demo

  • Read the diff and changed files
  • Static review (bundle.ts, VideoBenchmark.tsx, serve-h3-artifact.py, routes)
  • Check CI status — all green
  • Runtime verification of /video and /zh/video
  • Post findings

🟢 LGTM — no blocking issues found

I reviewed the diff statically and verified the pages at runtime. This is a carefully-built, self-contained feature with no inference/backend surface.

Runtime verification (localhost, real DB):

  • /video renders the empty state ("Open a real CI result to begin") with 0 console errors (the 2 warnings are the unrelated site-wide brand/left-pattern-full.svg preload).
  • /zh/video renders the Chinese empty state ("打开真实 CI 结果开始查看"), <meta name="robots"> = noindex, nofollow on both locales, and the EN↔中文 toggle links correctly (/video/zh/video).

CI: typecheck/unit, lint/format, component + full Chrome/Firefox E2E matrix, CodeQL, and Bugbot all pass.

Security surface reviewed — looks sound:

  • safePath rejects traversal/absolute/control-char/scheme paths; loadBundle verifies SHA256SUMS, manifest evidence, and per-role media identity, with size caps (512 MiB/file, 1 GiB total).
  • httpReader enforces HTTPS (HTTP only on loopback), strips credentials, redirect: 'error', credentials: 'omit', blocks query/hash.
  • ?manifest= auto-load is gated to localhost/127.0.0.1 only — a shared preview link can't trigger a fetch to a sender-supplied URL.
  • Report HTML is sanitized (scripts/base/iframe/form/etc. removed, src/href rewritten to blob URLs), rendered in an iframe with sandbox="allow-same-origin" (no allow-scripts) plus an injected default-src 'none' CSP.
  • The earlier CodeQL "HTTP Response Splitting" alert on serve-h3-artifact.py is resolved in the current code: the handler now sends a hard-coded constant when Origin exactly matches one of two allow-listed values, rather than echoing the raw header. CodeQL check passes.

Object-URL lifecycle: the generation counter + activeUrls ref correctly revoke blob URLs on clear, on unmount, and on superseded in-flight loads — no leaks spotted.

Tests: bundle.ts has colocated unit tests (bundle.test.ts) covering the load contract, path safety, sampled power, and economics; VideoBenchmark.tsx has E2E coverage in navigation.cy.ts (empty state, load error, gate nav, bilingual robots). Coverage requirement satisfied.

Chinese copy: reviewed the new STRINGS.zh dict and tab-meta-zh entries against their English sources — accurate and natural, with English technical terms (warmup, seed, prompt, manifest, CI, CORS, Slurm, PSNR/MAE/RMS) appropriately preserved. No fidelity issues; advisory/non-blocking, no maintainer escalation needed.
· branch feat/h3-video-demo

@edwingao28
edwingao28 merged commit 43acfef into master Sep 9, 2026
25 checks passed
@edwingao28
edwingao28 deleted the feat/h3-video-demo branch September 9, 2026 01:47
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.

2 participants