fix(company): make delegation review lifecycle durable

This commit is contained in:
LZH-YS1998
2026-07-14 10:52:22 +08:00
parent 4bc18dcd27
commit 5e02364eb4
19 changed files with 3150 additions and 1087 deletions
+10 -1
View File
@@ -1067,12 +1067,21 @@ class CompanyRuntimeSuspendResumeTests(unittest.IsolatedAsyncioTestCase):
self.assertTrue(await engine._company_followup_target_progressed("task-ceo"))
task.metadata.pop("manager_no_delegation_justification", None)
task.metadata["manager_dispatch_guard_unresolved"] = (
"Soft dispatch constraint exhausted; accept the top-seat output."
)
await store.save_task(task)
self.assertTrue(await engine._company_followup_target_progressed("task-ceo"))
task.metadata.pop("manager_dispatch_guard_unresolved", None)
await store.save_task(task)
await store.update_delegation_work_item(
"wi-ceo",
metadata_updates={"manager_board_mutation_performed": True},
)
self.assertTrue(await engine._company_followup_target_progressed("task-ceo"))
# Dispatch outcome markers are attempt-scoped Task state. A stale
# WorkItem copy must not make a later follow-up look progressed.
self.assertFalse(await engine._company_followup_target_progressed("task-ceo"))
async def test_final_decider_followup_keeps_dispatch_turn_mode_with_existing_children(self) -> None:
runtime = CompanyRuntime(org_engine=None, communication=None, store=None)