Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions internal/rules/policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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" +
Expand All @@ -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" +
Expand All @@ -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" +
Expand Down Expand Up @@ -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},
Expand Down Expand Up @@ -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" +
Expand All @@ -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<string, string>();\n" +
Expand Down
2 changes: 1 addition & 1 deletion testdata/rules-fixture/google_adk/network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion testdata/rules-fixture/google_adk/path_safety.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions testdata/rules-fixture/google_adk/tool_definition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading