# krishnapollu/playwright-logbook architecture

> Architecture diagram of the GitHub repository krishnapollu/playwright-logbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishnapollu/playwright-logbook
- Repository: https://github.com/krishnapollu/playwright-logbook
- Video tour (about a minute): https://gitdiagram.com/krishnapollu/playwright-logbook/video

## Overview

Playwright Logbook captures Playwright test results into local history, then turns them into searchable HTML reports, CLI summaries, and bounded debugging evidence. A typical flow is Playwright run → reporter and persisted records → report/history views or an analysis task; CI shards can be merged and portable bundles can move evidence between stores. The VS Code extension reads history for browsing, comparison, and agent handoff. Edges are limited to relationships stated in the README or visible in excerpts/SOURCE INDEX references; unsampled implementation details are not assumed.

Main entry points: [`src/cli/program.ts`](https://github.com/krishnapollu/playwright-logbook/blob/main/src/cli/program.ts) (CLI commands), [`packages/vscode/src/extension.ts`](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/extension.ts) (VS Code extension), [`src/store.ts`](https://github.com/krishnapollu/playwright-logbook/blob/main/src/store.ts) (Local history store), [`packages/vscode/src/detail.ts`](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/detail.ts) (Failure details)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and records"]
  node_reporter["Reporter capture<br/>[reporter.ts]"]
  node_record["Run records<br/>[schema.ts]"]
  node_history["History analysis<br/>[history.ts]"]
  node_store[("Local history store<br/>[store.ts]")]
end

subgraph group_insight["Reports and investigation"]
  node_cli["CLI commands<br/>[program.ts]"]
  node_reportmodel["Report model<br/>[model.ts]"]
  node_renderer["HTML report<br/>[render.ts]"]
  node_reportjs["Report interactions<br/>[clientlib.ts]"]
  node_analysis["Debug evidence<br/>[analyze.ts]"]
end

subgraph group_transfer["CI and portability"]
  node_bundles["Bundle archive<br/>[archive.ts]"]
  node_bundleexport["Bundle export<br/>[export.ts]"]
  node_bundleingest["Bundle import<br/>[ingest.ts]"]
  node_github["GitHub artifacts<br/>[githubartifacts.ts]"]
end

subgraph group_editor["VS Code experience"]
  node_extension["VS Code extension<br/>[extension.ts]"]
  node_reader["History reader<br/>[historyreader.ts]"]
  node_details["Failure details<br/>[detail.ts]"]
  node_comparison["Run comparison<br/>[comparison.ts]"]
  node_insights["Editor insights<br/>[insights.ts]"]
  node_agent["Agent task prep<br/>[analysis.ts]"]
end

node_playwright(("Playwright tests"))

node_playwright -->|"reports results"| node_reporter
node_reporter -.->|"persists runs"| node_store
node_store -->|"validates records"| node_record
node_cli -->|"runs analysis"| node_analysis
node_cli -->|"exports bundles"| node_bundleexport
node_cli -->|"imports bundles"| node_bundleingest
node_cli -->|"fetches artifacts"| node_github
node_cli -->|"builds report model"| node_reportmodel
node_cli -->|"writes report"| node_renderer
node_reportmodel -->|"uses run trends"| node_history
node_renderer -->|"embeds interactions"| node_reportjs
node_store -->|"loads validated runs"| node_record
node_bundleexport -->|"reads history"| node_store
node_bundleexport -->|"creates archive"| node_bundles
node_bundleingest -->|"inspects archive"| node_bundles
node_bundleingest -.->|"writes imported runs"| node_store
node_extension -->|"reads history"| node_reader
node_reader -->|"validates records"| node_record
node_extension -->|"opens failures"| node_details
node_extension -->|"opens comparison"| node_comparison
node_extension -->|"loads insights"| node_insights
node_extension -->|"imports bundles"| node_bundleingest
node_details -->|"uses insights"| node_insights
node_details -->|"loads executions"| node_reader
node_details -->|"prepares task"| node_agent
node_agent -.->|"assembles evidence"| node_analysis

click node_reporter "https://github.com/krishnapollu/playwright-logbook/blob/main/src/reporter.ts"
click node_record "https://github.com/krishnapollu/playwright-logbook/blob/main/src/schema.ts"
click node_history "https://github.com/krishnapollu/playwright-logbook/blob/main/src/history.ts"
click node_store "https://github.com/krishnapollu/playwright-logbook/blob/main/src/store.ts"
click node_cli "https://github.com/krishnapollu/playwright-logbook/blob/main/src/cli/program.ts"
click node_reportmodel "https://github.com/krishnapollu/playwright-logbook/blob/main/src/model.ts"
click node_renderer "https://github.com/krishnapollu/playwright-logbook/blob/main/src/render.ts"
click node_reportjs "https://github.com/krishnapollu/playwright-logbook/blob/main/src/clientlib.ts"
click node_analysis "https://github.com/krishnapollu/playwright-logbook/blob/main/src/analyze.ts"
click node_bundles "https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/archive.ts"
click node_bundleexport "https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/export.ts"
click node_bundleingest "https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/ingest.ts"
click node_github "https://github.com/krishnapollu/playwright-logbook/blob/main/src/githubartifacts.ts"
click node_extension "https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/extension.ts"
click node_reader "https://github.com/krishnapollu/playwright-logbook/blob/main/src/historyreader.ts"
click node_details "https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/detail.ts"
click node_comparison "https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/comparison.ts"
click node_insights "https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/insights.ts"
click node_agent "https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/analysis.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_reporter,node_record,node_history,node_store toneBlue
class node_cli,node_reportmodel,node_renderer,node_reportjs,node_analysis toneAmber
class node_bundles,node_bundleexport,node_bundleingest,node_github toneMint
class node_extension,node_reader,node_details,node_comparison,node_insights,node_agent toneRose
class node_playwright toneIndigo
```

## Components

### Capture and records

- [Reporter capture](https://github.com/krishnapollu/playwright-logbook/blob/main/src/reporter.ts): `src/reporter.ts`
- [Run records](https://github.com/krishnapollu/playwright-logbook/blob/main/src/schema.ts): `src/schema.ts`
- [History analysis](https://github.com/krishnapollu/playwright-logbook/blob/main/src/history.ts): `src/history.ts`
- [Local history store](https://github.com/krishnapollu/playwright-logbook/blob/main/src/store.ts): `src/store.ts`

### Reports and investigation

- [CLI commands](https://github.com/krishnapollu/playwright-logbook/blob/main/src/cli/program.ts): `src/cli/program.ts`
- [Report model](https://github.com/krishnapollu/playwright-logbook/blob/main/src/model.ts): `src/model.ts`
- [HTML report](https://github.com/krishnapollu/playwright-logbook/blob/main/src/render.ts): `src/render.ts`
- [Report interactions](https://github.com/krishnapollu/playwright-logbook/blob/main/src/clientlib.ts): `src/clientlib.ts`
- [Debug evidence](https://github.com/krishnapollu/playwright-logbook/blob/main/src/analyze.ts): `src/analyze.ts`

### CI and portability

- [Bundle archive](https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/archive.ts): `src/bundles/archive.ts`
- [Bundle export](https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/export.ts): `src/bundles/export.ts`
- [Bundle import](https://github.com/krishnapollu/playwright-logbook/blob/main/src/bundles/ingest.ts): `src/bundles/ingest.ts`
- [GitHub artifacts](https://github.com/krishnapollu/playwright-logbook/blob/main/src/githubartifacts.ts): `src/githubartifacts.ts`

### VS Code experience

- [VS Code extension](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/extension.ts): `packages/vscode/src/extension.ts`
- [History reader](https://github.com/krishnapollu/playwright-logbook/blob/main/src/historyreader.ts): `src/historyreader.ts`
- [Failure details](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/detail.ts): `packages/vscode/src/detail.ts`
- [Run comparison](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/comparison.ts): `packages/vscode/src/comparison.ts`
- [Editor insights](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/insights.ts): `packages/vscode/src/insights.ts`
- [Agent task prep](https://github.com/krishnapollu/playwright-logbook/blob/main/packages/vscode/src/analysis.ts): `packages/vscode/src/analysis.ts`

### Other components

- **Playwright tests**

## Connections

- Playwright tests → Reporter capture: reports results (evidence: `README.md`)
- Reporter capture → Local history store: persists runs
- Local history store → Run records: validates records (evidence: `src/store.ts`)
- CLI commands → Debug evidence: runs analysis (evidence: `src/cli/program.ts`)
- CLI commands → Bundle export: exports bundles (evidence: `src/cli/program.ts`)
- CLI commands → Bundle import: imports bundles (evidence: `src/cli/program.ts`)
- CLI commands → GitHub artifacts: fetches artifacts (evidence: `src/cli/program.ts`)
- CLI commands → Report model: builds report model
- CLI commands → HTML report: writes report
- Report model → History analysis: uses run trends (evidence: `src/model.ts`)
- HTML report → Report interactions: embeds interactions (evidence: `src/render.ts`)
- Local history store → Run records: loads validated runs (evidence: `src/store.ts`)
- Bundle export → Local history store: reads history (evidence: `src/bundles/export.ts`)
- Bundle export → Bundle archive: creates archive (evidence: `src/bundles/export.ts`)
- Bundle import → Bundle archive: inspects archive (evidence: `src/bundles/ingest.ts`)
- Bundle import → Local history store: writes imported runs (evidence: `src/bundles/ingest.ts`)
- VS Code extension → History reader: reads history (evidence: `packages/vscode/src/extension.ts`)
- History reader → Run records: validates records (evidence: `src/historyreader.ts`)
- VS Code extension → Failure details: opens failures (evidence: `packages/vscode/src/extension.ts`)
- VS Code extension → Run comparison: opens comparison (evidence: `packages/vscode/src/extension.ts`)
- VS Code extension → Editor insights: loads insights (evidence: `packages/vscode/src/extension.ts`)
- VS Code extension → Bundle import: imports bundles (evidence: `packages/vscode/src/extension.ts`)
- Failure details → Editor insights: uses insights (evidence: `packages/vscode/src/detail.ts`)
- Failure details → History reader: loads executions (evidence: `packages/vscode/src/detail.ts`)
- Failure details → Agent task prep: prepares task (evidence: `packages/vscode/src/detail.ts`)
- Agent task prep → Debug evidence: assembles evidence
