From cc303f32b0741f3c00f680114272578e738f6639 Mon Sep 17 00:00:00 2001 From: Lihua <1017343802@qq.com> Date: Tue, 29 Sep 2026 19:15:26 -0700 Subject: [PATCH 1/2] test: align CI guards with generated digest and hook dispatch Signed-off-by: Lihua <1017343802@qq.com> Signed-off-by: duanjialing.777 --- tests/control_plane/test_prompt_upgrade_hook.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/control_plane/test_prompt_upgrade_hook.py b/tests/control_plane/test_prompt_upgrade_hook.py index e1d827b32..331788911 100644 --- a/tests/control_plane/test_prompt_upgrade_hook.py +++ b/tests/control_plane/test_prompt_upgrade_hook.py @@ -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 From 9f02983380fb10c2f4802f76c5b181b2f4de4b09 Mon Sep 17 00:00:00 2001 From: Lihua <1017343802@qq.com> Date: Tue, 29 Sep 2026 20:05:25 -0700 Subject: [PATCH 2/2] test: publish Host descendant marker atomically Signed-off-by: Lihua <1017343802@qq.com> Signed-off-by: duanjialing.777 --- tests/control_plane_ts/host_process.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/control_plane_ts/host_process.test.ts b/tests/control_plane_ts/host_process.test.ts index cbea7db0d..23b235a8e 100644 --- a/tests/control_plane_ts/host_process.test.ts +++ b/tests/control_plane_ts/host_process.test.ts @@ -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)})){