diff --git a/engine/dispatcher.py b/engine/dispatcher.py index 9013581..313e9de 100644 --- a/engine/dispatcher.py +++ b/engine/dispatcher.py @@ -136,12 +136,38 @@ class Dispatcher: for item in ready: await self._dispatch_one(item) + async def _sibling_context(self, item: dict) -> str: + """Completed-sibling reports appended to the task body: kanban runs are + isolated, so without this each task is blind to its siblings' output.""" + if not item.get("parent_id"): + return "" + rows = await db.fetch_all( + """ + SELECT e.payload FROM event e + JOIN work_item w ON w.id = e.work_item_id + WHERE w.parent_id = %s AND w.id <> %s AND w.status = 'done' + AND e.event_type = 'task.completed' + ORDER BY e.created_at + """, item["parent_id"], item["id"]) + lines = [] + for r in rows: + p = r["payload"] or {} + s = p.get("summary") or p.get("detail") + if s: + lines.append(f"- {str(s)[:400]}") + if not lines: + return "" + return ("\n\n## What teammates already completed on this objective\n" + + "\n".join(lines) + + "\nDo not assume their intermediate files exist; only the " + "shared workspace directory persists between runs.") + async def _dispatch_one(self, item: dict) -> None: budget = item["budget"] try: task = await self.hermes.create_task( item["title"], - body=_task_body(item), + body=_task_body(item) + await self._sibling_context(item), assignee=item["hermes_profile"], tenant=item["company_slug"], idempotency_key=str(item["id"]), diff --git a/engine/static/office.html b/engine/static/office.html index bc28c6f..678b909 100644 --- a/engine/static/office.html +++ b/engine/static/office.html @@ -9,81 +9,193 @@ margin:0; padding:1rem; text-align:center; } h1 { font-size:1.1rem; } a { color:#5c9de0; } canvas { image-rendering:pixelated; border:1px solid #2a323c; border-radius:8px; - background:#151b22; max-width:100%; } - #ticker { max-width:800px; margin:.5rem auto; color:#8a94a0; font-size:.8rem; + max-width:100%; } + #ticker { max-width:960px; margin:.5rem auto; color:#8a94a0; font-size:.8rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; } + #legend { color:#8a94a0; font-size:.75rem; }