diff --git a/crates/cli/src/commands.rs b/crates/cli/src/commands.rs index b33a93b..cee70bc 100644 --- a/crates/cli/src/commands.rs +++ b/crates/cli/src/commands.rs @@ -418,7 +418,8 @@ fn runtime_location_json( if let Some(located) = project.locate(module_id, span) { location["line"] = json!(located.line); location["column"] = json!(located.column); - location["file"] = json!(located.file.path.display().to_string()); + // Attribution for a shareable snapshot is the project-relative + // path; an absolute host path is environment data, not contract. location["relative_path"] = json!(located.file.module_id.relative_path); } } @@ -444,7 +445,6 @@ fn runtime_error_json(error: &RuntimeError, project: &LoadedProject) -> serde_js "span": location["span"], "line": location["line"], "column": location["column"], - "file": location["file"], "relative_path": location["relative_path"], "frames": frames, }) diff --git a/crates/cli/src/commands/run.rs b/crates/cli/src/commands/run.rs index d95d2fd..7a7ddcd 100644 --- a/crates/cli/src/commands/run.rs +++ b/crates/cli/src/commands/run.rs @@ -49,7 +49,7 @@ pub fn execute( let stream = events.as_ref(); let named_args = match named_args { Ok(args) => args, - Err(message) => return fail(stream, "prepare", "cli.invalid_argument", &message, 2), + Err(message) => return fail(stream, "options", "cli.invalid_argument", &message, 2), }; let options = PrepareOptions { plugins: settings.plugins.clone(), diff --git a/crates/cli/tests/integration_cli.rs b/crates/cli/tests/integration_cli.rs index 4ed93b6..9682e86 100644 --- a/crates/cli/tests/integration_cli.rs +++ b/crates/cli/tests/integration_cli.rs @@ -989,22 +989,11 @@ fn runtime_error_in_imported_module_reports_that_module() { ); assert_eq!(error["relative_path"], "physics.mq.md"); assert!( - error["file"] - .as_str() - .unwrap_or_default() - .ends_with("physics.mq.md"), - "{}", - error["file"] + error.get("file").is_none(), + "a shareable snapshot must not embed an absolute host path: {error}" ); let line = error["line"].as_u64().unwrap_or(0); assert!(line >= 5, "expected the failing statement line, got {line}"); - assert!( - !error["file"] - .as_str() - .unwrap_or_default() - .ends_with("index.mq.md"), - "must not blame the entry file" - ); let human = cli(dir.path(), &["run", "index.mq.md"]); assert_exit(&human, 1, "human rendering also fails"); diff --git a/spec/observation.md b/spec/observation.md index d05ec25..0ca64a0 100644 --- a/spec/observation.md +++ b/spec/observation.md @@ -55,7 +55,9 @@ fields. Reject other format identifiers, unknown kinds and invalid payloads. Structural and selected-value events may stop at that point. Lifecycle and committed byte chunks remain subject to their own execution and output limits. The interpreter continues under unchanged program limits. -- `run.completed` contains the explicit return using [Value Wire](value-wire.md). +- Error locations in `run.failed` carry `module_id`, `relative_path`, `line` and +`column`; a snapshot never embeds an absolute host path. `run.completed` +contains the explicit return using [Value Wire](value-wire.md). A result containing a non-transferable handle has a null wire value and identifies its type. An explicit result, like a program print, can itself contain sensitive data. `run.failed` follows a started run and contains diff --git a/spec/resource-provider-v2.md b/spec/resource-provider-v2.md index 6856db3..f727889 100644 --- a/spec/resource-provider-v2.md +++ b/spec/resource-provider-v2.md @@ -223,6 +223,11 @@ Token lifecycle: 6. Provider error codes map to existing categories: `permission.denied`, `resource.closed`, `resource.exhausted`, `resource.unsupported`, otherwise `host.error`. +7. Any transport failure — including a request frame that exceeds the 1 MiB + budget or a malformed reply — kills and reaps the helper. The peer is never + reused after a protocol error, so a program that sends an oversized request + must expect subsequent calls to that provider to fail closed rather than + silently truncate the payload. ## 6. Authorization