Skip to content

test(rules): mirror and cover CREW-013 - #177

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

bradAGI wants to merge 1 commit into
trustabl:mainfrom
bradAGI:feat/crewai-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#105, 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 crewai/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#105, 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 crewai/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 mirror is exact: comparing the added block here against trustabl/agent-reliability-rules#105 line for line, the two are identical, which is what check-rules-sync.sh needs.

The three cases are right, and the third is the one worth having. PredNameIn lowercases and compares the whole name, so process_invoice_batch staying silent pins the semantics that would otherwise flood every pack sharing that list. parsePy takes ToolDef.Name from the function name, so all three cases exercise the predicate rather than passing vacuously.

I have left a change request on the rules half about CrewAI's positional decorator name, since @tool("Fetch order status") over def process(...) fires today on a name the model never sees. Whatever lands there has to be mirrored here, so I would rather hold this one until that settles. One unrelated nit while you are in there: the diff also drops a blank line at the end of policyRepoRuleCases, which is not part of this change and just adds noise to the review.

Happy to take it once the rules half is settled and mirrored back here.

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