davinci-resolve-mcp 4.19.3 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,51 @@
2
2
 
3
3
  Release history for the DaVinci Resolve MCP Server. The latest release is summarized in the root README; older entries live here to keep the README focused.
4
4
 
5
+ ## What's New in v5.0.1 — Three more Resolve calls reported as broken in #336 are withdrawn
6
+
7
+ A ledger correction. No tool behavior changed.
8
+
9
+ ### Fixed
10
+
11
+ - **`TimelineItem.SetPosition` and `Timeline.MoveItems` are no longer recorded as broken (#336).** The reporter re-ran them on Studio 21.2.0.6 (Windows), on a timeline whose clips sit inside its own range. Both returned True and the clip moved. The entry keeps the earlier 21.1.2.10 reading (False for 0, 100, and -50) and says that no reported input on that build was at or after the timeline's start frame, so that build's answer to one is not known.
12
+ - **`TimelineItem.AddMarker` at relative frame 0 is no longer recorded as a silent failure (#336).** On 21.2.0.6 the marker was written and read back from `TimelineItem.GetMarkers()`. The earlier run read `Timeline.GetMarkers()`. The entry records both readbacks.
13
+ - **`TimelineItem.SetLeftOffset` is no longer recorded as destructive (#336).** It moves the clip's start and changes its source range, and it returned True for a start below the timeline's `StartFrame`. The runaway extension in the first report came from a clip outside the timeline's range and did not reproduce.
14
+ - **`MediaPool.AddToPhotoAlbum` stands**, with the 21.2.0.6 reading added: `None`, and the album stays empty.
15
+
16
+ ### Documentation
17
+
18
+ - `docs/reference/api-limitations.md` is regenerated. The Blackmagic report goes from 66 to 63 bugs.
19
+
20
+ ### Not changed
21
+
22
+ - Every reading in these entries is the reporter's. Nothing was re-measured against a live Resolve for this release. Withdrawn entries stay in `lookup_api_truth`, marked `WITHDRAWN`, so the correction is findable.
23
+
24
+ ## What's New in v5.0.0 — A tool call can no longer run a command or choose the program the server spawns
25
+
26
+ **A breaking security release.** It fixes two reports made through GitHub's private vulnerability reporting: [GHSA-x2fm-g3cm-6x5w](https://github.com/samuelgursky/davinci-resolve-mcp/security/advisories/GHSA-x2fm-g3cm-6x5w), reported by Artur Chlebicki (@Artur12555), and [GHSA-h2fm-rcfg-jch9](https://github.com/samuelgursky/davinci-resolve-mcp/security/advisories/GHSA-h2fm-rcfg-jch9), reported by @3099404236. Thank you both.
27
+
28
+ ### Removed (breaking)
29
+
30
+ - **`project_manager apply_spec` no longer runs spec hooks.** A hook is a command line taken from the spec, and the spec comes from the caller (inline, or any file the caller names), so `run_hooks: true` ran caller-chosen commands as the user, e.g. `bash -c '…'`. That broke the v3.0.0 rule that this server does not execute caller-supplied code. `run_hooks: true` is now refused with `SPEC_HOOKS_NOT_RUN` before the spec is read or Resolve is touched. A successful apply lists the hooks it did not run in `hooks_not_run`, so a caller relying on an `after` hook doesn't read success as "the hook ran".
31
+ - **`offline_ref`'s `postgres.pgDumpPath` argument.** It was spawned as given, so a caller could name any executable.
32
+
33
+ ### Security
34
+
35
+ - **`apply_spec` is gated.** It was missing from the destructive registry, so safe mode and `logs/security-audit.jsonl` never saw it. It is now registered and rated MEDIUM (it creates projects, bins and timelines and changes settings, but never deletes).
36
+ - **The advanced server refuses a caller-chosen binary at its one entry point.** Tool arguments are `passthrough()`, and helpers take the binary to run as an option, so `conform qc run` forwarded a caller's `ffmpegPath` straight to `spawnSync`. Every tool call is now checked before its handler runs. A string under `ffmpeg`, `ffprobe`, `ffmpegPath`, `ffprobePath`, `pgDumpPath`, `findPath` or `python`, at any depth, returns `BINARY_OVERRIDE_REFUSED`. A source scan in the suite fails if a new option that selects a binary is missing from that list.
37
+ - **The `pg_dump` backup path no longer comes from the database name.** It used to be `/tmp/offline-ref-Sm2Timeline-backup-${database}.sql`, so `../` in the name escaped the temp folder. The name is now reduced to a safe filename, and the backup goes in a fresh private directory.
38
+ - **Option-like media paths are refused.** A path starting with `-`, passed where ffprobe or ffmpeg read their input or output positionally, was parsed as an option. With the guard removed, the test run showed `-report` making ffprobe write a log file. Those paths are now refused (`OPTION_LIKE_PATH_REFUSED`), or made absolute where the server builds the path itself.
39
+
40
+ ### Migration
41
+
42
+ - Spec hooks: apply without `run_hooks`, then run the commands yourself. A person at a terminal can still use `davinci-resolve-mcp batch apply <spec> --run-hooks`, which keeps hooks because the person chose the file and typed the flag.
43
+ - `pg_dump` not on PATH: set `RESOLVE_ADVANCED_PG_DUMP` to its absolute path in the advanced server's environment.
44
+
45
+ ### Not changed
46
+
47
+ - The Python server's own ffprobe calls (`_probe_media_file`, `_ffprobe_media_summary`, `media_analysis._ffprobe`, `mix_plan.probe_duration`) still pass a caller path positionally. They are the same leading-dash shape and are not covered here.
48
+ - Covered by unit tests and mutation checks only. No Resolve or Postgres server was involved: the `pg_dump` test uses a stand-in script.
49
+
5
50
  ## What's New in v4.19.3 — Timeline pin verifies the switch; audio-only media analyzes cleanly
6
51
 
7
52
  ### Fixed
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  English | [简体中文](README.zh-CN.md)
4
4
 
5
- [![Version](https://img.shields.io/badge/version-4.19.3-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.0.1-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#server-modes)
package/README.zh-CN.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- [![Version](https://img.shields.io/badge/version-4.19.3-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-5.0.1-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
6
6
  [![npm](https://img.shields.io/npm/v/davinci-resolve-mcp.svg?label=npm&color=CB3837)](https://www.npmjs.com/package/davinci-resolve-mcp)
7
7
  [![API Coverage](https://img.shields.io/badge/API%20Coverage-100%25-brightgreen.svg)](docs/reference/api-coverage.md)
8
8
  [![Tools](https://img.shields.io/badge/MCP%20Tools-37%20(390%20full)-blue.svg)](#服务器模式)
@@ -12,7 +12,7 @@
12
12
  [![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
13
13
  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)
14
14
 
15
- > 本翻译对应 v4.19.3 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v5.0.1 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
package/docs/SKILL.md CHANGED
@@ -937,11 +937,14 @@ Health check and declarative spec (v2.28.0+):
937
937
  - `diff_to_spec(spec_path | spec)` — preview drift between a declarative spec and
938
938
  the live project WITHOUT mutating. Returns `{actions, diff, change_count}`.
939
939
  - `plan_spec(spec_path | spec)` — the ordered action list as a dry run.
940
- - `apply_spec(spec_path | spec, dry_run?, run_hooks?, continue_on_error?)` —
940
+ - `apply_spec(spec_path | spec, dry_run?, continue_on_error?)` —
941
941
  reconcile the project toward the spec. Idempotent (re-runs are no-ops); color/
942
942
  HDR settings apply in dependency order; markers added only when absent; explicit
943
- `settings` override a named `color_preset`; before/after shell hooks run only
944
- with `run_hooks=true`. The spec is YAML or JSON:
943
+ `settings` override a named `color_preset`. A spec's before/after `hooks` are
944
+ command lines, and the server does not run them: `run_hooks=true` is refused
945
+ with `SPEC_HOOKS_NOT_RUN`, and a successful apply lists the hooks it skipped in
946
+ `hooks_not_run`. Run them yourself, or have the user run
947
+ `davinci-resolve-mcp batch apply <spec> --run-hooks` in a terminal. The spec is YAML or JSON:
945
948
  `{project, color_preset?, settings?, timelines:[{name, fps?, settings?, markers?}], hooks?}`.
946
949
  Note: `apply_spec` reconciles the **currently open or already-existing** project;
947
950
  creating a brand-new project from a spec depends on Resolve's `CreateProject`
@@ -12,7 +12,7 @@ that none exists).
12
12
 
13
13
  **Verified on:** DaVinci Resolve Studio 21.0.2
14
14
 
15
- **Totals:** 43 missing capabilities, 66 bugs / unreliable behaviors.
15
+ **Totals:** 43 missing capabilities, 63 bugs / unreliable behaviors.
16
16
 
17
17
  The authoritative source is the runtime-queryable `api_truth` ledger
18
18
  (`resolve_control api_truth "<query>"`); this document is generated from
@@ -586,38 +586,11 @@ values, or automation-hostile modal prompts.
586
586
 
587
587
  - **Object:** `MediaPool`
588
588
  - **Signature:** `(clips) -> [MediaPoolItem]`
589
- - **Behavior:** On Studio 21.1.2.10 (Windows), re-measured by the reporter, AddToPhotoAlbum returned None and the album stayed at 0 photos across three argument forms. CreatePhotoAlbumFromPhotos returned an album with 2 photos in the same session and the same project. On Studio 19.1.3.7 (2026-11-01, dir() of the open project's MediaPool), AddToPhotoAlbum, CreateEmptyPhotoAlbum, CreatePhotoAlbumFromPhotos, and GetCurrentPhotoAlbum are absent.
590
- - **Workaround / current handling:** On 21.1.2, count the album's photos before and after and treat an unchanged count as failure. On 19.1.3.7 the methods are not there; do not call them.
589
+ - **Behavior:** On Studio 21.1.2.10 (Windows), re-measured by the reporter, AddToPhotoAlbum returned None and the album stayed at 0 photos across three argument forms. CreatePhotoAlbumFromPhotos returned an album with 2 photos in the same session and the same project. On Studio 21.2.0.6 (Windows) the reporter measured the same result: None, the album at 0 photos, and CreatePhotoAlbumFromPhotos placing one photo in the same session and project. On Studio 19.1.3.7 (2026-11-01, dir() of the open project's MediaPool), AddToPhotoAlbum, CreateEmptyPhotoAlbum, CreatePhotoAlbumFromPhotos, and GetCurrentPhotoAlbum are absent.
590
+ - **Workaround / current handling:** On 21.1.2 and 21.2.0, count the album's photos before and after and treat an unchanged count as failure. On 19.1.3.7 the methods are not there; do not call them.
591
591
  - **Reference:** [issue #336](https://github.com/samuelgursky/davinci-resolve-mcp/issues/336)
592
592
  - **Tags:** silent-failure, media-pool, missing-method
593
593
 
594
- ### TimelineItem.SetPosition / Timeline.MoveItems
595
-
596
- - **Object:** `TimelineItem / Timeline`
597
- - **Signature:** `SetPosition(...) -> bool; MoveItems(...) -> bool`
598
- - **Behavior:** On Studio 21.1.2.10 (Windows), re-measured by the reporter, TimelineItem.SetPosition returned False for 0, 100, and -50, and the clip start was unchanged. Timeline.MoveItems was not callable. The first report had both methods returning False across ints, floats, a no-op start, both moveLinkedItems values, and with or without subframePrecision, while Timeline.SetCurrentTimecode succeeded in that session. This server does not call either method. Not re-measured here.
599
- - **Workaround / current handling:** Do not treat False from SetPosition as a bad argument. On 21.1.2.10 it returned False for every input tried, and MoveItems was not callable. Move the clip in the Edit page.
600
- - **Reference:** [issue #336](https://github.com/samuelgursky/davinci-resolve-mcp/issues/336)
601
- - **Tags:** unreliable-return, timeline, edit
602
-
603
- ### TimelineItem.SetLeftOffset
604
-
605
- - **Object:** `TimelineItem`
606
- - **Signature:** `(offset, ...) -> bool`
607
- - **Behavior:** On Studio 21.1.2.10 (Windows), SetLeftOffset(5.0, False, True) on a clip at frame 400 with duration 120 returned True, moved the start to about -86000, and grew the duration to about 86515. Setting the offset back to 0 left the clip at about -86000. The call extends the clip from source media. It does not nudge the edit point, and the edit does not come back. The clip was at frame 400 on a timeline whose StartFrame was 86400, so it sat outside the timeline's declared range; the reporter did not re-run it, because the first call was destructive, and the entry stands as that readback. A live gap probe on an older build recorded SetLeftOffset as absent. This server only reads GetLeftOffset. Not re-measured here.
608
- - **Workaround / current handling:** Do not call SetLeftOffset to trim a handle. There is no API undo. Any future wrapper has to say that the call extends from source media and require an explicit confirm before it runs.
609
- - **Reference:** [issue #336](https://github.com/samuelgursky/davinci-resolve-mcp/issues/336)
610
- - **Tags:** silent-failure, timeline, edit, destructive
611
-
612
- ### TimelineItem.AddMarker at relative frame 0
613
-
614
- - **Object:** `TimelineItem`
615
- - **Signature:** `(frameId, color, name, note, duration, customData) -> bool`
616
- - **Behavior:** On Studio 21.1.2.10 (Windows), re-measured by the reporter with StartFrame 86400: Timeline.AddMarker(0) and Timeline.AddMarker(200) both returned True and the marker was present. TimelineItem.AddMarker(0) on the clip sitting at that StartFrame returned True and wrote nothing (GetMarkers count unchanged, the marker name absent). Same family as issue #34. The first filing recorded Timeline.AddMarker(0) returning False; that was the wrong object. This server already reports success false when AddMarker returns false. Not re-measured here.
617
- - **Workaround / current handling:** Read the marker back with GetMarkers. True from TimelineItem.AddMarker at relative frame 0 is not evidence the marker exists. Timeline.AddMarker at relative 0 did write the marker on this build.
618
- - **Reference:** [issue #336](https://github.com/samuelgursky/davinci-resolve-mcp/issues/336)
619
- - **Tags:** silent-failure, timeline, marker
620
-
621
594
  ### hasattr() / getattr() on Resolve API objects (attribute fabrication)
622
595
 
623
596
  - **Object:** `(all Resolve scripting objects)`
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "4.19.3"
40
+ VERSION = "5.0.1"
41
41
  # Only hard floor: mcp[cli] requires Python 3.10+. There is no upper bound —
42
42
  # Resolve's scripting bridge loads into newer interpreters on recent builds
43
43
  # (Python 3.14 verified against Resolve Studio 20.3.2). Older Resolve builds
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "davinci-resolve-mcp",
3
- "version": "4.19.3",
3
+ "version": "5.0.1",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -216,6 +216,14 @@ status + install hints):
216
216
  Missing features fail with a clear, actionable message rather than crashing; the server logs a one-line
217
217
  "needs setup" summary to stderr at startup.
218
218
 
219
+ > **Choosing binaries is the operator's job, not the caller's.** A tool call cannot name the program
220
+ > the server runs: an argument such as `ffmpegPath`, `ffprobe`, `pgDumpPath`, `findPath` or `python`
221
+ > holding a string is refused before any handler runs (`BINARY_OVERRIDE_REFUSED`). Put the binary on
222
+ > PATH, or set it in the server's environment. For `offline_ref` on a Postgres library, `pg_dump` comes
223
+ > from PATH or `RESOLVE_ADVANCED_PG_DUMP` (the old `postgres.pgDumpPath` argument is gone), and each
224
+ > backup is written to a fresh private directory under the system temp folder. A media path starting
225
+ > with `-` is refused wherever ffprobe or ffmpeg would read it as an option (`OPTION_LIKE_PATH_REFUSED`).
226
+
219
227
  > **Pinning the AAF interpreter.** `aaf_probe.py` runs under `AAF_PROBE_PYTHON`, falling back to
220
228
  > `PYTHON` and then plain `python3` on PATH. `install.py` sets that pin **only inside the `mcpServers`
221
229
  > JSON entry it writes**, so a host that spawns this advanced server some other way must pin it itself —
@@ -20,6 +20,7 @@ import { spawn, spawnSync } from 'node:child_process';
20
20
  import fs from 'node:fs';
21
21
  import path from 'node:path';
22
22
  import { requireFfmpeg } from './capabilities.mjs';
23
+ import { assertNotOption } from './spawn-guard.mjs';
23
24
 
24
25
  // color_transfer values that are DISPLAY-referred (SDR + HDR display). Camera log
25
26
  // (SLog3/LogC/RedLog) is NOT in ffmpeg's enum — it shows as 'unknown' → we refuse unless asserted.
@@ -46,6 +47,7 @@ const DISPLAY_MATRICES = new Set(['bt709', 'smpte170m', 'bt470bg', 'fcc', 'smpte
46
47
 
47
48
  /** Probe a media file's video stream: colorspace tags + frame count + fps. */
48
49
  export function probeStream(source, { ffprobe = 'ffprobe' } = {}) {
50
+ assertNotOption(source, 'source'); // ffprobe reads its input positionally
49
51
  const r = spawnSync(
50
52
  ffprobe,
51
53
  [
@@ -140,7 +142,9 @@ function runFfmpegToFile(args, ffmpegPath) {
140
142
  export async function extractFrames(clips, opts = {}) {
141
143
  requireFfmpeg();
142
144
  if (!opts.outDir) throw new Error('opts.outDir required');
143
- fs.mkdirSync(opts.outDir, { recursive: true });
145
+ // Absolute, so the output file ffmpeg reads positionally can never start with '-'.
146
+ const outDir = path.resolve(opts.outDir);
147
+ fs.mkdirSync(outDir, { recursive: true });
144
148
  const ffmpeg = opts.ffmpeg || 'ffmpeg';
145
149
  const ffprobe = opts.ffprobe || 'ffprobe';
146
150
  const frames = {};
@@ -169,7 +173,7 @@ export async function extractFrames(clips, opts = {}) {
169
173
  skipped.push({ id: c.id, reason: e.message });
170
174
  continue;
171
175
  }
172
- const outPng = path.join(opts.outDir, `${c.id}.png`);
176
+ const outPng = path.join(outDir, `${c.id}.png`);
173
177
  const args = ['-v', 'error', '-i', src, '-vf', `select=eq(n\\,${frameIdx})`, '-vframes', '1', '-y', outPng];
174
178
  try {
175
179
  await runFfmpegToFile(args, ffmpeg);
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { spawnSync } from 'node:child_process';
7
7
  import { requireFfmpeg } from './capabilities.mjs';
8
+ import { assertNotOption } from './spawn-guard.mjs';
8
9
 
9
10
  /** Parse an "a/b" rational string → number (0 on divide-by-zero). */
10
11
  export function ratio(s) {
@@ -21,6 +22,7 @@ export function ratio(s) {
21
22
  */
22
23
  export function probeMedia(file, opts = {}) {
23
24
  requireFfmpeg();
25
+ assertNotOption(file, 'file'); // ffprobe reads its input positionally
24
26
  const ffprobe = opts.ffprobe || 'ffprobe';
25
27
  const r = spawnSync(ffprobe, ['-v', 'error', '-show_streams', '-show_format', '-of', 'json', file], {
26
28
  encoding: 'utf8',
@@ -25,6 +25,7 @@ for (const m of ['log', 'info', 'debug']) {
25
25
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
26
26
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
27
27
  import { z } from 'zod';
28
+ import { assertNoBinaryOverrides } from './spawn-guard.mjs';
28
29
 
29
30
  import { drpTool } from './tools/drp.mjs';
30
31
  import { drtTool } from './tools/drt.mjs';
@@ -75,6 +76,20 @@ const toError = (err) => ({
75
76
  content: [{ type: 'text', text: JSON.stringify({ error: err?.message || String(err) }, null, 2) }],
76
77
  });
77
78
 
79
+ /**
80
+ * Run one tool call: the single path every MCP request takes into a handler.
81
+ * Exported so the trust boundary is testable without a stdio transport.
82
+ */
83
+ export async function callTool(tool, { action, args }) {
84
+ try {
85
+ // The caller chooses data, never the program the server spawns.
86
+ assertNoBinaryOverrides(args || {});
87
+ return toContent(await tool.handler({ action, args: args || {} }));
88
+ } catch (err) {
89
+ return toError(err);
90
+ }
91
+ }
92
+
78
93
  export async function startServer() {
79
94
  const server = new McpServer({ name: NAME, version: VERSION }, { capabilities: { tools: {} } });
80
95
 
@@ -88,13 +103,7 @@ export async function startServer() {
88
103
  args: z.object({}).passthrough().optional().describe('Action arguments'),
89
104
  },
90
105
  },
91
- async ({ action, args }) => {
92
- try {
93
- return toContent(await tool.handler({ action, args: args || {} }));
94
- } catch (err) {
95
- return toError(err);
96
- }
97
- },
106
+ async ({ action, args }) => callTool(tool, { action, args }),
98
107
  );
99
108
  }
100
109
 
@@ -32,6 +32,7 @@ import { createRequire } from 'node:module';
32
32
 
33
33
  const require = createRequire(import.meta.url);
34
34
  import { requireBetterSqlite3 } from './capabilities.mjs';
35
+ import { binaryFromEnv } from './spawn-guard.mjs';
35
36
 
36
37
  const DISK_DB_ROOT = path.join(os.homedir(), 'Library/Application Support/Blackmagic Design/DaVinci Resolve/Resolve Disk Database/Resolve Projects');
37
38
  // Modern Studio installs keep the local library under "Resolve Project
@@ -333,8 +334,15 @@ async function pgSelectTimeline(client, { timelineId, timelineName }) {
333
334
  function pgBackup(pg) {
334
335
  if (pg && typeof pg.__backupFn === 'function') return pg.__backupFn();
335
336
  const cfg = pgConfig(pg);
336
- const out = path.join(os.tmpdir(), `offline-ref-Sm2Timeline-backup-${cfg.database}.sql`);
337
- const dump = pg.pgDumpPath || 'pg_dump';
337
+ // The database name is caller data, so it never shapes the path: it is
338
+ // reduced to a safe filename, and the file goes in a fresh private directory
339
+ // rather than a predictable name in a shared tmp (GHSA-h2fm-rcfg-jch9).
340
+ const safeName = String(cfg.database).replace(/[^A-Za-z0-9_-]/g, '_').slice(0, 64) || 'database';
341
+ const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'offline-ref-backup-'));
342
+ const out = path.join(dir, `Sm2Timeline-${safeName}.sql`);
343
+ // The operator picks pg_dump (PATH or RESOLVE_ADVANCED_PG_DUMP); a tool call
344
+ // cannot. postgres.pgDumpPath used to be accepted here and was spawned as given.
345
+ const dump = binaryFromEnv('RESOLVE_ADVANCED_PG_DUMP', 'pg_dump');
338
346
  const env = { ...process.env };
339
347
  if (cfg.password != null) env.PGPASSWORD = String(cfg.password);
340
348
  const r = require('node:child_process').spawnSync(
@@ -344,7 +352,7 @@ function pgBackup(pg) {
344
352
  );
345
353
  if (r.status !== 0) {
346
354
  throw new Error(
347
- `pg_dump backup failed (refusing to write without a backup): ${(r.stderr || r.error?.message || 'unknown').toString().slice(-300)}. Pass postgres.pgDumpPath if pg_dump isn't on PATH.`,
355
+ `pg_dump backup failed (refusing to write without a backup): ${(r.stderr || r.error?.message || 'unknown').toString().slice(-300)}. If pg_dump isn't on PATH, set RESOLVE_ADVANCED_PG_DUMP to its absolute path in the server environment.`,
348
356
  );
349
357
  }
350
358
  return out;
@@ -37,7 +37,8 @@ export function makeSamplers(opts = {}) {
37
37
  const DW = opts.decodeW || 1200;
38
38
  const DH = opts.decodeH || 720;
39
39
  const fps = opts.fps || 24;
40
- const tmp = opts.tmpDir || fs.mkdtempSync(path.join(os.tmpdir(), 'qc-sample-'));
40
+ // Absolute, so the output path ffmpeg reads positionally can never start with '-'.
41
+ const tmp = path.resolve(opts.tmpDir || fs.mkdtempSync(path.join(os.tmpdir(), 'qc-sample-')));
41
42
  const mask = metrics.buildBurnInMask(DW, DH, opts.burnInRegions);
42
43
  let n = 0;
43
44
 
@@ -0,0 +1,94 @@
1
+ /**
2
+ * spawn-guard.mjs — what a tool caller may and may not choose about a child process.
3
+ *
4
+ * A caller picks DATA: which media file to probe, which database to back up.
5
+ * A caller never picks the PROGRAM. Several helpers take the binary to run as
6
+ * an option (`ffmpegPath`, `opts.ffprobe`, `pg.pgDumpPath`, …) so tests and the
7
+ * operator can point them at a specific install, and because tool arguments
8
+ * are `passthrough()`, any handler that forwarded its arguments wholesale let a
9
+ * prompt-injected agent name an arbitrary executable (GHSA-h2fm-rcfg-jch9).
10
+ *
11
+ * Two rules, enforced here:
12
+ *
13
+ * 1. `assertNoBinaryOverrides(args)` runs at the tool dispatcher, before any
14
+ * handler, and refuses a string under any binary-selecting key at any
15
+ * depth. The operator selects binaries through PATH or the environment
16
+ * (`binaryFromEnv`). `test/spawn-guard.test.mjs` scans the source for every
17
+ * option that falls back to a bare binary name, so a new one that is not in
18
+ * BINARY_OVERRIDE_KEYS fails the suite rather than reopening the hole.
19
+ *
20
+ * 2. `assertNotOption(value)` refuses a caller path that a child would parse
21
+ * as an option. A file named `-report` handed to ffprobe positionally is an
22
+ * option, not a file. Apply it wherever a caller path lands in a positional
23
+ * slot of an argv.
24
+ */
25
+
26
+ /** Option names that select which executable a helper spawns. */
27
+ export const BINARY_OVERRIDE_KEYS = Object.freeze([
28
+ 'ffmpeg',
29
+ 'ffprobe',
30
+ 'ffmpegPath',
31
+ 'ffprobePath',
32
+ 'pgDumpPath',
33
+ 'findPath',
34
+ 'python',
35
+ ]);
36
+
37
+ const KEY_SET = new Set(BINARY_OVERRIDE_KEYS);
38
+ const MAX_DEPTH = 64;
39
+
40
+ /**
41
+ * Throw if `args` carries a caller-chosen executable anywhere in its tree.
42
+ *
43
+ * Only a STRING under one of the keys is refused: that is the shape a binary
44
+ * path takes. An object under `ffprobe` (a probe result echoed back by a
45
+ * caller) is data and passes.
46
+ */
47
+ export function assertNoBinaryOverrides(args, where = 'args') {
48
+ const visit = (value, trail, depth) => {
49
+ if (depth > MAX_DEPTH || value === null || typeof value !== 'object') return;
50
+ if (Array.isArray(value)) {
51
+ value.forEach((item, index) => visit(item, `${trail}[${index}]`, depth + 1));
52
+ return;
53
+ }
54
+ for (const [key, child] of Object.entries(value)) {
55
+ const here = `${trail}.${key}`;
56
+ if (KEY_SET.has(key) && typeof child === 'string') {
57
+ const error = new Error(
58
+ `${here}: a tool call cannot choose which program the server runs. ` +
59
+ 'Put the binary on PATH, or set it in the server environment ' +
60
+ '(RESOLVE_ADVANCED_PG_DUMP for pg_dump), then retry without this key.',
61
+ );
62
+ error.code = 'BINARY_OVERRIDE_REFUSED';
63
+ throw error;
64
+ }
65
+ visit(child, here, depth + 1);
66
+ }
67
+ };
68
+ visit(args, where, 0);
69
+ }
70
+
71
+ /**
72
+ * Throw if a caller-supplied path would be parsed as an option by the child.
73
+ * Returns the value unchanged so it can wrap an argv element inline.
74
+ */
75
+ export function assertNotOption(value, label = 'path') {
76
+ if (typeof value !== 'string' || !value.length) {
77
+ throw new Error(`${label} must be a non-empty string`);
78
+ }
79
+ if (value.startsWith('-')) {
80
+ const error = new Error(
81
+ `${label} '${value}' starts with '-', so the program would read it as an option. ` +
82
+ 'Pass it as an absolute path or prefix it with ./',
83
+ );
84
+ error.code = 'OPTION_LIKE_PATH_REFUSED';
85
+ throw error;
86
+ }
87
+ return value;
88
+ }
89
+
90
+ /** The operator's choice of binary from the environment, else the bare name (PATH). */
91
+ export function binaryFromEnv(envName, fallback) {
92
+ const chosen = process.env[envName];
93
+ return typeof chosen === 'string' && chosen.trim() ? chosen.trim() : fallback;
94
+ }
@@ -298,7 +298,10 @@ export const conformTool = {
298
298
  const { makeSamplers } = await import('../qc-sampler.mjs');
299
299
  const need = ['lineageDb', 'snapshotId', 'referenceMovie', 'seqW', 'seqH', 'hrW', 'hrH'];
300
300
  for (const k of need) if (a[k] == null) throw new Error(`conform.qc run needs ${k}`);
301
- const s = makeSamplers(a);
301
+ // Never hand the raw tool arguments to a helper that spawns: makeSamplers
302
+ // reads opts.ffmpegPath as the program to run (GHSA-h2fm-rcfg-jch9).
303
+ const { ffmpegPath: _callerFfmpeg, ...samplerOpts } = a;
304
+ const s = makeSamplers(samplerOpts);
302
305
  // basic satisfiability: a sampled-null conform = source can't deliver → handled as turnover upstream
303
306
  const satisfiability = (cut) => {
304
307
  const src = (a.mediaMap && a.mediaMap[cut.source_basename]) || cut.source_path;
@@ -49,7 +49,6 @@ const pgSchema = z
49
49
  password: z.string().optional().describe('NEVER hardcoded — pass it (Resolve default "DaVinci") or set PGPASSWORD'),
50
50
  database: z.string().optional().describe('Postgres database name (or DbName)'),
51
51
  DbName: z.string().optional().describe('Resolve DbName (alias for database)'),
52
- pgDumpPath: z.string().optional().describe('Absolute path to pg_dump if not on PATH'),
53
52
  })
54
53
  .optional()
55
54
  .describe('Supply to target a PostgreSQL studio database instead of a SQLite disk DB');
@@ -101,6 +101,10 @@ const FFPROBE_ARGS = [
101
101
 
102
102
  /** Probe one file via ffprobe. Returns the normalized record (ok:false on failure). */
103
103
  function probeMedia(path, { ffprobePath = 'ffprobe' } = {}) {
104
+ // ffprobe reads its input positionally: a path starting with '-' is an option.
105
+ if (typeof path !== 'string' || !path.length || path.startsWith('-')) {
106
+ return { path, ok: false, error: `refused: '${path}' would be read by ffprobe as an option; pass an absolute path` };
107
+ }
104
108
  const r = spawnSync(ffprobePath, [...FFPROBE_ARGS, path], { encoding: 'utf8', maxBuffer: 8 * 1024 * 1024 });
105
109
  if (r.status !== 0) return { path, ok: false, error: (r.stderr || 'ffprobe failed').slice(-200) };
106
110
  return parseFfprobe(r.stdout, path);
package/src/batch_cli.py CHANGED
@@ -329,7 +329,10 @@ def _run_spec_action(action: str, params: Dict[str, Any]):
329
329
  r = get_resolve()
330
330
  if r is None:
331
331
  return None
332
- return _spec_action(r, r.GetProjectManager(), action, params)
332
+ # The terminal CLI is the one place hooks may run: the person at the
333
+ # keyboard chose the spec file and typed --run-hooks. MCP calls never pass
334
+ # allow_hooks, so the server itself does not run them.
335
+ return _spec_action(r, r.GetProjectManager(), action, params, allow_hooks=True)
333
336
 
334
337
 
335
338
  def _emit_spec_result(result, *, json_mode: bool) -> int:
@@ -93,7 +93,7 @@ if not logging.getLogger().handlers:
93
93
  handlers=[logging.StreamHandler()],
94
94
  )
95
95
 
96
- VERSION = "4.19.3"
96
+ VERSION = "5.0.1"
97
97
  logger = logging.getLogger("davinci-resolve-mcp")
98
98
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
99
99
  logger.info(f"Detected platform: {get_platform()}")
package/src/server.py CHANGED
@@ -11,7 +11,7 @@ Usage:
11
11
  python src/server.py --full # Start the 377-tool granular server instead
12
12
  """
13
13
 
14
- VERSION = "4.19.3"
14
+ VERSION = "5.0.1"
15
15
 
16
16
  import base64
17
17
  import os
@@ -21145,8 +21145,29 @@ def _make_spec_hook_runner(timeout: float = 120.0):
21145
21145
  return _run
21146
21146
 
21147
21147
 
21148
- def _spec_action(r, pm, action: str, p: Dict[str, Any]) -> Dict[str, Any]:
21149
- """plan_spec / apply_spec / diff_to_spec — declarative project reconcile."""
21148
+ #: Why an MCP call cannot run a spec's hooks. A hook is a command line taken
21149
+ #: from the spec, and the spec arrives from the caller (inline, or a file the
21150
+ #: caller names), so running it is executing caller-supplied code: the policy
21151
+ #: this server has kept since v3.0.0 (GHSA-x2fm-g3cm-6x5w).
21152
+ _SPEC_HOOKS_REFUSAL = (
21153
+ "project_manager.apply_spec does not run spec hooks: a hook is a command "
21154
+ "line from the spec, and this server does not execute caller-supplied code. "
21155
+ "Apply the spec without run_hooks and run the hook commands yourself, or run "
21156
+ "`davinci-resolve-mcp batch apply <spec> --run-hooks` from your own terminal."
21157
+ )
21158
+
21159
+
21160
+ def _spec_action(r, pm, action: str, p: Dict[str, Any], *, allow_hooks: bool = False) -> Dict[str, Any]:
21161
+ """plan_spec / apply_spec / diff_to_spec — declarative project reconcile.
21162
+
21163
+ `allow_hooks` is True only for the terminal batch CLI, where the person at
21164
+ the keyboard typed `--run-hooks` for a spec file they chose. Every MCP call
21165
+ reaches this with the default and cannot run a hook.
21166
+ """
21167
+ if action == "apply_spec" and _coerce_bool(p.get("run_hooks"), False) and not allow_hooks:
21168
+ # Refuse before the spec is read or Resolve is touched, so a refused
21169
+ # call has no partial effect.
21170
+ return _err(_SPEC_HOOKS_REFUSAL, code="SPEC_HOOKS_NOT_RUN", category="unsupported")
21150
21171
  spec_path = p.get("spec_path") or p.get("path")
21151
21172
  try:
21152
21173
  if spec_path:
@@ -21166,7 +21187,7 @@ def _spec_action(r, pm, action: str, p: Dict[str, Any]) -> Dict[str, Any]:
21166
21187
  return _ok(project=spec.project,
21167
21188
  **_project_spec.apply_spec(spec, executor, dry_run=True))
21168
21189
  # apply_spec
21169
- run_hooks = _coerce_bool(p.get("run_hooks"), False)
21190
+ run_hooks = allow_hooks and _coerce_bool(p.get("run_hooks"), False)
21170
21191
  try:
21171
21192
  result = _project_spec.apply_spec(
21172
21193
  spec, executor,
@@ -21178,6 +21199,12 @@ def _spec_action(r, pm, action: str, p: Dict[str, Any]) -> Dict[str, Any]:
21178
21199
  except _project_spec.SpecError as exc:
21179
21200
  return _err(str(exc), code="SPEC_APPLY_FAILED",
21180
21201
  category="batch_partial", state=exc.state)
21202
+ if spec.hooks and not run_hooks:
21203
+ # Say so: a caller relying on an `after` hook must not read success as
21204
+ # "the hook ran".
21205
+ result["hooks_not_run"] = [
21206
+ {"when": h.when, "name": h.name, "command": h.command} for h in spec.hooks
21207
+ ]
21181
21208
  return _ok(**result) if result.get("success") else {"success": False, **result}
21182
21209
 
21183
21210
 
@@ -21435,10 +21462,12 @@ def project_manager(action: str, params: Optional[Dict[str, Any]] = None) -> Dic
21435
21462
  declarative spec WITHOUT mutating. Spec is YAML/JSON: {project, color_preset?, settings?,
21436
21463
  timelines:[{name,fps?,settings?,markers?}], hooks?}.
21437
21464
  plan_spec(spec_path|spec) -> {dry_run, actions, diff, change_count} — same as apply with dry_run.
21438
- apply_spec(spec_path|spec, dry_run?, run_hooks?, continue_on_error?) -> {success, applied, failures}
21465
+ apply_spec(spec_path|spec, dry_run?, continue_on_error?) -> {success, applied, failures, hooks_not_run?}
21439
21466
  Reconcile the project toward the spec (idempotent: re-runs are no-ops). Color/HDR
21440
- settings are applied in dependency order; markers only added if absent. Hooks run only
21441
- when run_hooks=true (executes shell from the spec — opt-in).
21467
+ settings are applied in dependency order; markers only added if absent. Spec hooks
21468
+ never run from an MCP call: run_hooks=true is refused (SPEC_HOOKS_NOT_RUN), and a
21469
+ spec's hooks come back in hooks_not_run. Run them yourself, or use
21470
+ `davinci-resolve-mcp batch apply <spec> --run-hooks` in a terminal.
21442
21471
  """
21443
21472
  p = _params(params)
21444
21473
  r = get_resolve()
@@ -1830,18 +1830,21 @@ API_TRUTH: List[Dict[str, Any]] = [
1830
1830
  "AddToPhotoAlbum returned None and the album stayed at 0 "
1831
1831
  "photos across three argument forms. CreatePhotoAlbumFromPhotos "
1832
1832
  "returned an album with 2 photos in the same session and the "
1833
- "same project. On Studio 19.1.3.7 "
1833
+ "same project. On Studio 21.2.0.6 (Windows) the reporter "
1834
+ "measured the same result: None, the album at 0 photos, and "
1835
+ "CreatePhotoAlbumFromPhotos placing one photo in the same "
1836
+ "session and project. On Studio 19.1.3.7 "
1834
1837
  "(2026-11-01, dir() of the open project's MediaPool), "
1835
1838
  "AddToPhotoAlbum, CreateEmptyPhotoAlbum, "
1836
1839
  "CreatePhotoAlbumFromPhotos, and GetCurrentPhotoAlbum are "
1837
1840
  "absent.",
1838
- "recommended": "On 21.1.2, count the album's photos before and after "
1839
- "and treat an unchanged count as failure. On 19.1.3.7 "
1840
- "the methods are not there; do not call them.",
1841
+ "recommended": "On 21.1.2 and 21.2.0, count the album's photos before "
1842
+ "and after and treat an unchanged count as failure. On "
1843
+ "19.1.3.7 the methods are not there; do not call them.",
1841
1844
  "tags": ["silent-failure", "media-pool", "missing-method"],
1842
1845
  "submit": "bug",
1843
1846
  "issue": 336,
1844
- "verified_on": "dir() on Studio 19.1.3.7; the None result is the reporter's re-measurement on 21.1.2.10 and was not re-measured here",
1847
+ "verified_on": "dir() on Studio 19.1.3.7; the None result is the reporter's measurement on 21.1.2.10 and 21.2.0.6 (Windows) and was not re-measured here",
1845
1848
  },
1846
1849
  {
1847
1850
  "symbol": "Timeline.ExportFrame",
@@ -1868,72 +1871,87 @@ API_TRUTH: List[Dict[str, Any]] = [
1868
1871
  "symbol": "TimelineItem.SetPosition / Timeline.MoveItems",
1869
1872
  "object": "TimelineItem / Timeline",
1870
1873
  "signature": "SetPosition(...) -> bool; MoveItems(...) -> bool",
1871
- "reality": "On Studio 21.1.2.10 (Windows), re-measured by the reporter, "
1872
- "TimelineItem.SetPosition returned False for 0, 100, and "
1873
- "-50, and the clip start was unchanged. Timeline.MoveItems "
1874
- "was not callable. The first report had both methods "
1875
- "returning False across ints, floats, a no-op start, both "
1876
- "moveLinkedItems values, and with or without "
1877
- "subframePrecision, while Timeline.SetCurrentTimecode "
1878
- "succeeded in that session. This server does not call "
1879
- "either method. Not re-measured here.",
1880
- "recommended": "Do not treat False from SetPosition as a bad argument. "
1881
- "On 21.1.2.10 it returned False for every input tried, "
1882
- "and MoveItems was not callable. Move the clip in the "
1883
- "Edit page.",
1884
- "tags": ["unreliable-return", "timeline", "edit"],
1885
- "submit": "bug",
1874
+ "reality": "WITHDRAWN. Re-measured by the reporter on Studio 21.2.0.6 "
1875
+ "(Windows) on a timeline at StartFrame 86400 and EndFrame "
1876
+ "86640, with two clips read back at 86400 and 86600: "
1877
+ "TimelineItem.SetPosition returned True and the clip moved "
1878
+ "from 86400 to 86800, and Timeline.MoveItems returned True "
1879
+ "and moved it to 87000. GetPosition() and GetStart() agreed "
1880
+ "both times. The earlier reading was on Studio 21.1.2.10: "
1881
+ "SetPosition returned False for 0, 100, and -50, and "
1882
+ "MoveItems was not callable. The first report on that build "
1883
+ "was measured on a timeline whose clips sat before "
1884
+ "StartFrame 86400, so StartFrame and EndFrame were both "
1885
+ "86400. No reported input on 21.1.2.10 was at or after "
1886
+ "frame 86400, so that build's answer to one is not known. "
1887
+ "This server does not call either method. Not re-measured "
1888
+ "here.",
1889
+ "recommended": "Pass a target at or after GetStartFrame() and read "
1890
+ "GetStart() back. False for a frame below StartFrame is "
1891
+ "not evidence the method is broken. See the recordFrame "
1892
+ "entry for the placement that built the first timeline.",
1893
+ "tags": ["timeline", "edit"],
1886
1894
  "issue": 336,
1887
- "verified_on": "Reported on DaVinci Resolve Studio 21.1.2.10 (Windows); not re-measured here",
1895
+ "verified_on": "Withdrawn on the reporter's re-measurement, Studio 21.2.0.6 (Windows); the 21.1.2.10 result was not repeated on a consistent timeline, and nothing was re-measured here",
1888
1896
  },
1889
1897
  {
1890
1898
  "symbol": "TimelineItem.SetLeftOffset",
1891
1899
  "object": "TimelineItem",
1892
1900
  "signature": "(offset, ...) -> bool",
1893
- "reality": "On Studio 21.1.2.10 (Windows), SetLeftOffset(5.0, False, "
1894
- "True) on a clip at frame 400 with duration 120 returned "
1895
- "True, moved the start to about -86000, and grew the "
1896
- "duration to about 86515. Setting the offset back to 0 "
1897
- "left the clip at about -86000. The call extends the clip "
1898
- "from source media. It does not nudge the edit point, and "
1899
- "the edit does not come back. The clip was at frame 400 on "
1900
- "a timeline whose StartFrame was 86400, so it sat outside "
1901
- "the timeline's declared range; the reporter did not re-run "
1902
- "it, because the first call was destructive, and the entry "
1903
- "stands as that readback. A live gap probe on an older "
1904
- "build recorded SetLeftOffset as absent. This server only "
1905
- "reads GetLeftOffset. Not re-measured here.",
1906
- "recommended": "Do not call SetLeftOffset to trim a handle. There is "
1907
- "no API undo. Any future wrapper has to say that the "
1908
- "call extends from source media and require an explicit "
1909
- "confirm before it runs.",
1910
- "tags": ["silent-failure", "timeline", "edit", "destructive"],
1911
- "submit": "bug",
1901
+ "reality": "SetLeftOffset moves the clip's start on the timeline and "
1902
+ "changes its source range. It is not a handle nudge that "
1903
+ "leaves the edit point in place. Measured by the reporter "
1904
+ "on Studio 21.2.0.6 (Windows), on a timeline at StartFrame "
1905
+ "86400: a clip at 86400 with source range 10-50 went to "
1906
+ "start 86395 and source start 5 on SetLeftOffset(5.0), and "
1907
+ "to start 86390 and source start 0 on SetLeftOffset(0.0). "
1908
+ "Both returned True. SetLeftOffset(-5.0) returned False. "
1909
+ "Both accepted calls left the clip's start below the "
1910
+ "timeline's StartFrame. The first report, on Studio "
1911
+ "21.1.2.10, had SetLeftOffset(5.0, False, True) moving a "
1912
+ "clip from frame 400 to about -86000 and growing it to "
1913
+ "about 86515 frames, with offset 0 not restoring it. That "
1914
+ "clip sat outside the timeline's declared range (frame 400, "
1915
+ "StartFrame 86400), and the result did not reproduce on a "
1916
+ "consistent timeline, so the call is not recorded as "
1917
+ "destructive. A live gap probe on an older build recorded "
1918
+ "SetLeftOffset as absent. This server only reads "
1919
+ "GetLeftOffset. Not re-measured here.",
1920
+ "recommended": "Expect SetLeftOffset to move the clip's start as well "
1921
+ "as its source in point, and read GetStart() and "
1922
+ "GetLeftOffset() back. Check the new start against "
1923
+ "GetStartFrame(): the call returned True for a start "
1924
+ "below it. See the recordFrame entry for what a clip "
1925
+ "outside the timeline's range does to later calls.",
1926
+ "tags": ["timeline", "edit", "trim"],
1912
1927
  "issue": 336,
1913
- "verified_on": "Reported on DaVinci Resolve Studio 21.1.2.10 (Windows); not re-measured here",
1928
+ "verified_on": "Narrowed on the reporter's re-measurement, Studio 21.2.0.6 (Windows); not re-measured here",
1914
1929
  },
1915
1930
  {
1916
1931
  "symbol": "TimelineItem.AddMarker at relative frame 0",
1917
1932
  "object": "TimelineItem",
1918
1933
  "signature": "(frameId, color, name, note, duration, customData) -> bool",
1919
- "reality": "On Studio 21.1.2.10 (Windows), re-measured by the reporter "
1920
- "with StartFrame 86400: Timeline.AddMarker(0) and "
1921
- "Timeline.AddMarker(200) both returned True and the marker "
1922
- "was present. TimelineItem.AddMarker(0) on the clip sitting "
1923
- "at that StartFrame returned True and wrote nothing "
1924
- "(GetMarkers count unchanged, the marker name absent). Same "
1925
- "family as issue #34. The first filing recorded "
1926
- "Timeline.AddMarker(0) returning False; that was the wrong "
1927
- "object. This server already reports success false when "
1928
- "AddMarker returns false. Not re-measured here.",
1929
- "recommended": "Read the marker back with GetMarkers. True from "
1930
- "TimelineItem.AddMarker at relative frame 0 is not "
1931
- "evidence the marker exists. Timeline.AddMarker at "
1932
- "relative 0 did write the marker on this build.",
1933
- "tags": ["silent-failure", "timeline", "marker"],
1934
- "submit": "bug",
1934
+ "reality": "WITHDRAWN. Re-measured by the reporter on Studio 21.2.0.6 "
1935
+ "(Windows), on a timeline at StartFrame 86400 and EndFrame "
1936
+ "86640: TimelineItem.AddMarker(0) on the clip sitting at "
1937
+ "StartFrame returned True, and TimelineItem.GetMarkers() "
1938
+ "showed the marker at key 0. A second marker at frame 5 "
1939
+ "landed as well. The earlier reading, on Studio 21.1.2.10, "
1940
+ "had the same call returning True with the marker absent; "
1941
+ "that readback was Timeline.GetMarkers(), and the 21.2.0.6 "
1942
+ "readback was TimelineItem.GetMarkers(). On 21.1.2.10 "
1943
+ "Timeline.AddMarker(0) and Timeline.AddMarker(200) both "
1944
+ "returned True and the marker was present. The first filing "
1945
+ "recorded Timeline.AddMarker(0) returning False; that was "
1946
+ "the wrong object. This server already reports success "
1947
+ "false when AddMarker returns false. Not re-measured here.",
1948
+ "recommended": "Read a clip marker back with TimelineItem.GetMarkers(), "
1949
+ "and a timeline marker with Timeline.GetMarkers(). On "
1950
+ "21.2.0.6 a clip marker at relative frame 0 was written "
1951
+ "and read back.",
1952
+ "tags": ["timeline", "marker"],
1935
1953
  "issue": 336,
1936
- "verified_on": "Reported on DaVinci Resolve Studio 21.1.2.10 (Windows); not re-measured here",
1954
+ "verified_on": "Withdrawn on the reporter's re-measurement, Studio 21.2.0.6 (Windows); not re-measured here",
1937
1955
  },
1938
1956
  {
1939
1957
  "symbol": "Media Pool folder rename",
@@ -104,8 +104,12 @@ DESTRUCTIVE_ACTIONS_BY_TOOL: Dict[str, FrozenSet[str]] = {
104
104
  "delete_by_color",
105
105
  "delete_by_custom_data",
106
106
  }),
107
- "project_manager": frozenset({"archive", "delete", "safe_project_archive",
108
- "safe_project_delete"}),
107
+ # apply_spec creates projects, bins and timelines and changes settings.
108
+ # It was missing here, so safe mode and the audit log never saw it, while
109
+ # it could also run shell hooks from the spec (GHSA-x2fm-g3cm-6x5w). The
110
+ # hooks no longer run from an MCP call; this entry makes the rest gated.
111
+ "project_manager": frozenset({"apply_spec", "archive", "delete",
112
+ "safe_project_archive", "safe_project_delete"}),
109
113
  "project_settings": frozenset({"delete_color_group"}),
110
114
  "render": frozenset({"delete_all_jobs", "delete_job", "delete_preset"}),
111
115
  "render_presets": frozenset({"delete_burnin"}),
@@ -384,6 +388,7 @@ NATIVE_DRY_RUN_ACTIONS: frozenset = frozenset({
384
388
  ("script_plugin", "safe_remove_extension"),
385
389
  ("project_manager", "safe_project_delete"),
386
390
  ("project_manager", "safe_project_archive"),
391
+ ("project_manager", "apply_spec"),
387
392
  ("lut", "attenuate"),
388
393
  ("lut", "install"),
389
394
  ("lut", "remove"),
@@ -289,6 +289,12 @@ class RiskClassificationHook(LifecycleHook):
289
289
  # wrappers refuse those unless acknowledge_trap. See archive_guard.py.
290
290
  ("project_manager", "archive"),
291
291
  ("project_manager", "safe_project_archive"),
292
+ # Declarative project reconcile: creates the project, bins, timelines
293
+ # and markers the spec names, and changes project/timeline settings to
294
+ # match. Additive and idempotent (it never deletes), but it does alter
295
+ # existing settings. Spec hooks never run from an MCP call
296
+ # (GHSA-x2fm-g3cm-6x5w); a request for them is refused up front.
297
+ ("project_manager", "apply_spec"),
292
298
  # Script execution priority. App-wide, no getter on any build, and
293
299
  # before 21.1 it cannot be lowered again within the session; on 21.1
294
300
  # SetHighPriority(False) restores normal (reported, issue #207).