From ee7e483e29d2173d602f9fab647c99bcccdd2cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 5 Jun 2026 04:04:09 +0300 Subject: [PATCH] =?UTF-8?q?fix(m2):=20actionOf=20=E2=80=94=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=B0=20?= =?UTF-8?q?=D0=B2=D1=8B=D1=80=D0=BE=D0=B2=D0=BD=D0=B5=D0=BD=D1=8B=20=D1=81?= =?UTF-8?q?=20B4=20(=D0=BB=D0=BE=D0=B2=D0=B8=D1=82=20MCP=20filename/uri/de?= =?UTF-8?q?stination)=20(F1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/enforce-supreme-gate.mjs | 3 ++- tools/enforce-supreme-gate.test.mjs | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/enforce-supreme-gate.mjs b/tools/enforce-supreme-gate.mjs index 78ac754a..7485e6d8 100644 --- a/tools/enforce-supreme-gate.mjs +++ b/tools/enforce-supreme-gate.mjs @@ -48,7 +48,8 @@ export function actionOf(toolUse) { if (op === 'Bash') object = i.command || ''; else if (op === 'Skill') object = i.skill || ''; else if (op === 'Task') object = i.subagent_type || ''; - else object = i.file_path || i.notebook_path || i.path || i.target_file || ''; + // F1 (2026-06-05): поля выровнены с extractPath (B4) — MCP-писатели несут путь под разными именами. + else object = i.file_path || i.notebook_path || i.path || i.target_file || i.filename || i.destination || i.dest || i.output_path || i.uri || ''; return { op, object }; } diff --git a/tools/enforce-supreme-gate.test.mjs b/tools/enforce-supreme-gate.test.mjs index 8966ef9c..5c55cea2 100644 --- a/tools/enforce-supreme-gate.test.mjs +++ b/tools/enforce-supreme-gate.test.mjs @@ -26,6 +26,14 @@ describe('isSeed (D12/D13 bootstrap exemption)', () => { }); }); +describe('actionOf — поля объекта (F1, выровнено с B4)', () => { + it('берёт объект из доп. полей MCP-писателей (filename/uri/destination)', () => { + expect(actionOf({ name: 'mcp__fs__write', input: { filename: 'tools/foo.mjs' } }).object).toBe('tools/foo.mjs'); + expect(actionOf({ name: 'mcp__x', input: { uri: 'a/b.txt' } }).object).toBe('a/b.txt'); + expect(actionOf({ name: 'mcp__y', input: { destination: 'd/e.json' } }).object).toBe('d/e.json'); + }); +}); + const KEY = 'supreme-key'; const PLAN = { plan_id: 'x', frozen_at: 1,