Skip to content

Commit 8dcf862

Browse files
committed
ci: synchronize package-lock.json, fix clippy lint, and update rotation test
1 parent f9bfb7d commit 8dcf862

3 files changed

Lines changed: 117 additions & 111 deletions

File tree

package-lock.json

Lines changed: 106 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server-rs/src/services/acl_service.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,12 @@ impl AclServiceTrait for AclService {
3232
_ => true,
3333
}
3434
} else if agent_id == AGENT_ALPHA {
35-
match tool_name {
36-
"issue_alpha_directive" => false,
37-
_ => true, // Alpha Commander can spawn subagents & recruit
38-
}
35+
tool_name != "issue_alpha_directive" // Alpha Commander can spawn subagents & recruit
3936
} else if authority == RoleAuthorityLevel::Observer {
40-
match tool_name {
41-
"read_file" | "list_files" | "search_global_vault" => true,
42-
_ => false, // No mutations for observers
43-
}
37+
matches!(tool_name, "read_file" | "list_files" | "search_global_vault")
4438
} else {
4539
// Tactical Specialists: cannot spawn subagents or issue alpha directives
46-
match tool_name {
47-
"issue_alpha_directive" | "spawn_subagent" => false,
48-
_ => true,
49-
}
40+
!matches!(tool_name, "issue_alpha_directive" | "spawn_subagent")
5041
}
5142
}
5243

tests/unit/test_token_rotation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@ def test_confirm_rotation_revokes_old(self):
6363
# Initiate rotation
6464
rotate_token.rotate_token(grace_period_secs=10)
6565

66-
# Confirm rotation
67-
rotate_token.confirm_rotation()
66+
# Confirm rotation without force during grace period should be blocked
67+
rotate_token.confirm_rotation(force=False)
68+
lines = self.env_file.read_text().splitlines()
69+
env_dict = {line.split("=", 1)[0].strip(): line.split("=", 1)[1].strip() for line in lines if "=" in line}
70+
self.assertTrue("NEURAL_TOKEN_OLD" in env_dict)
71+
72+
# Confirm rotation with force=True should revoke old tokens
73+
rotate_token.confirm_rotation(force=True)
6874

6975
# Read back env
7076
lines = self.env_file.read_text().splitlines()

0 commit comments

Comments
 (0)