From d0eaa814de74fbe515ec6954844ece59f3df9164 Mon Sep 17 00:00:00 2001 From: Hongming Wang Date: Tue, 14 Apr 2026 12:29:32 -0700 Subject: [PATCH] fix(gate-4): add missing import json in sdk/python/molecule_plugin/builtins.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #63 code-review caught that the SDK copy of AgentskillsAdaptor uses json.loads/json.dumps in _merge_settings_fragment + _rewrite_hook_paths + _deep_merge_hooks but never imports json. The runtime copy (workspace-template/plugins_registry/builtins.py) already has the import; this brings the SDK side in line. Bug surfaces only when a plugin shipping settings-fragment.json (any of the 5 hook plugins or 2 workflow plugins in this PR) is installed through the SDK path — would NameError on the first json.loads call. The drift test catches behavioral drift via fixture install scenarios but not import-level drift in helper code paths. Verified: json is now importable (`hasattr(molecule_plugin.builtins, 'json')` → True), drift test still passes. Co-Authored-By: Claude Opus 4.6 (1M context) --- sdk/python/molecule_plugin/builtins.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/python/molecule_plugin/builtins.py b/sdk/python/molecule_plugin/builtins.py index eeb9a22e..63e61103 100644 --- a/sdk/python/molecule_plugin/builtins.py +++ b/sdk/python/molecule_plugin/builtins.py @@ -19,6 +19,7 @@ class in Python — unlimited expressiveness, no framework constraint. from __future__ import annotations +import json import os import shutil import subprocess