Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 11 additions & 2 deletions tests/control_plane/test_prompt_upgrade_hook.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,18 @@ def test_upgrade_read_projection_preserves_work_authority(tmp_path, monkeypatch,
assert read["command"] == hint["command"]
assert read["ordering"] == "before_work"
assert read["prompt_budget_bytes"] == 1536
# The dispatch names the hook that produced the read, and the projected hint
# must still carry every field of that read unchanged.
assert read["hook_id"] == "heartbeat.prompt_upgrade"
assert read["capability_id"] == "automation-prompt-upgrade"
assert {key: read[key] for key in hint} == hint
for key in baseline.keys() | pending.keys():
if key not in {"required_reads", "interaction_contract", "protocol_action_packet",
"turn_start_capability_hook_dispatch"}:
if key not in {
"required_reads",
"interaction_contract",
"protocol_action_packet",
"turn_start_capability_hook_dispatch",
}:
assert pending.get(key) == baseline.get(key), key
_set_fixture_prompt(path, database, desired)
assert build_live_quota_should_run_decision(status, **kwargs) == baseline
Expand Down
8 changes: 5 additions & 3 deletions tests/control_plane_ts/host_process.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ for (const mode of ["timeout", "abort", "leader_exit", "closed_pipes"] as const)
t.after(() => rm(root, {recursive: true, force: true}));
const marker = join(root, "counter");
// Ignore TERM so the test proves escalation and does not merely observe a
// cooperative child. Its marker is the semantic oracle, not a PID lookup.
// cooperative child. Publish the marker atomically: a kill during a write
// must not look like a surviving child, but each completed tick stays visible.
const child = `const fs=require('fs');let n=0;process.on('SIGTERM',()=>{});
fs.writeFileSync(${JSON.stringify(marker)},String(n));
setInterval(()=>fs.writeFileSync(${JSON.stringify(marker)},String(++n)),10)`;
const marker=${JSON.stringify(marker)}, staged=marker+'.next';
const publish=()=>{fs.writeFileSync(staged,String(n));fs.renameSync(staged,marker)};
publish();setInterval(()=>{n++;publish()},10)`;
const script = `const{spawn}=require('child_process');const fs=require('fs');
spawn(process.execPath,['-e',${JSON.stringify(child)}],{stdio:${JSON.stringify(mode === "closed_pipes" ? "ignore" : "inherit")}});
const timer=setInterval(()=>{if(fs.existsSync(${JSON.stringify(marker)})){
Expand Down
Loading