From 93e26401af1130787201f7c9392624dfada752fd Mon Sep 17 00:00:00 2001 From: sairenchristianbuerano Date: Mon, 21 Sep 2026 12:30:44 +0800 Subject: [PATCH] fix(google_adk): move the four tool-scoped rules into the 0NN block ADK-114, ADK-115, ADK-116 and ADK-117 shipped with scope: tool while sitting in the 1NN block, which the README documents as agent or subagent scope. Every other ADK rule obeys the split: 001-016 are tool scope, 101-112 are agent scope. @jhumel-code asked for this on the ADK-117 pull request before it landed and named ADK-014 as the replacement; the merge went in ahead of the change. IDs are permanent once anything external references them, so this closes the gap while it is still free. ADK-117 -> ADK-014 TypeScript FunctionTool writes to the filesystem ADK-114 -> ADK-017 TypeScript FunctionTool HTTP call has no timeout ADK-115 -> ADK-018 FunctionTool description is a placeholder ADK-116 -> ADK-019 FunctionTool description is too short 014, 017, 018 and 019 were the free ids in the 0NN block. Rule text, severity, confidence and match expressions are unchanged. Also extends the README file map for google_adk to name the new rules, matching how the claude_sdk lines already name CSDK-012. ADK-008 remains agent scope in the 0NN block. That one predates this and the README documents it explicitly, so it is left alone. --- internal/rules/policies_test.go | 24 +++++++++---------- .../rules-fixture/google_adk/network.yaml | 2 +- .../rules-fixture/google_adk/path_safety.yaml | 2 +- .../google_adk/tool_definition.yaml | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/internal/rules/policies_test.go b/internal/rules/policies_test.go index 2ccec328..583d1502 100644 --- a/internal/rules/policies_test.go +++ b/internal/rules/policies_test.go @@ -2716,11 +2716,11 @@ def lookup_order(order_id: str) -> str: "});\n", }, - // ─── ADK-114: TS ADK FunctionTool HTTP call without a timeout ─────────── + // ─── ADK-017: TS ADK FunctionTool HTTP call without a timeout ─────────── // adk-js uses the options-object form (new FunctionTool({ ..., execute })), // not the Python FunctionTool(fn) wrapper shape. { - name: "ADK-114 fires on TS fetch with no AbortSignal", ruleID: "ADK-114", + name: "ADK-017 fires on TS fetch with no AbortSignal", ruleID: "ADK-017", kind: models.KindADKFunctionTool, lang: models.LanguageTypeScript, wantFires: true, src: "import { FunctionTool } from \"@google/adk\";\n" + "const t = new FunctionTool({ name: \"fetch_report\", description: \"Fetch a report.\", parameters: {}, execute: async () => {\n" + @@ -2729,7 +2729,7 @@ def lookup_order(order_id: str) -> str: "} });\n", }, { - name: "ADK-114 silent when AbortSignal present", ruleID: "ADK-114", + name: "ADK-017 silent when AbortSignal present", ruleID: "ADK-017", kind: models.KindADKFunctionTool, lang: models.LanguageTypeScript, wantFires: false, src: "import { FunctionTool } from \"@google/adk\";\n" + "const t = new FunctionTool({ name: \"fetch_report\", description: \"Fetch a report.\", parameters: {}, execute: async () => {\n" + @@ -2738,7 +2738,7 @@ def lookup_order(order_id: str) -> str: "} });\n", }, { - name: "ADK-114 fires when fetch options omit any timeout", ruleID: "ADK-114", + name: "ADK-017 fires when fetch options omit any timeout", ruleID: "ADK-017", kind: models.KindADKFunctionTool, lang: models.LanguageTypeScript, wantFires: true, src: "import { FunctionTool } from \"@google/adk\";\n" + "const t = new FunctionTool({ name: \"fetch_report\", description: \"Fetch a report.\", parameters: {}, execute: async () => {\n" + @@ -2797,27 +2797,27 @@ def list_orders(customer_id: str) -> str: return customer_id `, wantFires: false}, - {name: "ADK-115 fires on placeholder description", ruleID: "ADK-115", kind: models.KindADKFunctionTool, src: ` + {name: "ADK-018 fires on placeholder description", ruleID: "ADK-018", kind: models.KindADKFunctionTool, src: ` def lookup_order(order_id: str) -> str: """TODO: describe this tool.""" return order_id `, wantFires: true}, - {name: "ADK-115 silent on a real description", ruleID: "ADK-115", kind: models.KindADKFunctionTool, src: ` + {name: "ADK-018 silent on a real description", ruleID: "ADK-018", kind: models.KindADKFunctionTool, src: ` def lookup_order(order_id: str) -> str: """Look up a single order by its identifier and return its current status.""" return order_id `, wantFires: false}, - {name: "ADK-116 fires on a too-short description", ruleID: "ADK-116", kind: models.KindADKFunctionTool, src: ` + {name: "ADK-019 fires on a too-short description", ruleID: "ADK-019", kind: models.KindADKFunctionTool, src: ` def list_orders(customer_id: str) -> str: """Gets data.""" return customer_id `, wantFires: true}, - {name: "ADK-116 silent on a full description", ruleID: "ADK-116", kind: models.KindADKFunctionTool, src: ` + {name: "ADK-019 silent on a full description", ruleID: "ADK-019", kind: models.KindADKFunctionTool, src: ` def list_orders(customer_id: str) -> str: """List every order belonging to one customer, most recent first.""" return customer_id `, wantFires: false}, - {name: "ADK-116 silent when the docstring is absent (ADK-001's case)", ruleID: "ADK-116", kind: models.KindADKFunctionTool, src: ` + {name: "ADK-019 silent when the docstring is absent (ADK-001's case)", ruleID: "ADK-019", kind: models.KindADKFunctionTool, src: ` def list_orders(customer_id: str) -> str: return customer_id `, wantFires: false}, @@ -3003,9 +3003,9 @@ def list_orders(customer_id: str) -> str: "} });\n", }, - // ─── ADK-117: TS ADK FunctionTool writes to the filesystem ────────────── + // ─── ADK-014: TS ADK FunctionTool writes to the filesystem ────────────── { - name: "ADK-117 fires on filesystem write", ruleID: "ADK-117", + name: "ADK-014 fires on filesystem write", ruleID: "ADK-014", kind: models.KindADKFunctionTool, lang: models.LanguageTypeScript, wantFires: true, src: "import { FunctionTool } from \"@google/adk\";\n" + "import { writeFileSync } from \"node:fs\";\n" + @@ -3015,7 +3015,7 @@ def list_orders(customer_id: str) -> str: "} });\n", }, { - name: "ADK-117 silent with no filesystem write", ruleID: "ADK-117", + name: "ADK-014 silent with no filesystem write", ruleID: "ADK-014", kind: models.KindADKFunctionTool, lang: models.LanguageTypeScript, wantFires: false, src: "import { FunctionTool } from \"@google/adk\";\n" + "const notes = new Map();\n" + diff --git a/testdata/rules-fixture/google_adk/network.yaml b/testdata/rules-fixture/google_adk/network.yaml index d1850279..375f9f31 100644 --- a/testdata/rules-fixture/google_adk/network.yaml +++ b/testdata/rules-fixture/google_adk/network.yaml @@ -52,7 +52,7 @@ rules: value that's tight enough to fail fast and loose enough to allow legitimate slow responses for this endpoint. - - id: ADK-114 + - id: ADK-017 title: TypeScript FunctionTool HTTP call has no timeout severity: high confidence: 0.6 diff --git a/testdata/rules-fixture/google_adk/path_safety.yaml b/testdata/rules-fixture/google_adk/path_safety.yaml index 689bf0ef..89f2c786 100644 --- a/testdata/rules-fixture/google_adk/path_safety.yaml +++ b/testdata/rules-fixture/google_adk/path_safety.yaml @@ -33,7 +33,7 @@ rules: Resolve the path with `Path(...).resolve()` and assert it sits under an allowed root before opening. - - id: ADK-117 + - id: ADK-014 title: TypeScript FunctionTool writes to the filesystem severity: low confidence: 0.5 diff --git a/testdata/rules-fixture/google_adk/tool_definition.yaml b/testdata/rules-fixture/google_adk/tool_definition.yaml index 025e5cef..51b8f796 100644 --- a/testdata/rules-fixture/google_adk/tool_definition.yaml +++ b/testdata/rules-fixture/google_adk/tool_definition.yaml @@ -128,7 +128,7 @@ rules: that names what the tool does, the inputs it expects, and what it returns. Write it for the model, not for a human reader. - - id: ADK-115 + - id: ADK-018 title: FunctionTool description is a placeholder severity: low confidence: 0.85 @@ -163,7 +163,7 @@ rules: neighboring tool, and document each parameter so the ADK can carry those descriptions into the generated declaration. - - id: ADK-116 + - id: ADK-019 title: FunctionTool description is too short to guide model selection severity: low confidence: 0.8