{"type":"begin","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"}}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"_SPOOL_DIRNAME = \"report_spool\"\n"},"line_number":44,"absolute_offset":1075,"submatches":[{"match":{"text":"spool"},"start":25,"end":30}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    def spool_path(self) -> Path:\n"},"line_number":228,"absolute_offset":6927,"submatches":[{"match":{"text":"spool"},"start":8,"end":13}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            _ACTIVE_SPOOL_WRITE_TOKENS[self.spool_path] = token\n"},"line_number":246,"absolute_offset":7711,"submatches":[{"match":{"text":"spool"},"start":44,"end":49}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                    _ACTIVE_SPOOL_WRITE_TOKENS.get(self.spool_path) is token\n"},"line_number":270,"absolute_offset":8501,"submatches":[{"match":{"text":"spool"},"start":56,"end":61}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            _atomic_write(self.spool_path, encoded)\n"},"line_number":276,"absolute_offset":8830,"submatches":[{"match":{"text":"spool"},"start":31,"end":36}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        for path in (self.spool_path, self.state_path):\n"},"line_number":280,"absolute_offset":8961,"submatches":[{"match":{"text":"spool"},"start":26,"end":31}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    def ack_if_unchanged(self, uploaded_bytes: bytes) -> bool:\n"},"line_number":301,"absolute_offset":9755,"submatches":[{"match":{"text":"upload"},"start":31,"end":37}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        return self.ack_path_if_unchanged(self.spool_path, uploaded_bytes)\n"},"line_number":302,"absolute_offset":9818,"submatches":[{"match":{"text":"spool"},"start":47,"end":52},{"match":{"text":"upload"},"start":59,"end":65}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    def ack_path_if_unchanged(self, path: Path, uploaded_bytes: bytes) -> bool:\n"},"line_number":304,"absolute_offset":9894,"submatches":[{"match":{"text":"upload"},"start":48,"end":54}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                logger.warning(\"session report spool ack read failed: %s\", candidate)\n"},"line_number":312,"absolute_offset":10201,"submatches":[{"match":{"text":"spool"},"start":47,"end":52}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            if current != uploaded_bytes:\n"},"line_number":314,"absolute_offset":10316,"submatches":[{"match":{"text":"upload"},"start":26,"end":32}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                logger.warning(\"session report spool ack delete failed: %s\", candidate)\n"},"line_number":321,"absolute_offset":10534,"submatches":[{"match":{"text":"spool"},"start":47,"end":52}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        spool_root = self._data_root / _SPOOL_DIRNAME\n"},"line_number":332,"absolute_offset":10838,"submatches":[{"match":{"text":"spool"},"start":8,"end":13}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        if not spool_root.is_dir():\n"},"line_number":333,"absolute_offset":10892,"submatches":[{"match":{"text":"spool"},"start":15,"end":20}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        for path in spool_root.glob(\"*.json\"):\n"},"line_number":337,"absolute_offset":11041,"submatches":[{"match":{"text":"spool"},"start":20,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        spool_root = self._data_root / _SPOOL_DIRNAME\n"},"line_number":355,"absolute_offset":11595,"submatches":[{"match":{"text":"spool"},"start":8,"end":13}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        if not spool_root.is_dir():\n"},"line_number":356,"absolute_offset":11649,"submatches":[{"match":{"text":"spool"},"start":15,"end":20}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        for path in spool_root.glob(\"*.json\"):\n"},"line_number":360,"absolute_offset":11791,"submatches":[{"match":{"text":"spool"},"start":20,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                logger.warning(\"session report spool prune failed: %s\", path)\n"},"line_number":367,"absolute_offset":12041,"submatches":[{"match":{"text":"spool"},"start":47,"end":52}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                logger.warning(\"session report spool prune failed: %s\", path)\n"},"line_number":376,"absolute_offset":12460,"submatches":[{"match":{"text":"spool"},"start":47,"end":52}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"async def upload_spool_file(\n"},"line_number":379,"absolute_offset":12540,"submatches":[{"match":{"text":"upload"},"start":10,"end":16},{"match":{"text":"spool"},"start":17,"end":22}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        logger.warning(\"discarding invalid session report spool: %s\", path)\n"},"line_number":394,"absolute_offset":13072,"submatches":[{"match":{"text":"spool"},"start":58,"end":63}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        await asyncio.to_thread(  # to_thread: bounded-local, one invalid spool unlink\n"},"line_number":395,"absolute_offset":13148,"submatches":[{"match":{"text":"spool"},"start":74,"end":79}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    disposition = await client.put_session_report(\n"},"line_number":400,"absolute_offset":13319,"submatches":[{"match":{"text":"disposition"},"start":4,"end":15}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    if disposition is ReportUploadDisposition.RETRY:\n"},"line_number":404,"absolute_offset":13444,"submatches":[{"match":{"text":"disposition"},"start":7,"end":18},{"match":{"text":"RETRY"},"start":46,"end":51}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"async def drain_report_spool(\n"},"line_number":414,"absolute_offset":13703,"submatches":[{"match":{"text":"spool"},"start":23,"end":28}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        await upload_spool_file(path=path, client=client, store=store)\n"},"line_number":425,"absolute_offset":14001,"submatches":[{"match":{"text":"upload"},"start":14,"end":20},{"match":{"text":"spool"},"start":21,"end":26}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._last_upload_attempt_turn = state.user_turn_count\n"},"line_number":456,"absolute_offset":14978,"submatches":[{"match":{"text":"upload"},"start":19,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._last_upload_attempt_monotonic = monotonic()\n"},"line_number":457,"absolute_offset":15041,"submatches":[{"match":{"text":"upload"},"start":19,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._upload_task: asyncio.Task[bool] | None = None\n"},"line_number":458,"absolute_offset":15099,"submatches":[{"match":{"text":"upload"},"start":14,"end":20}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            self._schedule_upload_if_due()\n"},"line_number":538,"absolute_offset":18091,"submatches":[{"match":{"text":"upload"},"start":27,"end":33}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        return self._schedule_upload(\n"},"line_number":554,"absolute_offset":18668,"submatches":[{"match":{"text":"upload"},"start":30,"end":36}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            name=\"terminal-session-report-final-upload\",\n"},"line_number":556,"absolute_offset":18730,"submatches":[{"match":{"text":"upload"},"start":48,"end":54}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    def _schedule_upload_if_due(self) -> None:\n"},"line_number":612,"absolute_offset":20764,"submatches":[{"match":{"text":"upload"},"start":18,"end":24}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            self.state.user_turn_count - self._last_upload_attempt_turn\n"},"line_number":616,"absolute_offset":20896,"submatches":[{"match":{"text":"upload"},"start":52,"end":58}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            and self._monotonic() - self._last_upload_attempt_monotonic\n"},"line_number":621,"absolute_offset":21079,"submatches":[{"match":{"text":"upload"},"start":47,"end":53}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            self._schedule_upload(name=\"terminal-session-report-upload\")\n"},"line_number":625,"absolute_offset":21233,"submatches":[{"match":{"text":"upload"},"start":27,"end":33},{"match":{"text":"upload"},"start":64,"end":70}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"    def _schedule_upload(\n"},"line_number":627,"absolute_offset":21307,"submatches":[{"match":{"text":"upload"},"start":18,"end":24}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        current = self._upload_task\n"},"line_number":634,"absolute_offset":21486,"submatches":[{"match":{"text":"upload"},"start":24,"end":30}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._last_upload_attempt_turn = self.state.user_turn_count\n"},"line_number":641,"absolute_offset":21740,"submatches":[{"match":{"text":"upload"},"start":19,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._last_upload_attempt_monotonic = self._monotonic()\n"},"line_number":642,"absolute_offset":21808,"submatches":[{"match":{"text":"upload"},"start":19,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        async def _upload() -> bool:\n"},"line_number":644,"absolute_offset":21873,"submatches":[{"match":{"text":"upload"},"start":19,"end":25}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                return await upload_spool_file(\n"},"line_number":646,"absolute_offset":21948,"submatches":[{"match":{"text":"upload"},"start":29,"end":35},{"match":{"text":"spool"},"start":36,"end":41}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                    path=self._store.spool_path,\n"},"line_number":647,"absolute_offset":21996,"submatches":[{"match":{"text":"spool"},"start":37,"end":42}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            disposition = await self._runtime.client.put_session_report(\n"},"line_number":651,"absolute_offset":22151,"submatches":[{"match":{"text":"disposition"},"start":12,"end":23}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            if disposition is not ReportUploadDisposition.ACK:\n"},"line_number":655,"absolute_offset":22333,"submatches":[{"match":{"text":"disposition"},"start":15,"end":26},{"match":{"text":"ACK"},"start":58,"end":61}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        upload_coroutine = _upload()\n"},"line_number":662,"absolute_offset":22619,"submatches":[{"match":{"text":"upload"},"start":8,"end":14},{"match":{"text":"upload"},"start":28,"end":34}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            task = self._runtime.tasks.create(upload_coroutine, name=name)\n"},"line_number":664,"absolute_offset":22669,"submatches":[{"match":{"text":"upload"},"start":46,"end":52}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            upload_coroutine.close()\n"},"line_number":666,"absolute_offset":22770,"submatches":[{"match":{"text":"upload"},"start":12,"end":18}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                \"session report upload scheduling failed: session_id=%s\",\n"},"line_number":668,"absolute_offset":22835,"submatches":[{"match":{"text":"upload"},"start":32,"end":38}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        self._upload_task = task\n"},"line_number":674,"absolute_offset":23018,"submatches":[{"match":{"text":"upload"},"start":14,"end":20}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            if self._upload_task is done_task:\n"},"line_number":677,"absolute_offset":23111,"submatches":[{"match":{"text":"upload"},"start":21,"end":27}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"                self._upload_task = None\n"},"line_number":678,"absolute_offset":23158,"submatches":[{"match":{"text":"upload"},"start":22,"end":28}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"            self._schedule_upload_if_due()\n"},"line_number":686,"absolute_offset":23379,"submatches":[{"match":{"text":"upload"},"start":27,"end":33}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        await asyncio.to_thread(  # to_thread: bounded-local, capped spool prune\n"},"line_number":690,"absolute_offset":23498,"submatches":[{"match":{"text":"spool"},"start":69,"end":74}]}}
{"type":"match","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"lines":{"text":"        await drain_report_spool(\n"},"line_number":694,"absolute_offset":23649,"submatches":[{"match":{"text":"spool"},"start":27,"end":32}]}}
{"type":"end","data":{"path":{"text":"/home/hyc/projects/agent-sdk/packages/comate_cli/comate_cli/terminal_agent/backend/session_report.py"},"binary_offset":null,"stats":{"elapsed":{"secs":0,"nanos":198624,"human":"0.000199s"},"searches":1,"searches_with_match":1,"bytes_searched":23794,"bytes_printed":18826,"matched_lines":56,"matches":64}}}
{"data":{"elapsed_total":{"human":"0.001258s","nanos":1257577,"secs":0},"stats":{"bytes_printed":18826,"bytes_searched":23794,"elapsed":{"human":"0.000199s","nanos":198624,"secs":0},"matched_lines":56,"matches":64,"searches":1,"searches_with_match":1}},"type":"summary"}
