The first half of removing the shared bind mount. Not wired yet — this adds the mechanism and its tests. One cause, four fixes so far: .git/objects permission denied (core.sharedRepository), the capture base being overwritten each phase, COMMIT_EDITMSG root-owned, and reset --hard deleting a prior phase's work (.git/clawmates-in-use). core.sharedRepository was never a general solution — it covers objects and refs, and every OTHER file git touches is a fresh opportunity. Copy-in/copy-out removes the cause instead: the agent owns its filesystem with no second writer. Measured before building, because the plan named copy cost as the open risk: a real 65 MB checkout of this repo copies in 0.23s and out 0.18s on gw-04. Not a risk at this size; re-measure an order of magnitude larger. No compression — the payload crosses a local socket, so gzip would spend CPU to save nothing. Two safety properties, both tested: - The archive comes back from a container the agent controls as ROOT, so it is untrusted input. A `../ESCAPED` entry must not write outside the destination. The test writes the tar header bytes by hand because the tar crate refuses to BUILD such an entry through its safe API — which is reassuring, but means the hostile case has to be constructed the way an attacker would. - Symlinks are packed as links, never dereferenced. Following them on copy-IN would smuggle host files into the container; the test plants a host secret behind a symlink and asserts its contents never appear in the archive. Ownership is deliberately not preserved on unpack: the archive's uids are the container's root, and re-applying them on the host would recreate the exact uid split this exists to remove. 413 tests, clippy clean. Co-Authored-By: Claude Opus 5 <[email protected]>
75 lines
2.2 KiB
TOML
75 lines
2.2 KiB
TOML
[package]
|
|
name = "cm-api"
|
|
version = "0.1.0"
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
license.workspace = true
|
|
publish.workspace = true
|
|
|
|
[dependencies]
|
|
getrandom = "0.2"
|
|
toml = "0.8"
|
|
toml_edit = "0.22"
|
|
serde_yaml = "0.9"
|
|
hex = "0.4"
|
|
hmac = "0.12"
|
|
sha2 = "0.10"
|
|
base64 = "0.22"
|
|
async-stream = "0.3"
|
|
axum = { version = "0.8", features = ["ws"] }
|
|
# Docker API — matches cm-sandbox's version so the workspace resolves cleanly.
|
|
# Used by research_container to spawn/stop per-topic team runtimes via the
|
|
# same socket-proxy the server already talks to.
|
|
bollard = "0.19"
|
|
futures = "0.3"
|
|
serde = { workspace = true }
|
|
serde_json = { workspace = true }
|
|
sqlx = { workspace = true }
|
|
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
|
|
cm-auth = { path = "../cm-auth" }
|
|
cm-billing = { path = "../cm-billing" }
|
|
cm-brain = { path = "../cm-brain" }
|
|
cm-config = { path = "../cm-config" }
|
|
cm-db = { path = "../cm-db" }
|
|
cm-domain = { path = "../cm-domain" }
|
|
cm-files = { path = "../cm-files" }
|
|
tar = { workspace = true }
|
|
cm-llm = { path = "../cm-llm" }
|
|
cm-orchestrator = { path = "../cm-orchestrator", features = ["provider"] }
|
|
cm-runtime = { path = "../cm-runtime" }
|
|
cm-sandbox = { path = "../cm-sandbox" }
|
|
cm-safety = { path = "../cm-safety" }
|
|
async-trait = "0.1"
|
|
cm-scheduler = { path = "../cm-scheduler" }
|
|
cm-secrets = { path = "../cm-secrets" }
|
|
cm-topology = { path = "../cm-topology" }
|
|
thiserror = { workspace = true }
|
|
tokio-tungstenite = { version = "0.26", features = ["rustls-tls-webpki-roots"] }
|
|
tower-http = { version = "0.6", features = ["trace"] }
|
|
time = { workspace = true }
|
|
tokio = { workspace = true }
|
|
urlencoding = "2"
|
|
uuid = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
axum = { version = "0.8", features = ["ws"] }
|
|
tempfile = "3"
|
|
jsonwebtoken = "9"
|
|
eventsource-stream = "0.2"
|
|
reqwest = { version = "0.12", default-features = false, features = [
|
|
"json",
|
|
"rustls-tls",
|
|
"stream",
|
|
] }
|
|
cm-llm = { path = "../cm-llm" }
|
|
cm-testkit = { path = "../cm-testkit" }
|
|
hex = "0.4"
|
|
hmac = "0.12"
|
|
base64 = "0.22"
|
|
rand_core = { version = "0.6", features = ["getrandom"] }
|
|
rsa = { version = "0.9", features = ["pem"] }
|
|
sha2 = "0.10"
|
|
|
|
[lints]
|
|
workspace = true
|