Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/delivery-video/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions external_plugins/delivery-video/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "delivery-video",
"version": "1.1.2",
"description": "Turn a feature that actually runs into a trustworthy delivery demo video, or a defect into a traceable feedback video: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"author": {
"name": "Lumos-789",
"url": "https://github.com/Lumos-789"
},
"homepage": "https://github.com/Lumos-789/delivery-video-plugin",
"repository": "https://github.com/Lumos-789/delivery-video-plugin",
"license": "MIT",
"keywords": [
"delivery",
"demo-video",
"bug-report",
"screen-recording",
"quality-gate",
"pi",
"dsh"
],
"skills": "./skills/",
"interface": {
"displayName": "Delivery Video",
"shortDescription": "Record and gate delivery demo videos",
"longDescription": "Records real screen sessions of working software, renders narration and word-synced subtitles, and runs a deterministic quality gate before the video is delivered. The same pipeline produces defect/feedback videos with severity and repro/actual chips plus a hashed issue report. No static screenshots, mocks or stale footage.",
"developerName": "Lumos-789",
"category": "Productivity",
"capabilities": [
"Read",
"Write with confirmation"
]
}
}
27 changes: 27 additions & 0 deletions external_plugins/delivery-video/.zcode-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "delivery-video",
"version": "1.1.2",
"description": "Record, render and gate trustworthy delivery demo videos — or defect/feedback report videos — of real, working software: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"description_i18n": {
"en": "Record, render and gate trustworthy delivery demo videos — or defect/feedback report videos — of real, working software: real screen recordings, edge-tts narration, word-synced subtitles and a deterministic quality gate.",
"zh-CN": "把真实运行的功能录成可交付的演示视频,或把缺陷录成可追溯的问题反馈视频:真实录屏、edge-tts 旁白、逐字对齐字幕与确定性质量闸,产出 1920x1080 成片与完整证据链。"
},
"author": {
"name": "Lumos-789",
"url": "https://github.com/Lumos-789"
},
"homepage": "https://github.com/Lumos-789/delivery-video-plugin",
"repository": "https://github.com/Lumos-789/delivery-video-plugin",
"license": "MIT",
"keywords": [
"delivery",
"demo-video",
"bug-report",
"screen-recording",
"acceptance",
"quality-gate",
"edge-tts",
"ffmpeg"
],
"skills": "skills"
}
30 changes: 30 additions & 0 deletions external_plugins/delivery-video/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Changelog

## 1.1.2

- Feedback reports are now fully bound to the evidence chain. `render.py` writes the
artifact SHA256 plus, into `quality_gate/report.json`, a normalized hash of the
`feedback.json` fields and the exact `feedback.generated.md` bytes.
- `verify_delivery.py` recomputes both hashes. Editing `issue.title`/`issue.actual` (or
any other report field), editing the markdown, deleting the markdown, or rendering
with an older report that has no feedback binding now fails with a specific message
instead of `DELIVERY=PASS`. The video-side binding (artifact SHA256, truncated video,
stripped audio, re-encoded resolution) is unchanged.
- Tests: `tests/test_feedback_binding.py` covers clean pass, edited title, edited actual,
edited markdown and deleted markdown; `tests/test_render.py` covers canonical hash
normalization. Feedback artifacts rendered by 1.1.1 must be re-rendered to gain the
binding.

## 1.1.1

- Feedback/defect report mode: `intent: "feedback"` plus an `issue` block adds severity
and phase chips, a repro-steps overlay, and writes `feedback.json` and
`feedback.generated.md` bound to the artifact SHA256. Quality-gate rules are unchanged.

## 1.0.x (2026-10-31 → 2026-11-02)

- 1.0.0 — first ZCode release: real-recording pipeline (`preflight`/`render`/`verify`), the built-in `delivery-v1` gate, bilingual READMEs.
- 1.0.1 — narration/TTS, subtitle line-breaking and low-bitrate false-positive fixes; preflight checks render dependencies early.
- 1.0.2 — default warnings cleaned up; auditable notices kept.
- 1.0.3 / 1.0.4 — DSH runtime skill registration, then registration scoped to each Agent (plugin shell: `package.json` + `index.js` + `cordis.patch.yml`).
- 1.0.5 / 1.0.6 — desktop-environment hardening; case-driven recording guidance.
21 changes: 21 additions & 0 deletions external_plugins/delivery-video/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2026 Lumos-789

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
76 changes: 76 additions & 0 deletions external_plugins/delivery-video/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# delivery-video

A skill plugin that turns a feature that **actually runs** into a trustworthy delivery demo video — real screen recordings, synthesized narration, word-synced subtitles, and a deterministic quality gate that refuses to pass a fake or broken demo.

