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:
2026-09-26 01:48:38 -07:00
co-authored by Claude Opus 5.5
parent 727e027fcf
commit 2b3ae080b4
311 changed files with 426 additions and 410 deletions
+5 -5
View File
@@ -4,7 +4,7 @@ use std::io::{self, Write};
use std::os::unix::net::UnixStream;
use std::path::{Path, PathBuf};
use proto::{
use bxcore::{
Approve, DecisionRecord, DenyReason, Empty, Envelope, ErrorCode, FrameError, Message,
PROTOCOL_VERSION, PendingApproval, Refuse, Timestamp, WireError, read_frame, write_frame,
};
@@ -288,10 +288,10 @@ fn session_shown(session: &str) -> String {
}
// The taint of a decision is its wire name.
fn taint_name(taint: proto::DataClass) -> &'static str {
fn taint_name(taint: bxcore::DataClass) -> &'static str {
match taint {
proto::DataClass::Public => "public",
proto::DataClass::Private => "private",
proto::DataClass::Secret => "secret",
bxcore::DataClass::Public => "public",
bxcore::DataClass::Private => "private",
bxcore::DataClass::Secret => "secret",
}
}
+2 -2
View File
@@ -4,7 +4,7 @@ use std::io::{BufRead, Write};
use std::os::unix::net::UnixStream;
use std::path::Path;
use proto::{
use bxcore::{
DenyReason, Envelope, ErrorCode, Message, PROTOCOL_VERSION, SessionId, Timestamp, Turn,
TurnDone, TurnEvent, WireError, read_frame, write_frame,
};
@@ -15,7 +15,7 @@ use crate::escape::{escape_json_text, escape_model_text};
#[derive(Debug)]
pub enum ChatError {
Connect(std::io::Error),
Frame(proto::FrameError),
Frame(bxcore::FrameError),
Refused(WireError),
Protocol(String),
}
+1 -1
View File
@@ -2,7 +2,7 @@
use std::path::{Path, PathBuf};
use proto::SessionId;
use bxcore::SessionId;
// Shown on stderr for any usage error. It names every subcommand and the flags they share, so a
// single line tells the owner what they can type.
+2 -2
View File
@@ -1,3 +1,3 @@
//! The text-escape helpers, from `proto` (moved there in M4b so `gatewayd` shows the same thing).
//! The text-escape helpers, from `bxcore` (moved there in M4b so `gatewayd` shows the same thing).
pub use proto::escape::{escape_json_text, escape_model_text};
pub use bxcore::escape::{escape_json_text, escape_model_text};
+1 -1
View File
@@ -4,11 +4,11 @@ use std::io::{BufRead, BufReader, Write};
use std::path::{Path, PathBuf};
use std::process::ExitCode;
use bxcore::{ErrorCode, SessionId, Timestamp, TurnDone};
use bxctl::admin::{self, AdminError};
use bxctl::chat::{Approvals, ChatError, OnPending, Printer, TurnIo, new_session_id, stream_turn};
use bxctl::cli::{self, ChatOptions, Command, USAGE};
use bxctl::escape::escape_model_text;
use proto::{ErrorCode, SessionId, Timestamp, TurnDone};
fn main() -> ExitCode {
// `args_os`, because `args` panics on an argument that is not UTF-8. bxctl's arguments are
+1 -1
View File
@@ -6,7 +6,7 @@ use std::os::unix::net::UnixStream;
use std::path::{Path, PathBuf};
use std::time::Duration;
use proto::{
use bxcore::{
Empty, Envelope, MemoryAdmin, MemoryCommand, Message, PROTOCOL_VERSION, read_frame, write_frame,
};
+3 -3
View File
@@ -1,10 +1,10 @@
//! Verifies the whole audit log under a home directory with `proto::ChainVerifier`, reading the
//! Verifies the whole audit log under a home directory with `bxcore::ChainVerifier`, reading the
//! files itself so it works when `brokerd` will not start.
use std::io::Write;
use std::path::Path;
use proto::ChainVerifier;
use bxcore::ChainVerifier;
/// Verifies the whole audit log under `home` and prints the report to `out`.
/// `Ok(true)`: the chain verifies. `Ok(false)`: it does not. `Err`: the log cannot be read.
@@ -21,7 +21,7 @@ pub fn run(home: &Path, out: &mut dyn Write) -> std::io::Result<bool> {
continue;
}
};
if proto::is_audit_log_name(&name) {
if bxcore::is_audit_log_name(&name) {
names.push(name);
} else if name.ends_with(".jsonl") {
// Looks like a log file but is not named as one: brokerd ignores it too. Say so, so