The truly free, open-source, local-first, cross-platform CapCut replacement. Scriptable through a JSON-RPC API & MCP.
Rust ffmpegfree-video-editormodel-context-protocolnon-linear-editoroffline-firstopen-source-video-editorself-hostedvideo-editingvideo-editing-automationvideo-editing-softwarevideo-editing-toolsvideo-editorvoice-cloningyoutube-automationyoutube-shorts
docs: drop the roadmap, the handoff, the audits and the effects guide
Jareer98260203de67
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 8ac72c6b..7969965d 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -18,9 +18,9 @@ and on [Discord](https://discord.gg/DVuPfpXfqP).## Before you write codeOpen an issue or drop into Discord first for anything beyond a small fix. Large-areas of [`ROADMAP.MD`](ROADMAP.MD) are already in progress or intentionally-deferred, and it is genuinely no fun to review a big PR that has to be turned-down for reasons that were invisible from outside.+areas are already in progress or intentionally deferred, and it is genuinely+no fun to review a big PR that has to be turned down for reasons that were+invisible from outside.## Setting updiff --git a/EFFECTS.md b/EFFECTS.mddeleted file mode 100644index 7c3819b7..00000000--- a/EFFECTS.md+++ /dev/null@@ -1,295 +0,0 @@-# Writing effects for Concat--Every effect, filter, transition and audio effect in Concat is a **package**:-a folder with a short manifest and, beside it, a filter chain or a shader.-The ones that ship with the app are packages too, and nothing in the app's-code names any of them. A package you write goes in a folder on your-machine and shows up on the same shelves as the built-ins, and a package you-share is that folder, zipped.--## Where packages live--Concat reads every folder under its effects directory:--| Platform | Folder |-|---|---|-| macOS | `~/Library/Application Support/concat/effects` |-| Windows | `%APPDATA%\concat\effects` |-| Linux | `~/.config/concat/effects` (or `$XDG_CONFIG_HOME/concat/effects`) |-| Portable build | `portable/effects` beside the executable |--The app watches that folder while it runs. Add a package, edit its files,-or delete it, and the shelves follow within a few seconds. The **Reload-custom effects** button on the Effects and Filters pages does the same on-demand, and its notice names the folder, so you never have to remember the-path. A package that will not load is skipped, the reason appears in the-window, and every reason is in the log (Settings › About opens it).--## The smallest package--A package is a folder named after its id, holding `effect.toml`:--```-effects/-└── ada.warm-shadows/- └── effect.toml-```--```toml-format = 1--[effect]-id = "ada.warm-shadows"-name = "Warm Shadows"-kind = "filter"-category = "Colour"-description = "A little amber in the shadows, the highlights left alone."--[[param]]-key = "amount"-label = "Amount"-min = 0-max = 100-default = 50-unit = "%"--[ffmpeg]-let = ["a = amount / 100 * 0.3"]-chain = "colorbalance=rs={fixed(a, 3)}:gs={fixed(a * 0.4, 3)}"-```--Save it, and Warm Shadows is on the Filters page under Colour, with one-slider. That is a whole package.--## The manifest--`effect.toml` is TOML. `format = 1` at the top says which package format-the file is written for; it may be left out, which means 1. A future Concat-that changes the format will bump the number, and a package written for a-newer one is refused with a message saying so rather than failing somewhere-confusing.--### `[effect]`--| Key | Meaning |-|---|---|-| `id` | `author.name`, lower-case letters, digits and hyphens. Stored in project files forever, so pick it once. The folder must be named after it. `concat.` is the built-ins' author and is refused for your own. |-| `name` | What the card says. |-| `kind` | `effect`, `filter`, `audio`, `transition` or `generator`. See below. |-| `category` | The shelf the card sits on, free text. `Imported` is where LUT imports go. |-| `order` | Sort key within the category; ties break on name. |-| `version` | Your own number, bumped when the output changes. Default 1. |-| `intensity` | For an effect: the parameter the simple view shows as its one slider. |-| `aliases` | Earlier ids this package answers to, so old projects keep rendering. |-| `description` | One sentence for the tooltip. |--### Kinds--- **filter**: a colour look, picture in, picture out. Every filter gets an- intensity control for free. Below full intensity the host mixes your result- with the untouched picture, so your chain or shader always renders the look- at full strength and never has to mix itself.-- **effect**: picture in, picture out, no automatic mixing. Blur,- distortion, texture, motion.-- **audio**: sound in, sound out. An FFmpeg chain of audio filters.-- **transition**: two pictures and a progress in, one picture out. A shader- under `[transition]`, never a chain.-- **generator**: no picture in, a picture out. A shader.--### `[[param]]`--One table per control, in the order the inspector shows them.--| Key | Meaning |-|---|---|-| `key` | The name the backend reads and the document stores. Lower-case letters, digits and underscores. `index` and `intensity` are reserved. |-| `label` | What the control is called. |-| `type` | `float` (default), `int`, `bool`, `enum`, `color`, `point`. |-| `min`, `max`, `default`, `step` | The range, the untouched value, and the slider increment. `max` defaults to 1, `step` 0 means continuous. |-| `unit` | Shown after the number: `%`, `dB`, `K`, `s`. |-| `group` | A subhead; consecutive params with the same group share one. |-| `animate` | Whether the control can carry keyframes. |-| `values`, `labels` | For `enum`: what the document may hold, and what each is called. |--Every declared parameter must be read by the backend, and a backend may not-read one the manifest does not declare. Both are caught at load.--## The FFmpeg backend--```toml-[ffmpeg]-let = ["k = clamp(strength / 100, 0, 1)", "r = round(k * 20)"]-chain = "gblur=sigma={fixed(k * 4, 2)},unsharp=5:5:{fixed(r / 10, 2)}"-```--`chain` is FFmpeg filter syntax with `{expression}` slots. `let` names-intermediate values, evaluated in order; each may read the parameters and-the names before it. `{{` and `}}` are literal braces.--An expression is a number, a parameter, arithmetic with `+ - * /`, a-comparison with `< > <= >= == !=` (1 or 0), and these functions:--| Function | Result |-|---|---|-| `round(x)`, `floor(x)`, `ceil(x)` | A whole number, printed without a decimal point. |-| `abs(x)`, `sqrt(x)`, `pow(x, y)` | As you would expect. |-| `min(a, b)`, `max(a, b)`, `clamp(x, lo, hi)` | Bounds. |-| `if(cond, a, b)` | `a` when `cond` is not 0, else `b`. |-| `fixed(x, n)` | Text with exactly `n` decimals, which is how a filtergraph wants most numbers. |--Two names are always there: `index`, the fragment's position in the clip's-chain, which any filtergraph labels you write must embed-(`split[a{index}][b{index}]`); and `lut`, the quoted path of the table a-`[lut]` section names.--**Which filters a chain may use.** A chain runs inside the app's own-process, and FFmpeg has filters that open files, load plugins and take-commands. A package is a folder anyone can share, so a chain is held to a-list of filters that read the frame and write the frame and nothing else.-The list is in-[`src/crates/concat-effects/src/filters.rs`](src/crates/concat-effects/src/filters.rs):-the colour, blur, distortion, keying and stacking filters, `split`, `blend`-and `overlay` for graphs, `lut3d` and `lut1d` for tables, and the tone,-dynamics, delay and pitch filters for sound. A chain naming anything else is-refused at load, and a filter's name has to be spelt out, never come from a-slot. If a pure pixel or sound filter you need is missing, add it to the-list in a pull request.--## The WGSL backend--```toml-[wgsl]-entry = "effect.wgsl"-```--`effect.wgsl` beside the manifest declares a `Params` struct with one field-per parameter and the entry the host calls:--```wgsl-struct Params { amount: f32 }--fn effect(uv: vec2<f32>) -> vec4<f32> {- let c = sample(uv);- let warm = split_tone(c.rgb, vec3<f32>(1.0, 0.75, 0.5), vec3<f32>(1.0), params.amount / 100.0);- return vec4<f32>(warm, c.a);-}-```--A `float`, `int`, `bool` or `enum` parameter is an `f32` field; a `point` is-a `vec2<f32>`; a `color` is a `vec4<f32>`. Every declared parameter must be-a field; a field the manifest does not declare stays zero.--The host wraps your file in its half of the contract. You get:--- `sample(uv)`: the layer's colour at `uv`, straight alpha.-- `texel()`: one pixel as a fraction of the layer.-- `luma(rgb)`: Rec. 709 luminance.-- `lut(rgb)`: the package's table applied, the identity when it ships none.-- `hash(p, seed)`: a number in 0..1 for grain and dither.-- `reveal_order(uv)`: over a title, which word is painted here, 0..1; 0- everywhere else.-- `frame.size` in pixels, `frame.time` in seconds into the timeline,- `frame.clip_time` in seconds since this clip began, and `frame.intensity`,- which the host applies for you after `effect` returns.-- The grading library: `saturation`, `vibrance`, `contrast`, `s_curve`,- `fade`, `lift_gamma_gain`, `split_tone`, `tint_midtones`, `white_balance`,- `kelvin`, `vignette`, `mono`, `matte`, `film_curve`, `hue_rotate`,- `hsl_band`, `halation`, `soften`, `grain_at`, `edge_at`, and the masks- `hue_mask`, `skin_mask`, `shadows`, `highlights`, `midtones`. Their- signatures are at the top of- [`src/crates/concat-effects/src/shader.rs`](src/crates/concat-effects/src/shader.rs).--Two rules the loader enforces: every loop must have a `break` or a-`break if` in it, and the shader may not declare bindings of its own. Both-keep a shared shader from hanging or reaching past its inputs.--A package may carry both backends. The shader renders wherever there is a-GPU; the chain is what a machine without one gets, and what the card-preview is rendered from. The built-in looks do this.--### Transitions--```toml-[transition]-entry = "effect.wgsl"-xfade = "dissolve"-fallback = "cross-fade"-```--The shader declares `fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32>`-and reads `from_at(uv)` and `to_at(uv)`, the outgoing and incoming pictures;-`sample` reads the outgoing one, so the grading helpers work on it unchanged.-`progress` runs 0 to 1 across the cut, and the shader owns the whole blend.-`xfade` names a built-in FFmpeg `xfade` transition for exports without a-GPU, and `fallback` a built-in transition id to degrade to; both are-optional.--### Tables--```toml-[lut]-file = "look.cube"-```--A `.cube` table beside the manifest. The shader reads it through `lut(rgb)`;-a chain names its path as `{lut}`, as in `lut3d=file={lut}`. Importing a-`.cube` from the Filters page writes exactly this package for you.--## Fixtures--`fixtures.toml` pins what the chain renders for given parameters, so a-change to the package, or to the expression language, that alters the-output is caught rather than shipped:--```toml-[[case]]-name = "as shot"-chain = "colorbalance=rs=0.150:gs=0.060"--[[case]]-name = "all the way"-at = "max"-chain = "colorbalance=rs=0.300:gs=0.120"--[[case]]-name = "a little"-params = { amount = 10 }-chain = "colorbalance=rs=0.030:gs=0.012"-```--`at` is `default`, `min` or `max` for every parameter, and `params` sets-some on top of it. `index` sets the fragment position. Every FFmpeg package-that ships with the app pins its default and both ends of every slider.--## The card--A package with a chain gets its card rendered for you the first time it-loads: the reference picture through the chain at its defaults, written-beside the manifest as `preview.jpg`. Put your own `preview.png` there to-use instead, which is the only way a shader-only package gets a picture.--## Checking a package--The command line does everything the app does on load, and runs the-fixtures, and says what is wrong:--```-concat-cli check ~/Library/Application\ Support/concat/effects/ada.warm-shadows-concat-cli check ~/Library/Application\ Support/concat/effects-```--One folder checks one package; a folder of folders checks them all. It-exits non-zero when any fails, so it runs in a CI job on a repository of-packages. Build it from the source tree with `cargo build -p concat-cli`-in `src/`.--## Sharing--A package is its folder. Zip it, and whoever receives it unzips it into-their effects folder. Keep the `format` line, pin fixtures for anything with-a chain, and include a `preview.png` if the package is shader-only. The-built-ins under-[`src/crates/concat-effects/packages/`](src/crates/concat-effects/packages/)-are 170-odd worked examples: `concat.sepia` is a chain and a shader,-`concat.bass` is audio, `concat.blur-dissolve` is a transition, and-`concat.adjust` shows parameters with groups and a full set of fixtures.diff --git a/HANDOFF.md b/HANDOFF.mddeleted file mode 100644index b6e1efc6..00000000--- a/HANDOFF.md+++ /dev/null@@ -1,357 +0,0 @@-# Concat — Engineering Handoff--**Date**: 2026-09-19-**Status**: Builds clean · Tests passing · All changes uncommitted on `main`-------## 1. What Is Concat--Concat is a **native, offline-first video editor** built with **Rust + Slint UI**, aiming for the feature set of the mainstream consumer editors. It runs on macOS, Windows, Linux, iOS, and Android from a single codebase. There is no cloud dependency, no sign-in, and no telemetry — everything runs on-device.--The project is in active early development. The goal is a free, open editor with the same snappiness and creative breadth as the commercial ones.-------## 2. Repository Layout--```-Concat/ ← git repo root-├── src/ ← Cargo workspace root (cd here for ALL cargo commands)-│ └── crates/-│ ├── concat/ ← Main desktop app (Slint UI + Rust glue)-│ │ ├── src/-│ │ │ ├── lib.rs ← All UI→Rust callback wiring (on_* handlers)-│ │ │ └── studio.rs ← Core editor state machine (~8 000 lines)-│ │ └── ui/-│ │ ├── workspace/-│ │ │ └── media-pane.slint ← Library panel (Effects/Transitions/Filters/etc.)-│ │ ├── timeline/-│ │ │ └── lanes.slint ← Timeline lanes, clip cards, transition seams-│ │ └── inspector/-│ │ └── clip-inspector.slint ← Right-panel inspector-│ ├── concat-effects/ ← Package system: all effects/filters/transitions/audio-│ │ ├── packages/ ← 165 packages, one folder each (auto-discovered at build)-│ │ └── src/-│ │ ├── catalogue.rs ← Category pill filtering logic-│ │ ├── manifest.rs ← effect.toml schema + Kind enum-│ │ └── expr.rs ← Tiny template language for FFmpeg chain strings-│ ├── concat-export/ ← FFmpeg-based export pipeline-│ │ └── src/lib.rs ← resolve_transitions(), composite_treated()-│ ├── concat-project/ ← Project model, commands, animation presets-│ │ └── src/animation.rs ← All animation keyframe presets-│ ├── concat-render/ ← GPU compositor (wgpu), transition shader runtime-│ │ └── src/gpu.rs ← GPU regression tests (run with --features gpu)-│ ├── concat-core/ ← TransitionShader / TransitionPass types-│ ├── concat-api/ ← Stable public API-│ ├── concat-cli/ ← CLI front-end-│ ├── concat-media/ ← Media probe & decode-│ ├── concat-server/ ← HTTP server / MCP integration-│ ├── concat-speech/ ← TTS / captions / speech-│ ├── concat-text/ ← Text rendering-│ └── concat-vision/ ← Background removal, segmentation models-├── engine/ ← Native rendering engine (non-Cargo)-├── assets/ ← App icons, splash screens-├── models/ ← Bundled AI models (segmentation, etc.)-└── scripts/ ← Tooling scripts (locale checker, etc.)-```--> **CRITICAL**: The Cargo workspace root is `src/`, not the git repo root. Every `cargo` command must be run from `src/`.-------## 3. Dev Setup--```bash-# Prerequisites: Rust stable, FFmpeg (system), wgpu-compatible GPU driver--git clone <repo>-cd "Concat/src"--# Run the desktop app-cargo run -p concat--# Faster iteration build profile-cargo run --profile quick -p concat--# Full test suite (includes GPU shader tests)-cargo test -p concat-effects -p concat-export -p concat-render -p concat-project --features gpu--# Type-check the whole app (including Slint UI macros) — ~45s-cargo check -p concat--# Lint everything-cargo clippy -p concat -p concat-export -p concat-effects -p concat-render -p concat-project \- --features concat-render/gpu -- -D warnings-```--> **Note for sandbox/CI environments**: `cargo check` and `cargo test` require network access to `index.crates.io`. They will fail in a fully sandboxed environment even with `--offline`. Always run these commands with real network access.-------## 4. Architecture — Things You Must Know--### 4.1 The Package System (Effects, Filters, Transitions, Audio)--Every built-in effect/filter/transition/audio item is a **folder** in `src/crates/concat-effects/packages/`. Naming convention: `concat.<name>/`.--Each folder contains:-- `effect.toml` — manifest (id, name, kind, params, category tags)-- `main.wgsl` or `effect.wgsl` — GPU shader (required for transitions; optional for effects/filters which have a CPU fallback)-- `ffmpeg.txt` or `ffmpeg.wgsl` — CPU-path FFmpeg filtergraph string (effects and filters; **forbidden** for transitions)-- `fixtures.toml` — golden test fixtures pinning exact FFmpeg chain output--**`build.rs` auto-discovers every folder at compile time.** Adding a package = adding a folder. Nothing in Rust ever names individual packages by ID. `Catalogue::builtin()` is the runtime entry point.--### 4.2 The `Kind` Enum (`manifest.rs`)--| Kind | GPU | FFmpeg | Intensity Slider | Notes |-|---|---|---|---|---|-| `Effect` | ✅ | ✅ | ❌ (define your own params) | Applied to selected clip's chain |-| `Filter` | ✅ | ✅ | ✅ (free, auto, don't declare it) | Overlay layer on timeline |-| `Transition` | ✅ ONLY | ❌ forbidden | ❌ | Two-input shader, `transition()` fn |-| `Audio` | — | ✅ | depends | Applied to clip's audio chain |-| `Generator` | reserved | — | — | No packages exist yet |--### 4.3 Transition Runtime--The GPU transition pipeline spans four crates:--```-effect.toml [transition] → TransitionShader (concat-core)- → TransitionPass (concat-render GPU compositor)- → Compositor::combine() called per-frame during preview- → resolve_transitions() + composite_treated() (concat-export)- → exported via FFmpeg frame-by-frame-```--Without a GPU the same `Compositor::combine()` runs on `CpuCompositor`, which-draws the shape the manifest names as `xfade` in plain arithmetic-(`concat-render/src/transitions.rs`): the crossfades, the clock wipe, the iris,-the wipes and slides, the zoom and the mosaic, each in the shipped shader's own-terms rather than FFmpeg's reading of the name. The `TransitionPass` carries-the name (`xfade`), filled in by `Catalogue::transition_pass()`. A package-naming no shape, or one the CPU does not draw, gets the dissolve ramp the-incoming clip already carries. The monitor takes the same path: with a GPU a-live transition goes through `PreviewSources::composite()` on the device-(`Monitor::texture_of`, the `needs_cpu` branch), without one through the CPU-shapes.--A transition shader body declares:-```wgsl-fn transition(uv: vec2<f32>, progress: f32) -> vec4<f32> {- // from_at(uv) = outgoing clip pixel- // to_at(uv) = incoming clip pixel- // progress = 0.0 (start of transition) → 1.0 (end)-}-```--**Handle constraint** (not a bug): a dissolve needs real unused source footage ("handle") before/after a clip's trim point. `Studio::apply_transition()` computes available handle and clamps or refuses. `resolve_transitions()` previously had a double-clamp bug that made it impossible to add transitions to untrimmed clips — this was fixed (see §6.3).--### 4.4 UI Callback Wiring--Every UI event flows:-```-Slint UI callback → lib.rs on_* handler → studio.rs method → apply(Command) → state mutation → notify()-```--- `src/crates/concat/src/lib.rs` — **All** UI→Rust wiring lives here. ~1 400 lines of `editor.on_*` registrations.-- `src/crates/concat/src/studio.rs` — The editor state machine. Nearly everything goes through `self.apply(Command::...)`.--### 4.5 Effects vs Filters vs Audition (IMPORTANT)--This distinction caused a critical bug and is non-obvious:--| | Applied where | Single-click behaviour | Double-click / `+` |-|---|---|---|---|-| **Effect** (tab 3) | Selected clip's `video_effects` chain | ✅ Applies directly | N/A (same) |-| **Filter** (tab 4) | Overlay layer placed at playhead | Auditions on monitor (overlay preview only) | Places as layer |-| **Transition** (tab 2) | Cut between two adjacent clips | ✅ Applies directly | N/A (same) |-| **Audio** (tab 3, audio mode) | Selected clip's `filters` chain | ✅ Applies directly | N/A (same) |--**The `audition` system** (`self.audition: Option<String>` in `studio.rs`, `audition_catalogue()`) renders an effect/filter overlay on the monitor **without touching the project**. It was designed for **Filters only**. If you wire `auditions: true` + `auditioned(id) => { root.audition-filter(id); }` to the Effects or Transitions shelf, single-click will flash the effect across the entire monitor frame (looks like "applied to the imported file"). **Do not do this.** The Filters shelf correctly uses `auditions: true`; Effects and Transitions shelves must use `auditions: false`.--### 4.6 Category Pill Bar--The Effects shelf has a horizontal pill category bar:--`All | Featured | Retro & Film | Optical & Lens | Distortion & Glitch | Party & Club | Light & Shadow`--- `matches_category(id, cat)` in `catalogue.rs` maps package IDs to categories-- `Library::category_changed()` (Slint global) + `Studio::library_category()` drive the filter-- When `category == "All"`, `view.group` is set to `-1` to bypass the group filter--### 4.7 The `{...}` Template Language in FFmpeg Chains--`expr.rs` implements a small expression language for FFmpeg filtergraph strings. Supported: `if / clamp / min / max / abs / floor / ceil / round / sqrt / pow / fixed`, arithmetic, comparisons. **No trig (`sin/cos/atan2`).** For per-pixel math (ripple, warps), use FFmpeg's own `geq` filter's expression language instead — it has `sin/hypot/T/X/Y/W/H/r/g/b`.--> ⚠️ Always spot-check a `geq` chain against a real `ffmpeg` binary before trusting it:-> ```bash-> ffmpeg -f lavfi -i testsrc=size=64x64:rate=1:duration=1 -vf "<chain>" -frames:v 1 -f null --> ```-------## 5. The Effects Library (165 Packages)--### 5.1 Transitions (19 packages)--| Package ID | Name |-|---|---|-| `concat.blur-dissolve` | Blur Dissolve |-| `concat.film-burn` | Film Burn |-| `concat.zoom-transition` | Zoom |-| `concat.slide` | Slide (L/R/U/D enum) |-| `concat.push` | Push (L/R/U/D enum) |-| `concat.spin` | Spin |-| `concat.swirl` | Swirl |-| `concat.glitch-transition` | Glitch |-| `concat.rgb-split-wipe` | RGB Split Wipe |-| `concat.linear-wipe` | Linear Wipe (L/R/U/D enum) |-| `concat.iris` | Iris |-| `concat.shape-wipe` | Shape Wipe (Circle/Heart/Star enum) |-| `concat.light-leak-transition` | Light Leak |-| `concat.cube` | Cube |-| `concat.clock-wipe` | Clock Wipe |-| `concat.whip-pan` | Whip Pan |-| `concat.zoom-blur-transition` | Zoom Blur |-| `concat.light-leak-flash` | Light Leak Flash |-| `concat.glitch-warp` | Glitch Warp |--### 5.2 Video Effects — Modern Pack (19 packages added in recent session)--**Featured**: `concat.camera-shake`, `concat.rgb-glitch`, `concat.sparkle`, `concat.light-leak`, `concat.tilt-shift`, `concat.strobe-flash`--**Cinematic & Film**: `concat.crt-scanlines`, `concat.film-reel`, `concat.camcorder-90s`, `concat.halation`--**Distortion & Optical**: `concat.wave-warp`, `concat.vortex-swirl`, `concat.prism-dispersion`, `concat.fisheye`, `concat.mirror-tile`--**Party & Club**: `concat.bass-shockwave`, `concat.laser-beams`, `concat.neon-glow`, `concat.color-cycle`--### 5.3 Fixtures Convention--Every package with an `[ffmpeg]` chain must have a `fixtures.toml` with:-- `[[case]] at = "default"` — always required-- `[[case]] at = "min"` and `[[case]] at = "max"` — required if the package has any `[[param]]`--Enforced by the test `every_ffmpeg_package_pins_its_default_and_every_slider_bound` in `concat-effects/src/lib.rs`.--**Fastest way to generate fixtures**: write a temporary `#[test]` that loads via `Catalogue::builtin()` and prints `package.ffmpeg_fragment(¶ms, index)` with `--nocapture`, paste into `fixtures.toml`, then delete the test.-------## 6. Recent Work (This Session — All Uncommitted)--### 6.1 Transition Engine Fix (`concat-export/src/lib.rs`)-- Removed a double-clamp bug in `resolve_transitions()` that prevented transitions on untrimmed clips-- Source start is now clamped to `.max(0.0)` only (was also clamping against `b.source_start / b.speed`)-- Added tests: `a_cross_fade_on_untrimmed_clip_succeeds`, `a_packaged_transition_on_untrimmed_clip_succeeds`--### 6.2 Transition Seam UI Redesign (`lanes.slint`)-- Symmetric cut placement (seam spans `-half-w` to `+half-w`)-- 18×18px rounded square seam button `[ ⧗ ]` centered at the cut-- Left/right draggable slider handles (3px wide, 14px hit target, `ew-resize` cursor)-- Floating duration tooltip pill-- Fixed `if` conditional blocks to `visible` properties for proper TouchArea access--### 6.3 Live Animated Previews (`clip-inspector.slint`)-- Added `id` field to `AnimCardData`-- Live procedural hover animations per type (Zoom In/Out, Slide Up/Down/Left/Right, Spin, Pulse, Fade, Bounce, Shake, Wobble, Sway, etc.)--### 6.4 Card Hover Animations + Category Pills (`media-pane.slint`)-- `sweep` animation (wipe overlay) on transition cards on hover-- `shimmer` gradient overlay on effect cards on hover-- `CategoryPillBar` component added for the effects shelf-- Preview artwork mapped for all new packages via `art-of(id)`--### 6.5 Effects/Transitions Click Bug Fix (`media-pane.slint`)-- **Bug**: `auditions: true` was set on the Effects and Transitions shelves, causing single-click to invoke `audition_catalogue()` — which renders an effect overlay across the entire monitor frame. This looked like "the effect applied to the imported file itself."-- **Fix**: Set `auditions: false` on both the Effects shelf (tab 3) and Transitions shelf (tab 2). Single-click now applies directly to the selected clip/cut. Only the Filters shelf (tab 4) retains `auditions: true` (correct for color grade preview).-------## 7. Known Open Issues / Next Steps--### 🔴 Critical / High Priority--None open. The three that were here are resolved:--| # | Was | Now |-|---|---|---|-| 1 | Transition seam drag handles did not write back to the project | Wired: a press on a handle or the seam button is `clip-pressed` with edge `2`, which starts `Gesture::TransitionResize`; the drag updates the echo through `Studio::transition_duration()`'s clamp, and the release commits `Command::UpdateClip` via `set_clip_transition_duration()` |-| 2 | No live preview for transitions on the monitor | With a GPU the monitor already combined through the shader (`Monitor::texture_of` → `PreviewSources::composite` on the device). Without one it showed a dissolve; it now draws the manifest's `xfade` shape on the CPU |-| 3 | Export had no `xfade` path; packaged transitions exported as a dissolve without a GPU | Picture is composited frame by frame, never through an FFmpeg filtergraph, so an `xfade` filter was never the right shape of fix. `CpuCompositor::combine()` now draws the named shape (`concat-render/src/transitions.rs`), and a GPU-less export shows the cut the GPU shows, minus the shader's flourish |--### 🟡 Medium Priority--| # | Issue | Location |-|---|---|---|-| 4 | **Transition seam tooltip shows raw seconds** — should format as `"0.5s"` not `"0.5"` | `lanes.slint` tooltip text |-| 5 | **Category pill bar doesn't scroll on very narrow media panel** — content clips instead of scrolling | `media-pane.slint` `CategoryPillBar` |-| 6 | **`concat.twirl` and `concat.kaleidoscope` FFmpeg paths are simplified** — the GPU shaders are accurate but the FFmpeg fallback is a mirror approximation (documented in previous `HANDOFF.md`) | `packages/concat.twirl/`, `concat.kaleidoscope/` |-| 7 | **Audio effects batch** — 5 planned audio packages (Vinyl, Underwater, Megaphone, Stadium, Whisper) exist as stubs or are missing `fixtures.toml` | `packages/concat.vinyl/` etc. |--### 🟢 Nice-to-Have / Roadmap--| # | Feature | Notes |-|---|---|---|-| 8 | **Keyframe Graph Editor** — Fine-grained curve editing for animation params | `concat-project/src/animation.rs` + new UI |-| 9 | **Generators** (`Kind::Generator`) — Gradients, noise, solid backgrounds | Reserved in `manifest.rs`, no packages yet |-| 10 | **Effect Mixer / Transition Mixer** — Combine nodes into custom effects | Major new system; `concat-render` + new UI |-| 11 | **Concat Hub / Registry** — Community package registry | Infrastructure + distribution |-| 12 | **Object & Face Tracking** — Attach effects/text to tracked targets | `concat-vision` |-------## 8. Verification Commands (Run After Any Change)--```bash-cd src--# All tests including GPU shader pipeline-cargo test -p concat-effects -p concat-export -p concat-render -p concat-project --features gpu--# Full app type-check (catches Slint UI macro errors too)-cargo check -p concat--# Lint-cargo clippy -p concat -p concat-export -p concat-effects -p concat-render -p concat-project \- --features concat-render/gpu -- -D warnings--# Run the app-cargo run -p concat-# or faster:-cargo run --profile quick -p concat-```--Test count as of this handoff: **128 passing** (`concat-effects`, `concat-export`, `concat-project`). The GPU render tests (`concat-render --features gpu`) add more on top of that.-------## 9. Git State--Everything described in §6 is **uncommitted**, sitting as working tree changes on `main`. Nothing has been pushed.--```bash-git status # See all modified and untracked files-git diff # See all line-level changes-```--Suggested commit strategy:-1. **Engine fix** (`concat-export` transition clamp + tests) — atomic commit-2. **UI redesign** (seam handles + animations) — atomic commit-3. **Effects library expansion** (19 effects + 4 transitions + category pills) — could be one or split by category-4. **Click bug fix** (`auditions: false` on effects/transitions shelf) — atomic commit, clearly described-------## 10. Critical Gotchas Summary--1. **Cargo workspace is `src/`, not repo root** — `cd src` before every `cargo` command-2. **`auditions: true` on effects/transitions shelves = global monitor overlay bug** — only Filters should use auditions-3. **Transitions have no FFmpeg filter path** — a `Kind::Transition` package is a WGSL body; `manifest.rs` validation enforces this. Without a GPU the CPU compositor draws the manifest's `xfade` shape in place of the shader (`concat-render/src/transitions.rs`); a name that file does not know, or no name, is the dissolve fallback-4. **Fixture strings are exact text diffs** — even a space change in an FFmpeg chain breaks the test; regenerate with `--nocapture`-5. **Don't use trig in `{...}` template expressions** — use FFmpeg's `geq` and always test the chain against a real `ffmpeg` binary-6. **`concat.light-leak` (effect) ≠ `concat.light-leak-transition` (transition)** — catalogue ID namespace is flat; duplicates are rejected at build time-7. **GPU regression tests are the only thing catching bind-group-layout bugs** — run `--features gpu` after any shader change-8. **Handle constraint in transitions is intentional** — you can't add a 1s transition to a clip that has 0 handles; the UX should guide the user, not silently clamp to 0diff --git a/README.md b/README.mdindex e8da0c74..29afb3ea 100644--- a/README.md+++ b/README.md@@ -89,7 +89,7 @@ Optional models download from the settings panel on first use and then never nee> [!IMPORTANT]> The best way to contribute is to grab a build from the [Releases](https://github.com/jub0t/Concat/releases) page and use it: find where it breaks, and say where it could be better.>-> Ready to write code? [CONTRIBUTING.md](./CONTRIBUTING.md) covers setup, the layout of the tree, the checks to run, and how contributions are licensed. Want to write an effect, a filter or a transition instead? [EFFECTS.md](./EFFECTS.md) is the whole of it: a folder, a manifest, and a chain or a shader, loaded from your effects folder while the app runs. Driving Concat from a script, a service or an agent? [docs/](./docs/README.md) is the developer reference for the Concat API and its transports: JSON-RPC, gRPC and MCP. [ROADMAP.MD](./ROADMAP.MD) says where the project is going, and [this Discussion](https://github.com/jub0t/Concat/discussions/3) is where it was announced.+> Ready to write code? [CONTRIBUTING.md](./CONTRIBUTING.md) covers setup, the layout of the tree, the checks to run, and how contributions are licensed. Driving Concat from a script, a service or an agent? [docs/](./docs/README.md) is the developer reference for the Concat API and its transports: JSON-RPC, gRPC and MCP. [This Discussion](https://github.com/jub0t/Concat/discussions/3) is where the project was announced.>> Contributors are free to claim a `@Contributor` role in the Discord server, just ask for it.diff --git a/ROADMAP.MD b/ROADMAP.MDdeleted file mode 100644index 234d0dca..00000000--- a/ROADMAP.MD+++ /dev/null@@ -1,91 +0,0 @@-# Roadmap--> Concat is still in early development. This roadmap represents the direction of the project rather than guaranteed features or release dates.->-> 🌟 = high priority / especially wanted--### 🧱 Editor & Core Architecture--* [x] 🌟 **Concat API** — A stable API shared by the Concat UI, plugins, scripts, automation, and MCP integrations.-* [ ] 🌟 **Extensible Effects Runtime** — A scalable, data-driven system capable of supporting hundreds of effects, filters, transitions, and generators, including custom WGSL shaders.-* [ ] **Hardware Analysis** — Detect device capabilities and performance tier so Concat can automatically choose appropriate playback, rendering, proxy, and processing settings.-* [ ] **Customizable Workspace** — Allow panels to be moved, resized, docked, and rearranged similar to Blender and other professional creative tools.--### 🎨 Effects, Transitions & Mixers--* [ ] 🌟 **Effect Mixer** — Create custom effects by combining reusable processing nodes, with support for custom WGSL shader nodes.-* [ ] 🌟 **Transition Mixer** — Build and share custom transitions from reusable nodes or custom shaders.-* [ ] 🌟 **Voice Mixer** — Create custom voice effects by combining audio processing stages such as pitch shift, formant shift, EQ, compression, reverb, delay, chorus, distortion, noise gate, limiter, stereo width, filters, de-essing, excitation, and more.-* [ ] **Generators** — Procedural visual sources such as gradients, noise, shapes, animated backgrounds, particles, grids, audio visualizers, and other generated media.-* [ ] **Reusable Creative Assets** — Expand support for color presets, caption styles, title animations, motion presets, effect presets, and other reusable creative components.--### 📦 Templates & Community Ecosystem--* [ ] 🌟 **Concat Hub / Registry** — A centralized community registry for installing and sharing templates, effects, transitions, caption styles, presets, generators, Mixer creations, and other extensions — somewhat like npm for creative assets.-* [ ] **Improved Templates** — Expand the template system and make templates easier to create, customize, package, and share.-* [ ] **Stock Media Library** — Integrate accessible stock video, images, music, and sound effects.--### 🎬 Timeline & Animation--* [ ] 🌟 **Keyframe Graph Editor** — Fine-grained control over animation curves, easing, interpolation, and effect parameters.-* [ ] **Speed Curves / Time Remapping** — Custom speed ramps, reusable velocity presets, and improved slow/fast-motion workflows.-* [ ] **Adjustment Layers** — Apply effects, filters, and color adjustments across multiple clips.-* [ ] **Scene Detection** — Detect cuts in imported footage and optionally split clips automatically.-* [ ] **Beat Detection & Beat Markers** — Analyze music and create timeline markers for rhythm-based editing.-* [ ] **Auto Cut / Beat Sync** — Automatically create edits synchronized to music and detected beats.--### 📝 Captions & Transcript Editing--* [ ] 🌟 **Advanced Caption Styling** — Reusable caption styles, animations, per-word effects, and other creator-focused caption tools.-* [ ] **Word Highlighting** — Use word-level transcription timestamps to highlight spoken words dynamically.-* [ ] **Transcript-Based Editing** — Edit spoken content through its transcript, with timeline edits automatically following text changes.-* [ ] **Filler-Word Removal** — Detect and remove filler words such as “um”, “uh”, and similar speech disfluencies.-* [ ] **Profanity Detection** — Detect profanity from transcribed audio and provide options to censor, mute, or modify affected sections.--### 🎙️ Audio--* [ ] 🌟 **Noise Removal / Voice Cleanup** — Local audio denoising and speech enhancement.-* [ ] **Silence Detection & Removal** — Automatically detect silent regions and optionally remove them from the timeline.-* [ ] **Audio Normalization** — Quickly normalize dialogue and other audio to useful loudness targets.-* [ ] **Beat Analysis** — Reusable audio analysis infrastructure for beat detection, synchronization, and music-driven effects.--### 👁️ Tracking, Masks & Computer Vision--* [ ] 🌟 **Object & Face Tracking** — Track people, faces, and selected objects through footage and attach effects, text, masks, or other elements to tracked targets.-* [ ] 🌟 **Masks & Tracked Masks** — Rectangle, ellipse, polygon/Bézier, feathering, expansion, inversion, keyframing, and tracking.-* [ ] **Automatic Face Detection & Blurring** — Detect and optionally track faces for automatic privacy blurring.-* [ ] **Background Removal** — Local subject segmentation and background removal without requiring a green screen.-* [ ] **Auto Reframe** — Automatically reframe footage for different aspect ratios while keeping important subjects in view.-* [ ] **Chroma Key** — Green/blue-screen removal with adjustable tolerance, spill suppression, feathering, and masking.--### 🔎 Media Intelligence & Automation--* [ ] **Smart Media Search** — Search local project media using speech, filenames, metadata, and eventually visual content.-* [ ] **Long Video → Clips** — Help identify and extract useful short-form segments from longer recordings.-* [ ] **Local Media Analysis** — Build reusable background analysis for transcripts, scenes, faces, audio, and other metadata that multiple Concat features can share.-* [ ] 🌟 **Enhance** — Upscale, denoise and deblur footage and stills with local restoration models (Real-ESRGAN, SCUNet, NAFNet) run through the ONNX runtime on the platform's accelerator, written once as an enhanced copy the timeline reads; no filter-chain shortcuts.--### 🔌 Plugins & Extensibility--* [ ] 🌟 **Plugin System** — Allow developers to extend Concat through the Concat API without modifying the core application.-* [ ] **Custom Mixer Nodes** — Let developers create reusable nodes for Mixers, including GPU shader nodes and sandboxed processing nodes.-* [ ] **Extension Permissions & Sandboxing** — Provide a safe capability/permission model for third-party extensions.-* [ ] **Extension Versioning & Dependencies** — Stable API versions, dependency resolution, compatibility checks, and updates for community extensions.-------### Longer-Term Ideas--These are areas worth exploring after the core editing experience is mature:--* [ ] Optical-flow frame interpolation-* [ ] OS-native super resolution and frame interpolation as a fast path for Enhance: VideoToolbox's `VTFrameProcessor` on macOS 26 / iOS 26, and the Windows App SDK video super-resolution API on Copilot+ PCs-* [ ] Video stabilization-* [ ] Video denoising and restoration-* [ ] Local video upscaling-* [ ] Motion Mixer / reusable animation graphs-* [ ] Caption Mixer-* [ ] Advanced color grading and LUT workflows-* [ ] Local semantic video search-* [ ] Community-created automation tools-* [ ] Plugin SDK and developer toolingdiff --git a/audits/AUDIT-2026-09-16.MD b/audits/AUDIT-2026-09-16.MDdeleted file mode 100644index 8e80e998..00000000--- a/audits/AUDIT-2026-09-16.MD+++ /dev/null@@ -1,129 +0,0 @@-# Concat `src/` audit — 16 September 2026--Scope: the Cargo workspace under `src/` (14 crates, ~34k lines of Rust, ~14k lines of Slint), the GitHub issue tracker (112 issues, 28 open), CI history, and the ecosystem around the stack. Method: full read of the workspace manifests, the API/server crates, the project-folder and session code, the model table, CI workflows, and a complete line-by-line read of `concat-core` and `concat-project`; metrics over the whole tree (`grep`, `cargo clippy`, `cargo test`); issue and PR triage. Equivalent deep reads of `concat-media`, `concat-export`, `concat-host`, `concat-render`, `concat-effects` and the window were started but cut off by a usage limit, so those crates are covered by targeted checks and the tracker rather than an exhaustive sweep.--**Status after the fix pass (same day):** bugs 1, 3, 10, 12, 13, 14, 15, 17, 18 and the merge/numbering items of 20 are fixed in the working tree (see `git diff`); bug 4 needs the model mirror workflow run; bugs 2, 5-9 need reproduction on the reporters' platforms; bugs 11, 16 (a deliberate design choice, not a bug) and 19 are addressed by `ARCHITECTURE-PROPOSAL.md`.--## 1. Where the project stands--**Health at a glance**--| Signal | Value |-|---|---|-| Version / age | 0.2.2, repository created 25 Aug 2026 (3 weeks old, 435 commits) |-| Community | 2 490 stars, 216 forks, ~11 contributors, one author writes ~90% |-| Clippy (`--workspace --all-targets`) | 0 warnings |-| Tests | 345 `#[test]` functions across 14 crates; engine crates pass locally |-| CI on `main` | **red** since the Remote page landed (see Bug 1) |-| `unsafe` blocks | 22, concentrated in `concat-android` (9), `concat-media` (8), `concat-speech` (3) |-| `unwrap/expect` outside tests | ~500; 154 in `concat-project/src/lib.rs` alone |-| Dependencies | 835 crates in the lock file, 67 duplicated at two versions |-| Largest files | `concat/src/studio.rs` 8 043 lines; `concat-export/src/lib.rs` 2 474; `commands.rs` 2 148 |--**Architecture is genuinely good for a three-week-old project.** The crate split is disciplined and the dependency arrows point one way: a std-only `concat-core`, one crate that knows FFmpeg exists (`concat-media`), the edit model with commands and undo (`concat-project`), a render plan with CPU and wgpu compositors (`concat-render`), export, a host layer, and a single API dispatcher (`concat-api`) that the CLI, the JSON-RPC/gRPC server and the window all drive. Effects are data (TOML manifest + WGSL + an FFmpeg chain string) rather than code, and 87 packages ship that way. Every model download is mirrored under the project's own release tag. That is a stronger foundation than most editors at this stage.--**The project has already pivoted once.** Git history shows a Tauri/React front end (`desktop/`) replaced by Slint, and the `engine/` tree renamed to `src/`. That churn explains several stale artefacts below.--**The weight is in the wrong place.** `studio.rs` (8k lines) is the window's controller, model, view-model and event bus at once; it is the most-changed file in the repository (76 commits). The engine crates are small, tested and clean; the window is where the open bugs live.--## 2. Bugs found--Ranked by impact. "Verified" means reproduced from source or a local run; "reported" means from the tracker with a plausible cause identified.--1. **CI on `main` is red (verified).** `concat`'s locale test fails: 20 English strings added by the Remote settings page and the Hologram effect have no translation in any of the 12 locales. `scripts/locales.py` was not run before commit `26bf590` and `86d4a5c`. Nightly builds are therefore skipped (the last five Nightly runs show `skipped`). Fix: run `python3 scripts/locales.py`, fill the locales, and add a pre-commit/CI step that fails on an out-of-date `en.json` *before* the long test job.--2. **Window freezes after clicking the "Concat" logo (reported, #99, duplicate #111).** Two independent Linux reporters; the app stops receiving pointer events. Symptom pattern is a modal/overlay left visible with `pointer-events` capturing, or the start screen swapped in while the editor's popup layer is still armed. Highest-priority UX bug: every user will click the logo.--3. **Project save is not crash-safe (verified, `concat-host/src/projects.rs:171-190`).** `save` writes `concat.json.saving` and renames it over the manifest, but never calls `sync_all` on the temp file before the rename. On ext4/APFS a power loss after rename can leave a zero-length manifest, and the code's own comment says a truncated manifest "loses the project". Issue #6 (data loss on malformed manifest) shows this class matters to users. One `file.sync_all()` fixes it.--4. **11 of 12 downloadable models have no digest (verified, `models/manifest.toml`).** Only `cutout-person` carries a sha256; every whisper, Kokoro and the object/brush cutout model is accepted unverified, which `SECURITY.md` explicitly lists as a threat it cares about. The Mirror models workflow computes digests but the results were never committed.--5. **60 fps export freezes partway (reported, #112).** A ~50 s timeline at 60 fps produces a file that freezes at 42 s; the same edit at 30 fps is fine. This landed after the mux/interleaver rewrite (`c88aebd`, `d591ddf`). Likely a DTS/PTS unit mismatch between the 60 fps video time base and the audio packet cadence in the interleaver's "whichever packet is due next" logic. The new e2e export suite (`concat-host/tests/export.rs`) runs only at the project default rate; add a 60 fps case.--6. **Audio export "End of file" on some sources (reported, #108, #59).** Partially addressed by PR #68 and the sample-count trim rewrite, but #108 is still open with a Peek screen capture (60 fps H.264 + AAC). Same family as bug 5; both point at `concat-media/src/audio.rs`, which has been rewritten 11 times in three weeks. It needs fixture-based tests against real oddities (edit lists, negative start PTS, VFR) rather than more patches.--7. **Double title bar on GNOME Wayland (reported, #97).** The window draws its own client-side decoration and never asks winit for `with_decorations(false)` on Wayland, or the request is made after the surface exists. Cosmetic but on every Ubuntu screen.--8. **Android/iPad layout collides with system bars and import does nothing (reported, #92).** Commit `15577c1` claims to keep out of the bars but a Redmi Pad and an iPad 9 both still show the overlap; the document picker is a JNI bridge (`concat-android/src/lib.rs`, 9 `unsafe` blocks) with no test coverage and no iOS equivalent.--9. **Loopback API trusts every local process (verified, `concat-server/src/lib.rs:60-84`).** A token is required only off loopback. With the Remote switch on, any process on the machine can read and write any file the user can, through `project.*`, `media.import`, `export.run` and `frame` with an arbitrary output path. That is the same trust model as most local dev servers, but it deserves a default token even on loopback (the window already knows how to mint one). Token comparison is also not constant-time.--10. **Documentation rot (verified).** `CONTRIBUTING.md` and `src/README.md` both tell contributors to read `ARCHITECTURE.md` first; it was deleted in `99f2293`. The `.cargo/config.toml` describes an optional `ffi` feature and a subprocess FFmpeg mode that no longer exist. The README's comparison table says "H.264 MP4 only" while the encoder supports HEVC and AV1.--### 2b. Edit-model bugs (`concat-project`, `concat-core`)--From a full read of both crates. Spot-checked in source where marked (v).--11. **Splitting or trimming a clip re-times every keyframe (v, `commands.rs:1226`, `:1276-1285`, `:1447`).** Keys, effect keys, speed-curve points and animation presets are stored as *fractions of clip length*. A split clones the whole animation into both halves, compressed into each half's span; a trim slides every key in absolute time; a merge stretches the head's keys over the new length. Scenario: a 10 s clip with an opacity fade over the first 5 s, split at 4 s, now fades over 2 s on the head and again over 3 s on the tail. This is the root of most animation oddities users will report and is a model change to fix (keys in clip-local seconds).--12. **Deleting a detached audio clip leaves the video permanently silent (v, `commands.rs:1894`).** `DetachAudio` sets the video's `muted = Some(true)`; only `ReattachAudio` clears it, and that is a no-op once the sound clip is gone. `ClipPatch` has no `muted` field, so nothing in the command surface can unmute. One-line fix: add `muted` to the patch.--13. **Splitting or freezing a reversed clip silently un-reverses it (v, `commands.rs:1261-1269`, `:1370-1374`).** The comment says the map "is not affine", but reverse *is* affine (`core/timeline.rs:303-312`); only speed curves need the mean fallback. Both halves play forward with no error. Commit `1ac2760` pinned this behaviour in a test, so it is design-endorsed data loss.--14. **Head trim on a reversed clip slides the picture (`commands.rs:1236`).** `source_start` advances by `moved × speed` regardless of `reverse`; for a reversed clip the head shows the far end of the source, so the correct edit leaves `source_start` alone.--15. **NaN is accepted by most numeric commands (v).** Only `SetClipKey` and `SetEffectKey` check finiteness (`commands.rs:1629`, `:1696`). `SetClipSpeed { speed: NaN }` stores a NaN speed and NaN duration; `SplitClips { time: NaN }` produces NaN durations on both halves. JSON cannot carry NaN, but `Command` is a public Rust API and the JSON-RPC layer accepts `1e999`-style overflow as infinity.--16. **Track names are dropped on load (`doc.rs:100-115`).** Legacy documents carry `"name"` on tracks; the `Track` struct no longer has the field, so reopening and saving an older project discards the names permanently.--17. **Reader and command clamps disagree (`doc.rs:247-273` vs `commands.rs:28`, `:1785`).** Minimum duration is 0.01 s on load but 1/60 s in commands; scale has no upper cap on load; offsets and rotation are not wrapped; speed-curve point speeds are unclamped. A hand-edited file can hold values no command could produce, while a comment in `lib.rs:1776` claims the opposite.--18. **Document version is written and never read (v, `doc.rs:33`, `:442`).** No migration table, no forward-compat passthrough of unknown fields on write. The "document this build cannot read" failures (#4, #12) will recur at the first breaking model change.--19. **Animation presets on the same property clobber instead of compose (suspected, `animation.rs:248-277`).** "Zoom In" plus a "Pulse" combo both write a scale key at `at = 0`; `value_at` takes the first and interpolates from the second, so the zoom vanishes.--20. Lower: `MergeClips` does not check `reverse`, `speed_curve`, `kind` or `audio_stream` before merging; `FreezeFrame` ripples only its own track, so detached audio drifts by the hold length; `next_numbered` concatenates every digit in a name ("Timeline 2 v10" → "Timeline 211"); core `Clip::range()` asserts on a negative duration and `Rational` arithmetic panics on i64 overflow even though `checked_new` exists.--What checked out: the rational time design, the arena, the cubic-bezier solver, speed-curve integration, id minting across loads, and the export boundary's frame-grid quantisation are all correct.--## 3. What is poorly designed--- **`studio.rs` is a God object.** 8 043 lines, 76 commits, holds every pane's state, every callback, the toast queue, the menu tokens, the server lifecycle and the preference persistence. There is no view-model layer between Slint models and engine state; state is mirrored by hand on every publish (`set_*` calls at lines 6247-7141). Every UI bug in the tracker lands here. Split by pane (media bin, timeline, inspector, monitor, settings) behind a small `Studio` façade, and put each pane's state behind a struct that owns its Slint model.-- **`unwrap` density in the model crate.** 154 unwraps in `concat-project/src/lib.rs` on a document that is user-editable JSON. Each one is a panic on a hand-edited or forward-version project file; with `panic = "abort"` in the `app` profile that is a crash, not an error dialog.-- **Two compositors, one truth.** CPU (`compositor.rs`) and wgpu (`gpu.rs`) paths must agree pixel-for-pixel; today parity is asserted by a handful of tests, and fixes like `a2fe39f` ("a branching effect chain opens on the CPU renderer") show they drift. Golden-frame tests with a perceptual threshold (SSIM/PSNR) across both paths would catch this class automatically.-- **Effects run through FFmpeg filter strings *and* WGSL.** Each package declares an `[ffmpeg] chain` template and a shader; the preview uses one, the audio path and some exports the other. The expression language in `expr.rs` is interpolated into filter strings; the crossed-bounds clamp panic fixed in PR #96 is the kind of bug that pattern breeds. Long term the roadmap's node-graph "mixers" cannot be built on string templates.-- **No frame cache or prefetch design.** Playback decodes on demand through `pool.rs`; the filmstrip regression (#52, 100% CPU on import) and the "strip caching" request (#57) are symptoms of no shared, bounded decoded-frame cache keyed by (media, time, size). Every professional editor has one.-- **Software decode only.** VideoToolbox is used for HEVC *encode*; there is no hardware *decode* on any platform, and issue #70 (VA-API hang on Intel) was "fixed" by not using VA-API. 4K H.265 phone footage will not scrub smoothly on laptops without it.-- **The timeline is drawn as one Slint element per clip** with the whole window redrawn on any dirty property (the Cargo.toml comment admits Skia partial rendering is off). PR #88 ("long clips crash the window with a wgpu texture-size error") shows lane textures are sized by clip length rather than viewport. Needs virtualisation: draw only the visible range, at viewport resolution.-- **Two edit models with the same type names.** `concat_core::timeline::{Project, Timeline, Track, Clip}` (rational time, arena ids) and `concat_project::model::{…}` (f64 seconds, string ids, a 40-field `Clip`) are unrelated types; every clip semantic is defined twice and translated in a third crate. All fields are `pub`, overlapping clips are permitted, and invariants such as "speed equals the curve's mean" are comments. Lookups are linear scans by `String` (`model.rs:1310`), `first_free_track` is tracks × clips.-- **`apply` is one 1 280-line match** (`commands.rs:866-2148`) with the 40-field `Clip` literal repeated three times; a new field is added in four places plus the reader.-- **Undo is a deep clone of the whole project per command** (`editor.rs:78`, depth 200) with no coalescing, so a drag emitting a command per mouse event produces a snapshot per event, and view state (`SelectTimeline`, `MoveTimeline`) lands in the undo history and the document.-- **Project file has no read schema version and no migration path.** The writer is derive-based and the reader is hand-walked, so the two schemas agree only by discipline; the version field is written and never read.-- **Dependency surface.** 835 crates, 67 at duplicate versions; `ort` pinned to a release candidate; three separate HTTP clients paths (ureq in host, ureq in speech, tonic/hyper behind `grpc`). Nothing runs `cargo audit` or `cargo deny` in CI.-- **Tests exist but the expensive ones are serialised** (`cargo test -j 1`, PR #110) because linking the `concat` test binary OOMs the runner. Engine tests should run in their own job so a window-crate link failure does not block them.--## 4. Test coverage--Good: `concat-core` (42 tests, time/arena/animate), `concat-media` (50, incl. real decode fixtures), `concat-project` (51), `concat-host/tests/export.rs` (every edit type exports end to end). Missing: anything for the window (`studio.rs`, 14 tests all in i18n/prefs), the Android bridge, the gRPC transport (5 tests), property tests for timeline invariants (no overlapping clips, non-negative durations), 60 fps / VFR / edit-list fixtures for the mixer, golden-frame comparisons between compositors, fuzzing of the manifest and package parsers.--## 5. Ecosystem research and what to adopt--Sources checked: crate registries and repositories for `ffmpeg-the-third`, `wgpu`, `slint`, `ort`, `whisper-rs`, `sherpa-onnx`; the Olive, Kdenlive/MLT, Shotcut, Cap, OpenCut and OpenTimelineIO projects; Flathub packaging guides. Items marked * were not re-verified today.--- **Hardware decode via FFmpeg's hwaccel API** is reachable from `ffmpeg-the-third` (it exposes `av_hwdevice_ctx_create` and `hw_frames_ctx`). VideoToolbox on macOS/iOS, D3D11VA on Windows, VAAPI on Linux behind an allow-list (the i915 hang in #70 argues for an opt-in toggle), MediaCodec on Android. Decoded frames can stay on the GPU and be imported into the shared wgpu device; on Metal this means zero-copy scrubbing.-- **Frame cache + render graph.** Olive 0.2 and Cap both key a bounded LRU by (source, timestamp, resolution) and render through a DAG so a parameter change invalidates only downstream nodes. This is also the natural substrate for the roadmap's effect/transition mixers and for keyframed effect parameters.-- **Colour management.** Issue #103 asks for full/limited range and Rec.2020; the HDR work in `9ef1b94` tags colour but does not convert it. OpenColorIO has no maintained Rust binding*; a smaller step is explicit linear-light compositing in the wgpu path with sRGB/BT.709 transfer in and out, which fixes blend and dissolve correctness at the same time.-- **Interchange.** OpenTimelineIO has a Rust crate (`opentimelineio-rs`*) and is the format DaVinci, Premiere and Kdenlive import. An OTIO export from `flatten.rs` is a weekend and opens the door to round-tripping.-- **Speech.** sherpa-onnx already ships in the binary and can run Whisper, SenseVoice, Moonshine and Parakeet models with word timestamps; consolidating captions onto it would drop whisper.cpp, its cmake build, and one of the two Metal contexts. Silero VAD (already prototyped in `test/silero_vad`) gives silence removal and a faster caption pre-pass. DeepFilterNet3 has a Rust crate (`deep_filter`) and an ONNX export for the "Noise removal" roadmap item.-- **Cutout.** RVM (GPL) is the person model; MODNet and BiRefNet* ship ONNX under permissive licences and handle objects. SAM2 small* replaces SlimSAM for the brush with better edges.-- **Untrusted WGSL.** Packages are user-installable. naga validation at load is in place; add a resource-limit check (bind groups, texture sizes, loop bounds are not statically bounded in WGSL) and run community shaders through a timeout on a throwaway device before they reach the monitor.-- **Plugins.** The roadmap wants sandboxed extensions. The WASM component model (`wasmtime` + WIT) is the only option that gives capability-based permissions for free; `extism` wraps it with a simpler ABI. Dynamic libraries via `abi_stable` give speed but no sandbox. MCP: the official `rmcp` Rust SDK sits naturally on `concat-api`'s dispatcher; PR #69 already prototypes 17 tools but re-implements the transport instead of reusing `concat-server`.-- **Distribution.** Flatpak with the `org.freedesktop.Platform.ffmpeg-full` extension solves #78 and the EGL/AppImage crashes (#30, #31); Windows code signing through SignPath's OSS programme or Azure Trusted Signing removes the SmartScreen wall; macOS is already notarised when secrets are set.-- **Testing.** Golden frames with SSIM thresholds (Kdenlive does this with MLT), `cargo fuzz` on `probe`, the TOML manifest parser and the JSON document loader, and `proptest` over `commands.rs` for timeline invariants.--## 6. Recommended order of work--1. Fix the red CI (locales) and add the locale check as a fast first job. (S)-2. `sync_all` before rename in `projects::save`; commit the 11 missing model digests. (S)-3. Reproduce and fix the logo-click freeze (#99); it is the first thing a reviewer will hit. (S-M)-3b. Three one-day fixes in `concat-project`: `muted` on `ClipPatch` (bug 12), a finiteness check at the top of `apply` (bug 15), and mirroring the affine map instead of clearing `reverse` on split/freeze/head-trim (bugs 13, 14). (S each)-4. 60 fps and VFR fixtures for the mixer/interleaver; fix #112 and #108 against them. (M)-4b. Move keyframes and speed-curve points to clip-local seconds so split/trim/merge preserve them (bug 11); add `proptest` laws: split-then-merge is identity, document round-trip is identity, `Rational` algebra. (L)-5. Split `studio.rs` by pane behind a façade; move each pane's state into a struct that owns its Slint model. (L, incremental)-6. Bounded decoded-frame cache shared by playback, filmstrip and export. (M)-7. Hardware decode behind a per-platform toggle, VideoToolbox first. (M)-8. Document schema version + migration table; replace unwraps in `concat-project` with errors. (M)-9. Golden-frame parity tests between CPU and GPU compositors; `cargo audit`/`cargo deny` in CI. (S-M)-10. OTIO export, then the WASM plugin host, then MCP on `rmcp` reusing `concat-server`. (L)--Restore `ARCHITECTURE.md` (or delete the links) and prune `.cargo/config.toml` while doing any of the above.diff --git a/audits/AUDIT-2026-09-19.md b/audits/AUDIT-2026-09-19.mddeleted file mode 100644index 2972a771..00000000--- a/audits/AUDIT-2026-09-19.md+++ /dev/null@@ -1,206 +0,0 @@-# Concat `src/` audit — 19 September 2026--Scope: the Cargo workspace under `src/` (16 crates, 58.5k lines of Rust, 20.2k-lines of Slint), the tracker (87 issues, 38 open), CI, and everything that-landed since the 16 September audit and its proposal. Method: the proposal was-worked through step by step over three days; every step landed on `main` with-its tests green; this report is what was found on the way, what the numbers-say now, and what is still wrong. It follows the shape of-`AUDIT-2026-09-16.md` so the two can be read side by side.--**Status of the proposal:** every line of `ARCHITECTURE-PROPOSAL.md` is-ticked, each with a note on what it left for later. `ARCHITECTURE.md` is back-and describes the tree as it is now.--## 1. Where the project stands--| Signal | 16 Sept | 19 Sept |-|---|---|---|-| Version / commits | 0.2.2, 435 commits | 0.2.2, 510 commits |-| Community | 2 490 stars, 216 forks | 2 867 stars, 254 forks |-| Crates / Rust lines | 14 / ~34k | 16 / 58.5k (`concat-perf` and the window's panes are new; the rest is tests and docs) |-| Slint lines | ~14k | 20.2k |-| Clippy (`--workspace --all-targets`) | 0 warnings | 0 warnings |-| Tests | 345 | 429 `#[test]` functions across 75 files, plus the export end-to-end suite, the parity suite and the performance table |-| CI on `main` | red (locales) | red until commit `796e9a9` (three test initialisers left behind by the ripple-on-drop PR); green from there |-| `unsafe` blocks | 22 | 31 (the nine new ones are the hardware decode path in `concat-media`, each with a SAFETY note) |-| `unwrap`/`expect` outside `#[test]` fns | ~500 | 725 in files that also hold tests; most are in test modules, and the count is a grep, not a judgement |-| Largest files | `studio.rs` 8 043; `export/lib.rs` 2 474; `commands.rs` 2 148 | `studio.rs` 6 360; `project/lib.rs` 2 957 (tests); `export/lib.rs` 2 046; `model.rs` 1 921; `pool.rs` 1 438 |--**The weight has moved.** Three days ago the window's controller was the-model, the view-model and the event bus at once. Ten of its concerns are now-panes behind one message loop, the engine gained a scheduler, a source-keyed-cache, proxies, hardware decode, one render description for both compositors-and a parity suite, the server mints tokens, and there is a performance table-with budgets. The gestures are what is left on the controller, and they are-the next cut.--**The engine found its own bugs.** The performance table's scrub scenario, on-its first run, showed one decode on the way back over covered ground. That was-two real defects (bugs 1 and 2 below), both older than the cache work, both-fixed the same hour. That is the argument for the table.--## 2. Bugs found and fixed this pass--Verified from source or a local run unless marked.--1. **Constant-rate files were indexed at a skewed rate (verified, fixed- `381c477`).** The probe took `avg_frame_rate` first, which on a short or- oddly-closed file is the frame count over a duration a frame short: ninety- frames over eighty-nine thirtieths is 30.34 fps. Every frame landed a third- of a frame early, boundary frames rounded up by one, and the cache had a- hole at the skipped index, so every scrub back re-decoded there. A- constant-rate stream now takes its base rate exactly when the two agree- within two percent; a variable stream keeps its average.--2. **A request past a file's last frame walked from the keyframe every time- (verified, fixed `381c477`).** A container that claims one frame more than- it holds made the pool seek and decode to the end on each request for that- index, since the answer was never remembered under it. It is now.--3. **The window did not build on `main` (verified, fixed `1147533`).** The- Persian locale arrived with the locale table still declared thirteen long.- The new file also lacked the inventory's newer keys, which the coverage- test refuses; they are filled with English until a translator gets there.--4. **The crate's tests did not build on `main` (verified, fixed `796e9a9`).**- The ripple-on-drop PR (#141) gave `AddClip` a `ripple` field and left three- test initialisers without it. CI has been red since it merged.--5. **Two title bars on Linux (reported #97, #145, fixed `ad28218`).** Slint's- winit backend re-applies the window's `no-frame` property after the window- is made, over the attribute hook the window used, so on GNOME under Wayland- the compositor's bar came back above the strip. The Slint window now says- `no-frame` wherever the strip carries its own buttons. Not run on a Wayland- desktop here; reasoned from the backend's source and the report.--6. **The loopback API trusted every local process (verified 16 Sept, fixed- `e35b2d9`).** A token is minted when none is set, on loopback too; the- comparison is constant-time; `version` reports `capabilities`.--7. **Touching an effect knob threw the clip's cached frames away (verified 16- Sept, fixed `7311d2d`).** The cache keys on the source frame now.--8. **An import of twenty files ran twenty decoders (reported #52, fixed- `ab70838`).** One scheduler with priorities and a reserved worker.--9. **Keys re-timed on split and trim (verified 16 Sept, fixed- `cbd961e`).** Re-anchored in the four commands that move a clip's window.--## 3. Bugs still open--From the tracker, with what this pass learned about each.--1. **Logo click freezes the window (#99, #111).** Still open and still the- highest-priority UX bug. The message loop now drops a result that arrives- after its project closed in one place, which removes one class of cause,- but the freeze itself has not been reproduced here. The next step is a- Linux run with `SLINT_DEBUG_PERFORMANCE` and a log of the last callback- before input stops.--2. **Windows exits silently with no compatible GPU adapter (#135).** The- window acquires a device with `Backends::DX12` only and, without one, asks- Slint for D3D by name (`platform.rs`), which refuses to start rather than- fall back. Refusing to start was chosen so a silent CPU fallback would not- hide a fault; it needs at least a message box before the exit, and an- opt-in software path.--3. **Android export has no encoder (#130).** The Android build links a- different FFmpeg; `VideoCodec::encoders` lists names the mobile build does- not carry. Needs the mobile FFmpeg script to build x264 or MediaCodec- encoding, and a test that every listed encoder exists on each target.--4. **Fade to black and white do not apply (#132).** Transitions are modelled- in the plan now (`Transition::FadeTo`, `Shading`) and the compositors draw- them, and the parity suite proves it, but the export still bakes fades into- the decoder's FFmpeg chain. Filling the plan's `transitions` from the- resolved transitions and dropping the chain is the fix, and it is the- follow-up named in the proposal's §5 tick.--5. **Android and iPad layout (#92).** Not touched. The launch screen now has a- phone shape; the editor's panes do not.--## 4. What is still poorly designed--- **The gestures.** `studio.rs` is 6 360 lines, and most of what remains is- the drag, trim, razor, stage and brush machinery over the echo. It is one- `Gesture` across the lanes and the stage, which is why it did not move with- the panes. It should become its own module with a `Gesture` state machine- and a test per gesture over a fake pointer.-- **Two shapes of the plan.** The plan can carry the crop, flips, transitions- and mask, and the tests fill them, but the export still bakes the first- three into the decoder and cuts the picture for the mask before planning.- Until that moves, the decoder's chain and the plan can disagree, which is- the drift the proposal set out to end.-- **`ExportClip` is still the wire type.** The CLI, the API and the title- rasteriser speak it. Deleting it means the API takes the project model- directly, which is a wire change.-- **Locales.** Fourteen locales, and the keys added this week are English in- thirteen of them. The coverage test keeps that honest; it does not make it- translated.-- **The Android crate has no tests** and nine `unsafe` blocks in a JNI bridge.-- **`unwrap` in the project crate's `lib.rs`** is mostly tests, but the file is- 2 957 lines of them and should split by concern the way `commands/` did.--## 5. Test coverage--429 tests in 75 files. What is held hard:--- Every edit exports, end to end, over synthetic media, and the suite crashes- on purpose rather than tolerating a bad file (`concat-host/tests/export.rs`,- four scenarios, ~35 s).-- The GPU matches the CPU reference on thirteen plans by SSIM, every one at- 0.9997 or better on this machine.-- The pool: eviction under budget, a scrub over covered ground decodes- nothing, a proxy that vanished falls back, a request past the end is- remembered.-- The scheduler: priority order, a reserved worker, a cursor that reverses.-- Hostile packages are refused at load; a table over budget too.-- Every locale covers the inventory.-- The panes' pure parts: rows are never reused, a marquee over zero columns,- the zoom's limits and a NaN factor, the frame's size at every tier.--What is not covered: anything that needs a window (the repaint, the gestures,-the freeze in #99), Android, gRPC on CI (the feature builds and tests locally),-and the hardware decode paths on Windows and Android.--## 6. Performance, this machine--`cargo run -p concat-perf --release` on a 2023 MacBook, 19 September:--| Scenario | Measured | Budget |-|---|---|---|-| plan one frame of 200 clips on 4 tracks | 0.76 µs | ≤ 200 µs |-| 200 clip additions and 200 undos | 0.59 ms | ≤ 150 ms |-| save and open a 200-clip document (116 KB) | 1.90 ms | ≤ 60 ms |-| choose the visible clips of 200 for one publish | 0.22 µs | ≤ 50 µs |-| decode 1080p H.264 in software | 1 600 fps | ≥ 120 fps |-| decode 1080p H.264 on VideoToolbox | 308 fps | ≥ 120 fps |-| scrub forward over 90 frames, cold | 0.81 ms/frame | ≤ 25 ms |-| scrub back over covered ground | 0.24 µs/frame | ≤ 200 µs |-| decodes when an effect knob is turned | 0 | ≤ 0 |-| compose 1080p, 3 layers, sepia, CPU | 55 ms | ≤ 400 ms |-| compose 1080p, 3 layers, sepia, GPU with readback | 2.5 ms | ≤ 25 ms |-| export a 4 s 720p cut, two overlapping clips | 119 fps | ≥ 30 fps |--Hardware decode is slower than software here because the software decoder-runs on every core and the test file is a trivially-coded gradient; on real-4K H.264 the order reverses. The budgets are loose on purpose: they catch a-regression of two or three times, not a slow laptop.--## 7. Recommended order of work--1. Push `main` so CI goes green, and add the `--check` run of `concat-perf- --quick` to the engine job.-2. Reproduce #99 on Linux with logging; it is the bug every user meets.-3. Fill the plan's crop, flips and transitions from the export and drop the- decoder's chain for them; this closes #132 and ends the last two-path- drift.-4. Move the gestures out of `studio.rs` into a state machine with tests.-5. A message before the exit, and a software path, for Windows without a- usable adapter (#135).-6. The Android encoder (#130), with a test that every listed encoder links- on every target.-7. Keep cached frames as textures in the GPU pool now that both compositors- read a plan.-8. Translate the week's keys.diff --git a/docs/README.md b/docs/README.mdindex be1a1730..77a6fbd2 100644--- a/docs/README.md+++ b/docs/README.md@@ -94,8 +94,7 @@ to the API reaches every transport without a change to any of them.| The edit commands | `src/crates/concat-project/src/commands/mod.rs` |Related reading: [`ARCHITECTURE.md`](../ARCHITECTURE.md) places the API in-the engine; [`EFFECTS.md`](../EFFECTS.md) is for writing the packages the-catalogue lists.+the engine.## Licensingdiff --git a/docs/transports/mcp.md b/docs/transports/mcp.mdindex 6cdab2b8..96869563 100644--- a/docs/transports/mcp.md+++ b/docs/transports/mcp.md@@ -18,7 +18,7 @@ connect an agent today.| The API an MCP server would expose | `concat-api` | ✅ Shipped. Every method in [Methods](../api/methods.md) || A socket server with a token and event fan-out | `concat-server` | ✅ Shipped. [JSON-RPC](json-rpc.md), [gRPC](grpc.md) || A prototype: the window serving MCP over Streamable HTTP with 17 tools, plus a stdio Python bridge | [PR #69](https://github.com/jub0t/Concat/pull/69) | ❌ Closed, not merged. It re-implemented the transport instead of reusing `concat-server` |-| The request | [issue #95 "MCP support"](https://github.com/jub0t/Concat/issues/95) | Closed on 2026-09-19 with a pointer to the documentation issue [#123](https://github.com/jub0t/Concat/issues/123). The [roadmap](../../ROADMAP.MD) lists MCP integrations under the Concat API |+| The request | [issue #95 "MCP support"](https://github.com/jub0t/Concat/issues/95) | Closed on 2026-09-19 with a pointer to the documentation issue [#123](https://github.com/jub0t/Concat/issues/123) |The design direction, from the September 2026 audit: build the MCP serveron the official Rust SDK (`rmcp`) over `concat-server`'s `Hub`, so it is a