feat(host): add trusted C ABI ResourceProvider v1
- Add the frozen marqdo_resource_provider.h ABI (version + open/read/write/ close/last_error) and a libloading-based host adapter with version/symbol checks and callsite-attached host errors (ADR-0036). - Add StdHost::register_c_resource_provider using the same kind/name validation and project-mode name grant as the in-process/worker providers. - Compile a C shared-library test provider; cover round-trip and fail-closed missing-library behavior. Trusted native code, not a sandbox; plugin-Worker binding remains open. - Update ADRs/spec/status/README/changelog and evidence. Gate: fmt, clippy -D warnings, 435 tests passed.
This commit is contained in:
1 parent
01f6fe46a7
commit
b22a89e7b4
15 files changed
+577
-2
No files matched your search
@@ -21,6 +21,7 @@ use crate::context::ExecutionContext;
|
||||
use crate::fs::ProjectFs;
|
||||
use crate::handles::{contains_plugin_handle, PluginHandleTable};
|
||||
use crate::plugin_worker::WorkerPlugin;
|
||||
use crate::provider_c::CResourceProvider;
|
||||
use crate::provider_worker::WorkerResourceProvider;
|
||||
use crate::resource::{ResourceProvider, ResourceRead, ResourceTable, SharedResourceProvider};
|
||||
use crate::trace::{EffectTrace, SemanticEvent, TraceBudget, TraceEntry, TraceState};
|
||||
@@ -582,6 +583,25 @@ impl StdHost {
|
||||
self.register_provider_checked(provider)
|
||||
}
|
||||
|
||||
/// Register a trusted C ABI resource provider (ADR-0036).
|
||||
///
|
||||
/// The shared library runs in the host address space and is **trusted**, not
|
||||
/// sandboxed. Registration still requires the provider-name grant at
|
||||
/// `resource.open` and is project-mode only.
|
||||
pub fn register_c_resource_provider(
|
||||
&mut self,
|
||||
name: &str,
|
||||
kinds: &[&str],
|
||||
library: &std::path::Path,
|
||||
) -> Result<(), RuntimeError> {
|
||||
let kinds = kinds
|
||||
.iter()
|
||||
.map(|kind| (*kind).to_string())
|
||||
.collect::<Vec<_>>();
|
||||
let provider = CResourceProvider::open(name, &kinds, library)?;
|
||||
self.register_provider_checked(Box::new(provider))
|
||||
}
|
||||
|
||||
/// Register a trusted worker-process resource provider (ADR-0035).
|
||||
///
|
||||
/// The helper speaks framed JSON over stdin/stdout and is **not** an OS
|
||||
|
||||
Reference in new issue
Block a user