Visual P10Y report in local quickstart#14
Merged
Merged
Conversation
…r read-only access. Update notifications report renderer to utilize this new interface, ensuring write operations are restricted. Adjust related components to support the new read-only view in the async database adapter.
akozak-gd
approved these changes
Jul 3, 2026
There was a problem hiding this comment.
Pull request overview
Adds a browser-renderable HTML version of the multi-workspace P10Y estimation report for local quickstart users, including an API endpoint to fetch the report and a TUI keybinding to open it, plus related backend refactors to safely pass a read-only DB handle into the renderer.
Changes:
- Generate and persist an HTML report alongside the existing markdown report, and archive it under the artifacts
report/subdir. - Add
GET /api/v1/generation-sessions/{generation_id}/report.htmlto serve the HTML report. - Update the local TUI to show component comparison details and support
hto fetch/cache/open the HTML report.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| mcp_server/tui/render.py | Adds component comparison rows to the estimate panel model and parsing. |
| mcp_server/tui/app.py | Renders component breakdown + hint; adds h keybinding to fetch/cache/open report HTML. |
| mcp_server/tests/test_tui_render.py | Updates render tests for new payload shape + component comparison sorting. |
| mcp_server/tests/test_tui_app.py | Adds coverage for component breakdown rendering and open-report behavior. |
| backend/test/test_report_generation.py | Adds workflow-level tests ensuring HTML report is written and Variants render with a real DB adapter. |
| backend/test/api/test_generation_sessions.py | Adds endpoint tests for /report.html success/404. |
| backend/test/api/test_email_notifications.py | Adds tests for shared HTML/plain report renderer used by email + workflow. |
| backend/scripts/example_test_session.py | Adds a utility script to seed a completed session + reports for local TUI testing. |
| backend/app/workflows/multi_workspace_estimation_p10y.py | Writes HTML report (best-effort) and archives report artifacts after completion. |
| backend/app/state/db_adapter.py | Adds a read-only DB view property to safely pass to read-only renderers. |
| backend/app/database/interface.py | Introduces ReadOnlyDatabase protocol (get-only). |
| backend/app/core/notifications.py | Refactors report rendering into a shared function used by email + workflow. |
| backend/app/core/artifact_files.py | Centralizes markdown/HTML report filenames as constants. |
| backend/app/api/v1/generation_sessions.py | Adds the /report.html endpoint serving the archived HTML report. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+1288
to
+1289
| html_parts.append(f'<div class="summary-item"><span class="summary-label">Specification:</span> {spec_path}</div>') | ||
| html_parts.append(f'<div class="summary-item"><span class="summary-label">Run ID:</span> {generation_id}</div>') |
Comment on lines
+1319
to
1322
| html_parts.append(f'<strong>{repo_link["workspace_id"]}:</strong> ') | ||
| html_parts.append( | ||
| '<div class="summary-item"><span class="summary-label">Total LLM cost (cumulative):</span> ' | ||
| f"<strong>{cost_display}</strong></div>" | ||
| f'<a href="{repo_link["branch_url"]}" target="_blank">Branch link</a>' | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a visual HTML version of the P10Y multi-workspace estimation report so local quickstart users, who have no email or Slack notifier configured, can still view a rendered report by pressing a key in the TUI instead of only getting the raw markdown.
Entrypoint
The workflow writes the HTML report in
multi_workspace_estimation_p10y_workflow(backend/app/workflows/multi_workspace_estimation_p10y.py), served via the newGET /api/v1/generation-sessions/{generation_id}/report.htmlendpoint (backend/app/api/v1/generation_sessions.py), and opened from the TUI's newhkeybinding inDashboardScreen.action_open_report(mcp_server/tui/app.py).Diagram
Nothing structural changed beyond an added artifact file (
multi-workspace-estimation-report.html) written next to the existing markdown report underARTIFACTS_BASE/{generation_id}/report/.Details
The "Review 1" commit fixes a bug where the workflow passed the async
StateMachineDBAdapterinto the report renderer instead of its underlying syncIDatabase, which silently swallowedAttributeErrors and dropped the Variants section from the HTML entirely; the fix exposes async_dbproperty on the adapter (backend/app/state/db_adapter.py) strictly for this read-only renderer use, since state/checkpoint writes must still go through the async adapter.