Repository navigation
Expand file tree
/
Copy pathclippy.toml
More file actions
187 lines (184 loc) · 23.7 KB
/
Copy pathclippy.toml
File metadata and controls
187 lines (184 loc) · 23.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# Shared across workspace crates: Clippy searches upward from each crate's
# manifest directory. Keep one root config so these rules cannot drift between
# packages and new crates inherit the same environment boundary.
#
# Clocks, randomness, task spawning, and selection must go through rivet-env so
# production code can also run under deterministic simulation. Unordered
# collections and direct runtime APIs can make replay depend on the host.
# Keep exceptions local to env adapters or telemetry-only clock reads.
# Metrics intentionally use real time, including during simulation.
# Moving these rules to the root also exposes violations in unmigrated crates.
disallowed-methods = [
{ path = "ed25519_dalek::SigningKey::generate", reason = "use production::secure_random at credential boundaries and SigningKey::from_seed; inject fixed signing keys into simulations" },
{ path = "std::net::TcpListener::bind", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "std::net::TcpStream::connect", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "std::net::TcpStream::connect_timeout", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpListener::bind", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpListener::from_std", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpStream::connect", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpStream::from_std", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpSocket::new_v4", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpSocket::new_v6", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpSocket::from_std_stream", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpSocket::connect", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::TcpSocket::listen", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio::net::lookup_host", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "std::net::ToSocketAddrs::to_socket_addrs", reason = "use the injected rivet-env HTTP/socket adapters; transport construction and DNS belong in production adapters" },
{ path = "tokio_tungstenite::connect_async", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::connect_async_with_config", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::connect_async_tls_with_config", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::client_async", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::client_async_with_config", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::client_async_tls", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "tokio_tungstenite::client_async_tls_with_config", reason = "open outbound WebSockets through rivet_env ExternalHttpClient::connect_websocket; sockets, DNS and TLS belong in production adapters" },
{ path = "libc::statvfs", reason = "read disk space through rivet_env::fs::Fs::disk_space so simulations can size disks" },
{ path = "libc::fstatvfs", reason = "read disk space through rivet_env::fs::Fs::disk_space so simulations can size disks" },
{ path = "libc::sysconf", reason = "read host hardware through rivet_env::host::Host so simulations can supply it" },
{ path = "std::fs::File::try_lock", reason = "use the injected rivet_env::fs file handle for exclusive filesystem ownership" },
{ path = "std::fs::File::lock", reason = "use the injected rivet_env::fs nonblocking lock; do not block an executor thread" },
{ path = "std::fs::File::try_lock_shared", reason = "filesystem ownership belongs behind rivet_env::fs" },
{ path = "std::fs::File::lock_shared", reason = "filesystem ownership belongs behind rivet_env::fs" },
{ path = "std::fs::File::unlock", reason = "retain and drop the rivet_env::fs ownership handle at the service boundary" },
{ path = "std::path::Path::exists", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::try_exists", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::is_file", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::is_dir", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::is_symlink", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::metadata", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::symlink_metadata", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::read_dir", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::read_link", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::path::Path::canonicalize", reason = "use the injected rivet_env::fs; Path filesystem helpers also bypass the environment" },
{ path = "std::fs::canonicalize", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::copy", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::create_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::create_dir_all", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::hard_link", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::metadata", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::read", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::read_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::read_link", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::read_to_string", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::remove_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::remove_dir_all", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::remove_file", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::rename", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::set_permissions", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::symlink_metadata", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::write", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::File::open", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::File::create", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::File::create_new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::File::options", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::OpenOptions::new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::OpenOptions::open", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::DirBuilder::new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::DirBuilder::create", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::canonicalize", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::copy", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::create_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::create_dir_all", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::hard_link", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::metadata", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::read", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::read_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::read_link", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::read_to_string", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::remove_dir", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::remove_dir_all", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::remove_file", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::rename", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::set_permissions", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::symlink_metadata", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::write", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::File::open", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::File::create", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::File::create_new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::File::options", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::OpenOptions::new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::OpenOptions::open", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::DirBuilder::new", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::DirBuilder::create", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::try_exists", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::File::from_std", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::fs::exists", reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::os::unix::fs::symlink", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::symlink", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::os::windows::fs::symlink_file", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "std::os::windows::fs::symlink_dir", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::symlink_file", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::fs::symlink_dir", allow-invalid = true, reason = "use the injected rivet_env::fs; direct filesystem I/O bypasses simulated disk durability" },
{ path = "tokio::task::yield_now", reason = "use rivet_env::tokio::task::yield_now so the owning production or simulation scheduler controls resumption" },
{ path = "libc::clock_gettime", reason = "use Env::clock() for deadlines or Env::thread_cpu_time_ns() for per-poll CPU metering" },
{ path = "libc::getrusage", reason = "CPU metering belongs behind Env::thread_cpu_time_ns(); direct resource clocks bypass simulation" },
{ path = "tokio::spawn", reason = "use Env::spawn" },
{ path = "tokio::task::spawn_blocking", reason = "blocking work breaks determinism; wrap behind Env" },
{ path = "tokio::task::spawn_local", reason = "use Env::spawn" },
{ path = "tokio::runtime::Handle::current", reason = "only ProductionEnv and SimRuntime hold a handle" },
{ path = "tokio::runtime::Handle::block_on", reason = "use Env blocking_io and request_io for synchronous adapter callbacks" },
{ path = "tokio::runtime::Runtime::block_on", reason = "use Env blocking_io and request_io; do not construct a nested runtime" },
{ path = "futures::executor::block_on", reason = "use Env request_io for synchronous adapter callbacks" },
{ path = "futures_executor::block_on", reason = "use Env request_io for synchronous adapter callbacks" },
{ path = "tokio::time::sleep", reason = "use Env::clock().sleep_until" },
{ path = "tokio::time::sleep_until", reason = "use Env::clock().sleep_until" },
{ path = "tokio::time::timeout", reason = "use rivet_env::timeout_at over Env::clock()" },
{ path = "tokio::time::timeout_at", reason = "use rivet_env::timeout_at over Env::clock()" },
{ path = "tokio::time::interval", reason = "use rivet_env::interval over Env::clock()" },
{ path = "tokio::time::interval_at", reason = "use rivet_env::interval over Env::clock()" },
{ path = "tokio::time::Instant::now", reason = "use Env::clock().observe()" },
{ path = "std::time::Instant::now", reason = "use Env::clock().observe()" },
{ path = "std::time::SystemTime::now", reason = "use Env::clock().observe()" },
{ path = "chrono::Utc::now", reason = "wall time comes from Env::clock(); store time comes from the own-heartbeat anchor" },
{ path = "rand::random", reason = "use Env::rng(label)" },
{ path = "rand::thread_rng", reason = "use Env::rng(label)" },
{ path = "uuid::Uuid::new_v4", reason = "use RngStream::uuid_v4" },
{ path = "rivet_util_id::Id::new_v1", reason = "use rivet_util::rng::RngStreamIdExt::id_v1 over Env::rng(label)" },
{ path = "std::thread::spawn", reason = "no OS threads in v3 crates" },
{ path = "std::thread::Builder::spawn", reason = "no OS threads in v3 crates; run work through Env::spawn or Env::spawn_blocking_io" },
{ path = "std::thread::Builder::spawn_scoped", reason = "no OS threads in v3 crates; run work through Env::spawn or Env::spawn_blocking_io" },
{ path = "std::thread::scope", reason = "no OS threads in v3 crates; run work through Env::spawn or Env::spawn_blocking_io" },
{ path = "std::thread::sleep", reason = "blocks a thread on real time; use Env::clock().sleep_until" },
{ path = "tokio::signal::ctrl_c", reason = "OS signals reach services through EngineContext::shutdown; only the production Env adapter listens for them" },
{ path = "tokio::signal::unix::signal", reason = "OS signals reach services through EngineContext::shutdown; only the production Env adapter listens for them" },
{ path = "tokio::signal::windows::ctrl_c", allow-invalid = true, reason = "OS signals reach services through EngineContext::shutdown; only the production Env adapter listens for them" },
{ path = "tokio::runtime::Builder::new_multi_thread", reason = "only process bootstrap and Env backends build runtimes; production code runs on the Env executor" },
{ path = "tokio::runtime::Builder::new_current_thread", reason = "only process bootstrap and Env backends build runtimes; production code runs on the Env executor" },
{ path = "hyper_util::rt::TokioExecutor::new", reason = "spawns connection tasks on the ambient Tokio runtime; serve through the injected rivet-env HttpServer" },
{ path = "getrandom::getrandom", allow-invalid = true, reason = "use Env::rng(label); production::secure_random for keys and credentials" },
{ path = "getrandom::fill", allow-invalid = true, reason = "use Env::rng(label); production::secure_random for keys and credentials" },
{ path = "slatedb::DbBuilder::build", reason = "open writers through the injected rivet_env::capabilities::slatedb::SlateDbFactory; it binds storage fencing to the committed grant" },
{ path = "slatedb::Db::open", reason = "open writers through the injected SlateDbFactory so callers cannot bypass grant fencing or environment adapters" },
{ path = "slatedb::DbReaderBuilder::build", reason = "construct readers inside an injected environment storage adapter" },
{ path = "slatedb::admin::CloneBuilder::build", reason = "create clones inside the injected environment storage adapter with stable intent and a fresh dispatch guard" },
{ path = "slatedb::admin::Admin::delete_db", reason = "delete retired stores through SlateDbFactory::delete_unpinned_database so child pins and current cleanup authority are checked" },
{ path = "slatedb::admin::Admin::delete_checkpoint", reason = "release storage pins inside an injected environment adapter; application cleanup uses SlateDbFactory::delete_unpinned_database" },
{ path = "slatedb::admin::AdminBuilder::build", reason = "construct storage administration inside the injected SlateDbFactory so clocks, stores and mutation guards stay at the environment boundary" },
]
disallowed-types = [
{ path = "std::net::TcpListener", reason = "raw sockets belong inside rivet-env production adapters; application code uses injected HTTP/socket capabilities" },
{ path = "std::net::TcpStream", reason = "raw sockets belong inside rivet-env production adapters; application code uses injected HTTP/socket capabilities" },
{ path = "tokio::net::TcpListener", reason = "raw sockets belong inside rivet-env production adapters; application code uses injected HTTP/socket capabilities" },
{ path = "tokio::net::TcpStream", reason = "raw sockets belong inside rivet-env production adapters; application code uses injected HTTP/socket capabilities" },
{ path = "tokio::net::TcpSocket", reason = "raw sockets belong inside rivet-env production adapters; application code uses injected HTTP/socket capabilities" },
{ path = "std::fs::File", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "std::fs::OpenOptions", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "std::fs::DirBuilder", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "std::fs::ReadDir", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "std::fs::DirEntry", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "tokio::fs::File", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "tokio::fs::OpenOptions", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "tokio::fs::DirBuilder", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "tokio::fs::ReadDir", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "tokio::fs::DirEntry", reason = "use Fs and File from rivet_env::fs; filesystem handles belong inside the production adapter" },
{ path = "rand::rngs::OsRng", reason = "use Env::rng for operational randomness; production::secure_random for keys and credentials outside simulated transitions" },
{ path = "rand::rngs::ThreadRng", reason = "use Env::rng(label)" },
{ path = "std::collections::HashMap", reason = "iteration order is behaviour; use BTreeMap, or scc for point lookups" },
{ path = "std::collections::HashSet", reason = "iteration order is behaviour; use BTreeSet" },
{ path = "tokio_util::time::DelayQueue", allow-invalid = true, reason = "sleeps on tokio time and bypasses Clock; use Clock::sleep_until" },
{ path = "std::sync::Mutex", reason = "use tokio::sync::Mutex in async code, parking_lot::Mutex in forced-sync code" },
]
disallowed-macros = [
{ path = "tokio::select", reason = "use rivet_env::select! (seeded start branch) or rivet_env::select_biased! with a reason string" },
{ path = "std::println", reason = "use tracing" },
{ path = "std::eprintln", reason = "use tracing" },
]