proto becomes bxcore, the one shared crate (M5b task 00)
Done the way the owner asked and the spike mapped: the crate and the manifests renamed, then what the build reported fixed. Layers: 138 "proto unresolved" errors across 169 files; cargo fmt reordering imports; six fixture paths built as strings in brokerd's and bxctl's tests, which the compiler cannot see, and comments naming crates/proto/; the crate-dependency check and its self-test. One more the spike did not reach: a `\nproto =` key inside a printf format in the self-test, which a word-boundary replacement skips because `n` and `p` are both word characters. make gate: gate: ok, 944 tests; no new entry in /tmp. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use super::{Label, Matched, SessionState};
|
||||
use crate::args::{ToolArgs, host_matches, inside};
|
||||
use crate::grants::GrantSet;
|
||||
use proto::{DataClass, Grant, Hash32, Mode, Timestamp};
|
||||
use bxcore::{DataClass, Grant, Hash32, Mode, Timestamp};
|
||||
|
||||
/// The grants left after matching, and the two flags that pick the denial reason when none are
|
||||
/// left.
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
//! constructor is exposed.
|
||||
//!
|
||||
//! ```compile_fail
|
||||
//! let request = proto::ToolRequest {
|
||||
//! session: proto::SessionId::new("s1").unwrap(),
|
||||
//! call: proto::CallId(1),
|
||||
//! let request = bxcore::ToolRequest {
|
||||
//! session: bxcore::SessionId::new("s1").unwrap(),
|
||||
//! call: bxcore::CallId(1),
|
||||
//! tool: "shell".to_string(),
|
||||
//! arguments: r#"{"command":"ls"}"#.to_string(),
|
||||
//! };
|
||||
@@ -33,9 +33,9 @@
|
||||
//! The same three hold for `Ask`.
|
||||
//!
|
||||
//! ```compile_fail
|
||||
//! let request = proto::ToolRequest {
|
||||
//! session: proto::SessionId::new("s1").unwrap(),
|
||||
//! call: proto::CallId(1),
|
||||
//! let request = bxcore::ToolRequest {
|
||||
//! session: bxcore::SessionId::new("s1").unwrap(),
|
||||
//! call: bxcore::CallId(1),
|
||||
//! tool: "shell".to_string(),
|
||||
//! arguments: r#"{"command":"ls"}"#.to_string(),
|
||||
//! };
|
||||
@@ -60,15 +60,15 @@
|
||||
//! ```
|
||||
//! fn needs_clone<T: Clone>() {}
|
||||
//! fn needs_decoding<T: serde::de::DeserializeOwned>() {}
|
||||
//! needs_clone::<proto::ToolRequest>();
|
||||
//! needs_decoding::<proto::ToolRequest>();
|
||||
//! let request = proto::ToolRequest {
|
||||
//! session: proto::SessionId::new("s1").unwrap(),
|
||||
//! call: proto::CallId(1),
|
||||
//! needs_clone::<bxcore::ToolRequest>();
|
||||
//! needs_decoding::<bxcore::ToolRequest>();
|
||||
//! let request = bxcore::ToolRequest {
|
||||
//! session: bxcore::SessionId::new("s1").unwrap(),
|
||||
//! call: bxcore::CallId(1),
|
||||
//! tool: "shell".to_string(),
|
||||
//! arguments: r#"{"command":"ls"}"#.to_string(),
|
||||
//! };
|
||||
//! let now = proto::Timestamp::from_unix_millis(0).unwrap();
|
||||
//! let now = bxcore::Timestamp::from_unix_millis(0).unwrap();
|
||||
//! match brokerd::policy::decide(
|
||||
//! request,
|
||||
//! &brokerd::grants::GrantSet::default(),
|
||||
@@ -76,7 +76,7 @@
|
||||
//! now,
|
||||
//! ) {
|
||||
//! brokerd::policy::Outcome::Denied(denial) => {
|
||||
//! assert_eq!(denial.reason, proto::DenyReason::NoGrant);
|
||||
//! assert_eq!(denial.reason, bxcore::DenyReason::NoGrant);
|
||||
//! }
|
||||
//! other => panic!("expected a denial, got {other:?}"),
|
||||
//! }
|
||||
@@ -86,8 +86,8 @@ mod matching;
|
||||
|
||||
use crate::args::{self, ToolArgs, ToolName};
|
||||
use crate::grants::GrantSet;
|
||||
use bxcore::{DataClass, DenyReason, Hash32, Mode, Timestamp, ToolRequest};
|
||||
use matching::{MatchResult, build_matched, match_grants, winner};
|
||||
use proto::{DataClass, DenyReason, Hash32, Mode, Timestamp, ToolRequest};
|
||||
|
||||
/// The session's taint, and whether its results are untrusted. Only `taint` shapes a decision.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
|
||||
Reference in New Issue
Block a user