flakewatch-core
v0.3.0
Published
Core logic for flakewatch: failure grouping, context packaging, LLM interface
Maintainers
Readme
flakewatch-core
Core logic for Flakewatch -- AI-powered Playwright test failure triage.
This package contains the shared libraries used by the CLI, reporter, browser agent, and GitHub Action. Most users should use flakewatch (CLI) or flakewatch-playwright (reporter) instead of this package directly.
What's inside
- Config -- loading, validation, and defaults
- Context -- packaging test failures with source code, page objects, error info, and screenshots
- Grouping -- clustering failures by normalized error signature
- LLM -- Anthropic client with verdict-focused system prompt
- Verdicts -- type definitions for all verdict types
- Reporting -- Markdown, JSON, and GitHub comment output
- Triage -- the main pipeline that groups, investigates, and reports
Usage
import {
loadConfig,
triageFailures,
formatMarkdownReport,
parsePlaywrightJsonReport,
} from 'flakewatch-core';
const config = await loadConfig();
const { failures, totalTests } = parsePlaywrightJsonReport(jsonReport);
const report = await triageFailures({ failures, totalTests, config });
console.log(formatMarkdownReport(report));License
MIT
