This commit is contained in:
commit
f8b82d4143
94 files changed
+3905
-546
No files matched your search
@@ -18,6 +18,7 @@ marqdo-frontend = { workspace = true }
|
||||
marqdo-foreign = { workspace = true }
|
||||
marqdo-plugin-abi = { workspace = true }
|
||||
marqdo-host = { workspace = true }
|
||||
marqdo-host-contract = { workspace = true }
|
||||
marqdo-runtime = { workspace = true }
|
||||
marqdo-package = { workspace = true }
|
||||
marqdo-sandbox = { workspace = true }
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use marqdo_host::{Host, StdHost};
|
||||
use marqdo_host::StdHost;
|
||||
use marqdo_host_contract::Host;
|
||||
use marqdo_runtime::{run_with_limits, EvaluatedArg, MemoryLimits, RuntimeError, Value};
|
||||
use marqdo_sandbox::{PlatformCapabilities, SandboxMode, StrictOutcome};
|
||||
use marqdo_span::Span;
|
||||
@@ -270,12 +271,12 @@ fn load_plugin_into_host(
|
||||
.parent()
|
||||
.map(|parent| parent.to_path_buf())
|
||||
.unwrap_or_else(|| PathBuf::from("."));
|
||||
let manifest = marqdo_plugin_abi::PluginManifest::load(&manifest_path)
|
||||
let manifest = marqdo_host::plugin::PluginManifest::load(&manifest_path)
|
||||
.map_err(|error| format!("{}: {}", error.code, error.message))?;
|
||||
manifest
|
||||
.validate()
|
||||
.map_err(|error| format!("{}: {}", error.code, error.message))?;
|
||||
if manifest.plugin.kind == marqdo_plugin_abi::PluginKind::Native && !trusted {
|
||||
if manifest.plugin.kind == marqdo_host::plugin::PluginKind::Native && !trusted {
|
||||
return Err(format!(
|
||||
"loading `{}` in-process requires --trust-native-plugin; use `kind: worker` for crash isolation",
|
||||
manifest.plugin.name
|
||||
|
||||
@@ -274,7 +274,7 @@ pub fn execute(
|
||||
&& static_plugins
|
||||
.plugins
|
||||
.iter()
|
||||
.any(|plugin| plugin.kind == marqdo_plugin_abi::PluginKind::Native)
|
||||
.any(|plugin| plugin.kind == marqdo_host::plugin::PluginKind::Native)
|
||||
{
|
||||
return fail(
|
||||
stream,
|
||||
@@ -558,9 +558,9 @@ mod tests {
|
||||
base_dir: PathBuf::from("/fixtures/demo"),
|
||||
package: "demo.ext".into(),
|
||||
version: "0.1.0".into(),
|
||||
kind: marqdo_plugin_abi::PluginKind::Worker,
|
||||
kind: marqdo_host::plugin::PluginKind::Worker,
|
||||
manifest_sha256: format!("sha256:{}", "b".repeat(64)),
|
||||
artifact_target: marqdo_plugin_abi::HostTarget::current()
|
||||
artifact_target: marqdo_host::plugin::HostTarget::current()
|
||||
.triple()
|
||||
.to_string(),
|
||||
artifact_sha256: "a".repeat(64),
|
||||
|
||||
@@ -44,7 +44,7 @@ pub fn plugin_inspect(target: &Path, json: bool) -> i32 {
|
||||
.parent()
|
||||
.map(|parent| parent.to_path_buf())
|
||||
.unwrap_or_else(|| PathBuf::from("."));
|
||||
let manifest = match marqdo_plugin_abi::PluginManifest::load(&manifest_path) {
|
||||
let manifest = match marqdo_host::plugin::PluginManifest::load(&manifest_path) {
|
||||
Ok(manifest) => manifest,
|
||||
Err(error) => {
|
||||
report_plugin_error(&error, json);
|
||||
@@ -55,7 +55,7 @@ pub fn plugin_inspect(target: &Path, json: bool) -> i32 {
|
||||
report_plugin_error(&error, json);
|
||||
return 1;
|
||||
}
|
||||
let host_target = marqdo_plugin_abi::HostTarget::current();
|
||||
let host_target = marqdo_host::plugin::HostTarget::current();
|
||||
let artifact = match manifest.verify_artifact(&base_dir, &host_target) {
|
||||
Ok((path, artifact)) => {
|
||||
let abi = match manifest.abi_requirement() {
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
use std::collections::BTreeSet;
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
|
||||
use marqdo_host::plugin::{HostTarget, PluginKind, PluginManifest};
|
||||
use marqdo_ir::callable::{CallableDescriptor, CallableId, CallableOrigin, CallableSignature};
|
||||
use marqdo_ir::SignatureKind;
|
||||
use marqdo_plugin_abi::{HostTarget, PluginKind, PluginManifest};
|
||||
use marqdo_span::Span;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
|
||||
@@ -81,12 +81,12 @@ fn plugin_identity(extension: &ResolvedExtension) -> Result<LockedExtension, Pre
|
||||
),
|
||||
)
|
||||
})?;
|
||||
let manifest = marqdo_plugin_abi::PluginManifest::load(&extension.path)
|
||||
let manifest = marqdo_host::plugin::PluginManifest::load(&extension.path)
|
||||
.map_err(|error| PrepareError::option(error.code.clone(), error.message.clone()))?;
|
||||
manifest
|
||||
.validate()
|
||||
.map_err(|error| PrepareError::option(error.code.clone(), error.message.clone()))?;
|
||||
let host = marqdo_plugin_abi::HostTarget::current();
|
||||
let host = marqdo_host::plugin::HostTarget::current();
|
||||
let artifact = manifest
|
||||
.resolve_artifact(&host)
|
||||
.map_err(|error| PrepareError::option("ext.no_matching_artifact", error.message))?;
|
||||
@@ -161,7 +161,7 @@ fn provider_identity(extension: &ResolvedExtension) -> Result<LockedExtension, P
|
||||
format!("`{}` has no version", extension.path.display()),
|
||||
)
|
||||
})?;
|
||||
let target = marqdo_plugin_abi::HostTarget::current()
|
||||
let target = marqdo_host::plugin::HostTarget::current()
|
||||
.triple()
|
||||
.to_string();
|
||||
let artifacts = manifest
|
||||
@@ -293,7 +293,7 @@ fn kernel_identity(extension: &ResolvedExtension) -> Result<LockedExtension, Pre
|
||||
version: format!("wire:{wire_version}"),
|
||||
manifest_digest: hex(&Sha256::digest(&manifest_bytes)),
|
||||
artifact_digest: digest.to_ascii_lowercase(),
|
||||
selected_target: marqdo_plugin_abi::HostTarget::current()
|
||||
selected_target: marqdo_host::plugin::HostTarget::current()
|
||||
.triple()
|
||||
.to_string(),
|
||||
source: extension.from.clone(),
|
||||
|
||||
@@ -500,7 +500,7 @@ fn dispatch() -> i32 {
|
||||
},
|
||||
Command::External(args) => tool::dispatch(&args),
|
||||
Command::PluginWorker(args) => {
|
||||
marqdo_plugin_abi::worker::serve(&args.manifest, &args.base_dir)
|
||||
marqdo_host::plugin::worker::serve(&args.manifest, &args.base_dir)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ use std::rc::Rc;
|
||||
use std::time::{SystemTime, UNIX_EPOCH};
|
||||
|
||||
use marqdo_host::{
|
||||
FrameId, ObservationConfig, ObservationError, ObservationEvent, ObservationSink,
|
||||
ParameterSource, ValueState, DEFAULT_MAX_OBSERVATION_BYTES, DEFAULT_MAX_OBSERVATION_EVENTS,
|
||||
DEFAULT_MAX_VALUE_BYTES,
|
||||
ObservationConfig, ObservationError, ObservationEvent, ObservationSink, ValueState,
|
||||
DEFAULT_MAX_OBSERVATION_BYTES, DEFAULT_MAX_OBSERVATION_EVENTS, DEFAULT_MAX_VALUE_BYTES,
|
||||
};
|
||||
use marqdo_host_contract::{FrameId, ParameterSource};
|
||||
use marqdo_value::Value;
|
||||
use serde_json::{json, Value as Json};
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use marqdo_host::plugin::{HostTarget, TargetTriple};
|
||||
use marqdo_host::StdHost;
|
||||
use marqdo_plugin_abi::{HostTarget, TargetTriple};
|
||||
use serde::Deserialize;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
@@ -577,7 +577,7 @@ fn is_lowercase_sha256(value: &str) -> bool {
|
||||
}
|
||||
|
||||
fn is_known_capability(name: &str) -> bool {
|
||||
marqdo_plugin_abi::KNOWN_CAPABILITIES.contains(&name)
|
||||
marqdo_host::plugin::KNOWN_CAPABILITIES.contains(&name)
|
||||
}
|
||||
|
||||
/// A dotted vendor capability proposal (validation only, never a grant).
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
//! Architecture boundary gate (review RFC-CM P0/P1).
|
||||
//!
|
||||
//! These checks pin the documented layering: the runtime depends on the host
|
||||
//! platform layer, the bundled stdlib stays in this repository, `std:` import
|
||||
//! targets resolve only inside the bundle, and the host keeps the documented
|
||||
//! stdio/file/TCP resource endpoints. They are source and digest checks, not an
|
||||
//! OS-sandbox proof.
|
||||
//! These checks pin the documented layering: the engine depends on the neutral
|
||||
//! Host contract (never the native host), the plugin ABI contract carries no
|
||||
//! loader/worker execution side, the bundled stdlib stays in this repository,
|
||||
//! `std:` import targets resolve only inside the bundle, and the host keeps the
|
||||
//! documented stdio/file/TCP resource endpoints. They are source and digest
|
||||
//! checks, not an OS-sandbox proof; `tools/ci/check_dependency_boundaries.py`
|
||||
//! adds the Cargo-metadata graph gate.
|
||||
|
||||
#[path = "support/stdlib.rs"]
|
||||
pub mod stdlib_support;
|
||||
@@ -26,66 +28,114 @@ fn read(path: &Path) -> String {
|
||||
std::fs::read_to_string(path).unwrap_or_else(|error| panic!("read {}: {error}", path.display()))
|
||||
}
|
||||
|
||||
const WORKSPACE_CRATES: &[&str] = &[
|
||||
"marqdo-span",
|
||||
"marqdo-value",
|
||||
"marqdo-expression",
|
||||
"marqdo-markdown",
|
||||
"marqdo-ir",
|
||||
"marqdo-frontend",
|
||||
"marqdo-foreign",
|
||||
"marqdo-plugin-abi",
|
||||
"marqdo-provider-worker",
|
||||
"marqdo-worker-ipc",
|
||||
"marqdo-plugin-sdk",
|
||||
"marqdo-host",
|
||||
"marqdo-runtime",
|
||||
"marqdo-package",
|
||||
"marqdo-sandbox",
|
||||
"cli",
|
||||
];
|
||||
|
||||
/// Issue #13 / ADR-0071: the reviewed responsibility allowlist is the crate
|
||||
/// table in the single current architecture overview, not a frozen count. A new
|
||||
/// crate must be added there (and to the dependency gate's reviewed map) in the
|
||||
/// same change.
|
||||
#[test]
|
||||
fn workspace_crates_match_the_documented_layers() {
|
||||
let manifest = read(&repo_root().join("Cargo.toml"));
|
||||
fn workspace_crates_are_documented_responsibilities() {
|
||||
let root = repo_root();
|
||||
let manifest = read(&root.join("Cargo.toml"));
|
||||
let members = manifest
|
||||
.split("members = [")
|
||||
.nth(1)
|
||||
.and_then(|rest| rest.split(']').next())
|
||||
.expect("workspace members");
|
||||
let names: Vec<&str> = members
|
||||
let names: Vec<String> = members
|
||||
.split(',')
|
||||
.map(|item| item.trim().trim_matches('"'))
|
||||
.filter(|item| !item.is_empty())
|
||||
.map(|member| {
|
||||
let directory = member
|
||||
.strip_prefix("crates/")
|
||||
.expect("workspace members are crates/<name>");
|
||||
let manifest = read(&root.join(member).join("Cargo.toml"));
|
||||
manifest
|
||||
.lines()
|
||||
.find_map(|line| line.strip_prefix("name = "))
|
||||
.map(|name| name.trim().trim_matches('"').to_string())
|
||||
.unwrap_or_else(|| directory.to_string())
|
||||
})
|
||||
.collect();
|
||||
let expected: Vec<String> = WORKSPACE_CRATES
|
||||
.iter()
|
||||
.map(|name| format!("crates/{name}"))
|
||||
.collect();
|
||||
assert_eq!(
|
||||
names,
|
||||
expected.iter().map(String::as_str).collect::<Vec<_>>(),
|
||||
"workspace members drifted; update docs/architecture/CURRENT.md with the layer"
|
||||
);
|
||||
let current = read(&root.join("docs/architecture/CURRENT.md"));
|
||||
let responsibilities = current
|
||||
.split("## Workspace crate responsibility map")
|
||||
.nth(1)
|
||||
.expect("CURRENT.md must own the reviewed crate responsibility map")
|
||||
.split("\n## ")
|
||||
.next()
|
||||
.unwrap_or("");
|
||||
for name in &names {
|
||||
assert!(
|
||||
responsibilities.contains(&format!("`{name}`")),
|
||||
"workspace crate `{name}` has no documented responsibility in CURRENT.md"
|
||||
);
|
||||
}
|
||||
for name in [
|
||||
"marqdo-host-contract",
|
||||
"marqdo-host",
|
||||
"marqdo-plugin-abi",
|
||||
"marqdo-cli",
|
||||
] {
|
||||
assert!(
|
||||
names.iter().any(|crate_name| crate_name == name),
|
||||
"required layer crate `{name}` is missing from the workspace"
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
!names.contains(&"crates/marqdo-stdlib"),
|
||||
"the stdlib must stay in this repository (ADR-0039), not become a crate"
|
||||
!names.iter().any(|name| name == "marqdo-stdlib"),
|
||||
"the stdlib is a Bundle input, not a workspace crate (ADR-0039/ADR-0070)"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_depends_on_the_host_platform_layer_without_a_cycle() {
|
||||
let runtime = read(&repo_root().join("crates/marqdo-runtime/Cargo.toml"));
|
||||
fn engine_depends_on_the_neutral_host_contract_only() {
|
||||
let root = repo_root();
|
||||
let runtime = read(&root.join("crates/marqdo-runtime/Cargo.toml"));
|
||||
let runtime_dependencies = runtime
|
||||
.split("[dependencies]")
|
||||
.nth(1)
|
||||
.expect("runtime dependencies")
|
||||
.split("[dev-dependencies]")
|
||||
.next()
|
||||
.expect("runtime normal dependencies");
|
||||
assert!(
|
||||
runtime
|
||||
runtime_dependencies
|
||||
.lines()
|
||||
.any(|line| line.trim() == "marqdo-host-contract = { workspace = true }"),
|
||||
"runtime must depend on the neutral marqdo-host-contract crate"
|
||||
);
|
||||
assert!(
|
||||
!runtime_dependencies
|
||||
.lines()
|
||||
.any(|line| line.trim() == "marqdo-host = { workspace = true }"),
|
||||
"runtime must keep the documented marqdo-runtime -> marqdo-host direction"
|
||||
"runtime normal/build dependencies must not link the native host"
|
||||
);
|
||||
let host = read(&repo_root().join("crates/marqdo-host/Cargo.toml"));
|
||||
let contract = read(&root.join("crates/marqdo-host-contract/Cargo.toml"));
|
||||
let contract_deps: Vec<&str> = contract
|
||||
.split("[dependencies]")
|
||||
.nth(1)
|
||||
.expect("contract dependencies")
|
||||
.lines()
|
||||
.filter_map(|line| line.split('=').next())
|
||||
.map(str::trim)
|
||||
.filter(|name| !name.is_empty() && !name.starts_with('['))
|
||||
.collect();
|
||||
assert_eq!(
|
||||
contract_deps,
|
||||
["marqdo-span", "marqdo-value"],
|
||||
"the host contract must stay platform neutral (value/span only)"
|
||||
);
|
||||
let host = read(&root.join("crates/marqdo-host/Cargo.toml"));
|
||||
for forbidden in ["marqdo-runtime", "marqdo-frontend", "marqdo-ir ="] {
|
||||
assert!(
|
||||
!host.contains(forbidden),
|
||||
"the native host must not depend back on `{forbidden}`"
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
!host.contains("marqdo-runtime"),
|
||||
"marqdo-host must not depend back on marqdo-runtime"
|
||||
host.contains("marqdo-host-contract = { workspace = true }"),
|
||||
"the native host must implement the neutral contract crate"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -163,7 +213,6 @@ fn shared_worker_transport_is_neutral_and_not_duplicated() {
|
||||
}
|
||||
for user in [
|
||||
"crates/marqdo-host/Cargo.toml",
|
||||
"crates/marqdo-plugin-abi/Cargo.toml",
|
||||
"crates/marqdo-provider-worker/Cargo.toml",
|
||||
] {
|
||||
assert!(
|
||||
@@ -174,8 +223,8 @@ fn shared_worker_transport_is_neutral_and_not_duplicated() {
|
||||
// The four-byte length prefix and its bounds live in exactly one crate.
|
||||
for private in [
|
||||
"crates/marqdo-host/src/plugin_worker.rs",
|
||||
"crates/marqdo-host/src/plugin/worker.rs",
|
||||
"crates/marqdo-host/src/provider_worker.rs",
|
||||
"crates/marqdo-plugin-abi/src/worker.rs",
|
||||
"crates/marqdo-provider-worker/src/main.rs",
|
||||
] {
|
||||
let text = read(&root.join(private));
|
||||
@@ -419,12 +468,12 @@ fn builtin_names_and_aliases_are_reviewed() {
|
||||
}
|
||||
|
||||
// Exhaustive matches make a new HostOp or Value variant require review under ADR-0064.
|
||||
const _: fn(marqdo_host::HostOp) = |operation| match operation {
|
||||
marqdo_host::HostOp::ForeignRun
|
||||
| marqdo_host::HostOp::ForeignCall
|
||||
| marqdo_host::HostOp::FsRead
|
||||
| marqdo_host::HostOp::FsWrite
|
||||
| marqdo_host::HostOp::PluginInvoke => (),
|
||||
const _: fn(marqdo_host_contract::HostOp) = |operation| match operation {
|
||||
marqdo_host_contract::HostOp::ForeignRun
|
||||
| marqdo_host_contract::HostOp::ForeignCall
|
||||
| marqdo_host_contract::HostOp::FsRead
|
||||
| marqdo_host_contract::HostOp::FsWrite
|
||||
| marqdo_host_contract::HostOp::PluginInvoke => (),
|
||||
};
|
||||
|
||||
const _: fn(marqdo_value::Value) = |value| match value {
|
||||
@@ -575,6 +624,129 @@ fn domain_math_kernel_is_not_part_of_the_core() {
|
||||
}
|
||||
}
|
||||
|
||||
/// E02/E03: there is exactly one Host trait/HostOp definition and it belongs to
|
||||
/// the neutral contract; the native host only implements it.
|
||||
#[test]
|
||||
fn host_contract_is_the_single_side_effect_interface() {
|
||||
let root = repo_root();
|
||||
let mut host_traits = Vec::new();
|
||||
let mut host_ops = Vec::new();
|
||||
for source in walk_rs(&root.join("crates")) {
|
||||
let relative = source
|
||||
.strip_prefix(&root)
|
||||
.unwrap()
|
||||
.to_string_lossy()
|
||||
.to_string();
|
||||
if relative.contains("/tests/") {
|
||||
continue;
|
||||
}
|
||||
let text = read(&source);
|
||||
if text.contains("pub trait Host {") {
|
||||
host_traits.push(relative.clone());
|
||||
}
|
||||
if text.contains("pub enum HostOp {") {
|
||||
host_ops.push(relative);
|
||||
}
|
||||
}
|
||||
assert_eq!(
|
||||
host_traits,
|
||||
["crates/marqdo-host-contract/src/host.rs"],
|
||||
"the Host trait must be defined once in the neutral contract"
|
||||
);
|
||||
assert_eq!(
|
||||
host_ops,
|
||||
["crates/marqdo-host-contract/src/host.rs"],
|
||||
"HostOp must be defined once in the neutral contract"
|
||||
);
|
||||
let runtime = read(&root.join("crates/marqdo-runtime/src/interpreter.rs"));
|
||||
assert!(
|
||||
runtime.contains("use marqdo_host_contract::{"),
|
||||
"the interpreter must consume the neutral contract"
|
||||
);
|
||||
let host = read(&root.join("crates/marqdo-host/src/host.rs"));
|
||||
assert!(
|
||||
host.contains("impl Host for StdHost"),
|
||||
"StdHost remains the single native host implementation"
|
||||
);
|
||||
}
|
||||
|
||||
/// A05/S01: the public ABI crate is a contract, not a loader; execution side
|
||||
/// lives in the native host and the SDK consumes only the contract.
|
||||
#[test]
|
||||
fn plugin_contract_carries_no_native_execution() {
|
||||
let root = repo_root();
|
||||
let abi = read(&root.join("crates/marqdo-plugin-abi/Cargo.toml"));
|
||||
for forbidden in ["libloading", "marqdo-worker-ipc", "serde_yaml", "sha2"] {
|
||||
assert!(
|
||||
!abi.contains(forbidden),
|
||||
"marqdo-plugin-abi must not depend on execution-side `{forbidden}`"
|
||||
);
|
||||
}
|
||||
for module in ["loader", "worker", "manifest", "artifact"] {
|
||||
assert!(
|
||||
!root
|
||||
.join(format!("crates/marqdo-plugin-abi/src/{module}.rs"))
|
||||
.exists(),
|
||||
"`{module}` is execution-side and belongs to the native host"
|
||||
);
|
||||
}
|
||||
for module in ["loader", "worker", "manifest", "artifact"] {
|
||||
assert!(
|
||||
root.join(format!("crates/marqdo-host/src/plugin/{module}.rs"))
|
||||
.exists(),
|
||||
"native host must own plugin `{module}`"
|
||||
);
|
||||
}
|
||||
let sdk = read(&root.join("crates/marqdo-plugin-sdk/Cargo.toml"));
|
||||
for forbidden in [
|
||||
"marqdo-host",
|
||||
"marqdo-cli",
|
||||
"libloading",
|
||||
"marqdo-worker-ipc",
|
||||
] {
|
||||
assert!(
|
||||
!sdk.contains(forbidden),
|
||||
"the plugin SDK must not depend on `{forbidden}`"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// E01/E04: the independent embedding consumer is a real package outside the
|
||||
/// workspace and depends only on engine crates.
|
||||
#[test]
|
||||
fn embedding_consumer_is_engine_only() {
|
||||
let root = repo_root();
|
||||
let consumer = read(&root.join("tests/embedding/Cargo.toml"));
|
||||
assert!(
|
||||
consumer.contains("[workspace]"),
|
||||
"the embedding consumer must be its own workspace to avoid feature unification"
|
||||
);
|
||||
assert!(
|
||||
consumer.contains("marqdo-runtime"),
|
||||
"the embedding consumer must execute through the real runtime"
|
||||
);
|
||||
for forbidden in [
|
||||
"marqdo-host",
|
||||
"marqdo-cli",
|
||||
"marqdo-sandbox",
|
||||
"marqdo-foreign",
|
||||
] {
|
||||
let dependency_line = format!("\n{forbidden} =");
|
||||
assert!(
|
||||
!consumer.contains(&dependency_line),
|
||||
"the embedding consumer must not depend on `{forbidden}`"
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
root.join("tests/embedding/Cargo.lock").is_file(),
|
||||
"the independent consumer must pin its own lock file"
|
||||
);
|
||||
assert!(
|
||||
root.join("tools/ci/check_engine_boundary.py").is_file(),
|
||||
"the build-and-run engine gate must exist"
|
||||
);
|
||||
}
|
||||
|
||||
fn hex(bytes: &[u8]) -> String {
|
||||
let mut out = String::with_capacity(bytes.len() * 2);
|
||||
for byte in bytes {
|
||||
|
||||
@@ -11,7 +11,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, Output};
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
|
||||
use marqdo_plugin_abi::{sha256_file, HostTarget};
|
||||
use marqdo_host::plugin::{sha256_file, HostTarget};
|
||||
|
||||
static COUNTER: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
|
||||
@@ -25,7 +25,8 @@ pub mod stdlib_support;
|
||||
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use marqdo_host::{Capabilities, Host, StdHost};
|
||||
use marqdo_host::{Capabilities, StdHost};
|
||||
use marqdo_host_contract::Host;
|
||||
use marqdo_ir::{ModuleId, Program, ResolvedImport};
|
||||
use marqdo_runtime::{run, EvaluatedArg};
|
||||
use marqdo_sandbox::SandboxMode;
|
||||
|
||||
@@ -9,7 +9,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, Output};
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
|
||||
use marqdo_plugin_abi::{sha256_file, HostTarget};
|
||||
use marqdo_host::plugin::{sha256_file, HostTarget};
|
||||
|
||||
static COUNTER: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
|
||||
@@ -783,7 +783,7 @@ fn lock_and_sync_locked_detect_dependency_tampering() {
|
||||
/// the Linux-only example manifest. This is what makes the integration test a
|
||||
/// real test on macOS/Windows rather than an accidental "no matching artifact".
|
||||
fn host_triple() -> String {
|
||||
marqdo_plugin_abi::artifact::current_target_triple()
|
||||
marqdo_host::plugin::artifact::current_target_triple()
|
||||
.as_str()
|
||||
.to_string()
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ fn native_plugin_is_fail_closed_in_event_mode() {
|
||||
let digest = hex::encode(sha2::Sha256::digest(fs::read(&artifact).unwrap()));
|
||||
let manifest = format!(
|
||||
"plugin:\n name: demo.solver\n version: 0.1.0\n abi: \"^1.0\"\n kind: native\n exports:\n - name: solver.add\n signature: \"($a: Int, $b: Int) -> Int\"\n requires:\n - math.compute\n artifacts:\n - target: {}\n file: solver.so\n sha256: \"{}\"\n",
|
||||
marqdo_plugin_abi::HostTarget::current().triple(),
|
||||
marqdo_host::plugin::HostTarget::current().triple(),
|
||||
digest
|
||||
);
|
||||
fs::write(plugin_dir.join("plugin.yaml"), manifest).unwrap();
|
||||
|
||||
@@ -5,7 +5,7 @@ use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, Output};
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
|
||||
use marqdo_plugin_abi::{sha256_file, HostTarget};
|
||||
use marqdo_host::plugin::{sha256_file, HostTarget};
|
||||
|
||||
static COUNTER: AtomicU32 = AtomicU32::new(0);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ use std::process::{Command, Output};
|
||||
use std::sync::atomic::{AtomicU32, Ordering};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use marqdo_plugin_abi::HostTarget;
|
||||
use marqdo_host::plugin::HostTarget;
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
const MARKER_ENV: &str = "MARQDO_TEST_PROVIDER_MARKER";
|
||||
|
||||
Reference in new issue
Block a user