Skip to content

[Epic][WIP] Enable Library-Mode for Chromium-Dashboard Integration #439

@szy196

Description

@szy196

Objective

Enable chromium-dashboard to generate high-quality, structured Markdown WPT coverage reports for ChromeStatus features by refactoring wpt-gen into an importable library.


Guiding Principles

  • CLI Parity: All existing CLI commands (wpt-gen generate, wpt-gen chromestatus, etc.) must remain fully functional with their current interactive behavior.
  • Zero Regression: The refactoring must not alter the core logic or quality of test generation and audit reports for existing CLI users.
  • Dependency Injection: Use interfaces and injection (specifically for the UI) to decouple the engine from its environment.

Scope: Direct API vs. Agentic Separation

The library integration focuses exclusively on the Direct Prompting workflow (Phases 1-3).

  • Supported (Direct API): Context Assembly, Requirements Extraction, Coverage Audit, and Markdown Report Rendering.
  • Excluded (Agentic): Phase 4 (Test Generation) uses the google-adk framework and is excluded from the vendored library scope due to environmental complexity.

Workflow Support Table (Library Mode)

Phase Methodology Framework/Tool Status
1. Context Assembly Logic / Scraping BeautifulSoup, requests In Scope
2. Requirements Extraction Direct Prompting LLMClient (Gemini API) In Scope
3. Coverage Audit Direct Prompting LLMClient (Gemini API) In Scope
Report Rendering (New) Direct Prompting LLMClient (Gemini API) In Scope
4. Test Generation Autonomous Agent Google ADK Out of Scope

Core Components

1. Programmatic Library API (wptgen/__init__.py)

A high-level function (generate_audit_report) that serves as the "Library Entry Point", initializing the engine with LoggingUIProvider.

2. UI Provider Abstraction (wptgen/ui.py)

  • RichUIProvider (CLI Mode): Existing interactive implementation.
  • LoggingUIProvider (Library Mode): New non-interactive implementation using the standard logging module.

3. Filesystem-Optional WPTGenEngine (wptgen/engine.py)

Update the engine to handle cases where config.wpt_path is None, relying on ChromeStatus metadata.

4. MarkdownReportRenderer (New Module)

A dedicated module to transform internal audit data into structured Markdown using LLM transformation.

5. Dependency Management (The "Extras" Pattern)

Move google-adk to an optional dependency group (wpt-gen[agent]) to keep the library lightweight for server-side use.


Implementation Tasks

This issue description was updated by Gemini

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions