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