Most "AI demo videos" are stitched from static screenshots, mock pages or stale recordings. This plugin enforces the opposite discipline: every segment must point at a real recording with a traceable time range, the last shot must end on a verified result state, and the artifact must pass hard checks for resolution/FPS/codec, audio presence, loudness, black frames and freeze frames before anything is posted. Bitrate density is reported as an informational notice; text still needs a 1:1 visual check. The uploaded file is always the gated file, bound by SHA256.

In DeepSeek Harness, the skill is registered in both the Host and each live Agent scope. That lets the installed plugin win over an older same-name copy in `~/.agents/skills`, even when an Agent preset mounts the filesystem skill provider in a nearer layer.

## What it does

1. **Verify first, record second** — the workflow requires evidence that the current version really runs (git SHA, tickets, request IDs) before any recording.
2. **Case-driven structure (recommended)** — for multi-case deliveries the skill suggests listing the acceptance cases first, recording one real run per case, then assembling segments in execution order with a result shot per case. Optional, not a gate.
3. **episode.json recipe** — each segment binds one real take + time range + one narration line + optional crop/case chip.
Set `intent: "feedback"` with an `issue` block to produce a defect report instead of a
delivery: severity and phase chips, a repro-steps overlay, and both `feedback.json` and a
ticket-ready `feedback.generated.md`. The gate report binds the artifact SHA256, a
normalized hash of the `feedback.json` fields and the exact markdown bytes, so
`verify_delivery.py` fails when the report was edited after rendering, or the markdown is
missing or was edited after rendering. Copy `examples/feedback-episode.example.json` as a
starting point. The same quality gate applies.
4. **Self-contained renderer** — `render.py` synthesizes narration via edge-tts (word-boundary clocks), times each segment to its narration (0.3x–3x speed is hard-checked, never clamped — out of range fails), draws the label chip and word-synced subtitles, concatenates, loudness-normalizes to −14 LUFS, and runs the built-in quality gate. Output: `screen_demo.mp4` (1920×1080, 30fps, h264 with AAC audio — a non-AAC track is a gate warning `E102`, not a failure), `timeline.json`, cover/preview frames, `quality_gate/report.json`.
5. **Fail-loud checks** — `preflight.py` validates the recipe before rendering (structure, intervals, crops, browser-recording evidence, TTS cache contracts, narration red lines); `verify_delivery.py` verifies the finished artifact, gate binding and optional independent visual review afterwards.
6. **Attachment gate** — `render.py gate` runs the same hard checks on any mp4 before it goes into a ticket, chat or customer channel.

## Prerequisites

- `python3` 3.9+
- `ffmpeg` and `ffprobe` on PATH
- `pip install "edge-tts>=7.3.1" Pillow`

`edge-tts` 7.2.8 and older can return HTTP 403 from the upstream endpoint. Use 7.3.1 or newer; the renderer fails early with an upgrade command when the installed version is too old.
Run `preflight.py`, `render.py` and `verify_delivery.py` with the same Python interpreter. Preflight fails early when ffmpeg/ffprobe, Pillow, a supported edge-tts version or a CJK font is missing.

Platform setup:

- macOS: `brew install ffmpeg`, then `python3 -m pip install "edge-tts>=7.3.1" Pillow`
- Windows: install FFmpeg with `winget install --id Gyan.FFmpeg -e` (or `choco install ffmpeg`). If `python3` is not available, use `py -3` consistently and run `py -3 -m pip install "edge-tts>=7.3.1" Pillow`
- Linux: install `ffmpeg` and a CJK font such as `fonts-noto-cjk` with your package manager, then install the Python packages

The renderer needs a CJK font for Chinese labels and subtitles. macOS and Windows normally provide one; minimal Linux images often do not, and preflight reports the missing font before rendering.

## Side effects (disclosed for review)

- **Network**: narration synthesis calls the public edge-tts (Microsoft Cognitive Services) endpoint; no other network access.
- **Files**: writes only inside the build directory you pass in (`tts/` cache, per-segment clips, final mp4, gate reports).
- **Commands**: runs `ffmpeg`/`ffprobe` locally; the skill never uploads, publishes or deletes anything by itself.

## Quick start

Install: `dsh plugin add /path/to/delivery-video-plugin` (DSH bundle). It exposes the skill in `skills/delivery-video/`.

