fix: CI failures — update deny.toml for cargo-deny v2, fix clippy derivable_impls
- deny.toml: remove deprecated fields (vulnerability, notice, unlicensed, copyleft) that were removed in cargo-deny v2. Add CDLA-Permissive-2.0 for webpki-roots. - security/policy.rs: replace manual Default impl for AutonomyLevel with #[derive(Default)] + #[default] attribute (clippy::derivable_impls on Rust 1.93) 657 tests passing, 0 clippy warnings (Rust 1.93.1), cargo-deny clean
This commit is contained in:
parent
ad39c52965
commit
4fceba0740
2 changed files with 7 additions and 13 deletions
11
deny.toml
11
deny.toml
|
|
@ -1,14 +1,12 @@
|
||||||
# cargo-deny configuration
|
# cargo-deny configuration — v2 schema
|
||||||
# https://embarkstudios.github.io/cargo-deny/
|
# https://embarkstudios.github.io/cargo-deny/
|
||||||
|
|
||||||
[advisories]
|
[advisories]
|
||||||
vulnerability = "deny"
|
unmaintained = "workspace"
|
||||||
unmaintained = "warn"
|
|
||||||
yanked = "warn"
|
yanked = "warn"
|
||||||
notice = "warn"
|
|
||||||
|
|
||||||
[licenses]
|
[licenses]
|
||||||
unlicensed = "deny"
|
# All licenses are denied unless explicitly allowed
|
||||||
allow = [
|
allow = [
|
||||||
"MIT",
|
"MIT",
|
||||||
"Apache-2.0",
|
"Apache-2.0",
|
||||||
|
|
@ -20,8 +18,9 @@ allow = [
|
||||||
"OpenSSL",
|
"OpenSSL",
|
||||||
"Zlib",
|
"Zlib",
|
||||||
"MPL-2.0",
|
"MPL-2.0",
|
||||||
|
"CDLA-Permissive-2.0",
|
||||||
]
|
]
|
||||||
copyleft = "deny"
|
unused-allowed-license = "allow"
|
||||||
|
|
||||||
[bans]
|
[bans]
|
||||||
multiple-versions = "warn"
|
multiple-versions = "warn"
|
||||||
|
|
|
||||||
|
|
@ -4,23 +4,18 @@ use std::sync::Mutex;
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
/// How much autonomy the agent has
|
/// How much autonomy the agent has
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
pub enum AutonomyLevel {
|
pub enum AutonomyLevel {
|
||||||
/// Read-only: can observe but not act
|
/// Read-only: can observe but not act
|
||||||
ReadOnly,
|
ReadOnly,
|
||||||
/// Supervised: acts but requires approval for risky operations
|
/// Supervised: acts but requires approval for risky operations
|
||||||
|
#[default]
|
||||||
Supervised,
|
Supervised,
|
||||||
/// Full: autonomous execution within policy bounds
|
/// Full: autonomous execution within policy bounds
|
||||||
Full,
|
Full,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for AutonomyLevel {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::Supervised
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Sliding-window action tracker for rate limiting.
|
/// Sliding-window action tracker for rate limiting.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct ActionTracker {
|
pub struct ActionTracker {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue