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.2.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.2.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"
}
88 changes: 88 additions & 0 deletions external_plugins/delivery-video/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Changelog

## 1.2.2

- **Fixed the dead black-frame check.** `parse_detects` required a space after the
colon, but ffmpeg prints blackdetect as `black_start:6 black_end:11.966667` with
no space (silencedetect/freezedetect do print one). A 12s video whose last 6s are
pure black passed the gate with empty `black_spans`; the regex now accepts both
formats, so `B101` fires again.
- Detect spans that run to the end of the video are no longer dropped:
freezedetect emits only `freeze_start` (no `freeze_end`) when the freeze reaches
EOF, and such spans are now closed at the total duration, so a frozen tail
triggers `T301`/`T304`.
- Feedback tamper-proofing can no longer be switched off by editing `episode.json`
(which sits outside every hash chain): `verify_delivery.py` now checks the
report/markdown hash bindings whenever the gate report carries a `feedback`
block, not only while episode.json still declares `intent: "feedback"`.
- `preflight.py` no longer demands a `size` field or a 1920x1080 resolution from
demo-stage evidence, matching the documented demo-stage contract
(sha256/fps/frames/duration) and `verify_delivery.py`. The build-name rejection
message now attributes the check to preflight — render.py accepts any directory
name; preflight is what rejects it.

## 1.2.1

- Docs fix: `references/recording.md` still claimed "the renderer crops to a 1080p
canvas" — the opposite of the 1.2.0 fix. It now says recordings are scaled/padded
onto the 1080p canvas and the full frame is shown unless a segment declares an
explicit `crop`, matching SKILL.md and `episode-and-review.md`.
- `render.py` and `preflight.py` no longer duplicate the crop validation: one shared
`crop_error()` (in `render.py`) is collected by preflight and raised by render.
Both entry points reject exactly the same inputs as before; render's message for a
negative-origin or non-positive crop now names that problem instead of the old
"exceeds source".
- Comment cleanup: dropped the `LAYOUTS` block comment duplicated by
`segment_filter`'s docstring, the behavior-restating half of the polyphone comment,
and a divider comment.

## 1.2.0

- **Root-caused the "only the middle of the screen is recorded" failure.** `render.py`
used to apply a hard-coded `DEFAULT_CROP = [260, 64, 1340, 780]` to every segment
that did not declare `crop`, silently trimming 260 px off the left and 320 px off the
right of any full-window 1920x1080 recording (and `preflight.py` validated browser
takes against the same silent default while demo-stage takes were validated as full
frame — the two defaults even disagreed). Frame geometry is now opt-in everywhere:
`crop` absent = the whole recording is shown; an explicit crop is bounds-checked
against the real source pixels in both preflight and render and fails loud.
- New episode-level `layout` field: `banded` (default, unchanged dark-canvas look with
the 1800x866 content box) or `fullbleed` (recording scaled onto the full 1920x1080
canvas; 16:9 sources map 1:1; case chip stays top-left and subtitles get a dark
backing box so they stay readable over light pages). Use `fullbleed` when every
pixel of the screen must stay visible.
- Polyphone lint in `preflight.py`: narration containing 行/重/还/都/长/得/着/差/数/干/应/结/系/弹/屏
produces a per-occurrence warning with context (e.g. table-row 行 háng vs walking 行
xíng — prefer 一条/这一单), so TTS mispronunciations are caught before render instead
of after delivery.
- Tests: `tests/test_render.py` covers full-frame default, explicit-crop placement and
fullbleed geometry.

## 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
Loading