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,