Skip to content

Commit ca07789

Browse files
committed
refactor: rename CC604 to agent-unrestricted-trigger
"open" read as "open the trigger". "unrestricted" says what the rule checks, a "*" with no restriction, and matches the name an existing linter gives the same check.
1 parent c1ed7bb commit ca07789

6 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎commit_check/agent_config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"agent-mcp-auto-approve": "agent_mcp_auto_approve",
3434
"agent-api-endpoint": "agent_api_endpoint",
3535
"agent-full-access": "agent_full_access",
36-
"agent-open-trigger": "agent_open_trigger",
36+
"agent-unrestricted-trigger": "agent_unrestricted_trigger",
3737
}
3838

3939
#: The ``[agent_config]`` list that lets a finding of each check through,

‎commit_check/agent_configs.toml‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
# docs where the agent documents these settings
1515
# settings one inline table per setting:
1616
# rule the rule that reports it:
17-
# agent-mcp-auto-approve MCP servers or their tools run
18-
# without asking
19-
# agent-api-endpoint requests go to another API endpoint
20-
# agent-full-access commands run without asking or
21-
# outside the sandbox
22-
# agent-open-trigger anyone can start the agent in CI
17+
# agent-mcp-auto-approve MCP servers or their tools run
18+
# without asking
19+
# agent-api-endpoint requests go to another API
20+
# endpoint
21+
# agent-full-access commands run without asking or
22+
# outside the sandbox
23+
# agent-unrestricted-trigger anyone can start the agent in CI
2324
# key the setting, keys joined with "."; * stands for any one key,
2425
# such as a server's name. A key that itself holds dots, as in
2526
# VS Code's settings, is matched whole first
@@ -67,8 +68,8 @@ files = [
6768
uses = "anthropics/claude-code-action"
6869
docs = "https://github.com/anthropics/claude-code-action/blob/main/docs/security.md"
6970
settings = [
70-
{ rule = "agent-open-trigger", key = "allowed_bots", value = "*" },
71-
{ rule = "agent-open-trigger", key = "allowed_non_write_users", value = "*" },
71+
{ rule = "agent-unrestricted-trigger", key = "allowed_bots", value = "*" },
72+
{ rule = "agent-unrestricted-trigger", key = "allowed_non_write_users", value = "*" },
7273
]
7374

7475
[[agent]]

‎commit_check/engine.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2400,7 +2400,7 @@ class ValidationEngine:
24002400
"agent_mcp_auto_approve": AgentConfigValidator,
24012401
"agent_api_endpoint": AgentConfigValidator,
24022402
"agent_full_access": AgentConfigValidator,
2403-
"agent_open_trigger": AgentConfigValidator,
2403+
"agent_unrestricted_trigger": AgentConfigValidator,
24042404
}
24052405

24062406
def __init__(self, rules: list[ValidationRule]):

‎commit_check/rules_catalog.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ def docs_url(self) -> str | None:
306306
),
307307
RuleCatalogEntry(
308308
rule_id="CC604",
309-
check="agent_open_trigger",
309+
check="agent_unrestricted_trigger",
310310
regex=None,
311311
error="Anyone can start the agent",
312312
suggest='List the allowed users or bots instead of "*"',

‎tests/agent_config_test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def test_a_finding_reads_setting_then_file(self):
381381
def _setting(files, key, value=ANY, uses=None):
382382
return AgentSetting(
383383
agent="Some agent",
384-
check="agent_open_trigger",
384+
check="agent_unrestricted_trigger",
385385
files=(files,),
386386
key=tuple(key.split(".")),
387387
value=value,

‎tests/main_test.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ def test_files_in_requested_checks(self):
18391839
"agent_mcp_auto_approve",
18401840
"agent_api_endpoint",
18411841
"agent_full_access",
1842-
"agent_open_trigger",
1842+
"agent_unrestricted_trigger",
18431843
}
18441844

18451845
def test_files_cli_options_reach_config(self):

0 commit comments

Comments
 (0)