Skip to content

test(rules): mirror and cover AG2-019 - #178

Closed
bradAGI wants to merge 1 commit into
trustabl:mainfrom
bradAGI:feat/autogen-ambiguous-tool-name
Closed

bradAGI wants to merge 1 commit into
trustabl:mainfrom
bradAGI:feat/autogen-ambiguous-tool-name

Conversation

@bradAGI

@bradAGI bradAGI commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Engine half of a coordinated pair. Rules half: trustabl/agent-reliability-rules#106, on a branch of the same name, so the rules-sync job resolves the matching pack rather than main. Neither half should merge alone — check-rules-sync.sh fails if they do.

What the pair adds

Ports the ambiguous-name check to this pack. CSDK-007, OAI-007, ADK-007, and MCP-003 all ship it; the newer packs had none. Same name_in list as CSDK-007.

What this PR does

  1. Mirrors autogen/tool_definition.yaml into testdata/rules-fixture/.
  2. Adds cases to policyRuleCases, as TestPolicyRules_AllRulesCovered requires.
case expectation
def process(...) fires
def summarize_invoice(...) silent
def process_invoice_batch(...) silent

Three cases rather than two. The third is the one worth having: process_invoice_batch merely contains a listed word. It pins that name_in matches the whole name rather than a substring — the plausible regression, and the one that would otherwise flood well-named tools with findings across every pack using this list at once.

Verification

$ RULES_REPO=../trustabl-rules scripts/check-rules-sync.sh
rules fixture is in sync with production (86 files compared)

$ go vet ./internal/rules/
$ go test ./internal/rules/
ok  	github.com/trustabl/trustabl/internal/rules

Engine half of a coordinated pair with trustabl/agent-reliability-rules#106, on a
branch of the same name so the rules-sync job resolves the matching pack
rather than main. Neither half should merge alone — check-rules-sync.sh
fails if they do.

Mirrors autogen/tool_definition.yaml into testdata/rules-fixture and adds
cases to policyRuleCases, as TestPolicyRules_AllRulesCovered requires.

Three cases: the generic name, the verb-object remediation, and
process_invoice_batch — a name that merely contains a listed word and must
stay silent. The third pins that name_in matches the whole name rather
than a substring, which is the plausible regression and the one that would
otherwise flood well-named tools with findings.
@jhumel-code

Copy link
Copy Markdown
Collaborator

Thanks @bradAGI. The fixture copy is byte identical to the YAML in trustabl/agent-reliability-rules#106, and both branches start from the same blob on main, so the sync check will be clean as long as the two land together.

The three cases are right, and the third is the one I would have asked for. PredNameIn lowercases and compares the whole name, so process_invoice_batch pins exact-match behavior rather than substring matching, which is exactly the regression that would flood every pack using this list. parsePy takes Name from the function name, so all three snippets exercise what you say they do, and none of them passes vacuously.

Two small things. The AG2-019 cases sit at the end of policyRuleCases after the CSDK-018 block, but that table is grouped by pack and the other AutoGen cases (AG2-007 through AG2-012) are much further up. Please move them next to those. The diff also drops a blank line at the tail of policyRepoRuleCases, which is unrelated to this change, so revert that hunk if it is easy.

Neither of those is blocking, and this is good to go alongside the rules half.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants