| 169 | raise RuntimeError('structured output rendering failed') from last_error |
| 170 | |
| 171 | def render_summary(self) -> str: |
| 172 | command_backlog = build_command_backlog() |
| 173 | tool_backlog = build_tool_backlog() |
| 174 | sections = [ |
| 175 | '# Python Porting Workspace Summary', |
| 176 | '', |
| 177 | self.manifest.to_markdown(), |
| 178 | '', |
| 179 | f'Command surface: {len(command_backlog.modules)} mirrored entries', |
| 180 | *command_backlog.summary_lines()[:10], |
| 181 | '', |
| 182 | f'Tool surface: {len(tool_backlog.modules)} mirrored entries', |
| 183 | *tool_backlog.summary_lines()[:10], |
| 184 | '', |
| 185 | f'Session id: {self.session_id}', |
| 186 | f'Conversation turns stored: {len(self.mutable_messages)}', |
| 187 | f'Permission denials tracked: {len(self.permission_denials)}', |
| 188 | f'Usage totals: in={self.total_usage.input_tokens} out={self.total_usage.output_tokens}', |
| 189 | f'Max turns: {self.config.max_turns}', |
| 190 | f'Max budget tokens: {self.config.max_budget_tokens}', |
| 191 | f'Transcript flushed: {self.transcript_store.flushed}', |
| 192 | ] |
| 193 | return '\n'.join(sections) |