Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
20fc7f9
refactor(runtime): centralize capability outcome processing
henrypark133 Aug 17, 2026
74449c9
test(runtime): pin inline invocation modes through the response proce…
henrypark133 Aug 17, 2026
c4d7e41
docs+test(runtime): fix dispatch-result attribution, pin approval-loo…
henrypark133 Aug 17, 2026
f88f3d5
test(runtime): assert grant consumption in approval-resume contract test
henrypark133 Aug 17, 2026
638c82e
docs(runtime): restore relocated rationale comments, drop stale refer…
henrypark133 Aug 17, 2026
2e38668
test(qa): await fired routine finalization
henrypark133 Aug 19, 2026
84ff78a
fix(mcp): reject CallToolResult.isError instead of passing it as success
henrypark133 Aug 17, 2026
b388c30
fix(extensions): normalize provider failures for model context
henrypark133 Aug 17, 2026
7a391d9
fix(runtime): terminalize resumed dispatch failures
henrypark133 Aug 17, 2026
d828f8e
fix(runtime): keep preflight missing credentials routed to the auth gate
henrypark133 Aug 17, 2026
7ef3ef7
fix(runtime): scrub provider diagnostics before guest-visible failures
henrypark133 Aug 17, 2026
bfe0f5e
fix(extensions): cover ToolError::Rejected in remaining exhaustive ma…
henrypark133 Aug 17, 2026
c708ffe
test+fix(extensions): pin the scrub chokepoint and provider-diagnosti…
henrypark133 Aug 17, 2026
5ee4e14
refactor(contracts): drop the unused dispatch attempt accounting carrier
henrypark133 Aug 17, 2026
4587b16
fix(github): carry the provider 401 message in the guest error envelope
henrypark133 Aug 17, 2026
3e1b359
feat(wasm): typed WIT tool response with legacy fallback
henrypark133 Aug 17, 2026
bf69b86
feat(extensions): migrate bundled WASM guests to the typed tool response
henrypark133 Aug 17, 2026
32dbc8d
test(runtime): move host-runtime WAT harness to the 0.4.0 tool contract
henrypark133 Aug 17, 2026
c532490
fix(wasm): carry provider 401 code and message through the typed resp…
henrypark133 Aug 17, 2026
e11e55d
fix(wasm): review follow-ups — bound 401 message, gate legacy retry, …
henrypark133 Aug 17, 2026
0faf908
fix(wasm): more review follow-ups on the typed tool response
henrypark133 Aug 17, 2026
de67857
fix(safety): redact credential-shaped tokens in provider error bodies
henrypark133 Aug 17, 2026
31079e6
fix(github): keep one 401 message-capture mechanism after the typed m…
henrypark133 Aug 17, 2026
699755e
refactor(contracts): retire lane-named DispatchError variants
henrypark133 Aug 17, 2026
d815a1f
chore(wasm): remove the 0.3.0 legacy tool-response fallback
henrypark133 Aug 17, 2026
f96c079
fix(contracts): redact rejection detail in Debug, centralize Rejected…
henrypark133 Aug 17, 2026
91c82fa
test(wasm): add direct coverage for classify_instantiation_error
henrypark133 Aug 17, 2026
fcdd718
fix(contracts): stop vendor causes from displacing host failure summa…
henrypark133 Aug 17, 2026
516bee1
Address PR review feedback (#7711)
henrypark133 Aug 18, 2026
d82cd1f
Fix stale WASM contract guidance (#7711)
henrypark133 Aug 18, 2026
0616797
Format PR review regression tests (#7711)
henrypark133 Aug 18, 2026
89f3f3b
Converge extension tool failures (#7711)
henrypark133 Aug 19, 2026
16ac805
Rebuild Slack guest for typed failures (#7711)
henrypark133 Aug 19, 2026
0c08e2b
Merge main and refresh typed WASM failures
henrypark133 Aug 20, 2026
e34e786
test(wasm): cover every failure discriminant
henrypark133 Aug 20, 2026
a6e4838
docs(wasm): remove stale WIT version references
henrypark133 Aug 20, 2026
4216a80
Merge branch 'main' into fix/7627-dispatch-error-cleanup
henrypark133 Aug 20, 2026
27b11d0
fix(runtime): address typed failure boundary review
henrypark133 Aug 20, 2026
9fb70f3
Merge remote-tracking branch 'origin/main' into fix/7627-dispatch-err…
henrypark133 Aug 20, 2026
551bbf6
Address PR review feedback (#7711)
henrypark133 Aug 21, 2026
54609df
Fix Reborn integration fixture diagnostics (#7711)
henrypark133 Aug 21, 2026
612f552
Apply Rust 1.98 formatting (#7711)
henrypark133 Aug 21, 2026
6b0e45e
Address remaining PR review gaps
henrypark133 Aug 21, 2026
619847e
Fix merge-queue Clippy failure
henrypark133 Aug 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1287,15 +1287,10 @@ const ALLOWLIST: &[(&str, &str)] = &[
"github",
),
("crates/ironclaw_assistant/src/workflow.rs", "slack"),
("crates/ironclaw_host_api/src/dispatch.rs", "slack"),
(
"crates/ironclaw_host_runtime/src/first_party_tools/schemas.rs",
"slack",
),
(
"crates/ironclaw_host_runtime/src/services/wasm_execution.rs",
"slack",
),
("crates/ironclaw_loop_host/src/tool_disclosure.rs", "google"),
(
"crates/ironclaw_loop_host/src/tool_disclosure.rs",
Expand Down Expand Up @@ -1694,7 +1689,13 @@ const ALLOWLIST: &[(&str, &str)] = &[
// `loop_driver_host.rs`/"slack" carve-out was retired when the channel-context
// forwarding it described was reworked, so its now-stale allowlist entry was
// deleted — the ratchet only ever shrinks.
const WS0_EXTENSION_SPECIFICITY_ALLOWLIST_BASELINE: usize = 112;
// 112 -> 110 (retire lane-named DispatchError variants, PR 4 stage 1): the
// `ironclaw_host_api/src/dispatch.rs`/"slack" and
// `ironclaw_host_runtime/src/services/wasm_execution.rs`/"slack" carve-outs
// named doc-comment examples on the retired `DispatchError::Wasm` variant;
// deleting the variant deleted the examples, so the now-stale allowlist
// entries were deleted too.
const WS0_EXTENSION_SPECIFICITY_ALLOWLIST_BASELINE: usize = 110;

/// §11.2.8 vendor-scope shrink, armed at the WS0 baseline.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,20 @@ const RETIRED_TYPES: &[&str] = &[
// retried), not free text that lets a producer skip classifying.
"CapabilityFailureKindValue",
"FailureKindValue",
"DispatchError::Mcp",
"DispatchError::Script",
"DispatchError::Wasm",
"DispatchError::FirstParty",
"DispatchErrorLane",
"dispatch_error_lane",
"ToolError::Failed",
];

// Crate paths are spelled flat (`crates/ironclaw_x/...`) and RESOLVED through
// the crate inventory, so the family move (PROPOSAL section 5) repoints them
// without editing the literals. Identity on today's tree - pinned by
// `reborn_crate_inventory.rs` (CHECKLIST WS10).
use ratchet_support::{crate_path, workspace_root};
use ratchet_support::{crate_path, strip_comments_and_strings, workspace_root};

/// Conversion helpers that existed only to move a value between two spellings
/// of the same domain. Their absence is what proves the collapse is real
Expand Down Expand Up @@ -79,55 +86,6 @@ const RETIRED_MAPPERS: &[&str] = &[
/// invent one. A retired type name inside a string literal would be
/// stringly-typed handling of the exact domain this collapse made typed, so
/// the blind spot is not worth a real parser.
fn strip_comments(source: &str) -> String {
let bytes = source.as_bytes();
let mut out = String::with_capacity(source.len());
let mut index = 0usize;
// Depth, not a bool: Rust block comments nest (`/* /* … */ still comment */`),
// so a bool would exit at the first `*/` and scan the tail as code.
let mut depth = 0usize;
while index < bytes.len() {
let byte = bytes[index];
if depth > 0 {
if byte == b'/' && bytes.get(index + 1) == Some(&b'*') {
depth += 1;
out.push(' ');
out.push(' ');
index += 2;
continue;
}
if byte == b'*' && bytes.get(index + 1) == Some(&b'/') {
depth -= 1;
out.push(' ');
out.push(' ');
index += 2;
continue;
}
// Keep newlines so reported line numbers stay accurate.
out.push(if byte == b'\n' { '\n' } else { ' ' });
index += 1;
continue;
}
if byte == b'/' && bytes.get(index + 1) == Some(&b'*') {
depth = 1;
out.push(' ');
out.push(' ');
index += 2;
continue;
}
if byte == b'/' && bytes.get(index + 1) == Some(&b'/') {
while index < bytes.len() && bytes[index] != b'\n' {
out.push(' ');
index += 1;
}
continue;
}
out.push(byte as char);
index += 1;
}
out
}

/// Scan one directory tree, failing loudly on anything unreadable.
///
/// A gate that silently skips a path it cannot read is a gate that passes
Expand Down Expand Up @@ -164,7 +122,7 @@ fn scan_dir(root: &Path, dir: &Path, hits: &mut Vec<String>) -> std::io::Result<
}
let contents = std::fs::read_to_string(&path)
.map_err(|error| std::io::Error::other(format!("read {relative}: {error}")))?;
for (number, line) in strip_comments(&contents).lines().enumerate() {
for (number, line) in strip_comments_and_strings(&contents).lines().enumerate() {
if line.trim().is_empty() {
continue;
}
Expand Down Expand Up @@ -207,7 +165,7 @@ fn the_surviving_failure_vocabulary_stays_closed() {
.unwrap_or_else(|error| panic!("read {}: {error}", result_meta.display()));
// Same rule as the scan above: prose explaining the retired open set is
// worth keeping, so only code is policed.
let contents = strip_comments(&raw);
let contents = strip_comments_and_strings(&raw);

assert!(
contents.contains("Unclassified"),
Expand All @@ -228,15 +186,65 @@ fn the_surviving_failure_vocabulary_stays_closed() {
);
}

fn assert_tool_error_rejected_uses_runtime_kind(contents: &str) {
let rejected = contents
.split("pub enum ToolError")
.nth(1)
.expect("pub enum ToolError")
.split("Rejected {")
.nth(1)
.and_then(|tail| tail.split('}').next())
.expect("ToolError::Rejected variant");

assert!(
rejected.contains("kind: RuntimeDispatchErrorKind"),
"extension adapters may report runtime failures only; trusted dispatch owns control-plane kinds"
);
assert!(
!rejected.contains("DispatchFailureKind"),
"ToolError::Rejected must not accept the host's control-plane failure taxonomy"
);
}

#[test]
fn extension_tool_errors_cannot_mint_control_plane_failure_kinds() {
let root = workspace_root();
let tool_adapter = crate_path(
&root,
"crates/ironclaw_extension_contracts/src/tool_adapter.rs",
);
let raw = std::fs::read_to_string(&tool_adapter)
.unwrap_or_else(|error| panic!("read {}: {error}", tool_adapter.display()));
let contents = strip_comments_and_strings(&raw);

assert_tool_error_rejected_uses_runtime_kind(&contents);
}

#[test]
#[should_panic(expected = "extension adapters may report runtime failures only")]
fn extension_tool_error_scope_ratchet_rejects_malformed_source() {
let malformed = r#"
enum UnrelatedError {
Rejected { kind: RuntimeDispatchErrorKind },
}

pub enum ToolError {
Rejected { kind: DispatchFailureKind },
}
"#;

assert_tool_error_rejected_uses_runtime_kind(malformed);
}

/// The comment contract is a promise this gate makes to every file it scans,
/// so it gets its own coverage rather than being trusted. A guardrail whose
/// exemption rule is untested is a guardrail that silently changes meaning.
#[cfg(test)]
mod strip_comments_tests {
use super::strip_comments;
use super::strip_comments_and_strings;

fn scans_as_code(source: &str, term: &str) -> bool {
strip_comments(source).contains(term)
strip_comments_and_strings(source).contains(term)
}

#[test]
Expand Down Expand Up @@ -285,7 +293,8 @@ mod strip_comments_tests {
#[test]
fn line_numbers_survive_stripping() {
// Hits are reported by line, so blanking must preserve newlines.
let stripped = strip_comments("/* one\ntwo\nthree */\npub enum CapabilityErrorClass {}");
let stripped =
strip_comments_and_strings("/* one\ntwo\nthree */\npub enum CapabilityErrorClass {}");
let line = stripped
.lines()
.position(|line| line.contains("CapabilityErrorClass"))
Expand Down
Loading
Loading