davinci-resolve-mcp 4.1.0 → 4.1.2

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,103 @@
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 v4.1.2 — the installer's healthy-branch test stops depending on a live Resolve
6
+
7
+ Test-only. No behaviour change to the server or the installer.
8
+
9
+ ### Fixed
10
+
11
+ - **`SetupExitStatusTests.test_a_working_install_still_reports_ready_and_exits_zero`
12
+ failed roughly once per full-suite run** while passing in isolation and on an
13
+ immediate re-run. It was not the shared-state bug class this repo has seen
14
+ before: it asserted the healthy branch by running the **real** probe, which
15
+ spawns a subprocess asking a live GUI application to answer over IPC within
16
+ 10 seconds and returns `False, "Connection timed out"` if it does not.
17
+ Resolve can be mid-launch, showing a modal, loading a project, or simply slow
18
+ while the rest of the suite saturates the machine — none of which is a defect
19
+ in the installer, which is the only thing the test exists to catch.
20
+
21
+ What it actually guards — *a successful verification must print
22
+ `Environment ready!` and return 0* — is a property of `main()`'s reporting,
23
+ not of the host. It is now asserted against a **pinned** verification result,
24
+ so it is deterministic and runs everywhere, including on CI with no Resolve
25
+ installed. Its mirror (*a stated failure is never reported ready*) is pinned
26
+ the same way.
27
+
28
+ - **The live probe is still exercised, as an integration check**, by
29
+ `test_the_live_probe_agrees_with_the_summary`. It asserts the summary and
30
+ exit status **agree with whatever the probe said** — and skips, naming the
31
+ probe's own message, when the probe did not answer. It is not an assertion
32
+ that the probe succeeds, because that is not something a unit suite can
33
+ guarantee. A probe that answers and a summary that contradicts it still
34
+ fails, which is the regression that matters.
35
+
36
+ - **The skip gate admitted machines the test could not pass.**
37
+ `_resolve_is_installed()` checked only for a `fusionscript` library, but
38
+ `main()` sets `verification_failed` when `api_path` is falsy — printing
39
+ `Skipped — Resolve API path not detected` — *before* the probe runs. On a
40
+ machine with the app installed but no `Developer/Scripting` directory (Studio's
41
+ installer can omit that component; on Linux it may sit outside the defaults),
42
+ the test therefore failed **deterministically**, for a reason unrelated to
43
+ what it pins. The gate now requires both halves, and it expands `{user}` the
44
+ way `find_resolve_paths()` does.
45
+
46
+ ### Guards
47
+
48
+ - Every reporting test in `SetupExitStatusTests` is re-run with
49
+ `verify_resolve_connection` booby-trapped to raise, so any test that reaches
50
+ a live Resolve — by dropping its pin, by letting discovery find the host's
51
+ install, or by being added without one — fails at authoring time instead of
52
+ once a fortnight in someone's suite run. Exactly one test is exempt, named in
53
+ `LIVE_TEST`.
54
+ - The ready assertion is re-asserted against a dead `RESOLVE_PATHS`, pinning
55
+ that the summary follows the verification result rather than the machine.
56
+ - A pinned verification is asserted to actually replace the probe rather than
57
+ shadow it, so pinning the wrong symbol cannot quietly reacquire the flake.
58
+ - The gate is asserted to reject a library with no API directory beside it.
59
+
60
+ All four fail when the defect they pin is reintroduced.
61
+
62
+ ## What's New in v4.1.1 — drift detection stops comparing two different timelines
63
+
64
+ Reported by @V2arK (#224), with the root cause correctly diagnosed in the report.
65
+
66
+ ### Fixed
67
+
68
+ - **`project_manager.load` emitted a drift warning for an edit that never
69
+ happened.** `DriftDetectionHook` compared `pre_state["duration_frames"]`
70
+ against the post-state's with no check that the two described the same
71
+ timeline — and `load` is not in `_DURATION_ALTERING_ACTIONS`, so a project
72
+ switch took the "unexpected drift" branch by construction. Switching from a
73
+ 120-frame timeline in one project to a 17854-frame timeline in another
74
+ reported a drift of 17734 frames during an action that edited nothing.
75
+
76
+ This is the failure the verification layer exists to prevent, occurring
77
+ inside the verification layer: an agent reading the envelope was told an edit
78
+ had corrupted a timeline when no edit had occurred, and the README is
79
+ explicit that a confident wrong answer is worse than no answer.
80
+
81
+ - **The check is now on identity, not on an action allow-list.** The hook skips
82
+ the comparison when `project_name` or `timeline_name` moved between pre- and
83
+ post-state — both of which the state provider already reported and the hook
84
+ simply ignored. Identity was chosen over adding `load` to a list because the
85
+ set of actions that can replace the current timeline is open-ended (`load`,
86
+ `create`, `set_current`, anything that closes a project) while the question —
87
+ does the baseline still refer to what we measured? — is the same for all of
88
+ them. The reporter suggested both directions; this is the more general one.
89
+
90
+ - **The reset is reported, not silently omitted.** The hook returns
91
+ `drift_detected: false` with `baseline_reset: true`, the key that moved, and
92
+ a notice, rather than returning nothing. No drift record is indistinguishable
93
+ from "not checked"; this says the check ran and the baseline stopped
94
+ applying.
95
+
96
+ The case the hook exists for is unaffected: same project, same timeline,
97
+ duration moved under a non-duration-altering action still reports drift, and
98
+ a state with no identity keys at all still compares durations rather than
99
+ silently disabling itself. All three are covered by tests, and the two new
100
+ ones fail without the change.
101
+
5
102
  ## What's New in v4.1.0 — `timeline_markers add` can be previewed, and "false" stops meaning true
6
103
 
7
104
  Contributed by @Rohitkanithi (#218), adapted onto v4.0.0.
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.1.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-4.1.2-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(387%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.1.0-blue.svg)](https://github.com/samuelgursky/davinci-resolve-mcp/releases)
5
+ [![Version](https://img.shields.io/badge/version-4.1.2-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(387%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.1.0 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
15
+ > 本翻译对应 v4.1.2 版 README。如与英文原版有出入,以 [英文原版](README.md) 为准。
16
16
 
17
17
  一个 Model Context Protocol (MCP) 服务器,让 AI 助手通过官方脚本 API 控制 DaVinci Resolve Studio(达芬奇)。它提供完整的 API 覆盖,外加带护栏的工作流助手,涵盖剪辑、媒体池整理、渲染设置、审阅标记、调色、Fusion、Fairlight、项目生命周期任务、扩展开发,以及不碰源媒体的媒体分析。
18
18
 
package/install.py CHANGED
@@ -37,7 +37,7 @@ from src.utils.update_check import (
37
37
 
38
38
  # ─── Version ──────────────────────────────────────────────────────────────────
39
39
 
40
- VERSION = "4.1.0"
40
+ VERSION = "4.1.2"
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.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "NPM bootstrapper for the DaVinci Resolve MCP Server.",
5
5
  "license": "MIT",
6
6
  "author": "Samuel Gursky <samgursky@gmail.com>",
@@ -87,7 +87,7 @@ if not logging.getLogger().handlers:
87
87
  handlers=[logging.StreamHandler()],
88
88
  )
89
89
 
90
- VERSION = "4.1.0"
90
+ VERSION = "4.1.2"
91
91
  logger = logging.getLogger("davinci-resolve-mcp")
92
92
  logger.info(f"Starting DaVinci Resolve MCP Server v{VERSION}")
93
93
  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.1.0"
14
+ VERSION = "4.1.2"
15
15
 
16
16
  import base64
17
17
  import os
@@ -541,9 +541,44 @@ class DriftDetectionHook(LifecycleHook):
541
541
  "delete_clips", "cut_clip", "delete_item", "ripple_trim"
542
542
  }
543
543
 
544
+ #: Identity keys that make a duration comparable. If either of these moved,
545
+ #: the two durations describe different timelines and their difference is
546
+ #: not drift.
547
+ _IDENTITY_KEYS = ("project_name", "timeline_name")
548
+
544
549
  def __init__(self, state_provider: Optional[Callable[[], Optional[Dict[str, Any]]]] = None):
545
550
  self._state_provider = state_provider
546
551
 
552
+ @classmethod
553
+ def _baseline_identity_changed(
554
+ cls, pre_state: Dict[str, Any], post_state: Dict[str, Any]
555
+ ) -> Optional[str]:
556
+ """Name the identity key that moved, or None if the baseline still holds.
557
+
558
+ A duration delta only means drift when both numbers describe the same
559
+ timeline. Actions that *replace* the current timeline rather than modify
560
+ it -- `project_manager.load` most obviously -- leave a pre-state
561
+ measuring one project's timeline and a post-state measuring another's.
562
+ Comparing them reports a large unexpected drift for a call during which
563
+ nothing was edited at all.
564
+
565
+ That is the failure this layer exists to prevent, occurring inside the
566
+ layer itself: the README is explicit that a confident wrong answer is
567
+ worse than no answer, and an agent reading the envelope is told an edit
568
+ corrupted a timeline when no edit happened.
569
+
570
+ Identity is checked rather than the action being allow-listed, because
571
+ the set of actions that can swap the current timeline is open-ended
572
+ (`load`, `create`, `set_current`, anything that closes a project) while
573
+ the question -- does the baseline still refer to the thing we measured?
574
+ -- is the same for all of them.
575
+ """
576
+ for key in cls._IDENTITY_KEYS:
577
+ before, after = pre_state.get(key), post_state.get(key)
578
+ if before is not None and after is not None and before != after:
579
+ return key
580
+ return None
581
+
547
582
  def after_tool_call(
548
583
  self, ctx: ToolCallContext, result: Any, duration_ms: int
549
584
  ) -> Optional[Dict[str, Any]]:
@@ -556,6 +591,23 @@ class DriftDetectionHook(LifecycleHook):
556
591
  return None
557
592
  ctx.post_state = post_state
558
593
 
594
+ moved = self._baseline_identity_changed(ctx.pre_state, post_state)
595
+ if moved:
596
+ # Say so explicitly rather than returning None. "No drift
597
+ # record" is indistinguishable from "not checked"; this reports
598
+ # that the check ran and the baseline stopped applying.
599
+ return {
600
+ "drift_detected": False,
601
+ "baseline_reset": True,
602
+ "reset_on": moved,
603
+ "notice": (
604
+ f"Drift not evaluated: {moved} changed from "
605
+ f"{ctx.pre_state.get(moved)!r} to {post_state.get(moved)!r} "
606
+ f"during '{ctx.action}', so the pre-state duration is no "
607
+ "longer a baseline for the post-state duration."
608
+ ),
609
+ }
610
+
559
611
  pre_dur = ctx.pre_state.get("duration_frames")
560
612
  post_dur = post_state.get("duration_frames")
561
613