1. Record real takes of the feature with your usual tool (macOS `Cmd+Shift+5`, OBS, or a scripted browser screencast — see the skill's recording reference). For two or more acceptance cases, list them first using `examples/cases.example.md` as a template, then record one real run per case.
2. Create `build/screen_demo-<slug>/episode.json` (copy `examples/episode.example.json`).
3. Run the three scripts (use `py -3` instead of `python3` on Windows when needed):

```bash
python3 <skill>/scripts/preflight.py build/screen_demo-myfeature
python3 <skill>/scripts/render.py render build/screen_demo-myfeature
python3 <skill>/scripts/verify_delivery.py build/screen_demo-myfeature
```

Run the unit tests with:

```bash
python3 -m unittest discover -s tests -v
```

Suggested trial prompt after install: *"用 delivery-video 把这个项目刚完成的功能录成一段 90 秒交付演示视频"* — the skill will walk verification, storyboard, recording guidance, recipe assembly, render and gating.

## Same-name skill copies

ZCode 0.17.x can keep a user-level skill and a plugin skill with the same name. If an older `~/.agents/skills/delivery-video` still exists, the unqualified `/skill delivery-video` command may select that copy. Select `delivery-video:delivery-video` in the composer, or use `/skill delivery-video:delivery-video <task>`, to run the installed plugin.

## License

MIT © Lumos-789
74 changes: 74 additions & 0 deletions external_plugins/delivery-video/README_CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# delivery-video

把**真实运行**的功能做成可信交付演示视频的 skill 插件——真实录屏、合成旁白、逐字对齐字幕,加一道拒绝放过造假或残次演示的确定性质量闸。

大多数「AI 演示视频」是静态截图、mock 页面或旧录屏拼出来的。这个插件强制相反的纪律:每个镜头必须指向一段真实录屏和可追溯的时间区间,最后一镜必须落在已回读验证的结果状态上,成片必须先过硬检查(分辨率/帧率/编码、音轨、响度、黑帧、冻结帧)才允许外发。码率密度会作为信息项保留,关键页面仍需按 1:1 目检。贴出去的文件永远是过闸的那一个文件,用 SHA256 绑定。

在 DeepSeek Harness 中,该 Skill 会同时注册到 Host 与每个 Agent 作用域。因此即使 Agent preset 在更近的文件系统层加载了 Skill,已安装插件仍会优先于 `~/.agents/skills` 里的旧同名副本。

## 它做什么

1. **先验真,再录**——工作流要求先有当前版本真实跑通的版本证据(git SHA、工单、请求 ID),才允许录制。
2. **按用例组织(推荐)**——多 case 交付时,建议先拆一张用例清单,再一个 case 一次真实运行录制,最后按执行顺序拼镜头,每个 case 以自己的结果回读收尾。属使用建议,不做强制校验。
3. **episode.json 配方**——每个镜头绑定一段真实原片 + 时间区间 + 一句旁白 + 可选裁切/case 徽标。
写 `intent: "feedback"` 并添加 `issue` 块即可产出问题反馈视频:严重级别与阶段徽标、
复现步骤浮层、复现/现象镜头,以及 `feedback.json` 和可直接贴工单的
`feedback.generated.md`。闸报告同时绑定成片 SHA256、`feedback.json` 字段的归一化哈希
与 markdown 原始字节哈希,渲染后改动报告内容或删除/篡改 markdown 都会被
`verify_delivery.py` 拒绝;质量闸规则不变。可从 `examples/feedback-episode.example.json` 复制起步。
4. **自包含渲染器**——`render.py` 用 edge-tts 合成旁白(逐字时间钟),按旁白时长配速每个镜头(0.3x–3x 变速硬校验,超范围直接失败,绝不自动钳制),绘制标签徽标与逐字同步字幕,拼接、响度归一到 −14 LUFS,并自动跑内置质量闸。输出:`screen_demo.mp4`(1920×1080、30fps、h264,音轨为 AAC——非 AAC 只会得到闸警告 `E102`,不算失败)、`timeline.json`、封面/预览帧、`quality_gate/report.json`。
5. **Fail-loud 检查**——`preflight.py` 渲染前校验配方(结构、区间、裁切、浏览器录屏证据、TTS 缓存契约、旁白红线);`verify_delivery.py` 渲染后核验成片、闸绑定与可选的独立视觉复核。
6. **附件闸**——`render.py gate` 对任意 mp4 跑同一套硬检查,贴进工单、群聊或客户渠道之前必须过。

## 前置依赖

- `python3` 3.9+
- PATH 里有 `ffmpeg` 和 `ffprobe`
- `pip install "edge-tts>=7.3.1" Pillow`

`edge-tts` 7.2.8 及更早版本会从上游端点收到 HTTP 403。请使用 7.3.1 或更新版本;版本过低时渲染器会直接失败并给出升级命令。
`preflight.py`、`render.py` 和 `verify_delivery.py` 要用同一个 Python 解释器运行。预检会在 ffmpeg/ffprobe、Pillow、edge-tts 版本或中文字体不满足要求时直接失败。

不同系统的准备方式:

- macOS:`brew install ffmpeg`,然后执行 `python3 -m pip install "edge-tts>=7.3.1" Pillow`
- Windows:用 `winget install --id Gyan.FFmpeg -e`(或 `choco install ffmpeg`)安装 FFmpeg;如果没有 `python3`,统一改用 `py -3`,并执行 `py -3 -m pip install "edge-tts>=7.3.1" Pillow`
- Linux:用包管理器安装 `ffmpeg` 和中文字体(例如 `fonts-noto-cjk`),再安装 Python 包

渲染器需要中文字体来绘制标签和字幕。macOS 和 Windows 通常自带;精简 Linux 镜像可能没有,预检会在渲染前直接报告字体缺失。

## 副作用披露(审核要求如实说明)

- **网络**:旁白合成调用公共 edge-tts(Microsoft 认知服务)端点;无其他网络访问。
- **文件**:只在你传入的构建目录内写入(`tts/` 缓存、逐镜头片段、成片、闸报告)。
- **命令**:本地执行 `ffmpeg`/`ffprobe`;本 skill 自身不上传、不发布、不删除任何东西。

## 快速开始

安装:`dsh plugin add /path/to/delivery-video-plugin`(DSH bundle),会暴露 `skills/delivery-video/` 下的 skill。

1. 用你惯用的工具录真实原片(macOS `Cmd+Shift+5`、OBS,或脚本化浏览器录屏——见 skill 内录制指引)。覆盖两条以上验收用例时,先按 `examples/cases.example.md` 拆清单,再一个 case 录一次真实运行。
2. 创建 `build/screen_demo-<slug>/episode.json`(可复制 `examples/episode.example.json`)。
3. 依次跑三个脚本(Windows 没有 `python3` 时改用 `py -3`):

```bash
python3 <skill>/scripts/preflight.py build/screen_demo-myfeature
python3 <skill>/scripts/render.py render build/screen_demo-myfeature
python3 <skill>/scripts/verify_delivery.py build/screen_demo-myfeature
```

单测命令:

```bash
python3 -m unittest discover -s tests -v
```

安装后的试用 prompt:*"用 delivery-video 把这个项目刚完成的功能录成一段 90 秒交付演示视频"*——skill 会带你走完验真、分镜、录制指引、配方组装、渲染与过闸。

## 同名 Skill 副本

ZCode 0.17.x 允许用户级 Skill 和插件 Skill 同名共存。如果本机还保留旧的 `~/.agents/skills/delivery-video`,直接输入 `/skill delivery-video` 可能选中旧副本。请在输入框选择 `delivery-video:delivery-video`,或使用 `/skill delivery-video:delivery-video <任务>` 调用已安装插件。

## 许可

MIT © Lumos-789
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions external_plugins/delivery-video/cordis.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- insert:
- id: delivery-video
name: 'delivery-video'
17 changes: 17 additions & 0 deletions external_plugins/delivery-video/examples/cases.example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Acceptance cases (optional)

Use this when one video covers two or more acceptance cases. It is a working
list, not a gate: keep the same case ids in the take filenames and in
`segments[].case`. Keep the file in the target project, not in the plugin.

Feature: order owner assignment
Audience: operations staff
Problem this demo covers: handing an order to another owner without losing the saved state

| Case | Proves | Entry | Precondition / data | Expected observable result | Result |
| --- | --- | --- | --- | --- | --- |
| F-01 | main flow works end to end | order detail page | test order `T-1001` | saved owner is shown after refresh | PASS |
| F-02 | empty selection is rejected | same page | clear the owner field | inline validation appears, nothing is saved | PASS |

Takes: `F-01-entry.mp4`, `F-01-result.mp4`, `F-02-validation.mp4`.
Each case starts from a known state and is recorded as its own real run.
37 changes: 37 additions & 0 deletions external_plugins/delivery-video/examples/episode.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"voice": "zh-CN-YunxiNeural",
"rate": "+5%",
"title": "Order task list — delivery demo",
"segments": [
{
"id": "01-entry",
"case": "F-01",
"label": "入口",
"shot": "take-01.mp4",
"start": 0.5,
"end": 11.5,
"crop": [56, 159, 1512, 738],
"text": "从订单详情进入任务运营名单,当前负责人和保存入口都在页面上。"
},
{
"id": "02-save",
"case": "F-01",
"label": "保存",
"shot": "take-02.mp4",
"start": 0.3,
"end": 9.8,
"crop": [56, 159, 1512, 738],
"text": "修改负责人后点保存,页面提示已更新,没有报错。"
},
{
"id": "03-readback",
"case": "F-01",
"label": "回读",
"shot": "take-03.mp4",
"start": 0.4,
"end": 8.2,
"crop": [56, 159, 1512, 738],
"text": "刷新页面重新打开名单,刚才的修改仍然生效。"
}
]
}
Loading