Conversation
Precondition work so the rust toolchain gates pass at all — the workspace was written before this box's rustfmt/clippy, and the current toolchain reformats it and fires lints on the existing code: - cargo fmt --all (mechanical, no semantic change) - studio-compose: implement std::iter::FromIterator for SkillsLibrary instead of an inherent from_iter (should_implement_trait) - studio-cp: derive Default for FleetRuntime (derivable_impls); use `?` in role_identity (question_mark); crate-level allow too_many_arguments for the flat dispatch-arg provision/observe API — same class of allowance already used on this call surface's callers. Same normalization the still-open openabdev#163 branch landed for the same gates; no behavior change intended. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…studio#135) The studio#135 mirror writes `<folder>/<name>/config.toml` from inside the sidecar before anything touches S3, but `name` went straight into `Path::join` — and `deploy_provision_agent` is a public MCP tool any caller (the console wizard's free-text Agent-name field, or a direct "admin agent" call) can drive. A `name` of `../x`, `a/b`, or an absolute path escaped the operator's Config folder and wrote `config.toml` wherever the sidecar can reach — and the local mirror "succeeding" before the deploy later fails on a bad name also broke the local-first ordering the feature promises. write_local_agent_config now refuses anything that isn't a single normal path component (rejects `..`, `.`, embedded separators — `\` explicitly, since it's only a separator on Windows — and absolute paths) before any filesystem write, and is `pub` so the containment contract is exercised directly by an integration test. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #135
Summary
The studio#135 mirror (
write_local_agent_config→<config folder>/<name>/config.toml, wired in #136) joined a caller-controllednamestraight into the Config-folder path.deploy_provision_agentis a public MCP tool — the console wizard's free-text Agent-name field or a direct MCP/"admin agent" call — soname = "../x",a/b, or an absolute path escaped the folder and wroteconfig.tomlwherever the sidecar can reach, before the deploy could reject the bad name. This also weakened the local-first ordering the feature promises: the local write could "succeed" on a name the deploy later refuses.studio_cp::write_local_agent_confignow refuses anything that isn't a single normal path component (..,., embedded/, absolute paths) before any filesystem write;\is refused explicitly sincePath::componentsonly treats it as a separator on Windows.read_local_agent_config(src-tauri) — review flagged it performing the same unsanitized join.puband exercised by a new integration test (crates/studio-cp/tests/local_agent_config.rs) covering plain names, every traversal shape, and that a refused name writes nothing anywhere.deploy_provision_agent'slocal_config_folderschema description now documents the refusal.Also includes a separate
chore:commit normalizing workspace formatting + satisfying clippy under the current stable toolchain (same precondition the #104/#163 branches needed for these gates).Test plan
cargo test -p studio-cp --test local_agent_config— 2/2 passcargo fmt --all -- --check,cargo test --workspace(225 tests),cargo clippy --workspace --all-targets -- -D warnings— all cleanverify_issue.py— all five gates pass (incl. red replay: test fails compile on base because the fn was private)Generated with Devin