feat(microvm): the tool gate's denials and inert marker reach the mission record
deploy / test (push) Failing after 1m36s
deploy / build (push) Skipped

vm_tool_gate writes denied.jsonl for every call it refuses and an `inert`
marker each time it cannot parse its input and lets the call through. The
guest has written both since the gate existed; nothing read them out of a VM.
A denial, or a gate that had quietly stopped checking, left no trace — the
same shape the container tier closed with drain_inert on 09-14.

The executor probes both files (one exec, while /root still exists) into
VmOutcome.tool_gate; launch_microvm_phase records them on the mission as the
container tier's `gate.inert` (with the count) and `gate.denied` (one event
per refused call, the gate's own JSON as the detail). Absent gate is None,
not zero — "no gate" and "a gate that refused nothing" are different facts.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WZb5A2kfVfjpdwSochkuHz
This commit is contained in:
Omar Sobh
2026-09-18 22:40:26 -05:00
co-authored by Claude Opus 5
parent 507d7444d1
commit 9fc904a056
3 changed files with 112 additions and 0 deletions
+31
View File
@@ -1780,6 +1780,37 @@ async fn launch_microvm_phase(
// contract exists to prevent.
if let Ok(o) = &outcome {
record_vm_tools(&pool2, mission_id, phase_id, run_id, &o.tools, &[]).await;
// The gate's own record, on the mission, in the container tier's
// vocabulary: `gate.inert` when it gave up parsing and allowed
// calls unchecked, `gate.denied` per call it refused. The guest
// wrote both files from day one; this is the first reader.
if let Some(g) = &o.tool_gate {
if g.inert > 0 {
crate::mission_events::record(
&pool2,
crate::mission_events::MissionEvent::new(
mission_id,
crate::container_tool_hooks::GATE_INERT,
)
.phase(phase_id)
.run(run_id)
.detail(serde_json::json!({ "occurrences": g.inert, "tier": "microvm" })),
)
.await;
}
for line in &g.denied {
let detail = serde_json::from_str::<serde_json::Value>(line)
.unwrap_or_else(|_| serde_json::json!({ "raw": line }));
crate::mission_events::record(
&pool2,
crate::mission_events::MissionEvent::new(mission_id, "gate.denied")
.phase(phase_id)
.run(run_id)
.detail(detail),
)
.await;
}
}
}
// What actually ran: the rootfs the node booted and the CLI the guest
// reported. Persisted on the run so "which image and version did this