(root: Path)
| 46 | |
| 47 | |
| 48 | def _feedback_buffer_summary(root: Path) -> dict[str, Any]: |
| 49 | path = root / "feedback_buffer.json" |
| 50 | if not path.exists(): |
| 51 | return {"pending_count": 0, "request_ids": []} |
| 52 | try: |
| 53 | raw = json.loads(path.read_text()) |
| 54 | except Exception as exc: |
| 55 | return {"pending_count": 0, "request_ids": [], "load_error": str(exc)} |
| 56 | if not isinstance(raw, dict): |
| 57 | return {"pending_count": 0, "request_ids": [], "load_error": "unexpected format"} |
| 58 | request_ids = sorted(str(key) for key in raw.keys()) |
| 59 | return { |
| 60 | "pending_count": len(request_ids), |
| 61 | "request_ids": request_ids[:100], |
| 62 | } |
| 63 | |
| 64 | |
| 65 | def _tail_text(path: Path, limit: int = 200) -> str: |
no outgoing calls
no test coverage detected