Merge remote-tracking branch 'origin/develop' into work/T-604-workdir-symlink-policy
This commit is contained in:
@@ -43,7 +43,6 @@ memory = { workspace = true }
|
||||
uuid = { workspace = true, features = ["v7"] }
|
||||
session-metrics = { workspace = true }
|
||||
arc-swap = "1.9.1"
|
||||
wasmtime = { version = "45.0.2", default-features = false, features = ["std", "runtime", "cranelift", "component-model"] }
|
||||
tungstenite = { version = "0.28.0", default-features = false, features = ["handshake", "native-tls", "url"] }
|
||||
tokio-tungstenite = { version = "0.28.0", default-features = false, features = ["native-tls", "connect"] }
|
||||
futures-util = { version = "0.3", features = ["sink"] }
|
||||
@@ -53,5 +52,3 @@ dotenv = "0.15.0"
|
||||
futures = { workspace = true }
|
||||
serial_test = "3.4.0"
|
||||
tempfile = { workspace = true }
|
||||
wat = "1.241.2"
|
||||
yoi-plugin-pdk = { workspace = true }
|
||||
|
||||
@@ -1386,12 +1386,6 @@ where
|
||||
feature_registry
|
||||
.add_module(crate::feature::builtin::orchestration::orchestration_feature());
|
||||
}
|
||||
for module in crate::feature::plugin::plugin_tool_features_if_enabled(
|
||||
feature_config.plugins.enabled,
|
||||
&worker.manifest().plugins,
|
||||
) {
|
||||
feature_registry = feature_registry.with_module(module);
|
||||
}
|
||||
if let Some(workspace_root) = local_workspace_root.as_ref() {
|
||||
if let Some(module) =
|
||||
crate::feature::mcp::discover_stdio_tool_feature(&mcp_config, workspace_root).await
|
||||
|
||||
@@ -2211,7 +2211,6 @@ pub enum FeatureInstallError {
|
||||
pub mod background;
|
||||
pub mod builtin;
|
||||
pub mod mcp;
|
||||
pub mod plugin;
|
||||
pub(crate) mod session;
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -2224,6 +2223,31 @@ mod tests {
|
||||
use serde_json::json;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
#[test]
|
||||
fn worker_feature_composition_has_no_dynamic_plugin_install_path() {
|
||||
let feature_source = include_str!("feature.rs")
|
||||
.split("#[cfg(test)]")
|
||||
.next()
|
||||
.unwrap();
|
||||
let controller_source = include_str!("controller.rs")
|
||||
.split("#[cfg(test)]")
|
||||
.next()
|
||||
.unwrap();
|
||||
for forbidden in [
|
||||
"pub mod plugin",
|
||||
"plugin_tool_features_if_enabled",
|
||||
"ResolvedPluginRecord",
|
||||
"read_resolved_plugin_runtime_component",
|
||||
"feature.plugins",
|
||||
] {
|
||||
assert!(
|
||||
!feature_source.contains(forbidden) && !controller_source.contains(forbidden),
|
||||
"dynamic Plugin install path returned through {forbidden}"
|
||||
);
|
||||
}
|
||||
assert_eq!(FeatureId::builtin("task").as_str(), "builtin:task");
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
struct DummyClient;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -127,7 +127,6 @@ where
|
||||
// parent manifest cannot accidentally grant its normal public tool surface
|
||||
// or recursively schedule Feature-owned background work.
|
||||
manifest.feature = Default::default();
|
||||
manifest.plugins = Default::default();
|
||||
manifest.mcp = Default::default();
|
||||
manifest.skills = None;
|
||||
manifest.compaction = None;
|
||||
@@ -681,7 +680,6 @@ pub(crate) fn prepare_internal_worker_from_spec(
|
||||
} = spec;
|
||||
manifest.worker.name = format!("internal-{}-{}", identity.kind, identity.run_id);
|
||||
manifest.feature = Default::default();
|
||||
manifest.plugins = Default::default();
|
||||
manifest.mcp = Default::default();
|
||||
manifest.skills = None;
|
||||
manifest.compaction = None;
|
||||
|
||||
@@ -951,7 +951,6 @@ fn manifest_to_reusable_config(manifest: &WorkerManifest) -> WorkerManifestConfi
|
||||
rules: p.rules.clone(),
|
||||
}),
|
||||
feature: manifest.feature.clone().into(),
|
||||
plugins: manifest.plugins.clone(),
|
||||
mcp: manifest.mcp.clone(),
|
||||
compaction: manifest
|
||||
.compaction
|
||||
|
||||
@@ -7753,80 +7753,6 @@ permission = "read"
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn plugin_resolved_manifest_snapshot_is_persisted_without_profile() {
|
||||
let mut manifest = WorkerManifest::from_toml(
|
||||
r#"
|
||||
[worker]
|
||||
name = "plugin-snapshot"
|
||||
|
||||
[model]
|
||||
scheme = "anthropic"
|
||||
model_id = "claude-sonnet-4-20250514"
|
||||
|
||||
[engine]
|
||||
instruction = "saved"
|
||||
|
||||
[[scope.allow]]
|
||||
target = "/snapshot/workspace"
|
||||
permission = "read"
|
||||
"#,
|
||||
)
|
||||
.unwrap();
|
||||
assert!(manifest.profile.is_none());
|
||||
assert!(
|
||||
worker_metadata_for_manifest(&manifest, None, None, None)
|
||||
.resolved_manifest_snapshot
|
||||
.is_none()
|
||||
);
|
||||
|
||||
manifest.plugins.resolved = vec![manifest::plugin::ResolvedPluginRecord {
|
||||
identity: manifest::plugin::SourceQualifiedPluginId::new(
|
||||
manifest::plugin::PluginSourceKind::Project,
|
||||
"example",
|
||||
),
|
||||
source: manifest::plugin::PluginSourceKind::Project,
|
||||
package_path: PathBuf::from("/snapshot/workspace/.yoi/plugins/example.yoi-plugin"),
|
||||
package_label: "example.yoi-plugin".to_string(),
|
||||
digest: "sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
.to_string(),
|
||||
version: "0.1.0".to_string(),
|
||||
manifest: manifest::plugin::PluginPackageManifest {
|
||||
schema_version: 1,
|
||||
id: "example".to_string(),
|
||||
name: "Example".to_string(),
|
||||
version: "0.1.0".to_string(),
|
||||
description: None,
|
||||
surfaces: vec![manifest::plugin::PluginSurface::Hook],
|
||||
runtime: None,
|
||||
hooks: vec![],
|
||||
tools: vec![],
|
||||
services: vec![],
|
||||
ingresses: vec![],
|
||||
permissions: vec![],
|
||||
request: vec![],
|
||||
websocket: vec![],
|
||||
},
|
||||
enabled_surfaces: vec![manifest::plugin::PluginSurface::Hook],
|
||||
grants: manifest::plugin::PluginGrantConfig::default(),
|
||||
config: None,
|
||||
}];
|
||||
|
||||
let metadata = worker_metadata_for_manifest(&manifest, None, None, None);
|
||||
let snapshot = metadata
|
||||
.resolved_manifest_snapshot
|
||||
.expect("plugin-resolved manifest should be snapshotted");
|
||||
let restored = manifest::read_persisted_worker_manifest_snapshot(snapshot).unwrap();
|
||||
|
||||
assert!(restored.profile.is_none());
|
||||
assert_eq!(restored.plugins.resolved.len(), 1);
|
||||
assert_eq!(
|
||||
restored.plugins.resolved[0].digest,
|
||||
"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
);
|
||||
assert_eq!(restored.plugins.resolved[0].version, "0.1.0");
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user